From e7eeb15ad1a15f6278910938a043bb0c2715d3d9 Mon Sep 17 00:00:00 2001 From: frankhillard Date: Wed, 14 Sep 2022 18:02:43 +0200 Subject: [PATCH 01/11] Prepare folder for vesting contract --- vesting-cameligo/.env.dist | 7 ++ vesting-cameligo/.gitignore | 7 ++ vesting-cameligo/Makefile | 87 +++++++++++++++++++ vesting-cameligo/README.md | 0 vesting-cameligo/scripts/deploy.ts | 44 ++++++++++ vesting-cameligo/scripts/metadata.json.dist | 21 +++++ vesting-cameligo/src/errors.mligo | 1 + vesting-cameligo/src/main.mligo | 12 +++ vesting-cameligo/src/parameter.mligo | 9 ++ vesting-cameligo/src/storage.mligo | 4 + .../test/ligo/bootstrap/bootstrap.mligo | 13 +++ .../test/ligo/helpers/assert.mligo | 15 ++++ vesting-cameligo/test/ligo/helpers/log.mligo | 18 ++++ .../test/ligo/helpers/vesting.mligo | 50 +++++++++++ .../test/ligo/vesting.entrypoint_1.test.mligo | 30 +++++++ 15 files changed, 318 insertions(+) create mode 100644 vesting-cameligo/.env.dist create mode 100644 vesting-cameligo/.gitignore create mode 100644 vesting-cameligo/Makefile create mode 100644 vesting-cameligo/README.md create mode 100644 vesting-cameligo/scripts/deploy.ts create mode 100644 vesting-cameligo/scripts/metadata.json.dist create mode 100644 vesting-cameligo/src/errors.mligo create mode 100644 vesting-cameligo/src/main.mligo create mode 100644 vesting-cameligo/src/parameter.mligo create mode 100644 vesting-cameligo/src/storage.mligo create mode 100644 vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo create mode 100644 vesting-cameligo/test/ligo/helpers/assert.mligo create mode 100644 vesting-cameligo/test/ligo/helpers/log.mligo create mode 100644 vesting-cameligo/test/ligo/helpers/vesting.mligo create mode 100644 vesting-cameligo/test/ligo/vesting.entrypoint_1.test.mligo diff --git a/vesting-cameligo/.env.dist b/vesting-cameligo/.env.dist new file mode 100644 index 00000000..b6b219d0 --- /dev/null +++ b/vesting-cameligo/.env.dist @@ -0,0 +1,7 @@ +# environment variables for nodejs +# values are taken from flextesa +# see https://tezos.gitlab.io/flextesa/ + +NODE_URL=http://localhost:20000 +SECRET_KEY=edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq +ADMIN=tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb \ No newline at end of file diff --git a/vesting-cameligo/.gitignore b/vesting-cameligo/.gitignore new file mode 100644 index 00000000..d25ef4cd --- /dev/null +++ b/vesting-cameligo/.gitignore @@ -0,0 +1,7 @@ +node_modules +/compiled +/deployments +/.env + +.vscode +.ligo-work \ No newline at end of file diff --git a/vesting-cameligo/Makefile b/vesting-cameligo/Makefile new file mode 100644 index 00000000..1d66c44e --- /dev/null +++ b/vesting-cameligo/Makefile @@ -0,0 +1,87 @@ +default: help + +# Perl Colors, with fallback if tput command not available +GREEN := $(shell command -v tput >/dev/null 2>&1 && tput -Txterm setaf 2 || echo "") +BLUE := $(shell command -v tput >/dev/null 2>&1 && tput -Txterm setaf 4 || echo "") +WHITE := $(shell command -v tput >/dev/null 2>&1 && tput -Txterm setaf 7 || echo "") +YELLOW := $(shell command -v tput >/dev/null 2>&1 && tput -Txterm setaf 3 || echo "") +RESET := $(shell command -v tput >/dev/null 2>&1 && tput -Txterm sgr0 || echo "") + +# Add help text after each target name starting with '\#\#' +# A category can be added with @category +HELP_FUN = \ + %help; \ + while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^([a-zA-Z\-]+)\s*:.*\#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \ + print "usage: make [target]\n\n"; \ + for (sort keys %help) { \ + print "${WHITE}$$_:${RESET}\n"; \ + for (@{$$help{$$_}}) { \ + $$sep = " " x (32 - length $$_->[0]); \ + print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \ + }; \ + print "\n"; } + +help: + @perl -e '$(HELP_FUN)' $(MAKEFILE_LIST) + +####################################### +# PROJECT # +####################################### + +all: install compile deploy ##@Project - Runs all the deployment chain from scratch + +####################################### +# CONTRACTS # +####################################### +ifndef LIGO +LIGO=docker run --platform linux/amd64 --rm -v "$(PWD)":"$(PWD)" -w "$(PWD)" ligolang/ligo:0.49.0 +endif + +compile = $(LIGO) compile contract ./src/$(1) -o ./compiled/$(2) $(3) +# ^ Compile contracts to Michelson or Micheline + +test-ligo = $(LIGO) run test ./test/ligo/$(1) +# ^ Run the given LIGO Test file + +compile: ##@Contracts - Compile LIGO contracts + @if [ ! -d ./compiled ]; then mkdir ./compiled ; fi + @echo "Compiling contracts..." + @$(call compile,main.mligo,vesting.tz) + @$(call compile,main.mligo,vesting.json,--michelson-format json) + +test-ligo: ##@Contracts - Run LIGO tests (make test-ligo SUITE=factory) +ifndef SUITE + @$(call test-ligo,vesting.entrypoint_1.test.mligo) +else + @$(call test-ligo,$(SUITE).test.mligo) +endif + +test-integration: ##@Contracts - Run integration tests + $(MAKE) deploy + @npm run test + +clean: ##@Contracts - Contracts clean up + @echo "Are you sure you want to DELETE ALL COMPILED CONTRACT FILES from your Compiled folder ? [y/N]" && read ans && if [ $${ans:-'N'} = 'y' ]; then rm -rf compiled/* ; fi + +####################################### +# SCRIPTS # +####################################### +install: ##@Scripts - Install NPM dependencies + @if [ ! -f ./.env ]; then cp .env.dist .env ; fi + @$(LIGO) install + @npm i + +deploy: ##@Scripts - Deploy contracts + @if [ ! -f ./scripts/metadata.json ]; then cp scripts/metadata.json.dist \ + scripts/metadata.json ; fi + @npx ts-node ./scripts/deploy.ts + + +####################################### +# SANDBOX # +####################################### +sandbox-start: ##@Sandbox - Start Flextesa sandbox + @./scripts/run-sandbox + +sandbox-stop: ##@Sandbox - Stop Flextesa sandbox + @docker stop sandbox diff --git a/vesting-cameligo/README.md b/vesting-cameligo/README.md new file mode 100644 index 00000000..e69de29b diff --git a/vesting-cameligo/scripts/deploy.ts b/vesting-cameligo/scripts/deploy.ts new file mode 100644 index 00000000..11088108 --- /dev/null +++ b/vesting-cameligo/scripts/deploy.ts @@ -0,0 +1,44 @@ +import dotenv from "dotenv"; +import { MichelsonMap, TezosToolkit } from "@taquito/taquito"; +import { InMemorySigner } from "@taquito/signer"; +import { buf2hex } from "@taquito/utils"; +import code from "../compiled/vesting.json"; +import metadata from "./metadata.json"; + +// Read environment variables from .env file +dotenv.config(); + +// Initialize RPC connection +const Tezos = new TezosToolkit(process.env.NODE_URL); + +// Deploy to configured node with configured secret key +const deploy = async () => { + try { + const signer = await InMemorySigner.fromSecretKey( + process.env.SECRET_KEY + ); + + Tezos.setProvider({ signer }); + + // create a JavaScript object to be used as initial storage + // https://tezostaquito.io/docs/originate/#a-initializing-storage-using-a-plain-old-javascript-object + const storage = { + metadata: MichelsonMap.fromLiteral({ + "": buf2hex(Buffer.from("tezos-storage:contents")), + contents: buf2hex(Buffer.from(JSON.stringify(metadata))), + }), + // ^ contract metadata (tzip-16) + // https://tzip.tezosagora.org/proposal/tzip-16/ + + admin: process.env.ADMIN, + }; + + const op = await Tezos.contract.originate({ code, storage }); + await op.confirmation(); + console.log(`[OK] ${op.contractAddress}`); + } catch (e) { + console.log(e); + } +}; + +deploy(); \ No newline at end of file diff --git a/vesting-cameligo/scripts/metadata.json.dist b/vesting-cameligo/scripts/metadata.json.dist new file mode 100644 index 00000000..d314a47e --- /dev/null +++ b/vesting-cameligo/scripts/metadata.json.dist @@ -0,0 +1,21 @@ +{ + "name": "Vesting Example", + "description": "A Vesting Example Contract", + "version": "1.0.0", + "license": { + "name": "MIT" + }, + "authors": [ + "smart-chain " + ], + "homepage": "https://github.com/ligolang/vesting-cameligo", + "source": { + "tools": "cameligo", + "location": "https://github.com/ligolang/vesting-cameligo/src" + }, + "interfaces": [ + "TZIP-012", + "TZIP-016", + "TZIP-017" + ] +} \ No newline at end of file diff --git a/vesting-cameligo/src/errors.mligo b/vesting-cameligo/src/errors.mligo new file mode 100644 index 00000000..30e6638c --- /dev/null +++ b/vesting-cameligo/src/errors.mligo @@ -0,0 +1 @@ +let not_admin : string = "not admin" \ No newline at end of file diff --git a/vesting-cameligo/src/main.mligo b/vesting-cameligo/src/main.mligo new file mode 100644 index 00000000..a93c3a00 --- /dev/null +++ b/vesting-cameligo/src/main.mligo @@ -0,0 +1,12 @@ +#import "storage.mligo" "Storage" +#import "parameter.mligo" "Parameter" +#import "errors.mligo" "Errors" + +type storage = Storage.t +type parameter = Parameter.t +type return = operation list * storage + +let main(param, store : parameter * storage) : return = + match param with + | Entrypoint_1 _p -> (([] : operation list), store) + | Entrypoint_2 _p -> (([] : operation list), store) diff --git a/vesting-cameligo/src/parameter.mligo b/vesting-cameligo/src/parameter.mligo new file mode 100644 index 00000000..27fbf8fd --- /dev/null +++ b/vesting-cameligo/src/parameter.mligo @@ -0,0 +1,9 @@ +type entrypoint_1_param = { + name : string +} + +type entrypoint_2_param = { + name : string +} + +type t = Entrypoint_1 of entrypoint_1_param | Entrypoint_2 of entrypoint_2_param diff --git a/vesting-cameligo/src/storage.mligo b/vesting-cameligo/src/storage.mligo new file mode 100644 index 00000000..ad0bbad5 --- /dev/null +++ b/vesting-cameligo/src/storage.mligo @@ -0,0 +1,4 @@ +type t = { + admin : address; + metadata : (string, bytes) big_map; +} \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo b/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo new file mode 100644 index 00000000..34e0e8c3 --- /dev/null +++ b/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo @@ -0,0 +1,13 @@ +#import "../helpers/vesting.mligo" "Vesting_helper" + +(* Boostrapping of the test environment for Vesting *) +let boot_vesting () = + let () = Test.reset_state 6n ([] : tez list) in + + let accounts = + Test.nth_bootstrap_account 1, + Test.nth_bootstrap_account 2 + in + + let vesting = Vesting_helper.originate(Vesting_helper.base_storage(accounts.0)) in + (accounts, vesting) diff --git a/vesting-cameligo/test/ligo/helpers/assert.mligo b/vesting-cameligo/test/ligo/helpers/assert.mligo new file mode 100644 index 00000000..4c3ce540 --- /dev/null +++ b/vesting-cameligo/test/ligo/helpers/assert.mligo @@ -0,0 +1,15 @@ +(* Assert contract call results in failwith with given string *) +let string_failure (res : test_exec_result) (expected : string) : unit = + let expected = Test.eval expected in + match res with + | Fail (Rejected (actual,_)) -> assert (actual = expected) + | Fail (Balance_too_low _err) -> failwith "contract failed: balance too low" + | Fail (Other s) -> failwith s + | Success _ -> failwith "Transaction should fail" + +(* Assert contract result is successful *) +let tx_success (res: test_exec_result) : unit = + match res with + | Success(_) -> () + | Fail (Rejected (error,_)) -> let () = Test.log(error) in Test.failwith "Transaction should not fail" + | Fail _ -> failwith "Transaction should not fail" diff --git a/vesting-cameligo/test/ligo/helpers/log.mligo b/vesting-cameligo/test/ligo/helpers/log.mligo new file mode 100644 index 00000000..99db4e0e --- /dev/null +++ b/vesting-cameligo/test/ligo/helpers/log.mligo @@ -0,0 +1,18 @@ +(* Return str repeated n times *) +let repeat (str, n : string * nat) : string = + let rec loop (n, acc: nat * string) : string = + if n = 0n then acc else loop (abs(n - 1n), acc ^ str) + in loop(n, "") + +(* + Log boxed lbl + + "+-----------+" + "| My string |" + "+-----------+" +*) +let describe (lbl : string) = + let hr = "+" ^ repeat("-", String.length(lbl) + 2n) ^ "+" in + let () = Test.log hr in + let () = Test.log ("| " ^ lbl ^ " |") in + Test.log hr diff --git a/vesting-cameligo/test/ligo/helpers/vesting.mligo b/vesting-cameligo/test/ligo/helpers/vesting.mligo new file mode 100644 index 00000000..e5e6951b --- /dev/null +++ b/vesting-cameligo/test/ligo/helpers/vesting.mligo @@ -0,0 +1,50 @@ +#import "../../../src/main.mligo" "Vesting" +#import "./assert.mligo" "Assert" + +(* Some types for readability *) +type taddr = (Vesting.parameter, Vesting.storage) typed_address +type contr = Vesting.parameter contract +type originated = { + addr: address; + taddr: taddr; + contr: contr; +} + +(* Base Factory storage *) +let base_storage (admin : address) : Vesting.storage = { + admin = admin; + metadata = (Big_map.empty : (string, bytes) big_map); +} + +(* Originate a Factory contract with given init_storage storage *) +let originate (init_storage : Vesting.storage) = + let (taddr, _, _) = Test.originate Vesting.main init_storage 0mutez in + let contr = Test.to_contract taddr in + let addr = Tezos.address contr in + {addr = addr; taddr = taddr; contr = contr} + +(* Call entry point of Factory contr contract *) +let call (p, contr : Vesting.parameter * contr) = + Test.transfer_to_contract contr (p) 0mutez + +let call_success (p, contr: Vesting.parameter * contr) = + Assert.tx_success (call(p, contr)) + +(* Call entry point of NFT contr contract with amount *) +let call_with_amount (p, amount_, contr : Vesting.parameter * tez * contr) = + Test.transfer_to_contract contr p amount_ + +let entrypoint_1 (p, amount_, contr : Vesting.Parameter.entrypoint_1_param * tez * contr) = + call_with_amount(Entrypoint_1(p), amount_, contr) + +let entrypoint_1_success (p, amount_, contr : Vesting.Parameter.entrypoint_1_param * tez * contr) = + Assert.tx_success (entrypoint_1(p, amount_, contr)) + +// (* assert Factory contract at [taddr] have [owner] address with [size] collections *) +// let assert_owned_collections_size (taddr, owner, size : taddr * Factory.Storage.collectionOwner * nat) = +// let s = Test.get_storage taddr in +// match Big_map.find_opt owner s.owned_collections with +// Some lst -> assert(List.size lst = size) +// (* assert(lst.size = size) *) +// | None -> failwith("Big_map key should not be missing") + diff --git a/vesting-cameligo/test/ligo/vesting.entrypoint_1.test.mligo b/vesting-cameligo/test/ligo/vesting.entrypoint_1.test.mligo new file mode 100644 index 00000000..6fceac71 --- /dev/null +++ b/vesting-cameligo/test/ligo/vesting.entrypoint_1.test.mligo @@ -0,0 +1,30 @@ +#import "./helpers/assert.mligo" "Assert" +#import "./bootstrap/bootstrap.mligo" "Bootstrap" +#import "./helpers/log.mligo" "Log" +#import "./helpers/vesting.mligo" "Vesting_helper" +#import "../../src/main.mligo" "Vesting" + +let () = Log.describe("[Vesting] test suite") + +let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) + +let bootstrap () = Bootstrap.boot_vesting() + +let test_success_entrypoint_1 = + let (accounts, vesting) = bootstrap() in + let (creator, operator) = accounts in + let () = Test.set_source operator in + let () = Vesting_helper.entrypoint_1_success({ + name = "collection_name"; + }, 0tez, vesting.contr) in + "OK" + //Vesting_helper.assert_owned_collections_size(vesting.taddr, creator, 1n) + +let test_failure_entrypoint_1 = + let (accounts, vesting) = bootstrap() in + let (creator, operator) = accounts in + let () = Test.set_source operator in + let result = Vesting_helper.entrypoint_1({ + name = "collection_name"; + }, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.not_admin From 82c1c99c7ce2d9536b0ebbb4291a7b36d2358d95 Mon Sep 17 00:00:00 2001 From: frankhillard Date: Thu, 15 Sep 2022 18:40:42 +0200 Subject: [PATCH 02/11] [Vesting] start entrypoint --- vesting-cameligo/.gitignore | 5 +- vesting-cameligo/Makefile | 13 ++- vesting-cameligo/esy.json | 5 ++ vesting-cameligo/src/errors.mligo | 9 +- vesting-cameligo/src/main.mligo | 90 ++++++++++++++++++- vesting-cameligo/src/parameter.mligo | 13 ++- vesting-cameligo/src/storage.mligo | 17 +++- .../test/ligo/bootstrap/bootstrap.mligo | 16 +++- vesting-cameligo/test/ligo/helpers/fa2.mligo | 40 +++++++++ .../test/ligo/helpers/vesting.mligo | 57 ++++++++++-- .../test/ligo/vesting.entrypoint_1.test.mligo | 30 ------- .../test/ligo/vesting.release.test.mligo | 61 +++++++++++++ .../test/ligo/vesting.start.test.mligo | 79 ++++++++++++++++ 13 files changed, 379 insertions(+), 56 deletions(-) create mode 100644 vesting-cameligo/esy.json create mode 100644 vesting-cameligo/test/ligo/helpers/fa2.mligo delete mode 100644 vesting-cameligo/test/ligo/vesting.entrypoint_1.test.mligo create mode 100644 vesting-cameligo/test/ligo/vesting.release.test.mligo create mode 100644 vesting-cameligo/test/ligo/vesting.start.test.mligo diff --git a/vesting-cameligo/.gitignore b/vesting-cameligo/.gitignore index d25ef4cd..ff4915b0 100644 --- a/vesting-cameligo/.gitignore +++ b/vesting-cameligo/.gitignore @@ -4,4 +4,7 @@ node_modules /.env .vscode -.ligo-work \ No newline at end of file +.ligo-work +.ligo +_esy +esy.lock \ No newline at end of file diff --git a/vesting-cameligo/Makefile b/vesting-cameligo/Makefile index 1d66c44e..19ea61e2 100644 --- a/vesting-cameligo/Makefile +++ b/vesting-cameligo/Makefile @@ -7,6 +7,10 @@ WHITE := $(shell command -v tput >/dev/null 2>&1 && tput -Txterm setaf 7 || ech YELLOW := $(shell command -v tput >/dev/null 2>&1 && tput -Txterm setaf 3 || echo "") RESET := $(shell command -v tput >/dev/null 2>&1 && tput -Txterm sgr0 || echo "") + +project_root=--project-root . + + # Add help text after each target name starting with '\#\#' # A category can be added with @category HELP_FUN = \ @@ -37,10 +41,10 @@ ifndef LIGO LIGO=docker run --platform linux/amd64 --rm -v "$(PWD)":"$(PWD)" -w "$(PWD)" ligolang/ligo:0.49.0 endif -compile = $(LIGO) compile contract ./src/$(1) -o ./compiled/$(2) $(3) +compile = $(LIGO) compile contract $(project_root) ./src/$(1) -o ./compiled/$(2) $(3) # ^ Compile contracts to Michelson or Micheline -test-ligo = $(LIGO) run test ./test/ligo/$(1) +test-ligo = $(LIGO) run test $(project_root) ./test/ligo/$(1) # ^ Run the given LIGO Test file compile: ##@Contracts - Compile LIGO contracts @@ -51,7 +55,8 @@ compile: ##@Contracts - Compile LIGO contracts test-ligo: ##@Contracts - Run LIGO tests (make test-ligo SUITE=factory) ifndef SUITE - @$(call test-ligo,vesting.entrypoint_1.test.mligo) + @$(call test-ligo,vesting.start.test.mligo) + @$(call test-ligo,vesting.release.test.mligo) else @$(call test-ligo,$(SUITE).test.mligo) endif @@ -69,7 +74,7 @@ clean: ##@Contracts - Contracts clean up install: ##@Scripts - Install NPM dependencies @if [ ! -f ./.env ]; then cp .env.dist .env ; fi @$(LIGO) install - @npm i + deploy: ##@Scripts - Deploy contracts @if [ ! -f ./scripts/metadata.json ]; then cp scripts/metadata.json.dist \ diff --git a/vesting-cameligo/esy.json b/vesting-cameligo/esy.json new file mode 100644 index 00000000..19a37275 --- /dev/null +++ b/vesting-cameligo/esy.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "tezos-ligo-fa2": "^1.0.0" + } +} \ No newline at end of file diff --git a/vesting-cameligo/src/errors.mligo b/vesting-cameligo/src/errors.mligo index 30e6638c..82f0ea08 100644 --- a/vesting-cameligo/src/errors.mligo +++ b/vesting-cameligo/src/errors.mligo @@ -1 +1,8 @@ -let not_admin : string = "not admin" \ No newline at end of file +let not_admin : string = "not admin" +let vesting_already_started : string = "Vesting already started" +let vesting_duration_zero : string = "Vesting duration is zero" +let vesting_duration_smaller_than_cliff_duration : string = "Vesting duration is smaller than cliff duration" +let vesting_not_started : string = "Vesting not started" +let sender_not_beneficiary : string = "Sender is registered among beneficiaries" +let beneficiary_revoked : string = "Beneficiary has been revoked" +let nothing_to_release : string = "No token can be released at this time" \ No newline at end of file diff --git a/vesting-cameligo/src/main.mligo b/vesting-cameligo/src/main.mligo index a93c3a00..02400b0b 100644 --- a/vesting-cameligo/src/main.mligo +++ b/vesting-cameligo/src/main.mligo @@ -1,12 +1,98 @@ #import "storage.mligo" "Storage" #import "parameter.mligo" "Parameter" #import "errors.mligo" "Errors" +#import "tezos-ligo-fa2/lib/fa2/asset/multi_asset.mligo" "FA2" type storage = Storage.t type parameter = Parameter.t type return = operation list * storage +let make_fa2_transfer(from, to, token_address, token_id, amount : address * address * address * nat * nat) : operation = + let destination : FA2.transfer contract = match (Tezos.get_entrypoint_opt "%transfer" token_address : FA2.transfer contract option) with + | None -> failwith "FA2 unknown transfer entrypoint" + | Some ctr -> ctr + in + let payload : FA2.transfer = [{from_=from; tx=[{to_=to; token_id=token_id; amount=amount}]}] in + Tezos.transaction payload 0mutez destination + +let compute_releasable_amount(total_beneficiary, already_released, end_of_cliff, vesting_end, release_duration : nat * nat * timestamp * timestamp * nat) : nat = + if (Tezos.get_now() - end_of_cliff < 0) then + 0n + else if (Tezos.get_now() - vesting_end > 0) then + abs(total_beneficiary - already_released) + else + let ratio = abs(Tezos.get_now() - end_of_cliff) / release_duration in + abs(total_beneficiary * ratio - already_released) + + +let start(_param, s : unit * storage) : operation list * storage = + let _check_already_started : unit = assert_with_error (s.started = False) Errors.vesting_already_started in + let _check_sender_admin : unit = assert_with_error (Tezos.get_sender() = s.admin) Errors.not_admin in + let _check_vesting_duration : unit = assert_with_error (s.release_duration > 0n) Errors.vesting_duration_zero in + let _check_vesting_duration_higher_than_cliff : unit = assert_with_error (s.release_duration >= s.cliff_duration) Errors.vesting_duration_smaller_than_cliff_duration in + + // compute vested_amount based on beneficiaries + let sum_beneficiaries_amounts(acc, elt : nat * (address * nat)) : nat = acc + elt.1 in + let vested_amount = Map.fold sum_beneficiaries_amounts s.beneficiaries 0n in + // admin transfer funds to vesting contract + let op = make_fa2_transfer(Tezos.get_sender(), Tezos.get_self_address(), s.token_address, s.token_id, vested_amount) in + // setup timestamps + let current_timestamp = Tezos.get_now() in + let end_of_cliff_timestamp = current_timestamp + int(s.cliff_duration) in + let start_timestamp = current_timestamp in + let vesting_end_timestamp = current_timestamp + int(s.release_duration) in + let modified_storage = { s with + started = True; + vested_amount=vested_amount; + start=(Some(start_timestamp)); + vesting_end=(Some(vesting_end_timestamp)); + end_of_cliff=(Some(end_of_cliff_timestamp)); + } + in + ([op], modified_storage) + +let revoke(_param, s : unit * storage) : operation list * storage = + (([] : operation list), s) + +let revoke_beneficiary(_param, s : Parameter.revoke_beneficiary_param * storage) : operation list * storage = + (([] : operation list), s) + +let release(_param, s : unit * storage) : operation list * storage = + let sender = Tezos.get_sender() in + let _check_is_started : unit = assert_with_error (s.started = True) Errors.vesting_not_started in + let total_beneficiary_amount = match Map.find_opt sender s.beneficiaries with + | None -> failwith Errors.sender_not_beneficiary + | Some val -> val + in + let beneficiary_revoked = match Map.find_opt sender s.revoked_addresses with + | None -> False + | Some revoked -> revoked + in + let _check_is_not_revoked : unit = assert_with_error (beneficiary_revoked = False) Errors.beneficiary_revoked in + + // compute releasable amount + let already_released_amount = match (Map.find_opt sender s.released) with + | None -> 0n + | Some released -> released + in + let releasable_amount = compute_releasable_amount( + total_beneficiary_amount, + already_released_amount, + Option.unopt(s.end_of_cliff), + Option.unopt(s.vesting_end), + s.release_duration + ) in + let _check_nothing_to_release : unit = assert_with_error (releasable_amount > 0n) Errors.nothing_to_release in + let modified_storage = { s with + total_released=s.total_released+releasable_amount; + released=Map.update sender (Some(already_released_amount + releasable_amount)) s.released; + } in + let op : operation = make_fa2_transfer(Tezos.get_self_address(), sender, s.token_address, s.token_id, releasable_amount) in + ([op], modified_storage) + let main(param, store : parameter * storage) : return = match param with - | Entrypoint_1 _p -> (([] : operation list), store) - | Entrypoint_2 _p -> (([] : operation list), store) + | Start p -> start(p, store) + | Revoke p -> revoke(p, store) + | RevokeBeneficiary p -> revoke_beneficiary(p, store) + | Release p -> release(p, store) diff --git a/vesting-cameligo/src/parameter.mligo b/vesting-cameligo/src/parameter.mligo index 27fbf8fd..b8098a83 100644 --- a/vesting-cameligo/src/parameter.mligo +++ b/vesting-cameligo/src/parameter.mligo @@ -1,9 +1,8 @@ -type entrypoint_1_param = { - name : string -} +type revoke_beneficiary_param = address -type entrypoint_2_param = { - name : string -} +type t = + Start of unit + | Revoke of unit + | RevokeBeneficiary of address + | Release of unit -type t = Entrypoint_1 of entrypoint_1_param | Entrypoint_2 of entrypoint_2_param diff --git a/vesting-cameligo/src/storage.mligo b/vesting-cameligo/src/storage.mligo index ad0bbad5..5c8ff1cf 100644 --- a/vesting-cameligo/src/storage.mligo +++ b/vesting-cameligo/src/storage.mligo @@ -1,4 +1,19 @@ type t = { + token_address : address; + token_id : nat; + beneficiaries : (address, nat) map; + revocable : bool; + release_duration : nat; + cliff_duration : nat; admin : address; + released : (address, nat) map; + revoked : bool; + revoked_addresses : (address, bool) map; + vested_amount : nat; + started : bool; + total_released : nat; + end_of_cliff : timestamp option; + vesting_end : timestamp option; + start : timestamp option; metadata : (string, bytes) big_map; -} \ No newline at end of file +} diff --git a/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo b/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo index 34e0e8c3..4e7b6629 100644 --- a/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo +++ b/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo @@ -1,13 +1,21 @@ #import "../helpers/vesting.mligo" "Vesting_helper" +#import "../helpers/fa2.mligo" "FA2_helper" (* Boostrapping of the test environment for Vesting *) -let boot_vesting () = +let boot_accounts () = let () = Test.reset_state 6n ([] : tez list) in let accounts = Test.nth_bootstrap_account 1, - Test.nth_bootstrap_account 2 + Test.nth_bootstrap_account 2, + Test.nth_bootstrap_account 3 in + accounts - let vesting = Vesting_helper.originate(Vesting_helper.base_storage(accounts.0)) in - (accounts, vesting) +let boot_fa2 (token_id, user : nat * address) = + let fa2 = FA2_helper.originate(FA2_helper.base_storage(token_id, user)) in + fa2 + +let boot_vesting (admin, token_address, token_id, beneficiaries, vesting_duration : address * address * nat * (address, nat)map * nat) = + let vesting = Vesting_helper.originate(Vesting_helper.base_storage(admin, token_address, token_id, beneficiaries, vesting_duration)) in + vesting \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/helpers/fa2.mligo b/vesting-cameligo/test/ligo/helpers/fa2.mligo new file mode 100644 index 00000000..72ec83d1 --- /dev/null +++ b/vesting-cameligo/test/ligo/helpers/fa2.mligo @@ -0,0 +1,40 @@ +#import "tezos-ligo-fa2/lib/fa2/asset/multi_asset.mligo" "FA2" +#import "./assert.mligo" "Assert" + +(* Some types for readability *) +type taddr = (FA2.parameter, FA2.storage) typed_address +type contr = FA2.parameter contract +type originated = { + addr: address; + taddr: taddr; + contr: contr; +} + +let dummy_token_metadata (token_id : nat): FA2.TokenMetadata.data = { + token_id=token_id; + token_info=Map.literal[("", 0x01)]; +} + +(* Base FA2 storage *) +let base_storage (token_id, admin : nat * address) : FA2.storage = { + ledger=(Big_map.literal[((admin, token_id), 1000n)] : FA2.Ledger.t); + token_metadata=Big_map.literal[(token_id, dummy_token_metadata(token_id))]; + operators=(Big_map.empty : FA2.Operators.t); +} + +(* Originate a FA2 contract with given init_storage storage *) +let originate (init_storage : FA2.storage) = + let (taddr, _, _) = Test.originate FA2.main init_storage 0mutez in + let contr = Test.to_contract taddr in + let addr = Tezos.address contr in + {addr = addr; taddr = taddr; contr = contr} + +(* Call entry point of FA2 contr contract *) +let call (p, contr : FA2.parameter * contr) = + Test.transfer_to_contract contr (p) 0mutez + +let update_operators (p, contr : FA2.update_operators * contr) = + call(Update_operators(p), contr) + +let update_operators_success (p, contr : FA2.update_operators * contr) = + Assert.tx_success(update_operators(p, contr)) \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/helpers/vesting.mligo b/vesting-cameligo/test/ligo/helpers/vesting.mligo index e5e6951b..19f8a34b 100644 --- a/vesting-cameligo/test/ligo/helpers/vesting.mligo +++ b/vesting-cameligo/test/ligo/helpers/vesting.mligo @@ -10,13 +10,30 @@ type originated = { contr: contr; } +let zero_timestamp : timestamp = ("1970-01-01T00:00:01Z" : timestamp) + (* Base Factory storage *) -let base_storage (admin : address) : Vesting.storage = { +let base_storage (admin, token_address, token_id, beneficiaries, vesting_duration : address * address * nat * (address, nat)map * nat) : Vesting.storage = { + token_address=token_address; + token_id=token_id; + beneficiaries=beneficiaries; + revocable=True; + release_duration=vesting_duration; + cliff_duration=1000n; admin = admin; + released=(Map.empty : (address, nat) map); + revoked=False; + revoked_addresses=(Map.empty :(address, bool) map); + vested_amount=0n; + started=False; + total_released=0n; + end_of_cliff=(None : timestamp option); + vesting_end=(None : timestamp option); + start=(None : timestamp option); metadata = (Big_map.empty : (string, bytes) big_map); } -(* Originate a Factory contract with given init_storage storage *) +(* Originate a Vesting contract with given init_storage storage *) let originate (init_storage : Vesting.storage) = let (taddr, _, _) = Test.originate Vesting.main init_storage 0mutez in let contr = Test.to_contract taddr in @@ -34,11 +51,30 @@ let call_success (p, contr: Vesting.parameter * contr) = let call_with_amount (p, amount_, contr : Vesting.parameter * tez * contr) = Test.transfer_to_contract contr p amount_ -let entrypoint_1 (p, amount_, contr : Vesting.Parameter.entrypoint_1_param * tez * contr) = - call_with_amount(Entrypoint_1(p), amount_, contr) +let start (p, amount_, contr : unit * tez * contr) = + call_with_amount(Start(p), amount_, contr) + +let revoke (p, amount_, contr : unit * tez * contr) = + call_with_amount(Revoke(p), amount_, contr) + +let revoke_beneficiary (p, amount_, contr : Vesting.Parameter.revoke_beneficiary_param * tez * contr) = + call_with_amount(RevokeBeneficiary(p), amount_, contr) + +let release (p, amount_, contr : unit * tez * contr) = + call_with_amount(Release(p), amount_, contr) + +let start_success (p, amount_, contr : unit * tez * contr) = + Assert.tx_success (start(p, amount_, contr)) + +let revoke_success (p, amount_, contr : unit * tez * contr) = + Assert.tx_success (revoke(p, amount_, contr)) + +let revoke_beneficiary_success (p, amount_, contr : Vesting.Parameter.revoke_beneficiary_param * tez * contr) = + Assert.tx_success (revoke_beneficiary(p, amount_, contr)) + +let release_success (p, amount_, contr : unit * tez * contr) = + Assert.tx_success (release(p, amount_, contr)) -let entrypoint_1_success (p, amount_, contr : Vesting.Parameter.entrypoint_1_param * tez * contr) = - Assert.tx_success (entrypoint_1(p, amount_, contr)) // (* assert Factory contract at [taddr] have [owner] address with [size] collections *) // let assert_owned_collections_size (taddr, owner, size : taddr * Factory.Storage.collectionOwner * nat) = @@ -48,3 +84,12 @@ let entrypoint_1_success (p, amount_, contr : Vesting.Parameter.entrypoint_1_par // (* assert(lst.size = size) *) // | None -> failwith("Big_map key should not be missing") +let assert_vesting_started(taddr, expected_started : taddr * bool) = + let s = Test.get_storage taddr in + assert(s.started = expected_started) + +let assert_released_amount(taddr, owner, expected_released_amount : taddr * address * nat) = + let s = Test.get_storage taddr in + match Map.find_opt owner s.released with + | None -> assert(0n = expected_released_amount) + | Some released_amount -> assert(released_amount = expected_released_amount) diff --git a/vesting-cameligo/test/ligo/vesting.entrypoint_1.test.mligo b/vesting-cameligo/test/ligo/vesting.entrypoint_1.test.mligo deleted file mode 100644 index 6fceac71..00000000 --- a/vesting-cameligo/test/ligo/vesting.entrypoint_1.test.mligo +++ /dev/null @@ -1,30 +0,0 @@ -#import "./helpers/assert.mligo" "Assert" -#import "./bootstrap/bootstrap.mligo" "Bootstrap" -#import "./helpers/log.mligo" "Log" -#import "./helpers/vesting.mligo" "Vesting_helper" -#import "../../src/main.mligo" "Vesting" - -let () = Log.describe("[Vesting] test suite") - -let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) - -let bootstrap () = Bootstrap.boot_vesting() - -let test_success_entrypoint_1 = - let (accounts, vesting) = bootstrap() in - let (creator, operator) = accounts in - let () = Test.set_source operator in - let () = Vesting_helper.entrypoint_1_success({ - name = "collection_name"; - }, 0tez, vesting.contr) in - "OK" - //Vesting_helper.assert_owned_collections_size(vesting.taddr, creator, 1n) - -let test_failure_entrypoint_1 = - let (accounts, vesting) = bootstrap() in - let (creator, operator) = accounts in - let () = Test.set_source operator in - let result = Vesting_helper.entrypoint_1({ - name = "collection_name"; - }, 0tez, vesting.contr) in - Assert.string_failure result Vesting.Errors.not_admin diff --git a/vesting-cameligo/test/ligo/vesting.release.test.mligo b/vesting-cameligo/test/ligo/vesting.release.test.mligo new file mode 100644 index 00000000..8736c2fd --- /dev/null +++ b/vesting-cameligo/test/ligo/vesting.release.test.mligo @@ -0,0 +1,61 @@ +#import "./helpers/assert.mligo" "Assert" +#import "./bootstrap/bootstrap.mligo" "Bootstrap" +#import "./helpers/log.mligo" "Log" +#import "./helpers/vesting.mligo" "Vesting_helper" +#import "./helpers/fa2.mligo" "FA2_helper" +#import "../../src/main.mligo" "Vesting" + +let () = Log.describe("[Vesting - Release] test suite") + +let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) + + + +let test_failure_release_during_cliff = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, 10000n) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Test.set_source alice in + let result = Vesting_helper.release(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.nothing_to_release + +let test_failure_release_not_started = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, 10000n) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source alice in + let result = Vesting_helper.release(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_not_started + + +// let test_success_release_at_end_of_duration = +// let accounts = Bootstrap.boot_accounts() in +// let (admin, alice, bob) = accounts in +// let token_id = 0n in +// let fa2 = Bootstrap.boot_fa2(token_id, admin) in +// let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in +// let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, 10000n) in +// let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + +// let () = Test.set_source admin in +// let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + +// //let () = Test.bake_until_n_cycle_end(1000n) in + +// let () = Test.set_source alice in +// let () = Vesting_helper.release_success(unit, 0tez, vesting.contr) in +// Vesting_helper.assert_released_amount(vesting.taddr, alice, 20n) + + diff --git a/vesting-cameligo/test/ligo/vesting.start.test.mligo b/vesting-cameligo/test/ligo/vesting.start.test.mligo new file mode 100644 index 00000000..dc637f9a --- /dev/null +++ b/vesting-cameligo/test/ligo/vesting.start.test.mligo @@ -0,0 +1,79 @@ +#import "./helpers/assert.mligo" "Assert" +#import "./bootstrap/bootstrap.mligo" "Bootstrap" +#import "./helpers/log.mligo" "Log" +#import "./helpers/vesting.mligo" "Vesting_helper" +#import "./helpers/fa2.mligo" "FA2_helper" +#import "../../src/main.mligo" "Vesting" + +let () = Log.describe("[Vesting - Start] test suite") + +let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) + +let test_success_start_by_admin = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, 10000n) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.assert_vesting_started(vesting.taddr, false) in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + Vesting_helper.assert_vesting_started(vesting.taddr, true) + +let test_failure_start_already_started = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, 10000n) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let result = Vesting_helper.start(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_already_started + +let test_failure_start_by_unauthorized_user = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, 10000n) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source alice in + let result = Vesting_helper.start(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.not_admin + +let test_failure_start_with_zero_duration = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting_duration = 0n in + let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, vesting_duration) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let result = Vesting_helper.start(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_duration_zero + +let test_failure_start_with_duration_smaller_than_cliff = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting_duration = 100n in + let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, vesting_duration) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let result = Vesting_helper.start(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_duration_smaller_than_cliff_duration \ No newline at end of file From 007e11bc5316cecf4418d25004fbe62cfdde4ab2 Mon Sep 17 00:00:00 2001 From: frankhillard Date: Fri, 16 Sep 2022 01:02:28 +0200 Subject: [PATCH 03/11] WIP unit test + FA1 support --- vesting-cameligo/Makefile | 2 + vesting-cameligo/src/errors.mligo | 7 +- vesting-cameligo/src/main.mligo | 63 ++++++++++- vesting-cameligo/src/storage.mligo | 4 +- .../test/ligo/bootstrap/bootstrap.mligo | 4 +- .../test/ligo/helpers/vesting.mligo | 15 ++- .../test/ligo/vesting.release.test.mligo | 6 +- .../test/ligo/vesting.revoke.test.mligo | 86 ++++++++++++++ .../ligo/vesting.revokeaddress.test.mligo | 105 ++++++++++++++++++ .../test/ligo/vesting.start.test.mligo | 10 +- 10 files changed, 283 insertions(+), 19 deletions(-) create mode 100644 vesting-cameligo/test/ligo/vesting.revoke.test.mligo create mode 100644 vesting-cameligo/test/ligo/vesting.revokeaddress.test.mligo diff --git a/vesting-cameligo/Makefile b/vesting-cameligo/Makefile index 19ea61e2..05e480f9 100644 --- a/vesting-cameligo/Makefile +++ b/vesting-cameligo/Makefile @@ -57,6 +57,8 @@ test-ligo: ##@Contracts - Run LIGO tests (make test-ligo SUITE=factory) ifndef SUITE @$(call test-ligo,vesting.start.test.mligo) @$(call test-ligo,vesting.release.test.mligo) + @$(call test-ligo,vesting.revoke.test.mligo) + @$(call test-ligo,vesting.revokeaddress.test.mligo) else @$(call test-ligo,$(SUITE).test.mligo) endif diff --git a/vesting-cameligo/src/errors.mligo b/vesting-cameligo/src/errors.mligo index 82f0ea08..6b35fc6a 100644 --- a/vesting-cameligo/src/errors.mligo +++ b/vesting-cameligo/src/errors.mligo @@ -5,4 +5,9 @@ let vesting_duration_smaller_than_cliff_duration : string = "Vesting duration is let vesting_not_started : string = "Vesting not started" let sender_not_beneficiary : string = "Sender is registered among beneficiaries" let beneficiary_revoked : string = "Beneficiary has been revoked" -let nothing_to_release : string = "No token can be released at this time" \ No newline at end of file +let nothing_to_release : string = "No token can be released at this time" + +let vesting_not_revocable : string = "Contract is not revocable" +let vesting_already_revoked : string = "Vesting already revoked" +let vesting_not_started : string = "Vesting not started" +let address_already_revoked : string = "Address already revoked" \ No newline at end of file diff --git a/vesting-cameligo/src/main.mligo b/vesting-cameligo/src/main.mligo index 02400b0b..76e45150 100644 --- a/vesting-cameligo/src/main.mligo +++ b/vesting-cameligo/src/main.mligo @@ -2,11 +2,21 @@ #import "parameter.mligo" "Parameter" #import "errors.mligo" "Errors" #import "tezos-ligo-fa2/lib/fa2/asset/multi_asset.mligo" "FA2" +#import "tezos-ligo-fa2/lib/fa1.2/FA1.2.jsligo" "FA1" type storage = Storage.t type parameter = Parameter.t type return = operation list * storage +let make_fa1_transfer(from, to, token_address, amount : address * address * address * nat) : operation = + let destination : FA1.transfer contract = match (Tezos.get_entrypoint_opt "%transfer" token_address : FA1.transfer contract option) with + | None -> failwith "FA1 unknown transfer entrypoint" + | Some ctr -> ctr + in + let payload : FA1.transfer = (from, (to, amount)) in + Tezos.transaction payload 0mutez destination + + let make_fa2_transfer(from, to, token_address, token_id, amount : address * address * address * nat * nat) : operation = let destination : FA2.transfer contract = match (Tezos.get_entrypoint_opt "%transfer" token_address : FA2.transfer contract option) with | None -> failwith "FA2 unknown transfer entrypoint" @@ -35,7 +45,10 @@ let start(_param, s : unit * storage) : operation list * storage = let sum_beneficiaries_amounts(acc, elt : nat * (address * nat)) : nat = acc + elt.1 in let vested_amount = Map.fold sum_beneficiaries_amounts s.beneficiaries 0n in // admin transfer funds to vesting contract - let op = make_fa2_transfer(Tezos.get_sender(), Tezos.get_self_address(), s.token_address, s.token_id, vested_amount) in + let op = match s.token_address with + | FA1 token_address -> make_fa1_transfer(Tezos.get_sender(), Tezos.get_self_address(), token_address, vested_amount) + | FA2 token_address -> make_fa2_transfer(Tezos.get_sender(), Tezos.get_self_address(), token_address, s.token_id, vested_amount) + in // setup timestamps let current_timestamp = Tezos.get_now() in let end_of_cliff_timestamp = current_timestamp + int(s.cliff_duration) in @@ -52,10 +65,47 @@ let start(_param, s : unit * storage) : operation list * storage = ([op], modified_storage) let revoke(_param, s : unit * storage) : operation list * storage = - (([] : operation list), s) + let _check_started : unit = assert_with_error (s.started = True) Errors.vesting_not_started in + let _check_revocable : unit = assert_with_error (s.revocable = True) Errors.vesting_not_revocable in + let _check_sender_admin : unit = assert_with_error (Tezos.get_sender() = s.admin) Errors.not_admin in + let _check_not_revoked : unit = assert_with_error (s.revoked = False) Errors.vesting_already_revoked in + let revokable_amount = abs(s.vested_amount - s.total_released) in + let op = match s.token_address with + | FA1 token_address -> make_fa1_transfer(Tezos.get_self_address(), s.admin, token_address, revokable_amount) + | FA2 token_address -> make_fa2_transfer(Tezos.get_self_address(), s.admin, token_address, s.token_id, revokable_amount) + in + ([op], { s with revoked = True }) + +let revoke_beneficiary(param, s : Parameter.revoke_beneficiary_param * storage) : operation list * storage = + let _check_started : unit = assert_with_error (s.started = True) Errors.vesting_not_started in + let _check_revocable : unit = assert_with_error (s.revocable = True) Errors.vesting_not_revocable in + let _check_sender_admin : unit = assert_with_error (Tezos.get_sender() = s.admin) Errors.not_admin in + let _check_not_revoked : unit = assert_with_error (s.revoked = False) Errors.vesting_already_revoked in + let already_revoked = match Map.find_opt param s.revoked_addresses with + | None -> False + | Some status -> status + in + let _check_address_not_revoked : unit = assert_with_error (already_revoked = False) Errors.address_already_revoked in -let revoke_beneficiary(_param, s : Parameter.revoke_beneficiary_param * storage) : operation list * storage = - (([] : operation list), s) + let released_amount = match Map.find_opt param s.released with + | None -> 0n + | Some amt -> amt + in + let beneficiary_amount = match Map.find_opt param s.beneficiaries with + | None -> 0n + | Some amt -> amt + in + + let to_send_to_admin = abs(beneficiary_amount - released_amount) in + let op = match s.token_address with + | FA1 token_address -> make_fa1_transfer(Tezos.get_self_address(), s.admin, token_address, to_send_to_admin) + | FA2 token_address -> make_fa2_transfer(Tezos.get_self_address(), s.admin, token_address, s.token_id, to_send_to_admin) + in + let modified_storage = { s with + total_released=s.total_released + to_send_to_admin; + revoked_addresses=Map.update param (Some(True)) s.revoked_addresses; + } in + ([op], modified_storage) let release(_param, s : unit * storage) : operation list * storage = let sender = Tezos.get_sender() in @@ -87,7 +137,10 @@ let release(_param, s : unit * storage) : operation list * storage = total_released=s.total_released+releasable_amount; released=Map.update sender (Some(already_released_amount + releasable_amount)) s.released; } in - let op : operation = make_fa2_transfer(Tezos.get_self_address(), sender, s.token_address, s.token_id, releasable_amount) in + let op = match s.token_address with + | FA1 token_address -> make_fa1_transfer(Tezos.get_self_address(), sender, token_address, releasable_amount) + | FA2 token_address -> make_fa2_transfer(Tezos.get_self_address(), sender, token_address, s.token_id, releasable_amount) + in ([op], modified_storage) let main(param, store : parameter * storage) : return = diff --git a/vesting-cameligo/src/storage.mligo b/vesting-cameligo/src/storage.mligo index 5c8ff1cf..61e8cc3d 100644 --- a/vesting-cameligo/src/storage.mligo +++ b/vesting-cameligo/src/storage.mligo @@ -1,5 +1,7 @@ +type fa_type = FA1 of address | FA2 of address + type t = { - token_address : address; + token_address : fa_type; token_id : nat; beneficiaries : (address, nat) map; revocable : bool; diff --git a/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo b/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo index 4e7b6629..4017bd86 100644 --- a/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo +++ b/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo @@ -16,6 +16,6 @@ let boot_fa2 (token_id, user : nat * address) = let fa2 = FA2_helper.originate(FA2_helper.base_storage(token_id, user)) in fa2 -let boot_vesting (admin, token_address, token_id, beneficiaries, vesting_duration : address * address * nat * (address, nat)map * nat) = - let vesting = Vesting_helper.originate(Vesting_helper.base_storage(admin, token_address, token_id, beneficiaries, vesting_duration)) in +let boot_vesting (admin, token_address, token_id, beneficiaries, vesting_duration, revocable : address * Vesting_helper.Vesting.Storage.fa_type * nat * (address, nat)map * nat * bool) = + let vesting = Vesting_helper.originate(Vesting_helper.base_storage(admin, token_address, token_id, beneficiaries, vesting_duration, revocable)) in vesting \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/helpers/vesting.mligo b/vesting-cameligo/test/ligo/helpers/vesting.mligo index 19f8a34b..6a3c77b6 100644 --- a/vesting-cameligo/test/ligo/helpers/vesting.mligo +++ b/vesting-cameligo/test/ligo/helpers/vesting.mligo @@ -13,11 +13,11 @@ type originated = { let zero_timestamp : timestamp = ("1970-01-01T00:00:01Z" : timestamp) (* Base Factory storage *) -let base_storage (admin, token_address, token_id, beneficiaries, vesting_duration : address * address * nat * (address, nat)map * nat) : Vesting.storage = { +let base_storage (admin, token_address, token_id, beneficiaries, vesting_duration, revocable : address * Vesting.Storage.fa_type * nat * (address, nat)map * nat * bool) : Vesting.storage = { token_address=token_address; token_id=token_id; beneficiaries=beneficiaries; - revocable=True; + revocable=revocable; release_duration=vesting_duration; cliff_duration=1000n; admin = admin; @@ -93,3 +93,14 @@ let assert_released_amount(taddr, owner, expected_released_amount : taddr * addr match Map.find_opt owner s.released with | None -> assert(0n = expected_released_amount) | Some released_amount -> assert(released_amount = expected_released_amount) + + +let assert_vesting_revoked(taddr, expected_revoked : taddr * bool) = + let s = Test.get_storage taddr in + assert(s.revoked = expected_revoked) + +let assert_beneficiary_revoked(taddr, beneficiary, expected_status : taddr * address * bool) = + let s = Test.get_storage taddr in + match Map.find_opt beneficiary s.revoked_addresses with + | None -> assert(expected_status = False) + | Some status -> assert(status = expected_status) diff --git a/vesting-cameligo/test/ligo/vesting.release.test.mligo b/vesting-cameligo/test/ligo/vesting.release.test.mligo index 8736c2fd..9ad0de39 100644 --- a/vesting-cameligo/test/ligo/vesting.release.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.release.test.mligo @@ -17,7 +17,7 @@ let test_failure_release_during_cliff = let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, 10000n) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -32,7 +32,7 @@ let test_failure_release_not_started = let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, 10000n) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source alice in @@ -46,7 +46,7 @@ let test_failure_release_not_started = // let token_id = 0n in // let fa2 = Bootstrap.boot_fa2(token_id, admin) in // let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in -// let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, 10000n) in +// let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n) in // let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in // let () = Test.set_source admin in diff --git a/vesting-cameligo/test/ligo/vesting.revoke.test.mligo b/vesting-cameligo/test/ligo/vesting.revoke.test.mligo new file mode 100644 index 00000000..bb9cbd72 --- /dev/null +++ b/vesting-cameligo/test/ligo/vesting.revoke.test.mligo @@ -0,0 +1,86 @@ +#import "./helpers/assert.mligo" "Assert" +#import "./bootstrap/bootstrap.mligo" "Bootstrap" +#import "./helpers/log.mligo" "Log" +#import "./helpers/vesting.mligo" "Vesting_helper" +#import "./helpers/fa2.mligo" "FA2_helper" +#import "../../src/main.mligo" "Vesting" + +let () = Log.describe("[Vesting - Revoke] test suite") + +let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) + +let test_failure_revoke_by_admin_before_start = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let result = Vesting_helper.revoke(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_not_started + +let test_failure_revoke_not_revocable = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let revocable = False in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, revocable) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let result = Vesting_helper.revoke(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_not_revocable + +let test_failure_revoke_by_unauthorized = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Test.set_source alice in + let result = Vesting_helper.revoke(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.not_admin + +let test_failure_revoke_twice = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in + let () = Vesting_helper.revoke_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, true) in + let result = Vesting_helper.revoke(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_already_revoked + + +let test_success_revoke_by_admin_after_start = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in + let () = Vesting_helper.revoke_success(unit, 0tez, vesting.contr) in + Vesting_helper.assert_vesting_revoked(vesting.taddr, true) \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/vesting.revokeaddress.test.mligo b/vesting-cameligo/test/ligo/vesting.revokeaddress.test.mligo new file mode 100644 index 00000000..bb5b7940 --- /dev/null +++ b/vesting-cameligo/test/ligo/vesting.revokeaddress.test.mligo @@ -0,0 +1,105 @@ +#import "./helpers/assert.mligo" "Assert" +#import "./bootstrap/bootstrap.mligo" "Bootstrap" +#import "./helpers/log.mligo" "Log" +#import "./helpers/vesting.mligo" "Vesting_helper" +#import "./helpers/fa2.mligo" "FA2_helper" +#import "../../src/main.mligo" "Vesting" + +let () = Log.describe("[Vesting - RevokeAddress] test suite") + +let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) + + + +let test_failure_revoke_address_by_admin_before_start = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let result = Vesting_helper.revoke_beneficiary(bob, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_not_started + +let test_failure_revoke_address_not_revocable = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let revocable = False in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, revocable) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let result = Vesting_helper.revoke_beneficiary(bob, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_not_revocable + +let test_failure_revoke_address_by_unauthorized = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Test.set_source alice in + let result = Vesting_helper.revoke_beneficiary(bob, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.not_admin + +let test_failure_revoke_address_vesting_revoked = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in + let () = Vesting_helper.revoke_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, true) in + let result = Vesting_helper.revoke_beneficiary(bob, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_already_revoked + + +let test_failure_revoke_address_twice = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in + let () = Vesting_helper.revoke_beneficiary_success(bob, 0tez, vesting.contr) in + let () = Vesting_helper.assert_beneficiary_revoked(vesting.taddr, bob, true) in + let result = Vesting_helper.revoke_beneficiary(bob, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.address_already_revoked + +let test_success_revoke_address_by_admin_after_start = + let accounts = Bootstrap.boot_accounts() in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in + let () = Vesting_helper.revoke_beneficiary_success(bob, 0tez, vesting.contr) in + Vesting_helper.assert_beneficiary_revoked(vesting.taddr, bob, true) diff --git a/vesting-cameligo/test/ligo/vesting.start.test.mligo b/vesting-cameligo/test/ligo/vesting.start.test.mligo index dc637f9a..a4ed9534 100644 --- a/vesting-cameligo/test/ligo/vesting.start.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.start.test.mligo @@ -15,7 +15,7 @@ let test_success_start_by_admin = let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, 10000n) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -29,7 +29,7 @@ let test_failure_start_already_started = let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, 10000n) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -43,7 +43,7 @@ let test_failure_start_by_unauthorized_user = let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, 10000n) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source alice in @@ -57,7 +57,7 @@ let test_failure_start_with_zero_duration = let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting_duration = 0n in - let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, vesting_duration) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, vesting_duration, True) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -71,7 +71,7 @@ let test_failure_start_with_duration_smaller_than_cliff = let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting_duration = 100n in - let vesting = Bootstrap.boot_vesting(admin, fa2.addr, token_id, beneficiaries, vesting_duration) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, vesting_duration, True) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in From 3fcd7419994858ca83035449795f9b7f683a6785 Mon Sep 17 00:00:00 2001 From: frankhillard Date: Fri, 16 Sep 2022 14:19:57 +0200 Subject: [PATCH 04/11] Tests for vesting using FA1.2 --- vesting-cameligo/Makefile | 12 +- .../test/ligo/bootstrap/bootstrap.mligo | 14 ++- vesting-cameligo/test/ligo/helpers/fa1.mligo | 48 ++++++++ vesting-cameligo/test/ligo/helpers/fa2.mligo | 8 +- .../test/ligo/helpers/vesting.mligo | 69 ++++++----- .../test/ligo/vesting.release.fa1.test.mligo | 60 ++++++++++ ...t.mligo => vesting.release.fa2.test.mligo} | 39 +++---- .../test/ligo/vesting.revoke.fa1.test.mligo | 91 +++++++++++++++ ...st.mligo => vesting.revoke.fa2.test.mligo} | 22 ++-- .../ligo/vesting.revokeaddress.fa1.test.mligo | 109 ++++++++++++++++++ ...o => vesting.revokeaddress.fa2.test.mligo} | 26 ++--- .../test/ligo/vesting.start.fa1.test.mligo | 84 ++++++++++++++ ...est.mligo => vesting.start.fa2.test.mligo} | 22 ++-- 13 files changed, 512 insertions(+), 92 deletions(-) create mode 100644 vesting-cameligo/test/ligo/helpers/fa1.mligo create mode 100644 vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo rename vesting-cameligo/test/ligo/{vesting.release.test.mligo => vesting.release.fa2.test.mligo} (55%) create mode 100644 vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo rename vesting-cameligo/test/ligo/{vesting.revoke.test.mligo => vesting.revoke.fa2.test.mligo} (83%) create mode 100644 vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo rename vesting-cameligo/test/ligo/{vesting.revokeaddress.test.mligo => vesting.revokeaddress.fa2.test.mligo} (84%) create mode 100644 vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo rename vesting-cameligo/test/ligo/{vesting.start.test.mligo => vesting.start.fa2.test.mligo} (81%) diff --git a/vesting-cameligo/Makefile b/vesting-cameligo/Makefile index 05e480f9..504421d3 100644 --- a/vesting-cameligo/Makefile +++ b/vesting-cameligo/Makefile @@ -55,10 +55,14 @@ compile: ##@Contracts - Compile LIGO contracts test-ligo: ##@Contracts - Run LIGO tests (make test-ligo SUITE=factory) ifndef SUITE - @$(call test-ligo,vesting.start.test.mligo) - @$(call test-ligo,vesting.release.test.mligo) - @$(call test-ligo,vesting.revoke.test.mligo) - @$(call test-ligo,vesting.revokeaddress.test.mligo) + @$(call test-ligo,vesting.start.fa2.test.mligo) + @$(call test-ligo,vesting.release.fa2.test.mligo) + @$(call test-ligo,vesting.revoke.fa2.test.mligo) + @$(call test-ligo,vesting.revokeaddress.fa2.test.mligo) + @$(call test-ligo,vesting.start.fa1.test.mligo) + @$(call test-ligo,vesting.revoke.fa1.test.mligo) + @$(call test-ligo,vesting.release.fa1.test.mligo) + @$(call test-ligo,vesting.revokeaddress.fa1.test.mligo) else @$(call test-ligo,$(SUITE).test.mligo) endif diff --git a/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo b/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo index 4017bd86..c70d28c9 100644 --- a/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo +++ b/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo @@ -1,9 +1,10 @@ #import "../helpers/vesting.mligo" "Vesting_helper" +#import "../helpers/fa1.mligo" "FA1_helper" #import "../helpers/fa2.mligo" "FA2_helper" (* Boostrapping of the test environment for Vesting *) -let boot_accounts () = - let () = Test.reset_state 6n ([] : tez list) in +let boot_accounts (inittime : timestamp) = + let () = Test.reset_state_at inittime 6n ([] : tez list) in let accounts = Test.nth_bootstrap_account 1, @@ -12,10 +13,15 @@ let boot_accounts () = in accounts +let boot_fa1 (token_id, user : nat * address) = + let fa1 = FA1_helper.originate(FA1_helper.base_storage(token_id, user)) in + fa1 + + let boot_fa2 (token_id, user : nat * address) = let fa2 = FA2_helper.originate(FA2_helper.base_storage(token_id, user)) in fa2 -let boot_vesting (admin, token_address, token_id, beneficiaries, vesting_duration, revocable : address * Vesting_helper.Vesting.Storage.fa_type * nat * (address, nat)map * nat * bool) = - let vesting = Vesting_helper.originate(Vesting_helper.base_storage(admin, token_address, token_id, beneficiaries, vesting_duration, revocable)) in +let boot_vesting (admin, token_address, token_id, beneficiaries, vesting_duration, revocable, start_at : address * Vesting_helper.Vesting.Storage.fa_type * nat * (address, nat)map * nat * bool * timestamp option) = + let vesting = Vesting_helper.originate(Vesting_helper.base_storage(admin, token_address, token_id, beneficiaries, vesting_duration, revocable, start_at)) in vesting \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/helpers/fa1.mligo b/vesting-cameligo/test/ligo/helpers/fa1.mligo new file mode 100644 index 00000000..9a00aa67 --- /dev/null +++ b/vesting-cameligo/test/ligo/helpers/fa1.mligo @@ -0,0 +1,48 @@ +#import "tezos-ligo-fa2/lib/fa1.2/FA1.2.jsligo" "FA1" +#import "./assert.mligo" "Assert" + +(* Some types for readability *) +type taddr = (FA1.parameter, FA1.storage) typed_address +type contr = FA1.parameter contract +type originated = { + addr: address; + taddr: taddr; + contr: contr; +} + +let dummy_token_metadata (token_id : nat): FA1.TokenMetadata.data = { + token_id=token_id; + token_info=Map.literal[("", 0x01)]; +} + +(* Base FA1 storage *) +let base_storage (token_id, admin : nat * address) : FA1.storage = +let allowance = (Map.empty : FA1.Allowance.t) in +{ + ledger=(Big_map.literal[(admin, (1000n, (Map.empty : FA1.Allowance.t))) ] : FA1.Ledger.t); + token_metadata=dummy_token_metadata(token_id); + totalSupply=0n; +} + +(* Originate a FA1 contract with given init_storage storage *) +let originate (init_storage : FA1.storage) = + let (taddr, _, _) = Test.originate FA1.main init_storage 0mutez in + let contr = Test.to_contract taddr in + let addr = Tezos.address contr in + {addr = addr; taddr = taddr; contr = contr} + +(* Call entry point of FA1 contr contract *) +let call (p, contr : FA1.parameter * contr) = + Test.transfer_to_contract contr (p) 0mutez + +let approve (p, contr : FA1.approve * contr) = + call(Approve(p), contr) + +let approve_success (p, contr : FA1.approve * contr) = + Assert.tx_success(approve(p, contr)) + +let transfer (p, contr : FA1.transfer * contr) = + call(Transfer(p), contr) + +let transfer_success (p, contr : FA1.transfer * contr) = + Assert.tx_success(transfer(p, contr)) \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/helpers/fa2.mligo b/vesting-cameligo/test/ligo/helpers/fa2.mligo index 72ec83d1..d8fcfa40 100644 --- a/vesting-cameligo/test/ligo/helpers/fa2.mligo +++ b/vesting-cameligo/test/ligo/helpers/fa2.mligo @@ -37,4 +37,10 @@ let update_operators (p, contr : FA2.update_operators * contr) = call(Update_operators(p), contr) let update_operators_success (p, contr : FA2.update_operators * contr) = - Assert.tx_success(update_operators(p, contr)) \ No newline at end of file + Assert.tx_success(update_operators(p, contr)) + +let transfer (p, contr : FA2.transfer * contr) = + call(Transfer(p), contr) + +let transfer_success (p, contr : FA2.transfer * contr) = + Assert.tx_success(transfer(p, contr)) \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/helpers/vesting.mligo b/vesting-cameligo/test/ligo/helpers/vesting.mligo index 6a3c77b6..30416113 100644 --- a/vesting-cameligo/test/ligo/helpers/vesting.mligo +++ b/vesting-cameligo/test/ligo/helpers/vesting.mligo @@ -11,27 +11,49 @@ type originated = { } let zero_timestamp : timestamp = ("1970-01-01T00:00:01Z" : timestamp) +let day2_timestamp : timestamp = ("1970-01-02T00:00:01Z" : timestamp) +let day3_timestamp : timestamp = ("1970-01-03T00:00:01Z" : timestamp) (* Base Factory storage *) -let base_storage (admin, token_address, token_id, beneficiaries, vesting_duration, revocable : address * Vesting.Storage.fa_type * nat * (address, nat)map * nat * bool) : Vesting.storage = { - token_address=token_address; - token_id=token_id; - beneficiaries=beneficiaries; - revocable=revocable; - release_duration=vesting_duration; - cliff_duration=1000n; - admin = admin; - released=(Map.empty : (address, nat) map); - revoked=False; - revoked_addresses=(Map.empty :(address, bool) map); - vested_amount=0n; - started=False; - total_released=0n; - end_of_cliff=(None : timestamp option); - vesting_end=(None : timestamp option); - start=(None : timestamp option); - metadata = (Big_map.empty : (string, bytes) big_map); -} +let base_storage (admin, token_address, token_id, beneficiaries, vesting_duration, revocable, started_at : address * Vesting.Storage.fa_type * nat * (address, nat)map * nat * bool * timestamp option) : Vesting.storage = + let cliff_duration=1000n in + let end_of_cliff_timestamp = match started_at with + | None -> (None : timestamp option) + | Some start_time -> (Some(start_time + int(cliff_duration)) : timestamp option) + in + let vesting_end_timestamp = match started_at with + | None -> (None : timestamp option) + | Some start_time -> (Some(start_time + int(vesting_duration)) : timestamp option) + in + let started = match started_at with + | None -> False + | Some start_time -> True + in + let vested_amount = match started_at with + | None -> 0n + | Some start_time -> + let sum(acc, elt: nat * (address * nat)) : nat = acc + elt.1 in + Map.fold sum beneficiaries 0n + in + { + token_address=token_address; + token_id=token_id; + beneficiaries=beneficiaries; + revocable=revocable; + release_duration=vesting_duration; + cliff_duration=cliff_duration; + admin = admin; + released=(Map.empty : (address, nat) map); + revoked=False; + revoked_addresses=(Map.empty :(address, bool) map); + vested_amount=vested_amount; + started=started; + total_released=0n; + end_of_cliff=end_of_cliff_timestamp; + vesting_end=vesting_end_timestamp; + start=started_at; + metadata = (Big_map.empty : (string, bytes) big_map); + } (* Originate a Vesting contract with given init_storage storage *) let originate (init_storage : Vesting.storage) = @@ -75,15 +97,6 @@ let revoke_beneficiary_success (p, amount_, contr : Vesting.Parameter.revoke_ben let release_success (p, amount_, contr : unit * tez * contr) = Assert.tx_success (release(p, amount_, contr)) - -// (* assert Factory contract at [taddr] have [owner] address with [size] collections *) -// let assert_owned_collections_size (taddr, owner, size : taddr * Factory.Storage.collectionOwner * nat) = -// let s = Test.get_storage taddr in -// match Big_map.find_opt owner s.owned_collections with -// Some lst -> assert(List.size lst = size) -// (* assert(lst.size = size) *) -// | None -> failwith("Big_map key should not be missing") - let assert_vesting_started(taddr, expected_started : taddr * bool) = let s = Test.get_storage taddr in assert(s.started = expected_started) diff --git a/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo new file mode 100644 index 00000000..5b425a9d --- /dev/null +++ b/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo @@ -0,0 +1,60 @@ +#import "./helpers/assert.mligo" "Assert" +#import "./bootstrap/bootstrap.mligo" "Bootstrap" +#import "./helpers/log.mligo" "Log" +#import "./helpers/vesting.mligo" "Vesting_helper" +#import "./helpers/fa1.mligo" "FA1_helper" +#import "../../src/main.mligo" "Vesting" + +let () = Log.describe("[Vesting - Release - FA1] test suite") + +let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) + + + +let test_failure_release_during_cliff = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Test.set_source alice in + let result = Vesting_helper.release(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.nothing_to_release + +let test_failure_release_not_started = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source alice in + let result = Vesting_helper.release(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_not_started + + +let test_success_release_at_end_of_duration = + let accounts = Bootstrap.boot_accounts(Vesting_helper.day3_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, Some(Vesting_helper.day2_timestamp)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + //let result = FA1_helper.transfer(((admin, (vesting.addr, 30n)) : FA1.transfer), fa1.contr) in + + let () = Test.set_source alice in + let () = Vesting_helper.release_success(unit, 0tez, vesting.contr) in + Vesting_helper.assert_released_amount(vesting.taddr, alice, 20n) + + diff --git a/vesting-cameligo/test/ligo/vesting.release.test.mligo b/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo similarity index 55% rename from vesting-cameligo/test/ligo/vesting.release.test.mligo rename to vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo index 9ad0de39..439b05b0 100644 --- a/vesting-cameligo/test/ligo/vesting.release.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo @@ -5,19 +5,19 @@ #import "./helpers/fa2.mligo" "FA2_helper" #import "../../src/main.mligo" "Vesting" -let () = Log.describe("[Vesting - Release] test suite") +let () = Log.describe("[Vesting - Release - FA2] test suite") let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) let test_failure_release_during_cliff = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -27,12 +27,12 @@ let test_failure_release_during_cliff = Assert.string_failure result Vesting.Errors.nothing_to_release let test_failure_release_not_started = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source alice in @@ -40,22 +40,21 @@ let test_failure_release_not_started = Assert.string_failure result Vesting.Errors.vesting_not_started -// let test_success_release_at_end_of_duration = -// let accounts = Bootstrap.boot_accounts() in -// let (admin, alice, bob) = accounts in -// let token_id = 0n in -// let fa2 = Bootstrap.boot_fa2(token_id, admin) in -// let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in -// let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n) in -// let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in +let test_success_release_at_end_of_duration = + let accounts = Bootstrap.boot_accounts(Vesting_helper.day3_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa2 = Bootstrap.boot_fa2(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, Some(Vesting_helper.day2_timestamp)) in + let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in + let () = FA2_helper.transfer_success([{from_=admin; tx=[{to_=vesting.addr; token_id=token_id; amount=30n}]}], fa2.contr) in + //let () = Test.set_source admin in + //let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in -// let () = Test.set_source admin in -// let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in - -// //let () = Test.bake_until_n_cycle_end(1000n) in -// let () = Test.set_source alice in -// let () = Vesting_helper.release_success(unit, 0tez, vesting.contr) in -// Vesting_helper.assert_released_amount(vesting.taddr, alice, 20n) + let () = Test.set_source alice in + let () = Vesting_helper.release_success(unit, 0tez, vesting.contr) in + Vesting_helper.assert_released_amount(vesting.taddr, alice, 20n) diff --git a/vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo new file mode 100644 index 00000000..31dafef4 --- /dev/null +++ b/vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo @@ -0,0 +1,91 @@ +#import "./helpers/assert.mligo" "Assert" +#import "./bootstrap/bootstrap.mligo" "Bootstrap" +#import "./helpers/log.mligo" "Log" +#import "./helpers/vesting.mligo" "Vesting_helper" +#import "./helpers/fa1.mligo" "FA1_helper" +#import "../../src/main.mligo" "Vesting" + +let () = Log.describe("[Vesting - Revoke - FA1] test suite") + +let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) + +let test_failure_revoke_by_admin_before_start = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let result = Vesting_helper.revoke(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_not_started + +let test_failure_revoke_not_revocable = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let revocable = False in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, revocable, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let result = Vesting_helper.revoke(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_not_revocable + +let test_failure_revoke_by_unauthorized = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Test.set_source alice in + let result = Vesting_helper.revoke(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.not_admin + +let test_failure_revoke_twice = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in + let () = Vesting_helper.revoke_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, true) in + let result = Vesting_helper.revoke(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_already_revoked + + +let test_success_revoke_by_admin_after_start = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in + let () = Vesting_helper.revoke_success(unit, 0tez, vesting.contr) in + Vesting_helper.assert_vesting_revoked(vesting.taddr, true) \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/vesting.revoke.test.mligo b/vesting-cameligo/test/ligo/vesting.revoke.fa2.test.mligo similarity index 83% rename from vesting-cameligo/test/ligo/vesting.revoke.test.mligo rename to vesting-cameligo/test/ligo/vesting.revoke.fa2.test.mligo index bb9cbd72..4516f610 100644 --- a/vesting-cameligo/test/ligo/vesting.revoke.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.revoke.fa2.test.mligo @@ -5,17 +5,17 @@ #import "./helpers/fa2.mligo" "FA2_helper" #import "../../src/main.mligo" "Vesting" -let () = Log.describe("[Vesting - Revoke] test suite") +let () = Log.describe("[Vesting - Revoke - FA2] test suite") let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) let test_failure_revoke_by_admin_before_start = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -23,13 +23,13 @@ let test_failure_revoke_by_admin_before_start = Assert.string_failure result Vesting.Errors.vesting_not_started let test_failure_revoke_not_revocable = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let revocable = False in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, revocable) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, revocable, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -38,12 +38,12 @@ let test_failure_revoke_not_revocable = Assert.string_failure result Vesting.Errors.vesting_not_revocable let test_failure_revoke_by_unauthorized = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -53,12 +53,12 @@ let test_failure_revoke_by_unauthorized = Assert.string_failure result Vesting.Errors.not_admin let test_failure_revoke_twice = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -71,12 +71,12 @@ let test_failure_revoke_twice = let test_success_revoke_by_admin_after_start = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in diff --git a/vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo new file mode 100644 index 00000000..eb1c5dab --- /dev/null +++ b/vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo @@ -0,0 +1,109 @@ +#import "./helpers/assert.mligo" "Assert" +#import "./bootstrap/bootstrap.mligo" "Bootstrap" +#import "./helpers/log.mligo" "Log" +#import "./helpers/vesting.mligo" "Vesting_helper" +#import "./helpers/fa1.mligo" "FA1_helper" +#import "../../src/main.mligo" "Vesting" + +let () = Log.describe("[Vesting - RevokeAddress - FA1] test suite") + +let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) + +let test_failure_revoke_address_by_admin_before_start = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let result = Vesting_helper.revoke_beneficiary(bob, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_not_started + +let test_failure_revoke_address_not_revocable = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let revocable = False in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, revocable, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let result = Vesting_helper.revoke_beneficiary(bob, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_not_revocable + +let test_failure_revoke_address_by_unauthorized = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Test.set_source alice in + let result = Vesting_helper.revoke_beneficiary(bob, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.not_admin + +let test_failure_revoke_address_vesting_revoked = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in + let () = Vesting_helper.revoke_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, true) in + let result = Vesting_helper.revoke_beneficiary(bob, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_already_revoked + + +let test_failure_revoke_address_twice = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in + let () = Vesting_helper.revoke_beneficiary_success(bob, 0tez, vesting.contr) in + let () = Vesting_helper.assert_beneficiary_revoked(vesting.taddr, bob, true) in + let result = Vesting_helper.revoke_beneficiary(bob, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.address_already_revoked + +let test_success_revoke_address_by_admin_after_start = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in + let () = Vesting_helper.revoke_beneficiary_success(bob, 0tez, vesting.contr) in + Vesting_helper.assert_beneficiary_revoked(vesting.taddr, bob, true) diff --git a/vesting-cameligo/test/ligo/vesting.revokeaddress.test.mligo b/vesting-cameligo/test/ligo/vesting.revokeaddress.fa2.test.mligo similarity index 84% rename from vesting-cameligo/test/ligo/vesting.revokeaddress.test.mligo rename to vesting-cameligo/test/ligo/vesting.revokeaddress.fa2.test.mligo index bb5b7940..ba3f7383 100644 --- a/vesting-cameligo/test/ligo/vesting.revokeaddress.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.revokeaddress.fa2.test.mligo @@ -5,19 +5,19 @@ #import "./helpers/fa2.mligo" "FA2_helper" #import "../../src/main.mligo" "Vesting" -let () = Log.describe("[Vesting - RevokeAddress] test suite") +let () = Log.describe("[Vesting - RevokeAddress - FA2] test suite") let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) let test_failure_revoke_address_by_admin_before_start = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -25,13 +25,13 @@ let test_failure_revoke_address_by_admin_before_start = Assert.string_failure result Vesting.Errors.vesting_not_started let test_failure_revoke_address_not_revocable = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let revocable = False in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, revocable) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, revocable, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -40,12 +40,12 @@ let test_failure_revoke_address_not_revocable = Assert.string_failure result Vesting.Errors.vesting_not_revocable let test_failure_revoke_address_by_unauthorized = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -55,12 +55,12 @@ let test_failure_revoke_address_by_unauthorized = Assert.string_failure result Vesting.Errors.not_admin let test_failure_revoke_address_vesting_revoked = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -73,12 +73,12 @@ let test_failure_revoke_address_vesting_revoked = let test_failure_revoke_address_twice = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -90,12 +90,12 @@ let test_failure_revoke_address_twice = Assert.string_failure result Vesting.Errors.address_already_revoked let test_success_revoke_address_by_admin_after_start = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in diff --git a/vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo new file mode 100644 index 00000000..4318d1fe --- /dev/null +++ b/vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo @@ -0,0 +1,84 @@ +#import "./helpers/assert.mligo" "Assert" +#import "./bootstrap/bootstrap.mligo" "Bootstrap" +#import "./helpers/log.mligo" "Log" +#import "./helpers/vesting.mligo" "Vesting_helper" +#import "./helpers/fa1.mligo" "FA1_helper" +#import "../../src/main.mligo" "Vesting" + +let () = Log.describe("[Vesting - Start - FA1] test suite") + +let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) + +let test_success_start_by_admin = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.assert_vesting_started(vesting.taddr, false) in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + Vesting_helper.assert_vesting_started(vesting.taddr, true) + +let test_failure_start_already_started = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let result = Vesting_helper.start(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_already_started + +let test_failure_start_by_unauthorized_user = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source alice in + let result = Vesting_helper.start(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.not_admin + +let test_failure_start_with_zero_duration = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting_duration = 0n in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, vesting_duration, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let result = Vesting_helper.start(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_duration_zero + +let test_failure_start_with_duration_smaller_than_cliff = + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in + let (admin, alice, bob) = accounts in + let token_id = 0n in + let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in + let vesting_duration = 100n in + let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, vesting_duration, True, (None : timestamp option)) in + let () = Test.set_source admin in + let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + + let () = Test.set_source admin in + let result = Vesting_helper.start(unit, 0tez, vesting.contr) in + Assert.string_failure result Vesting.Errors.vesting_duration_smaller_than_cliff_duration \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/vesting.start.test.mligo b/vesting-cameligo/test/ligo/vesting.start.fa2.test.mligo similarity index 81% rename from vesting-cameligo/test/ligo/vesting.start.test.mligo rename to vesting-cameligo/test/ligo/vesting.start.fa2.test.mligo index a4ed9534..6c05606a 100644 --- a/vesting-cameligo/test/ligo/vesting.start.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.start.fa2.test.mligo @@ -5,17 +5,17 @@ #import "./helpers/fa2.mligo" "FA2_helper" #import "../../src/main.mligo" "Vesting" -let () = Log.describe("[Vesting - Start] test suite") +let () = Log.describe("[Vesting - Start - FA2] test suite") let metadata_empty : (string, bytes) big_map = (Big_map.empty : (string, bytes) big_map) let test_success_start_by_admin = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -24,12 +24,12 @@ let test_success_start_by_admin = Vesting_helper.assert_vesting_started(vesting.taddr, true) let test_failure_start_already_started = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -38,12 +38,12 @@ let test_failure_start_already_started = Assert.string_failure result Vesting.Errors.vesting_already_started let test_failure_start_by_unauthorized_user = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source alice in @@ -51,13 +51,13 @@ let test_failure_start_by_unauthorized_user = Assert.string_failure result Vesting.Errors.not_admin let test_failure_start_with_zero_duration = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting_duration = 0n in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, vesting_duration, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, vesting_duration, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in @@ -65,13 +65,13 @@ let test_failure_start_with_zero_duration = Assert.string_failure result Vesting.Errors.vesting_duration_zero let test_failure_start_with_duration_smaller_than_cliff = - let accounts = Bootstrap.boot_accounts() in + let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in let fa2 = Bootstrap.boot_fa2(token_id, admin) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting_duration = 100n in - let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, vesting_duration, True) in + let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, vesting_duration, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = Test.set_source admin in From 9ae5a5d4f5149c13201b11513d2277dda7291907 Mon Sep 17 00:00:00 2001 From: frankhillard Date: Fri, 16 Sep 2022 14:34:51 +0200 Subject: [PATCH 05/11] WIP: error mangled module when calling FA1.Transfer --- vesting-cameligo/test/ligo/helpers/fa1.mligo | 2 +- vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo | 8 +++++--- vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo | 3 --- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/vesting-cameligo/test/ligo/helpers/fa1.mligo b/vesting-cameligo/test/ligo/helpers/fa1.mligo index 9a00aa67..16f9b74c 100644 --- a/vesting-cameligo/test/ligo/helpers/fa1.mligo +++ b/vesting-cameligo/test/ligo/helpers/fa1.mligo @@ -43,6 +43,6 @@ let approve_success (p, contr : FA1.approve * contr) = let transfer (p, contr : FA1.transfer * contr) = call(Transfer(p), contr) - + let transfer_success (p, contr : FA1.transfer * contr) = Assert.tx_success(transfer(p, contr)) \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo index 5b425a9d..4fcbf00f 100644 --- a/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo @@ -50,11 +50,13 @@ let test_success_release_at_end_of_duration = let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, Some(Vesting_helper.day2_timestamp)) in let () = Test.set_source admin in + let result = FA1_helper.transfer(((admin, (vesting.addr, 30n)) : FA1_helper.FA1.transfer), fa1.contr) in + let () = Test.log(result) in let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in - //let result = FA1_helper.transfer(((admin, (vesting.addr, 30n)) : FA1.transfer), fa1.contr) in - + let () = Test.set_source alice in - let () = Vesting_helper.release_success(unit, 0tez, vesting.contr) in + let result = Vesting_helper.release(unit, 0tez, vesting.contr) in + let () = Test.log(result) in Vesting_helper.assert_released_amount(vesting.taddr, alice, 20n) diff --git a/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo b/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo index 439b05b0..36b39def 100644 --- a/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo @@ -49,9 +49,6 @@ let test_success_release_at_end_of_duration = let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, Some(Vesting_helper.day2_timestamp)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = FA2_helper.transfer_success([{from_=admin; tx=[{to_=vesting.addr; token_id=token_id; amount=30n}]}], fa2.contr) in - //let () = Test.set_source admin in - //let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in - let () = Test.set_source alice in let () = Vesting_helper.release_success(unit, 0tez, vesting.contr) in From 89005496aa1e9f1ef88cb7d03f342b895181b387 Mon Sep 17 00:00:00 2001 From: frankhillard Date: Mon, 19 Sep 2022 18:19:05 +0200 Subject: [PATCH 06/11] Bump to 0.51.0 comiler which fix error due to wrong typing system in Test framework --- vesting-cameligo/Makefile | 2 +- vesting-cameligo/test/ligo/helpers/fa1.mligo | 1 - vesting-cameligo/test/ligo/helpers/vesting.mligo | 4 ++-- vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo | 6 ++---- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/vesting-cameligo/Makefile b/vesting-cameligo/Makefile index 504421d3..76096f6d 100644 --- a/vesting-cameligo/Makefile +++ b/vesting-cameligo/Makefile @@ -38,7 +38,7 @@ all: install compile deploy ##@Project - Runs all the deployment chain from scra # CONTRACTS # ####################################### ifndef LIGO -LIGO=docker run --platform linux/amd64 --rm -v "$(PWD)":"$(PWD)" -w "$(PWD)" ligolang/ligo:0.49.0 +LIGO=docker run --platform linux/amd64 --rm -v "$(PWD)":"$(PWD)" -w "$(PWD)" ligolang/ligo:0.51.0 endif compile = $(LIGO) compile contract $(project_root) ./src/$(1) -o ./compiled/$(2) $(3) diff --git a/vesting-cameligo/test/ligo/helpers/fa1.mligo b/vesting-cameligo/test/ligo/helpers/fa1.mligo index 16f9b74c..362c6461 100644 --- a/vesting-cameligo/test/ligo/helpers/fa1.mligo +++ b/vesting-cameligo/test/ligo/helpers/fa1.mligo @@ -17,7 +17,6 @@ let dummy_token_metadata (token_id : nat): FA1.TokenMetadata.data = { (* Base FA1 storage *) let base_storage (token_id, admin : nat * address) : FA1.storage = -let allowance = (Map.empty : FA1.Allowance.t) in { ledger=(Big_map.literal[(admin, (1000n, (Map.empty : FA1.Allowance.t))) ] : FA1.Ledger.t); token_metadata=dummy_token_metadata(token_id); diff --git a/vesting-cameligo/test/ligo/helpers/vesting.mligo b/vesting-cameligo/test/ligo/helpers/vesting.mligo index 30416113..a1a81de3 100644 --- a/vesting-cameligo/test/ligo/helpers/vesting.mligo +++ b/vesting-cameligo/test/ligo/helpers/vesting.mligo @@ -27,11 +27,11 @@ let base_storage (admin, token_address, token_id, beneficiaries, vesting_duratio in let started = match started_at with | None -> False - | Some start_time -> True + | Some _start_time -> True in let vested_amount = match started_at with | None -> 0n - | Some start_time -> + | Some _start_time -> let sum(acc, elt: nat * (address * nat)) : nat = acc + elt.1 in Map.fold sum beneficiaries 0n in diff --git a/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo index 4fcbf00f..8f593961 100644 --- a/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo @@ -50,13 +50,11 @@ let test_success_release_at_end_of_duration = let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, Some(Vesting_helper.day2_timestamp)) in let () = Test.set_source admin in - let result = FA1_helper.transfer(((admin, (vesting.addr, 30n)) : FA1_helper.FA1.transfer), fa1.contr) in - let () = Test.log(result) in + let () = FA1_helper.transfer_success(((admin, (vesting.addr, 30n)) : FA1_helper.FA1.transfer), fa1.contr) in let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in let () = Test.set_source alice in - let result = Vesting_helper.release(unit, 0tez, vesting.contr) in - let () = Test.log(result) in + let () = Vesting_helper.release_success(unit, 0tez, vesting.contr) in Vesting_helper.assert_released_amount(vesting.taddr, alice, 20n) From 762312c3f54e3c5318db5429868378688a7b36fe Mon Sep 17 00:00:00 2001 From: frankhillard Date: Tue, 20 Sep 2022 12:32:46 +0200 Subject: [PATCH 07/11] assert balance in tests --- vesting-cameligo/test/ligo/helpers/fa1.mligo | 7 ++++++- vesting-cameligo/test/ligo/helpers/fa2.mligo | 7 ++++++- vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo | 4 +++- vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo | 2 ++ vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo | 3 +++ vesting-cameligo/test/ligo/vesting.revoke.fa2.test.mligo | 5 ++++- .../test/ligo/vesting.revokeaddress.fa1.test.mligo | 3 +++ .../test/ligo/vesting.revokeaddress.fa2.test.mligo | 5 ++++- vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo | 5 ++++- vesting-cameligo/test/ligo/vesting.start.fa2.test.mligo | 5 ++++- 10 files changed, 39 insertions(+), 7 deletions(-) diff --git a/vesting-cameligo/test/ligo/helpers/fa1.mligo b/vesting-cameligo/test/ligo/helpers/fa1.mligo index 362c6461..88ac2a42 100644 --- a/vesting-cameligo/test/ligo/helpers/fa1.mligo +++ b/vesting-cameligo/test/ligo/helpers/fa1.mligo @@ -44,4 +44,9 @@ let transfer (p, contr : FA1.transfer * contr) = call(Transfer(p), contr) let transfer_success (p, contr : FA1.transfer * contr) = - Assert.tx_success(transfer(p, contr)) \ No newline at end of file + Assert.tx_success(transfer(p, contr)) + +let assert_user_balance(taddr, owner, expected_balance : taddr * address * nat) = + let s = Test.get_storage taddr in + let (user_balance, _) = FA1.Ledger.get_for_user(s.ledger, owner) in + assert(user_balance = expected_balance) \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/helpers/fa2.mligo b/vesting-cameligo/test/ligo/helpers/fa2.mligo index d8fcfa40..19d5b60c 100644 --- a/vesting-cameligo/test/ligo/helpers/fa2.mligo +++ b/vesting-cameligo/test/ligo/helpers/fa2.mligo @@ -43,4 +43,9 @@ let transfer (p, contr : FA2.transfer * contr) = call(Transfer(p), contr) let transfer_success (p, contr : FA2.transfer * contr) = - Assert.tx_success(transfer(p, contr)) \ No newline at end of file + Assert.tx_success(transfer(p, contr)) + +let assert_user_balance(taddr, owner, token_id, expected_balance : taddr * address * nat * nat) = + let s = Test.get_storage taddr in + let user_balance = FA2.Ledger.get_for_user s.ledger owner token_id in + assert(user_balance = expected_balance) \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo index 8f593961..2ae49515 100644 --- a/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo @@ -52,9 +52,11 @@ let test_success_release_at_end_of_duration = let () = Test.set_source admin in let () = FA1_helper.transfer_success(((admin, (vesting.addr, 30n)) : FA1_helper.FA1.transfer), fa1.contr) in let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in - + let () = FA1_helper.assert_user_balance(fa1.taddr, alice, 0n) in + let () = Test.set_source alice in let () = Vesting_helper.release_success(unit, 0tez, vesting.contr) in + let () = FA1_helper.assert_user_balance(fa1.taddr, alice, 20n) in Vesting_helper.assert_released_amount(vesting.taddr, alice, 20n) diff --git a/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo b/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo index 36b39def..90f35f03 100644 --- a/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo @@ -49,9 +49,11 @@ let test_success_release_at_end_of_duration = let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, Some(Vesting_helper.day2_timestamp)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in let () = FA2_helper.transfer_success([{from_=admin; tx=[{to_=vesting.addr; token_id=token_id; amount=30n}]}], fa2.contr) in + let () = FA2_helper.assert_user_balance(fa2.taddr, alice, 0n, 0n) in let () = Test.set_source alice in let () = Vesting_helper.release_success(unit, 0tez, vesting.contr) in + let () = FA2_helper.assert_user_balance(fa2.taddr, alice, 0n, 20n) in Vesting_helper.assert_released_amount(vesting.taddr, alice, 20n) diff --git a/vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo index 31dafef4..abc9c833 100644 --- a/vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo @@ -83,9 +83,12 @@ let test_success_revoke_by_admin_after_start = let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + let () = FA1_helper.assert_user_balance(fa1.taddr, admin, 1000n) in let () = Test.set_source admin in let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = FA1_helper.assert_user_balance(fa1.taddr, admin, 970n) in let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in let () = Vesting_helper.revoke_success(unit, 0tez, vesting.contr) in + let () = FA1_helper.assert_user_balance(fa1.taddr, admin, 1000n) in Vesting_helper.assert_vesting_revoked(vesting.taddr, true) \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/vesting.revoke.fa2.test.mligo b/vesting-cameligo/test/ligo/vesting.revoke.fa2.test.mligo index 4516f610..e18e77d5 100644 --- a/vesting-cameligo/test/ligo/vesting.revoke.fa2.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.revoke.fa2.test.mligo @@ -78,9 +78,12 @@ let test_success_revoke_by_admin_after_start = let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in - + let () = FA2_helper.assert_user_balance(fa2.taddr, admin, 0n, 1000n) in + let () = Test.set_source admin in let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = FA2_helper.assert_user_balance(fa2.taddr, admin, 0n, 970n) in let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in let () = Vesting_helper.revoke_success(unit, 0tez, vesting.contr) in + let () = FA2_helper.assert_user_balance(fa2.taddr, admin, 0n, 1000n) in Vesting_helper.assert_vesting_revoked(vesting.taddr, true) \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo index eb1c5dab..56bc9bbd 100644 --- a/vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo @@ -101,9 +101,12 @@ let test_success_revoke_address_by_admin_after_start = let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in + let () = FA1_helper.assert_user_balance(fa1.taddr, admin, 1000n) in let () = Test.set_source admin in let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = FA1_helper.assert_user_balance(fa1.taddr, admin, 970n) in let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in let () = Vesting_helper.revoke_beneficiary_success(bob, 0tez, vesting.contr) in + let () = FA1_helper.assert_user_balance(fa1.taddr, admin, 980n) in Vesting_helper.assert_beneficiary_revoked(vesting.taddr, bob, true) diff --git a/vesting-cameligo/test/ligo/vesting.revokeaddress.fa2.test.mligo b/vesting-cameligo/test/ligo/vesting.revokeaddress.fa2.test.mligo index ba3f7383..62d2dc24 100644 --- a/vesting-cameligo/test/ligo/vesting.revokeaddress.fa2.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.revokeaddress.fa2.test.mligo @@ -97,9 +97,12 @@ let test_success_revoke_address_by_admin_after_start = let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in - + let () = FA2_helper.assert_user_balance(fa2.taddr, admin, 0n, 1000n) in + let () = Test.set_source admin in let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = FA2_helper.assert_user_balance(fa2.taddr, admin, 0n, 970n) in let () = Vesting_helper.assert_vesting_revoked(vesting.taddr, false) in let () = Vesting_helper.revoke_beneficiary_success(bob, 0tez, vesting.contr) in + let () = FA2_helper.assert_user_balance(fa2.taddr, admin, 0n, 980n) in Vesting_helper.assert_beneficiary_revoked(vesting.taddr, bob, true) diff --git a/vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo index 4318d1fe..c2c6746f 100644 --- a/vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo @@ -18,10 +18,13 @@ let test_success_start_by_admin = let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in - + let () = FA1_helper.assert_user_balance(fa1.taddr, admin, 1000n) in + let () = Test.set_source admin in let () = Vesting_helper.assert_vesting_started(vesting.taddr, false) in let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + + let () = FA1_helper.assert_user_balance(fa1.taddr, admin, 970n) in Vesting_helper.assert_vesting_started(vesting.taddr, true) let test_failure_start_already_started = diff --git a/vesting-cameligo/test/ligo/vesting.start.fa2.test.mligo b/vesting-cameligo/test/ligo/vesting.start.fa2.test.mligo index 6c05606a..c249f60f 100644 --- a/vesting-cameligo/test/ligo/vesting.start.fa2.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.start.fa2.test.mligo @@ -17,10 +17,13 @@ let test_success_start_by_admin = let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in - + let () = FA2_helper.assert_user_balance(fa2.taddr, admin, token_id, 1000n) in + + let () = Test.set_source admin in let () = Vesting_helper.assert_vesting_started(vesting.taddr, false) in let () = Vesting_helper.start_success(unit, 0tez, vesting.contr) in + let () = FA2_helper.assert_user_balance(fa2.taddr, admin, token_id, 970n) in Vesting_helper.assert_vesting_started(vesting.taddr, true) let test_failure_start_already_started = From b35a7cc8d487be7c160f9ca40fc11afad7b9496e Mon Sep 17 00:00:00 2001 From: frank Date: Mon, 21 Aug 2023 16:19:03 +0200 Subject: [PATCH 08/11] fix lib dependencies --- vesting-cameligo/Makefile | 2 +- vesting-cameligo/esy.json | 5 -- vesting-cameligo/package.json | 6 ++ vesting-cameligo/src/main.mligo | 11 ++-- .../test/ligo/bootstrap/bootstrap.mligo | 20 ++++++- vesting-cameligo/test/ligo/helpers/fa1.mligo | 34 +++++------ vesting-cameligo/test/ligo/helpers/fa2.mligo | 58 +++++++++++++------ .../test/ligo/helpers/vesting.mligo | 2 +- .../test/ligo/token/extended_fa2.mligo | 31 ++++++++++ vesting-cameligo/test/ligo/token/fa1.mligo | 18 ++++++ .../test/ligo/vesting.release.fa1.test.mligo | 8 +-- .../test/ligo/vesting.release.fa2.test.mligo | 2 +- .../test/ligo/vesting.revoke.fa1.test.mligo | 10 ++-- .../ligo/vesting.revokeaddress.fa1.test.mligo | 12 ++-- .../test/ligo/vesting.start.fa1.test.mligo | 10 ++-- 15 files changed, 158 insertions(+), 71 deletions(-) delete mode 100644 vesting-cameligo/esy.json create mode 100644 vesting-cameligo/package.json create mode 100644 vesting-cameligo/test/ligo/token/extended_fa2.mligo create mode 100644 vesting-cameligo/test/ligo/token/fa1.mligo diff --git a/vesting-cameligo/Makefile b/vesting-cameligo/Makefile index 76096f6d..18b9ddff 100644 --- a/vesting-cameligo/Makefile +++ b/vesting-cameligo/Makefile @@ -38,7 +38,7 @@ all: install compile deploy ##@Project - Runs all the deployment chain from scra # CONTRACTS # ####################################### ifndef LIGO -LIGO=docker run --platform linux/amd64 --rm -v "$(PWD)":"$(PWD)" -w "$(PWD)" ligolang/ligo:0.51.0 +LIGO=docker run --platform linux/amd64 --rm -v "$(PWD)":"$(PWD)" -w "$(PWD)" ligolang/ligo:0.70.1 endif compile = $(LIGO) compile contract $(project_root) ./src/$(1) -o ./compiled/$(2) $(3) diff --git a/vesting-cameligo/esy.json b/vesting-cameligo/esy.json deleted file mode 100644 index 19a37275..00000000 --- a/vesting-cameligo/esy.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "tezos-ligo-fa2": "^1.0.0" - } -} \ No newline at end of file diff --git a/vesting-cameligo/package.json b/vesting-cameligo/package.json new file mode 100644 index 00000000..31592c44 --- /dev/null +++ b/vesting-cameligo/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "ligo-extendable-fa2": "^1.0.4", + "ligo_fa1.2": "^1.0.0" + } +} \ No newline at end of file diff --git a/vesting-cameligo/src/main.mligo b/vesting-cameligo/src/main.mligo index 76e45150..cbe9d604 100644 --- a/vesting-cameligo/src/main.mligo +++ b/vesting-cameligo/src/main.mligo @@ -1,8 +1,11 @@ #import "storage.mligo" "Storage" #import "parameter.mligo" "Parameter" #import "errors.mligo" "Errors" -#import "tezos-ligo-fa2/lib/fa2/asset/multi_asset.mligo" "FA2" -#import "tezos-ligo-fa2/lib/fa1.2/FA1.2.jsligo" "FA1" +#import "ligo-extendable-fa2/lib/multi_asset/fa2.mligo" "FA2" +// #import "tezos-ligo-fa2/lib/fa2/asset/multi_asset.mligo" "FA2" +// #import "tezos-ligo-fa2/lib/fa1.2/FA1.2.jsligo" "FA1" +#import "ligo_fa1.2/lib/asset/fa12.mligo" "FA1" + type storage = Storage.t type parameter = Parameter.t @@ -22,7 +25,7 @@ let make_fa2_transfer(from, to, token_address, token_id, amount : address * addr | None -> failwith "FA2 unknown transfer entrypoint" | Some ctr -> ctr in - let payload : FA2.transfer = [{from_=from; tx=[{to_=to; token_id=token_id; amount=amount}]}] in + let payload : FA2.transfer = [{from_=from; txs=[{to_=to; token_id=token_id; amount=amount}]}] in Tezos.transaction payload 0mutez destination let compute_releasable_amount(total_beneficiary, already_released, end_of_cliff, vesting_end, release_duration : nat * nat * timestamp * timestamp * nat) : nat = @@ -112,7 +115,7 @@ let release(_param, s : unit * storage) : operation list * storage = let _check_is_started : unit = assert_with_error (s.started = True) Errors.vesting_not_started in let total_beneficiary_amount = match Map.find_opt sender s.beneficiaries with | None -> failwith Errors.sender_not_beneficiary - | Some val -> val + | Some value -> value in let beneficiary_revoked = match Map.find_opt sender s.revoked_addresses with | None -> False diff --git a/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo b/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo index c70d28c9..457bf0c6 100644 --- a/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo +++ b/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo @@ -13,13 +13,27 @@ let boot_accounts (inittime : timestamp) = in accounts -let boot_fa1 (token_id, user : nat * address) = - let fa1 = FA1_helper.originate(FA1_helper.base_storage(token_id, user)) in +let boot_fa1 (token_id, user, user_amount : nat * address * nat) = + let beneficiary_allowances = (Map.empty : (address, nat) map) in + let ledger = Big_map.literal ([ + (user, (user_amount, beneficiary_allowances)); + ]) + in + let token_info = (Map.empty: (string, bytes) map) in + let token_metadata = + { token_id = token_id; token_info = token_info; } + in + let metadata = Big_map.literal([ + ("", Bytes.pack("tezos-storage:contents")); + ("contents", ("54657374546F6B656E": bytes)) + ]) + in + let fa1 = FA1_helper.originate(FA1_helper.base_storage(ledger, token_metadata, user_amount, metadata)) in fa1 let boot_fa2 (token_id, user : nat * address) = - let fa2 = FA2_helper.originate(FA2_helper.base_storage(token_id, user)) in + let fa2 = FA2_helper.originate(FA2_helper.base_storage(token_id, user, 1000n)) in fa2 let boot_vesting (admin, token_address, token_id, beneficiaries, vesting_duration, revocable, start_at : address * Vesting_helper.Vesting.Storage.fa_type * nat * (address, nat)map * nat * bool * timestamp option) = diff --git a/vesting-cameligo/test/ligo/helpers/fa1.mligo b/vesting-cameligo/test/ligo/helpers/fa1.mligo index 88ac2a42..19e712e4 100644 --- a/vesting-cameligo/test/ligo/helpers/fa1.mligo +++ b/vesting-cameligo/test/ligo/helpers/fa1.mligo @@ -1,52 +1,52 @@ -#import "tezos-ligo-fa2/lib/fa1.2/FA1.2.jsligo" "FA1" +#import "../token/fa1.mligo" "Token" #import "./assert.mligo" "Assert" (* Some types for readability *) -type taddr = (FA1.parameter, FA1.storage) typed_address -type contr = FA1.parameter contract +type taddr = (Token.parameter, Token.storage) typed_address +type contr = Token.parameter contract type originated = { addr: address; taddr: taddr; contr: contr; } -let dummy_token_metadata (token_id : nat): FA1.TokenMetadata.data = { +let dummy_token_metadata (token_id : nat): Token.FA12.TokenMetadata.data = { token_id=token_id; token_info=Map.literal[("", 0x01)]; } (* Base FA1 storage *) -let base_storage (token_id, admin : nat * address) : FA1.storage = -{ - ledger=(Big_map.literal[(admin, (1000n, (Map.empty : FA1.Allowance.t))) ] : FA1.Ledger.t); - token_metadata=dummy_token_metadata(token_id); - totalSupply=0n; +let base_storage (ledger, token_metadata, total_supply, metadata : Token.FA12.Ledger.t * Token.FA12.TokenMetadata.t * nat * Token.FA12.Storage.Metadata.t) : Token.storage = { + ledger = ledger; + token_metadata = token_metadata; + total_supply = total_supply; + metadata = metadata; } (* Originate a FA1 contract with given init_storage storage *) -let originate (init_storage : FA1.storage) = - let (taddr, _, _) = Test.originate FA1.main init_storage 0mutez in +let originate (init_storage : Token.storage) = + let (taddr, _, _) = Test.originate_uncurried Token.main init_storage 0mutez in let contr = Test.to_contract taddr in let addr = Tezos.address contr in {addr = addr; taddr = taddr; contr = contr} (* Call entry point of FA1 contr contract *) -let call (p, contr : FA1.parameter * contr) = +let call (p, contr : Token.parameter * contr) = Test.transfer_to_contract contr (p) 0mutez -let approve (p, contr : FA1.approve * contr) = +let approve (p, contr : Token.FA12.approve * contr) = call(Approve(p), contr) -let approve_success (p, contr : FA1.approve * contr) = +let approve_success (p, contr : Token.FA12.approve * contr) = Assert.tx_success(approve(p, contr)) -let transfer (p, contr : FA1.transfer * contr) = +let transfer (p, contr : Token.FA12.transfer * contr) = call(Transfer(p), contr) -let transfer_success (p, contr : FA1.transfer * contr) = +let transfer_success (p, contr : Token.FA12.transfer * contr) = Assert.tx_success(transfer(p, contr)) let assert_user_balance(taddr, owner, expected_balance : taddr * address * nat) = let s = Test.get_storage taddr in - let (user_balance, _) = FA1.Ledger.get_for_user(s.ledger, owner) in + let (user_balance, _) = Token.FA12.Ledger.get_for_user s.ledger owner in assert(user_balance = expected_balance) \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/helpers/fa2.mligo b/vesting-cameligo/test/ligo/helpers/fa2.mligo index 19d5b60c..9c510827 100644 --- a/vesting-cameligo/test/ligo/helpers/fa2.mligo +++ b/vesting-cameligo/test/ligo/helpers/fa2.mligo @@ -1,51 +1,71 @@ -#import "tezos-ligo-fa2/lib/fa2/asset/multi_asset.mligo" "FA2" +#import "../token/extended_fa2.mligo" "Token" #import "./assert.mligo" "Assert" (* Some types for readability *) -type taddr = (FA2.parameter, FA2.storage) typed_address -type contr = FA2.parameter contract +type taddr = (Token.parameter, Token.extended_storage) typed_address +type contr = Token.parameter contract type originated = { addr: address; taddr: taddr; contr: contr; } -let dummy_token_metadata (token_id : nat): FA2.TokenMetadata.data = { +let dummy_token_metadata (token_id : nat): Token.FA2.TokenMetadata.data = { token_id=token_id; token_info=Map.literal[("", 0x01)]; } -(* Base FA2 storage *) -let base_storage (token_id, admin : nat * address) : FA2.storage = { - ledger=(Big_map.literal[((admin, token_id), 1000n)] : FA2.Ledger.t); +(* Base Token storage *) +let base_storage (token_id, beneficiary, beneficiary_amount : nat * address * nat) : Token.extended_storage = { + ledger=(Big_map.literal[((beneficiary, token_id), beneficiary_amount)] : Token.FA2.Ledger.t); token_metadata=Big_map.literal[(token_id, dummy_token_metadata(token_id))]; - operators=(Big_map.empty : FA2.Operators.t); + operators=(Big_map.empty : Token.FA2.Operators.t); + metadata = (Big_map.empty : (string, bytes) big_map); + extension = unit; } -(* Originate a FA2 contract with given init_storage storage *) -let originate (init_storage : FA2.storage) = - let (taddr, _, _) = Test.originate FA2.main init_storage 0mutez in +(* Originate a Token contract with given init_storage storage *) +let originate (init_storage : Token.extended_storage) = + let (taddr, _, _) = Test.originate_uncurried Token.main init_storage 0mutez in let contr = Test.to_contract taddr in let addr = Tezos.address contr in {addr = addr; taddr = taddr; contr = contr} -(* Call entry point of FA2 contr contract *) -let call (p, contr : FA2.parameter * contr) = +let originate_from_file (init_storage, balance : Token.extended_storage * tez) = + let f = "../token/extended_fa2.mligo" in + let v_mich = Test.run (fun (x:Token.extended_storage) -> x) init_storage in + let (addr, _, _) = Test.originate_from_file f "main" ["get_balance"] v_mich balance in + let taddr : taddr = Test.cast_address addr in + let contr = Test.to_contract taddr in + {addr = addr; taddr = taddr; contr = contr} + +(* Call entry point of Token contr contract *) +let call (p, contr : Token.parameter * contr) = Test.transfer_to_contract contr (p) 0mutez -let update_operators (p, contr : FA2.update_operators * contr) = +let update_operators (p, contr : Token.FA2.update_operators * contr) = call(Update_operators(p), contr) -let update_operators_success (p, contr : FA2.update_operators * contr) = +let update_operators_success (p, contr : Token.FA2.update_operators * contr) = Assert.tx_success(update_operators(p, contr)) -let transfer (p, contr : FA2.transfer * contr) = +let transfer (p, contr : Token.FA2.transfer * contr) = call(Transfer(p), contr) -let transfer_success (p, contr : FA2.transfer * contr) = +let transfer_success (p, contr : Token.FA2.transfer * contr) = Assert.tx_success(transfer(p, contr)) +let get_user_balance(taddr, owner : taddr * address) = + let s = Test.get_storage taddr in + Token.FA2.Ledger.get_for_user s.ledger owner + let assert_user_balance(taddr, owner, token_id, expected_balance : taddr * address * nat * nat) = let s = Test.get_storage taddr in - let user_balance = FA2.Ledger.get_for_user s.ledger owner token_id in - assert(user_balance = expected_balance) \ No newline at end of file + let user_balance = Token.FA2.Ledger.get_for_user s.ledger owner token_id in + // let () = Test.log(s) in + assert(user_balance = expected_balance) + +let assert_user_balance_in_range(taddr, owner, token_id, expected_balance, epsilon : taddr * address * nat * nat * nat) = + let s = Test.get_storage taddr in + let user_balance = Token.FA2.Ledger.get_for_user s.ledger owner token_id in + assert(abs(user_balance - expected_balance) <= epsilon) \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/helpers/vesting.mligo b/vesting-cameligo/test/ligo/helpers/vesting.mligo index a1a81de3..63388ee7 100644 --- a/vesting-cameligo/test/ligo/helpers/vesting.mligo +++ b/vesting-cameligo/test/ligo/helpers/vesting.mligo @@ -57,7 +57,7 @@ let base_storage (admin, token_address, token_id, beneficiaries, vesting_duratio (* Originate a Vesting contract with given init_storage storage *) let originate (init_storage : Vesting.storage) = - let (taddr, _, _) = Test.originate Vesting.main init_storage 0mutez in + let (taddr, _, _) = Test.originate_uncurried Vesting.main init_storage 0mutez in let contr = Test.to_contract taddr in let addr = Tezos.address contr in {addr = addr; taddr = taddr; contr = contr} diff --git a/vesting-cameligo/test/ligo/token/extended_fa2.mligo b/vesting-cameligo/test/ligo/token/extended_fa2.mligo new file mode 100644 index 00000000..bb890624 --- /dev/null +++ b/vesting-cameligo/test/ligo/token/extended_fa2.mligo @@ -0,0 +1,31 @@ +#import "ligo-extendable-fa2/lib/multi_asset/fa2.mligo" "FA2" + +type storage = FA2.storage + +type extension = unit + +type extended_storage = extension storage + +type parameter = [@layout:comb] + | Transfer of FA2.transfer + | Balance_of of FA2.balance_of + | Update_operators of FA2.update_operators + +let main (p, s : parameter * extended_storage) : operation list * extended_storage = + match p with + Transfer p -> FA2.transfer p s + | Balance_of p -> FA2.balance_of p s + | Update_operators p -> FA2.update_ops p s + + +let assert_token_exist (s : extended_storage) (token_id : nat) : unit = + match (Big_map.find_opt token_id s.token_metadata) with + None -> failwith FA2.Errors.undefined_token + | Some meta -> assert_with_error (meta.token_id = token_id) FA2.Errors.undefined_token + +let get_balance (s : extended_storage) (owner:address) (token_id:nat) : nat = + let () = assert_token_exist s token_id in + FA2.Ledger.get_for_user s.ledger owner token_id + +[@view] let get_balance (p, s : address * extended_storage) : nat = + get_balance s p 0n \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/token/fa1.mligo b/vesting-cameligo/test/ligo/token/fa1.mligo new file mode 100644 index 00000000..138866ec --- /dev/null +++ b/vesting-cameligo/test/ligo/token/fa1.mligo @@ -0,0 +1,18 @@ +#import "ligo_fa1.2/lib/asset/fa12.mligo" "FA12" + +type storage = FA12.storage + +type parameter = //[@layout:comb] + Transfer of FA12.transfer +| Approve of FA12.approve +| GetAllowance of FA12.getAllowance +| GetBalance of FA12.getBalance +| GetTotalSupply of FA12.getTotalSupply + +let main (p, s : parameter * storage) : operation list * storage = + match p with + Transfer p -> FA12.transfer(p, s) + | Approve p -> FA12.approve(p, s) + | GetAllowance p -> FA12.getAllowance(p, s) + | GetBalance p -> FA12.getBalance(p, s) + | GetTotalSupply p -> FA12.getTotalSupply(p, s) \ No newline at end of file diff --git a/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo index 2ae49515..76fad4a7 100644 --- a/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo @@ -15,7 +15,7 @@ let test_failure_release_during_cliff = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in @@ -31,7 +31,7 @@ let test_failure_release_not_started = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in @@ -46,11 +46,11 @@ let test_success_release_at_end_of_duration = let accounts = Bootstrap.boot_accounts(Vesting_helper.day3_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, Some(Vesting_helper.day2_timestamp)) in let () = Test.set_source admin in - let () = FA1_helper.transfer_success(((admin, (vesting.addr, 30n)) : FA1_helper.FA1.transfer), fa1.contr) in + let () = FA1_helper.transfer_success(((admin, (vesting.addr, 30n)) : FA1_helper.Token.FA12.transfer), fa1.contr) in let () = FA1_helper.approve_success((vesting.addr, 30n), fa1.contr) in let () = FA1_helper.assert_user_balance(fa1.taddr, alice, 0n) in diff --git a/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo b/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo index 90f35f03..ac14ac6b 100644 --- a/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo @@ -48,7 +48,7 @@ let test_success_release_at_end_of_duration = let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA2(fa2.addr), token_id, beneficiaries, 10000n, True, Some(Vesting_helper.day2_timestamp)) in let () = FA2_helper.update_operators_success([Add_operator({owner=admin; operator=vesting.addr; token_id=token_id})], fa2.contr) in - let () = FA2_helper.transfer_success([{from_=admin; tx=[{to_=vesting.addr; token_id=token_id; amount=30n}]}], fa2.contr) in + let () = FA2_helper.transfer_success([{from_=admin; txs=[{to_=vesting.addr; token_id=token_id; amount=30n}]}], fa2.contr) in let () = FA2_helper.assert_user_balance(fa2.taddr, alice, 0n, 0n) in let () = Test.set_source alice in diff --git a/vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo index abc9c833..7429cd2e 100644 --- a/vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo @@ -13,7 +13,7 @@ let test_failure_revoke_by_admin_before_start = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in @@ -27,7 +27,7 @@ let test_failure_revoke_not_revocable = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let revocable = False in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, revocable, (None : timestamp option)) in @@ -43,7 +43,7 @@ let test_failure_revoke_by_unauthorized = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in @@ -59,7 +59,7 @@ let test_failure_revoke_twice = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in @@ -78,7 +78,7 @@ let test_success_revoke_by_admin_after_start = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in diff --git a/vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo index 56bc9bbd..64011fab 100644 --- a/vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo @@ -13,7 +13,7 @@ let test_failure_revoke_address_by_admin_before_start = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in @@ -27,7 +27,7 @@ let test_failure_revoke_address_not_revocable = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let revocable = False in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, revocable, (None : timestamp option)) in @@ -43,7 +43,7 @@ let test_failure_revoke_address_by_unauthorized = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in @@ -59,7 +59,7 @@ let test_failure_revoke_address_vesting_revoked = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in @@ -78,7 +78,7 @@ let test_failure_revoke_address_twice = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in @@ -96,7 +96,7 @@ let test_success_revoke_address_by_admin_after_start = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in diff --git a/vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo b/vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo index c2c6746f..bbcf7111 100644 --- a/vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo +++ b/vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo @@ -13,7 +13,7 @@ let test_success_start_by_admin = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in @@ -31,7 +31,7 @@ let test_failure_start_already_started = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in @@ -46,7 +46,7 @@ let test_failure_start_by_unauthorized_user = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, 10000n, True, (None : timestamp option)) in let () = Test.set_source admin in @@ -60,7 +60,7 @@ let test_failure_start_with_zero_duration = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting_duration = 0n in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, vesting_duration, True, (None : timestamp option)) in @@ -75,7 +75,7 @@ let test_failure_start_with_duration_smaller_than_cliff = let accounts = Bootstrap.boot_accounts(Vesting_helper.zero_timestamp) in let (admin, alice, bob) = accounts in let token_id = 0n in - let fa1 = Bootstrap.boot_fa1(token_id, admin) in + let fa1 = Bootstrap.boot_fa1(token_id, admin, 1000n) in let beneficiaries = Map.literal[(alice, 20n);(bob, 10n)] in let vesting_duration = 100n in let vesting = Bootstrap.boot_vesting(admin, FA1(fa1.addr), token_id, beneficiaries, vesting_duration, True, (None : timestamp option)) in From 189d0292700151a74bfb9053c79db918a785ee7d Mon Sep 17 00:00:00 2001 From: Charaf ZELLOU Date: Tue, 22 Aug 2023 11:28:48 +0200 Subject: [PATCH 09/11] Added deployment scripts --- .../cameligo}/.env.dist | 0 .../cameligo}/.gitignore | 0 .../cameligo}/Makefile | 8 +- .../cameligo}/README.md | 0 .../cameligo}/package.json | 0 vesting/cameligo/scripts/.eslintrc.js | 8 + .../cameligo}/scripts/deploy.ts | 21 +- .../cameligo/scripts/metadata.json | 0 vesting/cameligo/scripts/metadata.json.dist | 21 + vesting/cameligo/scripts/package-lock.json | 2913 +++++++++++++++++ vesting/cameligo/scripts/package.json | 26 + vesting/cameligo/scripts/run-sandbox | 11 + vesting/cameligo/scripts/tsconfig.json | 22 + .../cameligo}/src/errors.mligo | 0 .../cameligo}/src/main.mligo | 0 .../cameligo}/src/parameter.mligo | 0 .../cameligo}/src/storage.mligo | 0 .../test/ligo/bootstrap/bootstrap.mligo | 0 .../cameligo}/test/ligo/helpers/assert.mligo | 0 .../cameligo}/test/ligo/helpers/fa1.mligo | 0 .../cameligo}/test/ligo/helpers/fa2.mligo | 0 .../cameligo}/test/ligo/helpers/log.mligo | 0 .../cameligo}/test/ligo/helpers/vesting.mligo | 0 .../test/ligo/token/extended_fa2.mligo | 0 .../cameligo}/test/ligo/token/fa1.mligo | 0 .../test/ligo/vesting.release.fa1.test.mligo | 0 .../test/ligo/vesting.release.fa2.test.mligo | 0 .../test/ligo/vesting.revoke.fa1.test.mligo | 0 .../test/ligo/vesting.revoke.fa2.test.mligo | 0 .../ligo/vesting.revokeaddress.fa1.test.mligo | 0 .../ligo/vesting.revokeaddress.fa2.test.mligo | 0 .../test/ligo/vesting.start.fa1.test.mligo | 0 .../test/ligo/vesting.start.fa2.test.mligo | 0 33 files changed, 3023 insertions(+), 7 deletions(-) rename {vesting-cameligo => vesting/cameligo}/.env.dist (100%) rename {vesting-cameligo => vesting/cameligo}/.gitignore (100%) rename {vesting-cameligo => vesting/cameligo}/Makefile (96%) rename {vesting-cameligo => vesting/cameligo}/README.md (100%) rename {vesting-cameligo => vesting/cameligo}/package.json (100%) create mode 100644 vesting/cameligo/scripts/.eslintrc.js rename {vesting-cameligo => vesting/cameligo}/scripts/deploy.ts (69%) rename vesting-cameligo/scripts/metadata.json.dist => vesting/cameligo/scripts/metadata.json (100%) create mode 100644 vesting/cameligo/scripts/metadata.json.dist create mode 100644 vesting/cameligo/scripts/package-lock.json create mode 100644 vesting/cameligo/scripts/package.json create mode 100755 vesting/cameligo/scripts/run-sandbox create mode 100644 vesting/cameligo/scripts/tsconfig.json rename {vesting-cameligo => vesting/cameligo}/src/errors.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/src/main.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/src/parameter.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/src/storage.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/bootstrap/bootstrap.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/helpers/assert.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/helpers/fa1.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/helpers/fa2.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/helpers/log.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/helpers/vesting.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/token/extended_fa2.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/token/fa1.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/vesting.release.fa1.test.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/vesting.release.fa2.test.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/vesting.revoke.fa1.test.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/vesting.revoke.fa2.test.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/vesting.revokeaddress.fa1.test.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/vesting.revokeaddress.fa2.test.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/vesting.start.fa1.test.mligo (100%) rename {vesting-cameligo => vesting/cameligo}/test/ligo/vesting.start.fa2.test.mligo (100%) diff --git a/vesting-cameligo/.env.dist b/vesting/cameligo/.env.dist similarity index 100% rename from vesting-cameligo/.env.dist rename to vesting/cameligo/.env.dist diff --git a/vesting-cameligo/.gitignore b/vesting/cameligo/.gitignore similarity index 100% rename from vesting-cameligo/.gitignore rename to vesting/cameligo/.gitignore diff --git a/vesting-cameligo/Makefile b/vesting/cameligo/Makefile similarity index 96% rename from vesting-cameligo/Makefile rename to vesting/cameligo/Makefile index 18b9ddff..386716a5 100644 --- a/vesting-cameligo/Makefile +++ b/vesting/cameligo/Makefile @@ -69,7 +69,7 @@ endif test-integration: ##@Contracts - Run integration tests $(MAKE) deploy - @npm run test + @npm --prefix run test clean: ##@Contracts - Contracts clean up @echo "Are you sure you want to DELETE ALL COMPILED CONTRACT FILES from your Compiled folder ? [y/N]" && read ans && if [ $${ans:-'N'} = 'y' ]; then rm -rf compiled/* ; fi @@ -79,14 +79,14 @@ clean: ##@Contracts - Contracts clean up ####################################### install: ##@Scripts - Install NPM dependencies @if [ ! -f ./.env ]; then cp .env.dist .env ; fi + @npm --prefix ./scripts install @$(LIGO) install - + deploy: ##@Scripts - Deploy contracts @if [ ! -f ./scripts/metadata.json ]; then cp scripts/metadata.json.dist \ scripts/metadata.json ; fi - @npx ts-node ./scripts/deploy.ts - + @npx ts-node ./scripts/deploy.ts --resolveJsonModule ####################################### # SANDBOX # diff --git a/vesting-cameligo/README.md b/vesting/cameligo/README.md similarity index 100% rename from vesting-cameligo/README.md rename to vesting/cameligo/README.md diff --git a/vesting-cameligo/package.json b/vesting/cameligo/package.json similarity index 100% rename from vesting-cameligo/package.json rename to vesting/cameligo/package.json diff --git a/vesting/cameligo/scripts/.eslintrc.js b/vesting/cameligo/scripts/.eslintrc.js new file mode 100644 index 00000000..d365941e --- /dev/null +++ b/vesting/cameligo/scripts/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + extends: [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:prettier/recommended", + ], + plugins: ["@typescript-eslint"], +}; diff --git a/vesting-cameligo/scripts/deploy.ts b/vesting/cameligo/scripts/deploy.ts similarity index 69% rename from vesting-cameligo/scripts/deploy.ts rename to vesting/cameligo/scripts/deploy.ts index 11088108..989d3ccf 100644 --- a/vesting-cameligo/scripts/deploy.ts +++ b/vesting/cameligo/scripts/deploy.ts @@ -18,19 +18,34 @@ const deploy = async () => { process.env.SECRET_KEY ); + const now = Date.now(); Tezos.setProvider({ signer }); // create a JavaScript object to be used as initial storage // https://tezostaquito.io/docs/originate/#a-initializing-storage-using-a-plain-old-javascript-object const storage = { + token_address : "KT1TwzD6zV3WeJ39ukuqxcfK2fJCnhvrdN1X", + token_id : 0, + beneficiaries : new MichelsonMap(), + // revocable : false, + release_duration : 3600, + cliff_duration : 1200, + admin: process.env.ADMIN, + released : new MichelsonMap(), + // revoked : false, + revoked_addresses : new MichelsonMap(), + vested_amount : 1000, + // started : true, + total_released : 0, + // end_of_cliff : now + 1200, + // vesting_end : now + 3600, + // start : now, metadata: MichelsonMap.fromLiteral({ "": buf2hex(Buffer.from("tezos-storage:contents")), contents: buf2hex(Buffer.from(JSON.stringify(metadata))), }), // ^ contract metadata (tzip-16) // https://tzip.tezosagora.org/proposal/tzip-16/ - - admin: process.env.ADMIN, }; const op = await Tezos.contract.originate({ code, storage }); @@ -41,4 +56,4 @@ const deploy = async () => { } }; -deploy(); \ No newline at end of file +deploy(); diff --git a/vesting-cameligo/scripts/metadata.json.dist b/vesting/cameligo/scripts/metadata.json similarity index 100% rename from vesting-cameligo/scripts/metadata.json.dist rename to vesting/cameligo/scripts/metadata.json diff --git a/vesting/cameligo/scripts/metadata.json.dist b/vesting/cameligo/scripts/metadata.json.dist new file mode 100644 index 00000000..d314a47e --- /dev/null +++ b/vesting/cameligo/scripts/metadata.json.dist @@ -0,0 +1,21 @@ +{ + "name": "Vesting Example", + "description": "A Vesting Example Contract", + "version": "1.0.0", + "license": { + "name": "MIT" + }, + "authors": [ + "smart-chain " + ], + "homepage": "https://github.com/ligolang/vesting-cameligo", + "source": { + "tools": "cameligo", + "location": "https://github.com/ligolang/vesting-cameligo/src" + }, + "interfaces": [ + "TZIP-012", + "TZIP-016", + "TZIP-017" + ] +} \ No newline at end of file diff --git a/vesting/cameligo/scripts/package-lock.json b/vesting/cameligo/scripts/package-lock.json new file mode 100644 index 00000000..005d36b1 --- /dev/null +++ b/vesting/cameligo/scripts/package-lock.json @@ -0,0 +1,2913 @@ +{ + "name": "vesting-scripts", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vesting-scripts", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@taquito/signer": "^17.2.0", + "@taquito/taquito": "^17.2.0", + "@taquito/utils": "^17.2.0", + "dotenv": "^16.3.1", + "ts-node": "^10.9.1", + "typescript": "^5.1.6" + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^6.4.1", + "@typescript-eslint/parser": "^6.4.1", + "eslint": "^8.47.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-prettier": "^5.0.0" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.7.0.tgz", + "integrity": "sha512-+HencqxU7CFJnQb7IKtuNBqS6Yx3Tz4kOL8BJXo+JyeiBm5MEX6pO8onXDkjrkCRlfYXS1Axro15ZjVFe9YgsA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", + "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", + "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@pkgr/utils": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz", + "integrity": "sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "fast-glob": "^3.3.0", + "is-glob": "^4.0.3", + "open": "^9.1.0", + "picocolors": "^1.0.0", + "tslib": "^2.6.0" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@stablelib/binary": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/binary/-/binary-1.0.1.tgz", + "integrity": "sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==", + "dependencies": { + "@stablelib/int": "^1.0.1" + } + }, + "node_modules/@stablelib/blake2b": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/blake2b/-/blake2b-1.0.1.tgz", + "integrity": "sha512-B3KyKoBAjkIFeH7romcF96i+pVFYk7K2SBQ1pZvaxV+epSBXJ+n0C66esUhyz6FF+5FbdQVm77C5fzGFcEZpKA==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/hash": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/bytes": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/bytes/-/bytes-1.0.1.tgz", + "integrity": "sha512-Kre4Y4kdwuqL8BR2E9hV/R5sOrUj6NanZaZis0V6lX5yzqC3hBuVSDXUIBqQv/sCpmuWRiHLwqiT1pqqjuBXoQ==" + }, + "node_modules/@stablelib/constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/constant-time/-/constant-time-1.0.1.tgz", + "integrity": "sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==" + }, + "node_modules/@stablelib/ed25519": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@stablelib/ed25519/-/ed25519-1.0.3.tgz", + "integrity": "sha512-puIMWaX9QlRsbhxfDc5i+mNPMY+0TmQEskunY1rZEBPi1acBCVQAhnsk/1Hk50DGPtVsZtAWQg4NHGlVaO9Hqg==", + "dependencies": { + "@stablelib/random": "^1.0.2", + "@stablelib/sha512": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/hash": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/hash/-/hash-1.0.1.tgz", + "integrity": "sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==" + }, + "node_modules/@stablelib/hmac": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/hmac/-/hmac-1.0.1.tgz", + "integrity": "sha512-V2APD9NSnhVpV/QMYgCVMIYKiYG6LSqw1S65wxVoirhU/51ACio6D4yDVSwMzuTJXWZoVHbDdINioBwKy5kVmA==", + "dependencies": { + "@stablelib/constant-time": "^1.0.1", + "@stablelib/hash": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/int": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/int/-/int-1.0.1.tgz", + "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==" + }, + "node_modules/@stablelib/keyagreement": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/keyagreement/-/keyagreement-1.0.1.tgz", + "integrity": "sha512-VKL6xBwgJnI6l1jKrBAfn265cspaWBPAPEc62VBQrWHLqVgNRE09gQ/AnOEyKUWrrqfD+xSQ3u42gJjLDdMDQg==", + "dependencies": { + "@stablelib/bytes": "^1.0.1" + } + }, + "node_modules/@stablelib/nacl": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@stablelib/nacl/-/nacl-1.0.4.tgz", + "integrity": "sha512-PJ2U/MrkXSKUM8C4qFs87WeCNxri7KQwR8Cdwm9q2sweGuAtTvOJGuW0F3N+zn+ySLPJA98SYWSSpogMJ1gCmw==", + "dependencies": { + "@stablelib/poly1305": "^1.0.1", + "@stablelib/random": "^1.0.2", + "@stablelib/wipe": "^1.0.1", + "@stablelib/x25519": "^1.0.3", + "@stablelib/xsalsa20": "^1.0.2" + } + }, + "node_modules/@stablelib/pbkdf2": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/pbkdf2/-/pbkdf2-1.0.1.tgz", + "integrity": "sha512-d5jwK6jW1DkMyzqY8D1Io+fRXcsUVr95lk5LKX9ghaUdAITTc1ZL0bff+R0IrwSixbHluxhnivG7vDw59AZ/Nw==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/hash": "^1.0.1", + "@stablelib/hmac": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/poly1305": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/poly1305/-/poly1305-1.0.1.tgz", + "integrity": "sha512-1HlG3oTSuQDOhSnLwJRKeTRSAdFNVB/1djy2ZbS35rBSJ/PFqx9cf9qatinWghC2UbfOYD8AcrtbUQl8WoxabA==", + "dependencies": { + "@stablelib/constant-time": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/random": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@stablelib/random/-/random-1.0.2.tgz", + "integrity": "sha512-rIsE83Xpb7clHPVRlBj8qNe5L8ISQOzjghYQm/dZ7VaM2KHYwMW5adjQjrzTZCchFnNCNhkwtnOBa9HTMJCI8w==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/salsa20": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@stablelib/salsa20/-/salsa20-1.0.2.tgz", + "integrity": "sha512-nfjKzw0KTKrrKBasEP+j7UP4I8Xudom8lVZIBCp0kQNARXq72IlSic0oabg2FC1NU68L4RdHrNJDd8bFwrphYA==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/constant-time": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/sha512": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/sha512/-/sha512-1.0.1.tgz", + "integrity": "sha512-13gl/iawHV9zvDKciLo1fQ8Bgn2Pvf7OV6amaRVKiq3pjQ3UmEpXxWiAfV8tYjUpeZroBxtyrwtdooQT/i3hzw==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/hash": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/wipe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/wipe/-/wipe-1.0.1.tgz", + "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==" + }, + "node_modules/@stablelib/x25519": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@stablelib/x25519/-/x25519-1.0.3.tgz", + "integrity": "sha512-KnTbKmUhPhHavzobclVJQG5kuivH+qDLpe84iRqX3CLrKp881cF160JvXJ+hjn1aMyCwYOKeIZefIH/P5cJoRw==", + "dependencies": { + "@stablelib/keyagreement": "^1.0.1", + "@stablelib/random": "^1.0.2", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/xsalsa20": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@stablelib/xsalsa20/-/xsalsa20-1.0.2.tgz", + "integrity": "sha512-7XdBGbcNgBShmuhDXv1G1WPVCkjZdkb1oPMzSidO7Fve0MHntH6TjFkj5bfLI+aRE+61weO076vYpP/jmaAYog==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/salsa20": "^1.0.2", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@taquito/core": { + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@taquito/core/-/core-17.2.0.tgz", + "integrity": "sha512-Sijn6uhSJUPgk9TzlxOAiJpfF7HogjNepmjGia3Eq9LidJMg6gqL+VRYYtCIAzNQl7Ge8dkqUx9yIibQFHPR7w==", + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/http-utils": { + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@taquito/http-utils/-/http-utils-17.2.0.tgz", + "integrity": "sha512-7Euinzp652JyAjxkFtyYD+ZxKrCHA87pafrf+Mwb868KXcv4po72jg2GTtaimmIAEkDh03Bp+EpQVX4vpQeo/A==", + "dependencies": { + "@taquito/core": "^17.2.0", + "axios": "0.26.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/local-forging": { + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@taquito/local-forging/-/local-forging-17.2.0.tgz", + "integrity": "sha512-f1ppmY7ItBbfBmT5TGOH5Sxp8sSUZ+LSHjZcRv3s36RGytHKK/IIbfY+z4+43ZIAVQpwxbXgZkqjPPsNacQPzA==", + "dependencies": { + "@taquito/core": "^17.2.0", + "@taquito/utils": "^17.2.0", + "bignumber.js": "^9.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/michel-codec": { + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@taquito/michel-codec/-/michel-codec-17.2.0.tgz", + "integrity": "sha512-PIQK9wrPKcsgoD/zQzb779jAhhHRs0ikBViqIQmTurT0uv3az2lRZRPdWrHovY835Iq9bhCZmL7s+ptPn1JjXg==", + "dependencies": { + "@taquito/core": "^17.2.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/michelson-encoder": { + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@taquito/michelson-encoder/-/michelson-encoder-17.2.0.tgz", + "integrity": "sha512-bJi9FLQ+RrERzSscwGVdti2lm7ktHQU9/nyljmP8LBCOkU7xvY3SJi+FKQHxcRGS52si6Wvi+oyMo6JcV6kYDg==", + "dependencies": { + "@taquito/rpc": "^17.2.0", + "@taquito/utils": "^17.2.0", + "bignumber.js": "^9.1.0", + "fast-json-stable-stringify": "^2.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/rpc": { + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@taquito/rpc/-/rpc-17.2.0.tgz", + "integrity": "sha512-Fufl4m0ajNAvLlQ+tj4oDeC5TYk4LyLdsVYR0FQ9HdNWTI1Nu+/XTEwnq7AHx7w1zRAFRkAV/YaYn5HSogatjw==", + "dependencies": { + "@taquito/core": "^17.2.0", + "@taquito/http-utils": "^17.2.0", + "@taquito/utils": "^17.2.0", + "bignumber.js": "^9.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/signer": { + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@taquito/signer/-/signer-17.2.0.tgz", + "integrity": "sha512-pVxjBCiK8Bazf4L7OvZVlUaghFfJWZ9yZKa/qyoiMgYDdYjy91rCNja8Tl/vwXLO3nOFa/VjBdPPHuKa3enAAQ==", + "dependencies": { + "@stablelib/blake2b": "^1.0.1", + "@stablelib/ed25519": "^1.0.3", + "@stablelib/hmac": "^1.0.1", + "@stablelib/nacl": "^1.0.4", + "@stablelib/pbkdf2": "^1.0.1", + "@stablelib/sha512": "^1.0.1", + "@taquito/taquito": "^17.2.0", + "@taquito/utils": "^17.2.0", + "@types/bn.js": "^5.1.1", + "bip39": "3.0.4", + "elliptic": "^6.5.4", + "pbkdf2": "^3.1.2", + "typedarray-to-buffer": "^4.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/taquito": { + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@taquito/taquito/-/taquito-17.2.0.tgz", + "integrity": "sha512-8eZwLH+2reeYF+rDfzXOrXIr/g+GUZpLqkzEfZaxfejj8jVfj5S/fVjvIqBkfu/6Z3nynxgDcEzicgx85Dqovg==", + "hasInstallScript": true, + "dependencies": { + "@taquito/core": "^17.2.0", + "@taquito/http-utils": "^17.2.0", + "@taquito/local-forging": "^17.2.0", + "@taquito/michel-codec": "^17.2.0", + "@taquito/michelson-encoder": "^17.2.0", + "@taquito/rpc": "^17.2.0", + "@taquito/utils": "^17.2.0", + "bignumber.js": "^9.1.0", + "rxjs": "^7.8.1" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/utils": { + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@taquito/utils/-/utils-17.2.0.tgz", + "integrity": "sha512-m+sl+glhPSKUtxuR+JDOrwEN/+ou/dpZxrLQiBQE2PG3GE1zRdfgBP7K49B+MNIgffdwXsDBfZSinx3AcayfeQ==", + "dependencies": { + "@stablelib/blake2b": "^1.0.1", + "@stablelib/ed25519": "^1.0.3", + "@taquito/core": "^17.2.0", + "@types/bs58check": "^2.1.0", + "bignumber.js": "^9.1.0", + "blakejs": "^1.2.1", + "bs58check": "^2.1.2", + "buffer": "^6.0.3", + "elliptic": "^6.5.4", + "typedarray-to-buffer": "^4.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==" + }, + "node_modules/@types/bn.js": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz", + "integrity": "sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/bs58check": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/bs58check/-/bs58check-2.1.0.tgz", + "integrity": "sha512-OxsysnJQh82vy9DRbOcw9m2j/WiyqZLn0YBhKxdQ+aCwoHj+tWzyCgpwAkr79IfDXZKxc6h7k89T9pwS78CqTQ==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.5.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.1.tgz", + "integrity": "sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==" + }, + "node_modules/@types/semver": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.1.tgz", + "integrity": "sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.4.1", + "@typescript-eslint/type-utils": "6.4.1", + "@typescript-eslint/utils": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.1.tgz", + "integrity": "sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.4.1", + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/typescript-estree": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz", + "integrity": "sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.1.tgz", + "integrity": "sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.4.1", + "@typescript-eslint/utils": "6.4.1", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.1.tgz", + "integrity": "sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.1.tgz", + "integrity": "sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.1.tgz", + "integrity": "sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.4.1", + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/typescript-estree": "6.4.1", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.1.tgz", + "integrity": "sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.4.1", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/axios": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.0.tgz", + "integrity": "sha512-lKoGLMYtHvFrPVt3r+RBMp9nh34N0M8zEfCWqdWZx6phynIEhQqAdydpyBAAG211zlhX9Rgu08cOamy6XjE5Og==", + "dependencies": { + "follow-redirects": "^1.14.8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/base-x": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", + "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/big-integer": { + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/bignumber.js": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.1.tgz", + "integrity": "sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig==", + "engines": { + "node": "*" + } + }, + "node_modules/bip39": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.4.tgz", + "integrity": "sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw==", + "dependencies": { + "@types/node": "11.11.6", + "create-hash": "^1.1.0", + "pbkdf2": "^3.0.9", + "randombytes": "^2.0.1" + } + }, + "node_modules/bip39/node_modules/@types/node": { + "version": "11.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", + "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" + }, + "node_modules/blakejs": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + }, + "node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/bplist-parser": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", + "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", + "dev": true, + "dependencies": { + "big-integer": "^1.6.44" + }, + "engines": { + "node": ">= 5.10.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + }, + "node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dependencies": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/bundle-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-3.0.0.tgz", + "integrity": "sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==", + "dev": true, + "dependencies": { + "run-applescript": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/default-browser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-4.0.0.tgz", + "integrity": "sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==", + "dev": true, + "dependencies": { + "bundle-name": "^3.0.0", + "default-browser-id": "^3.0.0", + "execa": "^7.1.1", + "titleize": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-3.0.0.tgz", + "integrity": "sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==", + "dev": true, + "dependencies": { + "bplist-parser": "^0.2.0", + "untildify": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "^8.47.0", + "@humanwhocodes/config-array": "^0.11.10", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-prettier": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.0.tgz", + "integrity": "sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.5" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", + "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^4.3.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "dev": true + }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/human-signals": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", + "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", + "dev": true, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-wsl/node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/open": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-9.1.0.tgz", + "integrity": "sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==", + "dev": true, + "dependencies": { + "default-browser": "^4.0.0", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.2.tgz", + "integrity": "sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==", + "dev": true, + "peer": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/run-applescript": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz", + "integrity": "sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==", + "dev": true, + "dependencies": { + "execa": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-applescript/node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/run-applescript/node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/run-applescript/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-applescript/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/run-applescript/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/run-applescript/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-applescript/node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/synckit": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", + "integrity": "sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==", + "dev": true, + "dependencies": { + "@pkgr/utils": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/titleize": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz", + "integrity": "sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz", + "integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==", + "dev": true, + "engines": { + "node": ">=16.13.0" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-4.0.0.tgz", + "integrity": "sha512-6dOYeZfS3O9RtRD1caom0sMxgK59b27+IwoNy8RDPsmslSGOyU+mpTamlaIW7aNKi90ZQZ9DFaZL3YRoiSCULQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/typescript": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/vesting/cameligo/scripts/package.json b/vesting/cameligo/scripts/package.json new file mode 100644 index 00000000..33213578 --- /dev/null +++ b/vesting/cameligo/scripts/package.json @@ -0,0 +1,26 @@ +{ + "name": "vesting-scripts", + "version": "1.0.0", + "description": "A modular vesting contract on Tezos written in Ligolang", + "scripts": { + "lint": "eslint . --ext .ts" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "@taquito/signer": "^17.2.0", + "@taquito/taquito": "^17.2.0", + "@taquito/utils": "^17.2.0", + "dotenv": "^16.3.1", + "ts-node": "^10.9.1", + "typescript": "^5.1.6" + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^6.4.1", + "@typescript-eslint/parser": "^6.4.1", + "eslint": "^8.47.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-prettier": "^5.0.0" + } +} diff --git a/vesting/cameligo/scripts/run-sandbox b/vesting/cameligo/scripts/run-sandbox new file mode 100755 index 00000000..0987ccf1 --- /dev/null +++ b/vesting/cameligo/scripts/run-sandbox @@ -0,0 +1,11 @@ +#!/bin/sh + +# run a local tezos sandbox +# https://tezos.gitlab.io/flextesa/ + +image=oxheadalpha/flextesa:20230607 +script=mumbaibox +docker run --rm --name sandbox --detach -p 20000:20000 \ + -e block_time=3 \ + -e flextesa_node_cors_origin='*' \ + "$image" "$script" start diff --git a/vesting/cameligo/scripts/tsconfig.json b/vesting/cameligo/scripts/tsconfig.json new file mode 100644 index 00000000..db120326 --- /dev/null +++ b/vesting/cameligo/scripts/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "target": "es6", + "moduleResolution": "node", + "sourceMap": true, + "outDir": "dist", + "types": [ + "mocha", + "node" + ], + "typeRoots": [ + "@types", + "node_modules/@types" + ] + }, + "lib": [ + "es2015" + ] +} diff --git a/vesting-cameligo/src/errors.mligo b/vesting/cameligo/src/errors.mligo similarity index 100% rename from vesting-cameligo/src/errors.mligo rename to vesting/cameligo/src/errors.mligo diff --git a/vesting-cameligo/src/main.mligo b/vesting/cameligo/src/main.mligo similarity index 100% rename from vesting-cameligo/src/main.mligo rename to vesting/cameligo/src/main.mligo diff --git a/vesting-cameligo/src/parameter.mligo b/vesting/cameligo/src/parameter.mligo similarity index 100% rename from vesting-cameligo/src/parameter.mligo rename to vesting/cameligo/src/parameter.mligo diff --git a/vesting-cameligo/src/storage.mligo b/vesting/cameligo/src/storage.mligo similarity index 100% rename from vesting-cameligo/src/storage.mligo rename to vesting/cameligo/src/storage.mligo diff --git a/vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo b/vesting/cameligo/test/ligo/bootstrap/bootstrap.mligo similarity index 100% rename from vesting-cameligo/test/ligo/bootstrap/bootstrap.mligo rename to vesting/cameligo/test/ligo/bootstrap/bootstrap.mligo diff --git a/vesting-cameligo/test/ligo/helpers/assert.mligo b/vesting/cameligo/test/ligo/helpers/assert.mligo similarity index 100% rename from vesting-cameligo/test/ligo/helpers/assert.mligo rename to vesting/cameligo/test/ligo/helpers/assert.mligo diff --git a/vesting-cameligo/test/ligo/helpers/fa1.mligo b/vesting/cameligo/test/ligo/helpers/fa1.mligo similarity index 100% rename from vesting-cameligo/test/ligo/helpers/fa1.mligo rename to vesting/cameligo/test/ligo/helpers/fa1.mligo diff --git a/vesting-cameligo/test/ligo/helpers/fa2.mligo b/vesting/cameligo/test/ligo/helpers/fa2.mligo similarity index 100% rename from vesting-cameligo/test/ligo/helpers/fa2.mligo rename to vesting/cameligo/test/ligo/helpers/fa2.mligo diff --git a/vesting-cameligo/test/ligo/helpers/log.mligo b/vesting/cameligo/test/ligo/helpers/log.mligo similarity index 100% rename from vesting-cameligo/test/ligo/helpers/log.mligo rename to vesting/cameligo/test/ligo/helpers/log.mligo diff --git a/vesting-cameligo/test/ligo/helpers/vesting.mligo b/vesting/cameligo/test/ligo/helpers/vesting.mligo similarity index 100% rename from vesting-cameligo/test/ligo/helpers/vesting.mligo rename to vesting/cameligo/test/ligo/helpers/vesting.mligo diff --git a/vesting-cameligo/test/ligo/token/extended_fa2.mligo b/vesting/cameligo/test/ligo/token/extended_fa2.mligo similarity index 100% rename from vesting-cameligo/test/ligo/token/extended_fa2.mligo rename to vesting/cameligo/test/ligo/token/extended_fa2.mligo diff --git a/vesting-cameligo/test/ligo/token/fa1.mligo b/vesting/cameligo/test/ligo/token/fa1.mligo similarity index 100% rename from vesting-cameligo/test/ligo/token/fa1.mligo rename to vesting/cameligo/test/ligo/token/fa1.mligo diff --git a/vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo b/vesting/cameligo/test/ligo/vesting.release.fa1.test.mligo similarity index 100% rename from vesting-cameligo/test/ligo/vesting.release.fa1.test.mligo rename to vesting/cameligo/test/ligo/vesting.release.fa1.test.mligo diff --git a/vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo b/vesting/cameligo/test/ligo/vesting.release.fa2.test.mligo similarity index 100% rename from vesting-cameligo/test/ligo/vesting.release.fa2.test.mligo rename to vesting/cameligo/test/ligo/vesting.release.fa2.test.mligo diff --git a/vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo b/vesting/cameligo/test/ligo/vesting.revoke.fa1.test.mligo similarity index 100% rename from vesting-cameligo/test/ligo/vesting.revoke.fa1.test.mligo rename to vesting/cameligo/test/ligo/vesting.revoke.fa1.test.mligo diff --git a/vesting-cameligo/test/ligo/vesting.revoke.fa2.test.mligo b/vesting/cameligo/test/ligo/vesting.revoke.fa2.test.mligo similarity index 100% rename from vesting-cameligo/test/ligo/vesting.revoke.fa2.test.mligo rename to vesting/cameligo/test/ligo/vesting.revoke.fa2.test.mligo diff --git a/vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo b/vesting/cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo similarity index 100% rename from vesting-cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo rename to vesting/cameligo/test/ligo/vesting.revokeaddress.fa1.test.mligo diff --git a/vesting-cameligo/test/ligo/vesting.revokeaddress.fa2.test.mligo b/vesting/cameligo/test/ligo/vesting.revokeaddress.fa2.test.mligo similarity index 100% rename from vesting-cameligo/test/ligo/vesting.revokeaddress.fa2.test.mligo rename to vesting/cameligo/test/ligo/vesting.revokeaddress.fa2.test.mligo diff --git a/vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo b/vesting/cameligo/test/ligo/vesting.start.fa1.test.mligo similarity index 100% rename from vesting-cameligo/test/ligo/vesting.start.fa1.test.mligo rename to vesting/cameligo/test/ligo/vesting.start.fa1.test.mligo diff --git a/vesting-cameligo/test/ligo/vesting.start.fa2.test.mligo b/vesting/cameligo/test/ligo/vesting.start.fa2.test.mligo similarity index 100% rename from vesting-cameligo/test/ligo/vesting.start.fa2.test.mligo rename to vesting/cameligo/test/ligo/vesting.start.fa2.test.mligo From dc3d2049bd0621ca83dc3393ad4c10efa03d78e0 Mon Sep 17 00:00:00 2001 From: Charaf ZELLOU Date: Tue, 22 Aug 2023 11:37:24 +0200 Subject: [PATCH 10/11] Update Makefile --- vesting/cameligo/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vesting/cameligo/Makefile b/vesting/cameligo/Makefile index 386716a5..20187e1f 100644 --- a/vesting/cameligo/Makefile +++ b/vesting/cameligo/Makefile @@ -86,7 +86,7 @@ install: ##@Scripts - Install NPM dependencies deploy: ##@Scripts - Deploy contracts @if [ ! -f ./scripts/metadata.json ]; then cp scripts/metadata.json.dist \ scripts/metadata.json ; fi - @npx ts-node ./scripts/deploy.ts --resolveJsonModule + @npx ts-node ./scripts/deploy.ts ####################################### # SANDBOX # From 3bcfaccd3c4318ff9f74a5a0af42af3ff1cd6b7b Mon Sep 17 00:00:00 2001 From: Charaf ZELLOU Date: Tue, 22 Aug 2023 11:38:52 +0200 Subject: [PATCH 11/11] Updated NPM Packages --- vesting/cameligo/scripts/package-lock.json | 6 +++--- vesting/cameligo/scripts/package.json | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vesting/cameligo/scripts/package-lock.json b/vesting/cameligo/scripts/package-lock.json index 005d36b1..ece897d5 100644 --- a/vesting/cameligo/scripts/package-lock.json +++ b/vesting/cameligo/scripts/package-lock.json @@ -540,9 +540,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.5.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.1.tgz", - "integrity": "sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==" + "version": "20.5.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.2.tgz", + "integrity": "sha512-5j/lXt7unfPOUlrKC34HIaedONleyLtwkKggiD/0uuMfT8gg2EOpg0dz4lCD15Ga7muC+1WzJZAjIB9simWd6Q==" }, "node_modules/@types/semver": { "version": "7.5.0", diff --git a/vesting/cameligo/scripts/package.json b/vesting/cameligo/scripts/package.json index 33213578..e660d5fc 100644 --- a/vesting/cameligo/scripts/package.json +++ b/vesting/cameligo/scripts/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "description": "A modular vesting contract on Tezos written in Ligolang", "scripts": { + "deploy": "ts-node ./deploy.ts", "lint": "eslint . --ext .ts" }, "keywords": [],