From 216fbaec9bc63b53888653e4b94035889ef51429 Mon Sep 17 00:00:00 2001 From: kstasi Date: Mon, 6 Sep 2021 15:46:27 +0300 Subject: [PATCH 01/22] use plextesa --- .github/workflows/master.yml | 2 +- README.md | 2 +- package.json | 3 +- yarn.lock | 8589 ---------------------------------- 4 files changed, 3 insertions(+), 8593 deletions(-) delete mode 100644 yarn.lock diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index dfb2168b..beea59e8 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -22,7 +22,7 @@ jobs: run: sudo apt install git -y - name: Install modules run: yarn - - name: Run the ganache-cli in background + - name: Run the sandbox in background run: ./ci/flextesa.sh - name: Remove existing .env run: rm .env diff --git a/README.md b/README.md index 8d0957de..9b3c21d7 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ The solution consists of 6 types of contracts: - Installed NodeJS (tested with NodeJS v12+) -- Installed Yarn (NPM isn't working properly with `ganache-cli@6.11.0-tezos.0`) +- Installed Yarn - Installed Ligo: diff --git a/package.json b/package.json index 19d25321..203e4145 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "migrate-granadanet-reset": "yarn clean && truffle migrate --network granadanet --reset", "compile-dex": "node scripts/cli.js build-dex --no-json -o contracts", "compile": "yarn clean && yarn compile-dex && truffle compile", - "start-sandbox": "ganache-cli --flavor tezos --seed alice --hardfork edo", + "start-sandbox": "docker run --rm --name my-sandbox -e flextesa_node_cors_origin='*' -e block_time=1 --detach -p 8732:20000 tqtezos/flextesa:20210602 granabox start", "test": "yarn clean && yarn compile && truffle test ", "test:quick": "truffle test", "postinstall": "patch-package" @@ -20,7 +20,6 @@ "bignumber.js": "^9.0.0", "commander": "^5.1.0", "dotenv": "^8.2.0", - "ganache-cli": "6.12.1-tezos.0", "patch-package": "^6.2.2", "truffle": "5.5.0-tezos.4", "typescript": "^4.0.3" diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index 362f37bf..00000000 --- a/yarn.lock +++ /dev/null @@ -1,8589 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/code-frame@^7.0.0": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" - integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== - dependencies: - "@babel/highlight" "^7.10.4" - -"@babel/helper-validator-identifier@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" - integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== - -"@babel/highlight@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" - integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== - dependencies: - "@babel/helper-validator-identifier" "^7.10.4" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@ethersproject/abi@5.0.0-beta.153": - version "5.0.0-beta.153" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.0-beta.153.tgz#43a37172b33794e4562999f6e2d555b7599a8eee" - integrity sha512-aXweZ1Z7vMNzJdLpR1CZUAIgnwjrZeUSvN9syCwlBaEBUFJmFY+HHnfuTI5vIhVs/mRkfJVrbEyl51JZQqyjAg== - dependencies: - "@ethersproject/address" ">=5.0.0-beta.128" - "@ethersproject/bignumber" ">=5.0.0-beta.130" - "@ethersproject/bytes" ">=5.0.0-beta.129" - "@ethersproject/constants" ">=5.0.0-beta.128" - "@ethersproject/hash" ">=5.0.0-beta.128" - "@ethersproject/keccak256" ">=5.0.0-beta.127" - "@ethersproject/logger" ">=5.0.0-beta.129" - "@ethersproject/properties" ">=5.0.0-beta.131" - "@ethersproject/strings" ">=5.0.0-beta.130" - -"@ethersproject/abstract-provider@^5.0.4": - version "5.0.7" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.0.7.tgz#04ee3bfe43323384e7fecf6c774975b8dec4bdc9" - integrity sha512-NF16JGn6M0zZP5ZS8KtDL2Rh7yHxZbUjBIHLNHMm/0X0BephhjUWy8jqs/Zks6kDJRzNthgmPVy41Ec0RYWPYA== - dependencies: - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/networks" "^5.0.3" - "@ethersproject/properties" "^5.0.3" - "@ethersproject/transactions" "^5.0.5" - "@ethersproject/web" "^5.0.6" - -"@ethersproject/abstract-signer@^5.0.6": - version "5.0.9" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.0.9.tgz#238ddc06031aeb9dfceee2add965292d7dd1acbf" - integrity sha512-CM5UNmXQaA03MyYARFDDRjHWBxujO41tVle7glf5kHcQsDDULgqSVpkliLJMtPzZjOKFeCVZBHybTZDEZg5zzg== - dependencies: - "@ethersproject/abstract-provider" "^5.0.4" - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/properties" "^5.0.3" - -"@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.0.5": - version "5.0.8" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.0.8.tgz#0c551659144a5a7643c6bea337149d410825298f" - integrity sha512-V87DHiZMZR6hmFYmoGaHex0D53UEbZpW75uj8AqPbjYUmi65RB4N2LPRcJXuWuN2R0Y2CxkvW6ArijWychr5FA== - dependencies: - "@ethersproject/bignumber" "^5.0.10" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/keccak256" "^5.0.3" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/rlp" "^5.0.3" - -"@ethersproject/base64@^5.0.3": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.0.6.tgz#26311ebf29ea3d0b9c300ccf3e1fdc44b7481516" - integrity sha512-HwrGn8YMiUf7bcdVvB4NJ+eWT0BtEFpDtrYxVXEbR7p/XBSJjwiR7DEggIiRvxbualMKg+EZijQWJ3az2li0uw== - dependencies: - "@ethersproject/bytes" "^5.0.4" - -"@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.0.10", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.0.8": - version "5.0.12" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.0.12.tgz#fe4a78667d7cb01790f75131147e82d6ea7e7cba" - integrity sha512-mbFZjwthx6vFlHG9owXP/C5QkNvsA+xHpDCkPPPdG2n1dS9AmZAL5DI0InNLid60rQWL3MXpEl19tFmtL7Q9jw== - dependencies: - "@ethersproject/bytes" "^5.0.8" - "@ethersproject/logger" "^5.0.5" - bn.js "^4.4.0" - -"@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.0.8": - version "5.0.8" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.0.8.tgz#cf1246a6a386086e590063a4602b1ffb6cc43db1" - integrity sha512-O+sJNVGzzuy51g+EMK8BegomqNIg+C2RO6vOt0XP6ac4o4saiq69FnjlsrNslaiMFVO7qcEHBsWJ9hx1tj1lMw== - dependencies: - "@ethersproject/logger" "^5.0.5" - -"@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.0.4": - version "5.0.7" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.0.7.tgz#44ff979e5781b17c8c6901266896c3ee745f4e7e" - integrity sha512-cbQK1UpE4hamB52Eg6DLhJoXeQ1plSzekh5Ujir1xdREdwdsZPPXKczkrWqBBR0KyywJZHN/o/hj0w8j7scSGg== - dependencies: - "@ethersproject/bignumber" "^5.0.7" - -"@ethersproject/hash@>=5.0.0-beta.128": - version "5.0.9" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.0.9.tgz#81252a848185b584aa600db4a1a68cad9229a4d4" - integrity sha512-e8/i2ZDeGSgCxXT0vocL54+pMbw5oX5fNjb2E3bAIvdkh5kH29M7zz1jHu1QDZnptIuvCZepIbhUH8lxKE2/SQ== - dependencies: - "@ethersproject/abstract-signer" "^5.0.6" - "@ethersproject/address" "^5.0.5" - "@ethersproject/bignumber" "^5.0.8" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/keccak256" "^5.0.3" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/properties" "^5.0.4" - "@ethersproject/strings" "^5.0.4" - -"@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.0.3": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.0.6.tgz#5b5ba715ef1be86efde5c271f896fa0daf0e1efe" - integrity sha512-eJ4Id/i2rwrf5JXEA7a12bG1phuxjj47mPZgDUbttuNBodhSuZF2nEO5QdpaRjmlphQ8Kt9PNqY/z7lhtJptZg== - dependencies: - "@ethersproject/bytes" "^5.0.4" - js-sha3 "0.5.7" - -"@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.0.5": - version "5.0.8" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.0.8.tgz#135c1903d35c878265f3cbf2b287042c4c20d5d4" - integrity sha512-SkJCTaVTnaZ3/ieLF5pVftxGEFX56pTH+f2Slrpv7cU0TNpUZNib84QQdukd++sWUp/S7j5t5NW+WegbXd4U/A== - -"@ethersproject/networks@^5.0.3": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.0.6.tgz#4d6586bbebfde1c027504ebf6dfb783b29c3803a" - integrity sha512-2Cg1N5109zzFOBfkyuPj+FfF7ioqAsRffmybJ2lrsiB5skphIAE72XNSCs4fqktlf+rwSh/5o/UXRjXxvSktZw== - dependencies: - "@ethersproject/logger" "^5.0.5" - -"@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.0.4": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.0.6.tgz#44d82aaa294816fd63333e7def42426cf0e87b3b" - integrity sha512-a9DUMizYhJ0TbtuDkO9iYlb2CDlpSKqGPDr+amvlZhRspQ6jbl5Eq8jfu4SCcGlcfaTbguJmqGnyOGn1EFt6xA== - dependencies: - "@ethersproject/logger" "^5.0.5" - -"@ethersproject/rlp@^5.0.3": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.0.6.tgz#29f9097348a3c330811997433b7df89ab51cd644" - integrity sha512-M223MTaydfmQSsvqAl0FJZDYFlSqt6cgbhnssLDwqCKYegAHE16vrFyo+eiOapYlt32XAIJm0BXlqSunULzZuQ== - dependencies: - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/logger" "^5.0.5" - -"@ethersproject/signing-key@^5.0.4": - version "5.0.7" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.0.7.tgz#d03bfc5f565efb962bafebf8e6965e70d1c46d31" - integrity sha512-JYndnhFPKH0daPcIjyhi+GMcw3srIHkQ40hGRe6DA0CdGrpMfgyfSYDQ2D8HL2lgR+Xm4SHfEB0qba6+sCyrvg== - dependencies: - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/properties" "^5.0.3" - elliptic "6.5.3" - -"@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.0.4": - version "5.0.7" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.0.7.tgz#8dc68f794c9e2901f3b75e53b2afbcb6b6c15037" - integrity sha512-a+6T80LvmXGMOOWQTZHtGGQEg1z4v8rm8oX70KNs55YtPXI/5J3LBbVf5pyqCKSlmiBw5IaepPvs5XGalRUSZQ== - dependencies: - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/constants" "^5.0.4" - "@ethersproject/logger" "^5.0.5" - -"@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.0.5": - version "5.0.8" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.0.8.tgz#3b4d7041e13b957a9c4f131e0aea9dae7b6f5a23" - integrity sha512-i7NtOXVzUe+YSU6QufzlRrI2WzHaTmULAKHJv4duIZMLqzehCBXGA9lTpFgFdqGYcQJ7vOtNFC2BB2mSjmuXqg== - dependencies: - "@ethersproject/address" "^5.0.4" - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/constants" "^5.0.4" - "@ethersproject/keccak256" "^5.0.3" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/properties" "^5.0.3" - "@ethersproject/rlp" "^5.0.3" - "@ethersproject/signing-key" "^5.0.4" - -"@ethersproject/web@^5.0.6": - version "5.0.11" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.0.11.tgz#d47da612b958b4439e415782a53c8f8461522d68" - integrity sha512-x03ihbPoN1S8Gsh9WSwxkYxUIumLi02ZEKJku1C43sxBfe+mdprWyvujzYlpuoRNfWRgNhdRDKMP8JbG6MwNGA== - dependencies: - "@ethersproject/base64" "^5.0.3" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/properties" "^5.0.3" - "@ethersproject/strings" "^5.0.4" - -"@jest/types@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" - integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^15.0.0" - chalk "^4.0.0" - -"@sindresorhus/is@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" - integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== - -"@szmarczak/http-timer@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" - integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== - dependencies: - defer-to-connect "^1.0.1" - -"@taquito/http-utils@^8.0.4-beta-RC.0": - version "8.0.4-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/http-utils/-/http-utils-8.0.4-beta-RC.0.tgz#c1fb1a3d239066e00cd97c989b84f3078739eb9d" - integrity sha512-EhaHIt7vWVPkjt77KiQWiFYce1JTiO2ajyXTN6UEd8K0RStPmVD58Ok7s40PYzuXg9jVwf006lvDxhYRIM43Nw== - dependencies: - xhr2-cookies "^1.1.0" - -"@taquito/michel-codec@^8.0.4-beta-RC.0": - version "8.0.4-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/michel-codec/-/michel-codec-8.0.4-beta-RC.0.tgz#551e8fbb1b74025ae4ec8aeb45b83b3e59274f3b" - integrity sha512-HNU4QuOhvnN3w7njvpvfyn4np2XD7KBvnWXkSq3YWwB6+U/JC33JhakLrlkPoXNNDY1pkCUMLtMtuAGG7siIjg== - -"@taquito/michelson-encoder@^8.0.4-beta-RC.0": - version "8.0.4-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/michelson-encoder/-/michelson-encoder-8.0.4-beta-RC.0.tgz#f0bad6f6e9fd5fbdc135daae7510fb2cad256a16" - integrity sha512-dEF0ACM0SLuf0xOYnQjTPyAu1+dFxnPVCX3hpUWW61uvN0H7okbHlpoUa8f6y1vKCdSd06fwGaydiPt0fQeP2w== - dependencies: - "@taquito/rpc" "^8.0.4-beta-RC.0" - "@taquito/utils" "^8.0.4-beta-RC.0" - bignumber.js "^9.0.1" - fast-json-stable-stringify "^2.1.0" - -"@taquito/rpc@^8.0.4-beta-RC.0": - version "8.0.4-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/rpc/-/rpc-8.0.4-beta-RC.0.tgz#3934ae0e838214b2e2ad4d3d5c1877c244e21d08" - integrity sha512-+/4S8CUvCIodJQCIkKb0mr6OmS4/5yD/hGVXUEoYXTwvvatiwRa41zfhPREtCGK79XIcw5aBbZaGiLfUEN1K9A== - dependencies: - "@taquito/http-utils" "^8.0.4-beta-RC.0" - bignumber.js "^9.0.1" - lodash "^4.17.20" - -"@taquito/signer@^8.0.4-beta.0": - version "8.0.4-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/signer/-/signer-8.0.4-beta-RC.0.tgz#f74540fbfb07fff1ed2b7a5ddbbe9b4c292909ba" - integrity sha512-5tT6Snud5Iq/J2GEsjziqBlJcMBmi5wOc4gDWzZWomEStjz2vwGtEA9hvRLNDuHsXFymTMVFnu8Zqj8POX6QbA== - dependencies: - "@taquito/taquito" "^8.0.4-beta-RC.0" - "@taquito/utils" "^8.0.4-beta-RC.0" - bignumber.js "^9.0.1" - bip39 "^3.0.2" - elliptic "^6.5.3" - libsodium-wrappers "^0.7.8" - pbkdf2 "^3.1.1" - typedarray-to-buffer "^3.1.5" - -"@taquito/taquito@^8.0.4-beta-RC.0", "@taquito/taquito@^8.0.4-beta.0": - version "8.0.4-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/taquito/-/taquito-8.0.4-beta-RC.0.tgz#682d976b91b4a349b1122b33435077bf0cc1e694" - integrity sha512-cVwV+S47jUPTS+tgOcNMtGR1hOjbxSVXs4eIdsKbn4U4ehInIhRv8Txw578q8T5p3zHmdQjjYQPw01Op//e2yw== - dependencies: - "@taquito/http-utils" "^8.0.4-beta-RC.0" - "@taquito/michel-codec" "^8.0.4-beta-RC.0" - "@taquito/michelson-encoder" "^8.0.4-beta-RC.0" - "@taquito/rpc" "^8.0.4-beta-RC.0" - "@taquito/utils" "^8.0.4-beta-RC.0" - bignumber.js "^9.0.1" - rx-sandbox "^1.0.3" - rxjs "^6.6.3" - -"@taquito/utils@^8.0.4-beta-RC.0": - version "8.0.4-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/utils/-/utils-8.0.4-beta-RC.0.tgz#8d582dcdbfb8895bd035e06375f715984cd3d886" - integrity sha512-ohjjFm22F5B20XgWQGs09Bp7AWLSFznGC7XNdKdCGplLVb+R0IGL/M656HoDQgMAoTNt9azdWWW6TxgG9Mii7Q== - dependencies: - blakejs "^1.1.0" - bs58check "^2.1.2" - buffer "^5.6.0" - -"@types/bignumber.js@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@types/bignumber.js/-/bignumber.js-5.0.0.tgz#d9f1a378509f3010a3255e9cc822ad0eeb4ab969" - integrity sha512-0DH7aPGCClywOFaxxjE6UwpN2kQYe9LwuDQMv+zYA97j5GkOMo8e66LYT+a8JYU7jfmUFRZLa9KycxHDsKXJCA== - dependencies: - bignumber.js "*" - -"@types/bn.js@^4.11.3", "@types/bn.js@^4.11.4", "@types/bn.js@^4.11.5": - version "4.11.6" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" - integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== - dependencies: - "@types/node" "*" - -"@types/chai@^4.2.13": - version "4.2.14" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.14.tgz#44d2dd0b5de6185089375d976b4ec5caf6861193" - integrity sha512-G+ITQPXkwTrslfG5L/BksmbLUA0M1iybEsmCWPqzSxsRRhJZimBKJkoMi8fr/CPygPTj4zO5pJH7I2/cm9M7SQ== - -"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" - integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw== - -"@types/istanbul-lib-report@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" - integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== - dependencies: - "@types/istanbul-lib-coverage" "*" - -"@types/istanbul-reports@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz#508b13aa344fa4976234e75dddcc34925737d821" - integrity sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA== - dependencies: - "@types/istanbul-lib-report" "*" - -"@types/mocha@^8.0.3": - version "8.2.0" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.2.0.tgz#3eb56d13a1de1d347ecb1957c6860c911704bc44" - integrity sha512-/Sge3BymXo4lKc31C8OINJgXLaw+7vL1/L1pGiBNpGrBiT8FQiaFpSYV0uhTaG4y78vcMBTMFsWaHDvuD+xGzQ== - -"@types/node@*": - version "14.14.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.12.tgz#0b1d86f8c40141091285dea02e4940df73bba43f" - integrity sha512-ASH8OPHMNlkdjrEdmoILmzFfsJICvhBsFfAum4aKZ/9U4B6M6tTmTPh+f3ttWdD74CEGV5XvXWkbyfSdXaTd7g== - -"@types/node@11.11.6": - version "11.11.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" - integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== - -"@types/node@^10.12.18", "@types/node@^10.3.2": - version "10.17.48" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.48.tgz#726e7f25d00bf58d79c8f00dd586dd9a10d06a4f" - integrity sha512-Agl6xbYP6FOMDeAsr3QVZ+g7Yzg0uhPHWx0j5g4LFdUBHVtqtU+gH660k/lCEe506jJLOGbEzsnqPDTZGJQLag== - -"@types/node@^12.12.6", "@types/node@^12.6.1": - version "12.19.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.8.tgz#efd6d1a90525519fc608c9db16c8a78f7693a978" - integrity sha512-D4k2kNi0URNBxIRCb1khTnkWNHv8KSL1owPmS/K5e5t8B2GzMReY7AsJIY1BnP5KdlgC4rj9jk2IkDMasIE7xg== - -"@types/pbkdf2@^3.0.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" - integrity sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ== - dependencies: - "@types/node" "*" - -"@types/secp256k1@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.1.tgz#fb3aa61a1848ad97d7425ff9dcba784549fca5a4" - integrity sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog== - dependencies: - "@types/node" "*" - -"@types/stack-utils@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" - integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== - -"@types/yargs-parser@*": - version "15.0.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d" - integrity sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw== - -"@types/yargs@^15.0.0": - version "15.0.11" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.11.tgz#361d7579ecdac1527687bcebf9946621c12ab78c" - integrity sha512-jfcNBxHFYJ4nPIacsi3woz1+kvUO6s1CyeEhtnDHBjHUMNj5UlW2GynmnSgiJJEdNg9yW5C8lfoNRZrHGv5EqA== - dependencies: - "@types/yargs-parser" "*" - -"@web3-js/scrypt-shim@^0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@web3-js/scrypt-shim/-/scrypt-shim-0.1.0.tgz#0bf7529ab6788311d3e07586f7d89107c3bea2cc" - integrity sha512-ZtZeWCc/s0nMcdx/+rZwY1EcuRdemOK9ag21ty9UsHkFxsNb/AaoucUz0iPuyGe0Ku+PFuRmWZG7Z7462p9xPw== - dependencies: - scryptsy "^2.1.0" - semver "^6.3.0" - -"@web3-js/websocket@^1.0.29": - version "1.0.30" - resolved "https://registry.yarnpkg.com/@web3-js/websocket/-/websocket-1.0.30.tgz#9ea15b7b582cf3bf3e8bc1f4d3d54c0731a87f87" - integrity sha512-fDwrD47MiDrzcJdSeTLF75aCcxVVt8B1N74rA+vh2XCAvFy4tEWJjtnUtj2QG7/zlQ6g9cQ88bZFBxwd9/FmtA== - dependencies: - debug "^2.2.0" - es5-ext "^0.10.50" - nan "^2.14.0" - typedarray-to-buffer "^3.1.5" - yaeti "^0.0.6" - -"@yarnpkg/lockfile@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" - integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== - -abstract-leveldown@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-3.0.0.tgz#5cb89f958a44f526779d740d1440e743e0c30a57" - integrity sha512-KUWx9UWGQD12zsmLNj64/pndaz4iJh/Pj7nopgkfDG6RlCcbMZvT6+9l7dchK4idog2Is8VdC/PvNbFuFmalIQ== - dependencies: - xtend "~4.0.0" - -abstract-leveldown@^2.4.1, abstract-leveldown@~2.7.1: - version "2.7.2" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz#87a44d7ebebc341d59665204834c8b7e0932cc93" - integrity sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w== - dependencies: - xtend "~4.0.0" - -abstract-leveldown@^5.0.0, abstract-leveldown@~5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz#f7128e1f86ccabf7d2893077ce5d06d798e386c6" - integrity sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A== - dependencies: - xtend "~4.0.0" - -abstract-leveldown@~2.6.0: - version "2.6.3" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz#1c5e8c6a5ef965ae8c35dfb3a8770c476b82c4b8" - integrity sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA== - dependencies: - xtend "~4.0.0" - -accepts@~1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - -aes-js@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" - integrity sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0= - -aes-js@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" - integrity sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ== - -ajv@^6.12.3: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - 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" - -ansi-colors@3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" - integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== - -ansi-colors@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" - integrity sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA== - dependencies: - ansi-wrap "^0.1.0" - -ansi-gray@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" - integrity sha1-KWLPVOyXksSFEKPetSRDaGHvclE= - dependencies: - ansi-wrap "0.1.0" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - -ansi-styles@^3.2.0, ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -ansi-wrap@0.1.0, ansi-wrap@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" - integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768= - -any-promise@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" - integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -anymatch@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" - integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -app-module-path@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/app-module-path/-/app-module-path-2.2.0.tgz#641aa55dfb7d6a6f0a8141c4b9c0aa50b6c24dd5" - integrity sha1-ZBqlXft9am8KgUHEucCqULbCTdU= - -append-buffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/append-buffer/-/append-buffer-1.0.2.tgz#d8220cf466081525efea50614f3de6514dfa58f1" - integrity sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE= - dependencies: - buffer-equal "^1.0.0" - -archy@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" - integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= - -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-filter@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/arr-filter/-/arr-filter-1.1.2.tgz#43fdddd091e8ef11aa4c45d9cdc18e2dff1711ee" - integrity sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4= - dependencies: - make-iterator "^1.0.0" - -arr-flatten@^1.0.1, arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-map@^2.0.0, arr-map@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/arr-map/-/arr-map-2.0.2.tgz#3a77345ffc1cf35e2a91825601f9e58f2e24cac4" - integrity sha1-Onc0X/wc814qkYJWAfnljy4kysQ= - dependencies: - make-iterator "^1.0.0" - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-each@^1.0.0, array-each@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" - integrity sha1-p5SvDAWrF1KEbudTofIRoFugxE8= - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - -array-initial@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/array-initial/-/array-initial-1.1.0.tgz#2fa74b26739371c3947bd7a7adc73be334b3d795" - integrity sha1-L6dLJnOTccOUe9enrcc74zSz15U= - dependencies: - array-slice "^1.0.0" - is-number "^4.0.0" - -array-last@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/array-last/-/array-last-1.3.0.tgz#7aa77073fec565ddab2493f5f88185f404a9d336" - integrity sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg== - dependencies: - is-number "^4.0.0" - -array-slice@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4" - integrity sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w== - -array-sort@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-sort/-/array-sort-1.0.0.tgz#e4c05356453f56f53512a7d1d6123f2c54c0a88a" - integrity sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg== - dependencies: - default-compare "^1.0.0" - get-value "^2.0.6" - kind-of "^5.0.2" - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -asn1.js@^5.2.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" - integrity sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA== - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - safer-buffer "^2.1.0" - -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - -assertion-error@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" - integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -async-done@^1.2.0, async-done@^1.2.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2" - integrity sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.2" - process-nextick-args "^2.0.0" - stream-exhaust "^1.0.1" - -async-each@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== - -async-eventemitter@^0.2.2: - version "0.2.4" - resolved "https://registry.yarnpkg.com/async-eventemitter/-/async-eventemitter-0.2.4.tgz#f5e7c8ca7d3e46aab9ec40a292baf686a0bafaca" - integrity sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw== - dependencies: - async "^2.4.0" - -async-limiter@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" - integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== - -async-settle@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-settle/-/async-settle-1.0.0.tgz#1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b" - integrity sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs= - dependencies: - async-done "^1.2.2" - -async@2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" - integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== - dependencies: - lodash "^4.17.11" - -async@^1.4.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= - -async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0, async@^2.6.1: - version "2.6.3" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== - dependencies: - lodash "^4.17.14" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" - integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== - -babel-code-frame@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -babel-core@^6.0.14, babel-core@^6.26.0: - version "6.26.3" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.1" - debug "^2.6.9" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.8" - slash "^1.0.0" - source-map "^0.5.7" - -babel-generator@^6.26.0: - version "6.26.1" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" - integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.17.4" - source-map "^0.5.7" - trim-right "^1.0.1" - -babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" - integrity sha1-zORReto1b0IgvK6KAsKzRvmlZmQ= - dependencies: - babel-helper-explode-assignable-expression "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-call-delegate@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" - integrity sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340= - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-define-map@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" - integrity sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-explode-assignable-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" - integrity sha1-8luCz33BBDPFX3BZLVdGQArCLKo= - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" - integrity sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= - dependencies: - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-get-function-arity@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" - integrity sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-hoist-variables@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" - integrity sha1-HssnaJydJVE+rbyZFKc/VAi+enY= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-optimise-call-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" - integrity sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-regex@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" - integrity sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI= - dependencies: - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-remap-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" - integrity sha1-XsWBgnrXI/7N04HxySg5BnbkVRs= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-replace-supers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" - integrity sha1-v22/5Dk40XNpohPKiov3S2qQqxo= - dependencies: - babel-helper-optimise-call-expression "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helpers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" - integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-messages@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-check-es2015-constants@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - integrity sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-syntax-async-functions@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" - integrity sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU= - -babel-plugin-syntax-exponentiation-operator@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" - integrity sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4= - -babel-plugin-syntax-trailing-function-commas@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" - integrity sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM= - -babel-plugin-transform-async-to-generator@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" - integrity sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E= - dependencies: - babel-helper-remap-async-to-generator "^6.24.1" - babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-arrow-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - integrity sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" - integrity sha1-u8UbSflk1wy42OC5ToICRs46YUE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoping@^6.23.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" - integrity sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8= - dependencies: - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-plugin-transform-es2015-classes@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" - integrity sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= - dependencies: - babel-helper-define-map "^6.24.1" - babel-helper-function-name "^6.24.1" - babel-helper-optimise-call-expression "^6.24.1" - babel-helper-replace-supers "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-computed-properties@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" - integrity sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-destructuring@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" - integrity sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-duplicate-keys@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" - integrity sha1-c+s9MQypaePvnskcU3QabxV2Qj4= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-for-of@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" - integrity sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-function-name@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" - integrity sha1-g0yJhTvDaxrw86TF26qU/Y6sqos= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" - integrity sha1-T1SgLWzWbPkVKAAZox0xklN3yi4= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" - integrity sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ= - dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: - version "6.26.2" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" - integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q== - dependencies: - babel-plugin-transform-strict-mode "^6.24.1" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-types "^6.26.0" - -babel-plugin-transform-es2015-modules-systemjs@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" - integrity sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM= - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-umd@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" - integrity sha1-rJl+YoXNGO1hdq22B9YCNErThGg= - dependencies: - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-object-super@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" - integrity sha1-JM72muIcuDp/hgPa0CH1cusnj40= - dependencies: - babel-helper-replace-supers "^6.24.1" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-parameters@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" - integrity sha1-V6w1GrScrxSpfNE7CfZv3wpiXys= - dependencies: - babel-helper-call-delegate "^6.24.1" - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-shorthand-properties@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" - integrity sha1-JPh11nIch2YbvZmkYi5R8U3jiqA= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-spread@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" - integrity sha1-1taKmfia7cRTbIGlQujdnxdG+NE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-sticky-regex@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" - integrity sha1-AMHNsaynERLN8M9hJsLta0V8zbw= - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-template-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - integrity sha1-qEs0UPfp+PH2g51taH2oS7EjbY0= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-typeof-symbol@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" - integrity sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-unicode-regex@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" - integrity sha1-04sS9C6nMj9yk4fxinxa4frrNek= - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - regexpu-core "^2.0.0" - -babel-plugin-transform-exponentiation-operator@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" - integrity sha1-KrDJx/MJj6SJB3cruBP+QejeOg4= - dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" - babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-regenerator@^6.22.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" - integrity sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8= - dependencies: - regenerator-transform "^0.10.0" - -babel-plugin-transform-strict-mode@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" - integrity sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-preset-env@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" - integrity sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg== - dependencies: - babel-plugin-check-es2015-constants "^6.22.0" - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-to-generator "^6.22.0" - babel-plugin-transform-es2015-arrow-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.23.0" - babel-plugin-transform-es2015-classes "^6.23.0" - babel-plugin-transform-es2015-computed-properties "^6.22.0" - babel-plugin-transform-es2015-destructuring "^6.23.0" - babel-plugin-transform-es2015-duplicate-keys "^6.22.0" - babel-plugin-transform-es2015-for-of "^6.23.0" - babel-plugin-transform-es2015-function-name "^6.22.0" - babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.22.0" - babel-plugin-transform-es2015-modules-commonjs "^6.23.0" - babel-plugin-transform-es2015-modules-systemjs "^6.23.0" - babel-plugin-transform-es2015-modules-umd "^6.23.0" - babel-plugin-transform-es2015-object-super "^6.22.0" - babel-plugin-transform-es2015-parameters "^6.23.0" - babel-plugin-transform-es2015-shorthand-properties "^6.22.0" - babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.22.0" - babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.23.0" - babel-plugin-transform-es2015-unicode-regex "^6.22.0" - babel-plugin-transform-exponentiation-operator "^6.22.0" - babel-plugin-transform-regenerator "^6.22.0" - browserslist "^3.2.6" - invariant "^2.2.2" - semver "^5.3.0" - -babel-register@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" - integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= - dependencies: - babel-core "^6.26.0" - babel-runtime "^6.26.0" - core-js "^2.5.0" - home-or-tmp "^2.0.0" - lodash "^4.17.4" - mkdirp "^0.5.1" - source-map-support "^0.4.15" - -babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" - -babel-template@^6.24.1, babel-template@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" - integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= - dependencies: - babel-runtime "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - lodash "^4.17.4" - -babel-traverse@^6.24.1, babel-traverse@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" - integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= - dependencies: - babel-code-frame "^6.26.0" - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - debug "^2.6.8" - globals "^9.18.0" - invariant "^2.2.2" - lodash "^4.17.4" - -babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" - integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= - dependencies: - babel-runtime "^6.26.0" - esutils "^2.0.2" - lodash "^4.17.4" - to-fast-properties "^1.0.3" - -babelify@^7.3.0: - version "7.3.0" - resolved "https://registry.yarnpkg.com/babelify/-/babelify-7.3.0.tgz#aa56aede7067fd7bd549666ee16dc285087e88e5" - integrity sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU= - dependencies: - babel-core "^6.0.14" - object-assign "^4.0.0" - -babylon@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" - integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== - -bach@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880" - integrity sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA= - dependencies: - arr-filter "^1.1.1" - arr-flatten "^1.0.1" - arr-map "^2.0.0" - array-each "^1.0.0" - array-initial "^1.0.0" - array-last "^1.1.1" - async-done "^1.2.2" - async-settle "^1.0.0" - now-and-later "^2.0.0" - -backoff@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/backoff/-/backoff-2.5.0.tgz#f616eda9d3e4b66b8ca7fca79f695722c5f8e26f" - integrity sha1-9hbtqdPktmuMp/ynn2lXIsX44m8= - dependencies: - precond "0.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -base-x@^3.0.2, base-x@^3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.8.tgz#1e1106c2537f0162e8b52474a557ebb09000018d" - integrity sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA== - dependencies: - safe-buffer "^5.0.1" - -base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - -bignumber.js@*, bignumber.js@^9.0.0, bignumber.js@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.1.tgz#8d7ba124c882bfd8e43260c67475518d0689e4e5" - integrity sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA== - -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== - -binary-extensions@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" - integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== - -bindings@^1.2.1, bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - -bip39@2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/bip39/-/bip39-2.5.0.tgz#51cbd5179460504a63ea3c000db3f787ca051235" - integrity sha512-xwIx/8JKoT2+IPJpFEfXoWdYwP7UVAoUxxLNfGCfVowaJE7yg1Y5B1BVPqlUNsBq5/nGwmFkwRJ8xDW4sX8OdA== - dependencies: - create-hash "^1.1.0" - pbkdf2 "^3.0.9" - randombytes "^2.0.1" - safe-buffer "^5.0.1" - unorm "^1.3.3" - -bip39@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.3.tgz#4a8b79067d6ed2e74f9199ac994a2ab61b176760" - integrity sha512-P0dKrz4g0V0BjXfx7d9QNkJ/Txcz/k+hM9TnjqjUaXtuOfAvxXSw2rJw8DX0e3ZPwnK/IgDxoRqf0bvoVCqbMg== - dependencies: - "@types/node" "11.11.6" - create-hash "^1.1.0" - pbkdf2 "^3.0.9" - randombytes "^2.0.1" - -bip66@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" - integrity sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI= - dependencies: - safe-buffer "^5.0.1" - -bl@^1.0.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.3.tgz#1e8dd80142eac80d7158c9dccc047fb620e035e7" - integrity sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww== - dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" - -blakejs@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" - integrity sha1-ad+S75U6qIylGjLfarHFShVfx6U= - -bluebird@^3.5.0: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - -bn.js@4.11.6: - version "4.11.6" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" - integrity sha1-UzRK2xRhehP26N0s4okF0cC6MhU= - -bn.js@4.11.8: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== - -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^4.8.0: - version "4.11.9" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" - integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw== - -bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2: - version "5.1.3" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.3.tgz#beca005408f642ebebea80b042b4d18d2ac0ee6b" - integrity sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ== - -body-parser@1.19.0, body-parser@^1.16.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== - dependencies: - bytes "3.1.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "1.7.2" - iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^2.3.1, braces@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -braces@^3.0.1, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -brorand@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.0.6, browserify-aes@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -browserify-cipher@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" - integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" - integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.1.0.tgz#b2fd06b5b75ae297f7ce2dc651f918f5be158c8d" - integrity sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog== - dependencies: - bn.js "^5.0.0" - randombytes "^2.0.1" - -browserify-sign@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.1.tgz#eaf4add46dd54be3bb3b36c0cf15abbeba7956c3" - integrity sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg== - dependencies: - bn.js "^5.1.1" - browserify-rsa "^4.0.1" - create-hash "^1.2.0" - create-hmac "^1.1.7" - elliptic "^6.5.3" - inherits "^2.0.4" - parse-asn1 "^5.1.5" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -browserslist@^3.2.6: - version "3.2.8" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" - integrity sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ== - dependencies: - caniuse-lite "^1.0.30000844" - electron-to-chromium "^1.3.47" - -bs58@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" - integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= - dependencies: - base-x "^3.0.2" - -bs58check@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" - integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== - dependencies: - bs58 "^4.0.0" - create-hash "^1.1.0" - safe-buffer "^5.1.2" - -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-crc32@~0.2.3: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= - -buffer-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" - integrity sha1-WWFrSYME1Var1GaWayLu2j7KX74= - -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -buffer-to-arraybuffer@^0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz#6064a40fa76eb43c723aba9ef8f6e1216d10511a" - integrity sha1-YGSkD6dutDxyOrqe+PbhIW0QURo= - -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= - -buffer-xor@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-2.0.2.tgz#34f7c64f04c777a1f8aac5e661273bb9dd320289" - integrity sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ== - dependencies: - safe-buffer "^5.1.1" - -buffer@^5.0.5, buffer@^5.2.1, buffer@^5.5.0, buffer@^5.6.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - -bufferutil@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.2.tgz#79f68631910f6b993d870fc77dc0a2894eb96cd5" - integrity sha512-AtnG3W6M8B2n4xDQ5R+70EXvOpnXsFYg/AK2yTZd+HQ/oxAdz+GI+DvjmhBw3L0ole+LJ0ngqY4JMbDzkfNzhA== - dependencies: - node-gyp-build "^4.2.0" - -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== - -bytewise-core@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/bytewise-core/-/bytewise-core-1.2.3.tgz#3fb410c7e91558eb1ab22a82834577aa6bd61d42" - integrity sha1-P7QQx+kVWOsasiqCg0V3qmvWHUI= - dependencies: - typewise-core "^1.2" - -bytewise@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/bytewise/-/bytewise-1.1.0.tgz#1d13cbff717ae7158094aa881b35d081b387253e" - integrity sha1-HRPL/3F65xWAlKqIGzXQgbOHJT4= - dependencies: - bytewise-core "^1.2.2" - typewise "^1.0.3" - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -cacheable-request@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" - integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== - dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^3.0.0" - lowercase-keys "^2.0.0" - normalize-url "^4.1.0" - responselike "^1.0.2" - -cachedown@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cachedown/-/cachedown-1.0.0.tgz#d43f036e4510696b31246d7db31ebf0f7ac32d15" - integrity sha1-1D8DbkUQaWsxJG19sx6/D3rDLRU= - dependencies: - abstract-leveldown "^2.4.1" - lru-cache "^3.2.0" - -call-bind@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.0.tgz#24127054bb3f9bdcb4b1fb82418186072f77b8ce" - integrity sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.0" - -camelcase@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" - integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo= - -camelcase@^5.0.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -caniuse-lite@^1.0.30000844: - version "1.0.30001165" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001165.tgz#32955490d2f60290bb186bb754f2981917fa744f" - integrity sha512-8cEsSMwXfx7lWSUMA2s08z9dIgsnR5NAqjXP23stdsU3AUWkCr/rr4s4OFtHXn5XXr6+7kam3QFVoYyXNPdJPA== - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - -chai@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5" - integrity sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw== - dependencies: - assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^3.0.1" - get-func-name "^2.0.0" - pathval "^1.1.0" - type-detect "^4.0.5" - -chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^2.0.0, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" - integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= - -checkpoint-store@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/checkpoint-store/-/checkpoint-store-1.1.0.tgz#04e4cb516b91433893581e6d4601a78e9552ea06" - integrity sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY= - dependencies: - functional-red-black-tree "^1.0.1" - -chokidar@3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.0.tgz#12c0714668c55800f659e262d4962a97faf554a6" - integrity sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.2.0" - optionalDependencies: - fsevents "~2.1.1" - -chokidar@^2.0.0: - version "2.1.8" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" - integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.1" - braces "^2.3.2" - glob-parent "^3.1.0" - inherits "^2.0.3" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - normalize-path "^3.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.2.1" - upath "^1.1.1" - optionalDependencies: - fsevents "^1.2.7" - -chownr@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -cids@^0.7.1: - version "0.7.5" - resolved "https://registry.yarnpkg.com/cids/-/cids-0.7.5.tgz#60a08138a99bfb69b6be4ceb63bfef7a396b28b2" - integrity sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA== - dependencies: - buffer "^5.5.0" - class-is "^1.1.0" - multibase "~0.6.0" - multicodec "^1.0.0" - multihashes "~0.4.15" - -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -class-is@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/class-is/-/class-is-1.1.0.tgz#9d3c0fba0440d211d843cec3dedfa48055005825" - integrity sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw== - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cliui@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -cliui@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" - integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== - dependencies: - string-width "^3.1.0" - strip-ansi "^5.2.0" - wrap-ansi "^5.1.0" - -clone-buffer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" - integrity sha1-4+JbIHrE5wGvch4staFnksrD3Fg= - -clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= - dependencies: - mimic-response "^1.0.0" - -clone-stats@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" - integrity sha1-s3gt/4u1R04Yuba/D9/ngvh3doA= - -clone@2.1.2, clone@^2.0.0, clone@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= - -cloneable-readable@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.3.tgz#120a00cb053bfb63a222e709f9683ea2e11d8cec" - integrity sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ== - dependencies: - inherits "^2.0.1" - process-nextick-args "^2.0.0" - readable-stream "^2.3.5" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -collection-map@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-map/-/collection-map-1.0.0.tgz#aea0f06f8d26c780c2b75494385544b2255af18c" - integrity sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw= - dependencies: - arr-map "^2.0.2" - for-own "^1.0.0" - make-iterator "^1.0.0" - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -color-support@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" - integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== - -combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commander@2.15.1: - version "2.15.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" - integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== - -commander@^2.8.1: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -commander@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" - integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== - -component-emitter@^1.2.1, component-emitter@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -concat-stream@^1.5.1, concat-stream@^1.6.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -content-disposition@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== - dependencies: - safe-buffer "5.1.2" - -content-hash@^2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/content-hash/-/content-hash-2.5.2.tgz#bbc2655e7c21f14fd3bfc7b7d4bfe6e454c9e211" - integrity sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw== - dependencies: - cids "^0.7.1" - multicodec "^0.5.5" - multihashes "^0.4.15" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -convert-source-map@^1.5.0, convert-source-map@^1.5.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" - integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== - dependencies: - safe-buffer "~5.1.1" - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== - -cookiejar@^2.1.1, cookiejar@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.2.tgz#dd8a235530752f988f9a0844f3fc589e3111125c" - integrity sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA== - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - -copy-props@^2.0.1: - version "2.0.4" - resolved "https://registry.yarnpkg.com/copy-props/-/copy-props-2.0.4.tgz#93bb1cadfafd31da5bb8a9d4b41f471ec3a72dfe" - integrity sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A== - dependencies: - each-props "^1.3.0" - is-plain-object "^2.0.1" - -core-js-pure@^3.0.1: - version "3.8.1" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.8.1.tgz#23f84048f366fdfcf52d3fd1c68fec349177d119" - integrity sha512-Se+LaxqXlVXGvmexKGPvnUIYC1jwXu1H6Pkyb3uBM5d8/NELMYCHs/4/roD7721NxrTLyv7e5nXd5/QLBO+10g== - -core-js@^2.4.0, core-js@^2.5.0: - version "2.6.12" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" - integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== - -core-util-is@1.0.2, core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -cors@^2.8.1: - version "2.8.5" - resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" - integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== - dependencies: - object-assign "^4" - vary "^1" - -create-ecdh@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" - integrity sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A== - dependencies: - bn.js "^4.1.0" - elliptic "^6.5.3" - -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - 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" - -create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - 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" - -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - -cross-fetch@^2.1.0, cross-fetch@^2.1.1: - version "2.2.3" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.3.tgz#e8a0b3c54598136e037f8650f8e823ccdfac198e" - integrity sha512-PrWWNH3yL2NYIb/7WF/5vFG3DCQiXDOVf8k3ijatbrtnwNuhMWLC7YF7uqf53tbTFDzHIUD8oITw4Bxt8ST3Nw== - dependencies: - node-fetch "2.1.2" - whatwg-fetch "2.0.4" - -cross-spawn@^6.0.0, cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -crypto-browserify@3.12.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" - -d@1, d@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" - integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== - dependencies: - es5-ext "^0.10.50" - type "^1.0.1" - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - -deasync@0.1.20: - version "0.1.20" - resolved "https://registry.yarnpkg.com/deasync/-/deasync-0.1.20.tgz#546fd2660688a1eeed55edce2308c5cf7104f9da" - integrity sha512-E1GI7jMI57hL30OX6Ht/hfQU8DO4AuB9m72WFm4c38GNbUD4Q03//XZaOIHZiY+H1xUaomcot5yk2q/qIZQkGQ== - dependencies: - bindings "^1.5.0" - node-addon-api "^1.7.1" - -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -debug@3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -debug@^4.1.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== - dependencies: - ms "2.1.2" - -decamelize@^1.1.1, decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -decompress-response@^3.2.0, decompress-response@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= - dependencies: - mimic-response "^1.0.0" - -decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/decompress-tar/-/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1" - integrity sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ== - dependencies: - file-type "^5.2.0" - is-stream "^1.1.0" - tar-stream "^1.5.2" - -decompress-tarbz2@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz#3082a5b880ea4043816349f378b56c516be1a39b" - integrity sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A== - dependencies: - decompress-tar "^4.1.0" - file-type "^6.1.0" - is-stream "^1.1.0" - seek-bzip "^1.0.5" - unbzip2-stream "^1.0.9" - -decompress-targz@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/decompress-targz/-/decompress-targz-4.1.1.tgz#c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee" - integrity sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w== - dependencies: - decompress-tar "^4.1.1" - file-type "^5.2.0" - is-stream "^1.1.0" - -decompress-unzip@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/decompress-unzip/-/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69" - integrity sha1-3qrM39FK6vhVePczroIQ+bSEj2k= - dependencies: - file-type "^3.8.0" - get-stream "^2.2.0" - pify "^2.3.0" - yauzl "^2.4.2" - -decompress@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.1.tgz#007f55cc6a62c055afa37c07eb6a4ee1b773f118" - integrity sha512-e48kc2IjU+2Zw8cTb6VZcJQ3lgVbS4uuB1TfCHbiZIP/haNXm+SVyhu+87jts5/3ROpd82GSVCoNs/z8l4ZOaQ== - dependencies: - decompress-tar "^4.0.0" - decompress-tarbz2 "^4.0.0" - decompress-targz "^4.0.0" - decompress-unzip "^4.0.1" - graceful-fs "^4.1.10" - make-dir "^1.0.0" - pify "^2.3.0" - strip-dirs "^2.0.0" - -deep-eql@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" - integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== - dependencies: - type-detect "^4.0.0" - -deep-equal@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" - integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g== - dependencies: - is-arguments "^1.0.4" - is-date-object "^1.0.1" - is-regex "^1.0.4" - object-is "^1.0.1" - object-keys "^1.1.1" - regexp.prototype.flags "^1.2.0" - -default-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" - integrity sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ== - dependencies: - kind-of "^5.0.2" - -default-resolution@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/default-resolution/-/default-resolution-2.0.0.tgz#bcb82baa72ad79b426a76732f1a81ad6df26d684" - integrity sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ= - -defer-to-connect@^1.0.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" - integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== - -deferred-leveldown@~1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz#3acd2e0b75d1669924bc0a4b642851131173e1eb" - integrity sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA== - dependencies: - abstract-leveldown "~2.6.0" - -deferred-leveldown@~4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz#0b0570087827bf480a23494b398f04c128c19a20" - integrity sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww== - dependencies: - abstract-leveldown "~5.0.0" - inherits "^2.0.3" - -define-properties@^1.1.2, define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -defined@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" - integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -des.js@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" - integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - -detect-file@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" - integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= - -detect-indent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= - dependencies: - repeating "^2.0.0" - -diff-sequences@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" - integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q== - -diff@3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -diffie-hellman@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" - integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" - -dom-walk@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" - integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== - -dotenv@^8.2.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a" - integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== - -dotignore@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/dotignore/-/dotignore-0.1.2.tgz#f942f2200d28c3a76fbdd6f0ee9f3257c8a2e905" - integrity sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw== - dependencies: - minimatch "^3.0.4" - -drbg.js@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/drbg.js/-/drbg.js-1.0.1.tgz#3e36b6c42b37043823cdbc332d58f31e2445480b" - integrity sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs= - dependencies: - browserify-aes "^1.0.6" - create-hash "^1.1.2" - create-hmac "^1.1.4" - -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= - -duplexify@^3.6.0: - version "3.7.1" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" - integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== - dependencies: - end-of-stream "^1.0.0" - inherits "^2.0.1" - readable-stream "^2.0.0" - stream-shift "^1.0.0" - -each-props@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/each-props/-/each-props-1.3.2.tgz#ea45a414d16dd5cfa419b1a81720d5ca06892333" - integrity sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA== - dependencies: - is-plain-object "^2.0.1" - object.defaults "^1.1.0" - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -electron-to-chromium@^1.3.47: - version "1.3.622" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.622.tgz#9726bd2e67a5462154750ce9701ca6af07d07877" - integrity sha512-AJT0Fm1W0uZlMVVkkJrcCVvczDuF8tPm3bwzQf5WO8AaASB2hwTRP7B8pU5rqjireH+ib6am8+hH5/QkXzzYKw== - -elliptic@6.3.3: - version "6.3.3" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.3.tgz#5482d9646d54bcb89fd7d994fc9e2e9568876e3f" - integrity sha1-VILZZG1UvLif19mU/J4ulWiHbj8= - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - inherits "^2.0.1" - -elliptic@6.5.3, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3: - version "6.5.3" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6" - integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw== - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" - -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -encoding-down@5.0.4, encoding-down@~5.0.0: - version "5.0.4" - resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-5.0.4.tgz#1e477da8e9e9d0f7c8293d320044f8b2cd8e9614" - integrity sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw== - dependencies: - abstract-leveldown "^5.0.0" - inherits "^2.0.3" - level-codec "^9.0.0" - level-errors "^2.0.0" - xtend "^4.0.1" - -encoding@^0.1.11: - version "0.1.13" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" - integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== - dependencies: - iconv-lite "^0.6.2" - -end-of-stream@^1.0.0, end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -errno@~0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" - integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== - dependencies: - prr "~1.0.1" - -error-ex@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -es-abstract@^1.17.0-next.1, es-abstract@^1.17.2: - version "1.17.7" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.7.tgz#a4de61b2f66989fc7421676c1cb9787573ace54c" - integrity sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.2.2" - is-regex "^1.1.1" - object-inspect "^1.8.0" - object-keys "^1.1.1" - object.assign "^4.1.1" - string.prototype.trimend "^1.0.1" - string.prototype.trimstart "^1.0.1" - -es-abstract@^1.18.0-next.1: - version "1.18.0-next.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" - integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.2.2" - is-negative-zero "^2.0.0" - is-regex "^1.1.1" - object-inspect "^1.8.0" - object-keys "^1.1.1" - object.assign "^4.1.1" - string.prototype.trimend "^1.0.1" - string.prototype.trimstart "^1.0.1" - -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - -es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50: - version "0.10.53" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" - integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q== - dependencies: - es6-iterator "~2.0.3" - es6-symbol "~3.1.3" - next-tick "~1.0.0" - -es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-symbol@^3.1.1, es6-symbol@~3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" - integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== - dependencies: - d "^1.0.1" - ext "^1.1.2" - -es6-weak-map@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" - integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== - dependencies: - d "1" - es5-ext "^0.10.46" - es6-iterator "^2.0.3" - es6-symbol "^3.1.1" - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -escape-string-regexp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" - integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - -eth-block-tracker@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/eth-block-tracker/-/eth-block-tracker-3.0.1.tgz#95cd5e763c7293e0b1b2790a2a39ac2ac188a5e1" - integrity sha512-WUVxWLuhMmsfenfZvFO5sbl1qFY2IqUlw/FPVmjjdElpqLsZtSG+wPe9Dz7W/sB6e80HgFKknOmKk2eNlznHug== - dependencies: - eth-query "^2.1.0" - ethereumjs-tx "^1.3.3" - ethereumjs-util "^5.1.3" - ethjs-util "^0.1.3" - json-rpc-engine "^3.6.0" - pify "^2.3.0" - tape "^4.6.3" - -eth-ens-namehash@2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf" - integrity sha1-IprEbsqG1S4MmR58sq74P/D2i88= - dependencies: - idna-uts46-hx "^2.3.1" - js-sha3 "^0.5.7" - -eth-json-rpc-infura@^3.1.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/eth-json-rpc-infura/-/eth-json-rpc-infura-3.2.1.tgz#26702a821067862b72d979c016fd611502c6057f" - integrity sha512-W7zR4DZvyTn23Bxc0EWsq4XGDdD63+XPUCEhV2zQvQGavDVC4ZpFDK4k99qN7bd7/fjj37+rxmuBOBeIqCA5Mw== - dependencies: - cross-fetch "^2.1.1" - eth-json-rpc-middleware "^1.5.0" - json-rpc-engine "^3.4.0" - json-rpc-error "^2.0.0" - -eth-json-rpc-middleware@^1.5.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/eth-json-rpc-middleware/-/eth-json-rpc-middleware-1.6.0.tgz#5c9d4c28f745ccb01630f0300ba945f4bef9593f" - integrity sha512-tDVCTlrUvdqHKqivYMjtFZsdD7TtpNLBCfKAcOpaVs7orBMS/A8HWro6dIzNtTZIR05FAbJ3bioFOnZpuCew9Q== - dependencies: - async "^2.5.0" - eth-query "^2.1.2" - eth-tx-summary "^3.1.2" - ethereumjs-block "^1.6.0" - ethereumjs-tx "^1.3.3" - ethereumjs-util "^5.1.2" - ethereumjs-vm "^2.1.0" - fetch-ponyfill "^4.0.0" - json-rpc-engine "^3.6.0" - json-rpc-error "^2.0.0" - json-stable-stringify "^1.0.1" - promise-to-callback "^1.0.0" - tape "^4.6.3" - -eth-lib@0.2.7: - version "0.2.7" - resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.7.tgz#2f93f17b1e23aec3759cd4a3fe20c1286a3fc1ca" - integrity sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco= - dependencies: - bn.js "^4.11.6" - elliptic "^6.4.0" - xhr-request-promise "^0.1.2" - -eth-lib@0.2.8: - version "0.2.8" - resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.8.tgz#b194058bef4b220ad12ea497431d6cb6aa0623c8" - integrity sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw== - dependencies: - bn.js "^4.11.6" - elliptic "^6.4.0" - xhr-request-promise "^0.1.2" - -eth-lib@^0.1.26: - version "0.1.29" - resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.1.29.tgz#0c11f5060d42da9f931eab6199084734f4dbd1d9" - integrity sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ== - dependencies: - bn.js "^4.11.6" - elliptic "^6.4.0" - nano-json-stream-parser "^0.1.2" - servify "^0.1.12" - ws "^3.0.0" - xhr-request-promise "^0.1.2" - -eth-query@^2.0.2, eth-query@^2.1.0, eth-query@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/eth-query/-/eth-query-2.1.2.tgz#d6741d9000106b51510c72db92d6365456a6da5e" - integrity sha1-1nQdkAAQa1FRDHLbktY2VFam2l4= - dependencies: - json-rpc-random-id "^1.0.0" - xtend "^4.0.1" - -eth-sig-util@2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.3.0.tgz#c54a6ac8e8796f7e25f59cf436982a930e645231" - integrity sha512-ugD1AvaggvKaZDgnS19W5qOfepjGc7qHrt7TrAaL54gJw9SHvgIXJ3r2xOMW30RWJZNP+1GlTOy5oye7yXA4xA== - dependencies: - buffer "^5.2.1" - elliptic "^6.4.0" - ethereumjs-abi "0.6.5" - ethereumjs-util "^5.1.1" - tweetnacl "^1.0.0" - tweetnacl-util "^0.15.0" - -eth-sig-util@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-1.4.2.tgz#8d958202c7edbaae839707fba6f09ff327606210" - integrity sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA= - dependencies: - ethereumjs-abi "git+https://github.com/ethereumjs/ethereumjs-abi.git" - ethereumjs-util "^5.1.1" - -eth-sig-util@^2.0.0: - version "2.5.3" - resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.5.3.tgz#6938308b38226e0b3085435474900b03036abcbe" - integrity sha512-KpXbCKmmBUNUTGh9MRKmNkIPietfhzBqqYqysDavLseIiMUGl95k6UcPEkALAZlj41e9E6yioYXc1PC333RKqw== - dependencies: - buffer "^5.2.1" - elliptic "^6.4.0" - ethereumjs-abi "0.6.5" - ethereumjs-util "^5.1.1" - tweetnacl "^1.0.0" - tweetnacl-util "^0.15.0" - -eth-tx-summary@^3.1.2: - version "3.2.4" - resolved "https://registry.yarnpkg.com/eth-tx-summary/-/eth-tx-summary-3.2.4.tgz#e10eb95eb57cdfe549bf29f97f1e4f1db679035c" - integrity sha512-NtlDnaVZah146Rm8HMRUNMgIwG/ED4jiqk0TME9zFheMl1jOp6jL1m0NKGjJwehXQ6ZKCPr16MTr+qspKpEXNg== - dependencies: - async "^2.1.2" - clone "^2.0.0" - concat-stream "^1.5.1" - end-of-stream "^1.1.0" - eth-query "^2.0.2" - ethereumjs-block "^1.4.1" - ethereumjs-tx "^1.1.1" - ethereumjs-util "^5.0.1" - ethereumjs-vm "^2.6.0" - through2 "^2.0.3" - -ethashjs@~0.0.7: - version "0.0.8" - resolved "https://registry.yarnpkg.com/ethashjs/-/ethashjs-0.0.8.tgz#227442f1bdee409a548fb04136e24c874f3aa6f9" - integrity sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw== - dependencies: - async "^2.1.2" - buffer-xor "^2.0.1" - ethereumjs-util "^7.0.2" - miller-rabin "^4.0.0" - -ethereum-bloom-filters@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.7.tgz#b7b80735e385dbb7f944ce6b4533e24511306060" - integrity sha512-cDcJJSJ9GMAcURiAWO3DxIEhTL/uWqlQnvgKpuYQzYPrt/izuGU+1ntQmHt0IRq6ADoSYHFnB+aCEFIldjhkMQ== - dependencies: - js-sha3 "^0.8.0" - -ethereum-common@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.2.0.tgz#13bf966131cce1eeade62a1b434249bb4cb120ca" - integrity sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA== - -ethereum-common@^0.0.18: - version "0.0.18" - resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f" - integrity sha1-L9w1dvIykDNYl26znaeDIT/5Uj8= - -ethereum-cryptography@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" - integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== - dependencies: - "@types/pbkdf2" "^3.0.0" - "@types/secp256k1" "^4.0.1" - blakejs "^1.1.0" - browserify-aes "^1.2.0" - bs58check "^2.1.2" - create-hash "^1.2.0" - create-hmac "^1.1.7" - hash.js "^1.1.7" - keccak "^3.0.0" - pbkdf2 "^3.0.17" - randombytes "^2.1.0" - safe-buffer "^5.1.2" - scrypt-js "^3.0.0" - secp256k1 "^4.0.1" - setimmediate "^1.0.5" - -ethereumjs-abi@0.6.5: - version "0.6.5" - resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz#5a637ef16ab43473fa72a29ad90871405b3f5241" - integrity sha1-WmN+8Wq0NHP6cqKa2QhxQFs/UkE= - dependencies: - bn.js "^4.10.0" - ethereumjs-util "^4.3.0" - -ethereumjs-abi@0.6.7: - version "0.6.7" - resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.7.tgz#d1d1c5cdb8d910a7d97645ba9e93be5d153bba2e" - integrity sha512-EMLOA8ICO5yAaXDhjVEfYjsJIXYutY8ufTE93eEKwsVtp2usQreKwsDTJ9zvam3omYqNuffr8IONIqb2uUslGQ== - dependencies: - bn.js "^4.11.8" - ethereumjs-util "^6.0.0" - -ethereumjs-abi@0.6.8, "ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": - version "0.6.8" - resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#1ce6a1d64235fabe2aaf827fd606def55693508f" - dependencies: - bn.js "^4.11.8" - ethereumjs-util "^6.0.0" - -ethereumjs-account@3.0.0, ethereumjs-account@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz#728f060c8e0c6e87f1e987f751d3da25422570a9" - integrity sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA== - dependencies: - ethereumjs-util "^6.0.0" - rlp "^2.2.1" - safe-buffer "^5.1.1" - -ethereumjs-account@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz#eeafc62de544cb07b0ee44b10f572c9c49e00a84" - integrity sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA== - dependencies: - ethereumjs-util "^5.0.0" - rlp "^2.0.0" - safe-buffer "^5.1.1" - -ethereumjs-block@2.2.2, ethereumjs-block@^2.2.2, ethereumjs-block@~2.2.0, ethereumjs-block@~2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz#c7654be7e22df489fda206139ecd63e2e9c04965" - integrity sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg== - dependencies: - async "^2.0.1" - ethereumjs-common "^1.5.0" - ethereumjs-tx "^2.1.1" - ethereumjs-util "^5.0.0" - merkle-patricia-tree "^2.1.2" - -ethereumjs-block@^1.2.2, ethereumjs-block@^1.4.1, ethereumjs-block@^1.6.0: - version "1.7.1" - resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz#78b88e6cc56de29a6b4884ee75379b6860333c3f" - integrity sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg== - dependencies: - async "^2.0.1" - ethereum-common "0.2.0" - ethereumjs-tx "^1.2.2" - ethereumjs-util "^5.0.0" - merkle-patricia-tree "^2.1.2" - -ethereumjs-blockchain@^4.0.3: - version "4.0.4" - resolved "https://registry.yarnpkg.com/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.4.tgz#30f2228dc35f6dcf94423692a6902604ae34960f" - integrity sha512-zCxaRMUOzzjvX78DTGiKjA+4h2/sF0OYL1QuPux0DHpyq8XiNoF5GYHtb++GUxVlMsMfZV7AVyzbtgcRdIcEPQ== - dependencies: - async "^2.6.1" - ethashjs "~0.0.7" - ethereumjs-block "~2.2.2" - ethereumjs-common "^1.5.0" - ethereumjs-util "^6.1.0" - flow-stoplight "^1.0.0" - level-mem "^3.0.1" - lru-cache "^5.1.1" - rlp "^2.2.2" - semaphore "^1.1.0" - -ethereumjs-common@1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.5.0.tgz#d3e82fc7c47c0cef95047f431a99485abc9bb1cd" - integrity sha512-SZOjgK1356hIY7MRj3/ma5qtfr/4B5BL+G4rP/XSMYr2z1H5el4RX5GReYCKmQmYI/nSBmRnwrZ17IfHuG0viQ== - -ethereumjs-common@^1.1.0, ethereumjs-common@^1.3.2, ethereumjs-common@^1.5.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz#2065dbe9214e850f2e955a80e650cb6999066979" - integrity sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA== - -ethereumjs-tx@2.1.2, ethereumjs-tx@^2.1.1, ethereumjs-tx@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz#5dfe7688bf177b45c9a23f86cf9104d47ea35fed" - integrity sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw== - dependencies: - ethereumjs-common "^1.5.0" - ethereumjs-util "^6.0.0" - -ethereumjs-tx@^1.1.1, ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.3: - version "1.3.7" - resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz#88323a2d875b10549b8347e09f4862b546f3d89a" - integrity sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA== - dependencies: - ethereum-common "^0.0.18" - ethereumjs-util "^5.0.0" - -ethereumjs-util@6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz#e9c51e5549e8ebd757a339cc00f5380507e799c8" - integrity sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q== - dependencies: - bn.js "^4.11.0" - create-hash "^1.1.2" - ethjs-util "0.1.6" - keccak "^1.0.2" - rlp "^2.0.0" - safe-buffer "^5.1.1" - secp256k1 "^3.0.1" - -ethereumjs-util@6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz#23ec79b2488a7d041242f01e25f24e5ad0357960" - integrity sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ== - dependencies: - "@types/bn.js" "^4.11.3" - bn.js "^4.11.0" - create-hash "^1.1.2" - ethjs-util "0.1.6" - keccak "^2.0.0" - rlp "^2.2.3" - secp256k1 "^3.0.1" - -ethereumjs-util@6.2.1, ethereumjs-util@^6.0.0, ethereumjs-util@^6.1.0, ethereumjs-util@^6.2.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" - integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== - dependencies: - "@types/bn.js" "^4.11.3" - bn.js "^4.11.0" - create-hash "^1.1.2" - elliptic "^6.5.2" - ethereum-cryptography "^0.1.3" - ethjs-util "0.1.6" - rlp "^2.2.3" - -ethereumjs-util@^4.3.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-4.5.1.tgz#f4bf9b3b515a484e3cc8781d61d9d980f7c83bd0" - integrity sha512-WrckOZ7uBnei4+AKimpuF1B3Fv25OmoRgmYCpGsP7u8PFxXAmAgiJSYT2kRWnt6fVIlKaQlZvuwXp7PIrmn3/w== - dependencies: - bn.js "^4.8.0" - create-hash "^1.1.2" - elliptic "^6.5.2" - ethereum-cryptography "^0.1.3" - rlp "^2.0.0" - -ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2, ethereumjs-util@^5.1.3, ethereumjs-util@^5.1.5, ethereumjs-util@^5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz#a833f0e5fca7e5b361384dc76301a721f537bf65" - integrity sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ== - dependencies: - bn.js "^4.11.0" - create-hash "^1.1.2" - elliptic "^6.5.2" - ethereum-cryptography "^0.1.3" - ethjs-util "^0.1.3" - rlp "^2.0.0" - safe-buffer "^5.1.1" - -ethereumjs-util@^7.0.2: - version "7.0.7" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.7.tgz#484fb9c03b766b2ee64821281070616562fb5a59" - integrity sha512-vU5rtZBlZsgkTw3o6PDKyB8li2EgLavnAbsKcfsH2YhHH1Le+PP8vEiMnAnvgc1B6uMoaM5GDCrVztBw0Q5K9g== - dependencies: - "@types/bn.js" "^4.11.3" - bn.js "^5.1.2" - create-hash "^1.1.2" - ethereum-cryptography "^0.1.3" - ethjs-util "0.1.6" - rlp "^2.2.4" - -ethereumjs-vm@4.1.3: - version "4.1.3" - resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-4.1.3.tgz#dc8eb45f47d775da9f0b2437d5e20896fdf66f37" - integrity sha512-RTrD0y7My4O6Qr1P2ZIsMfD6RzL6kU/RhBZ0a5XrPzAeR61crBS7or66ohDrvxDI/rDBxMi+6SnsELih6fzalw== - dependencies: - async "^2.1.2" - async-eventemitter "^0.2.2" - core-js-pure "^3.0.1" - ethereumjs-account "^3.0.0" - ethereumjs-block "^2.2.2" - ethereumjs-blockchain "^4.0.3" - ethereumjs-common "^1.5.0" - ethereumjs-tx "^2.1.2" - ethereumjs-util "^6.2.0" - fake-merkle-patricia-tree "^1.0.1" - functional-red-black-tree "^1.0.1" - merkle-patricia-tree "^2.3.2" - rustbn.js "~0.2.0" - safe-buffer "^5.1.1" - util.promisify "^1.0.0" - -ethereumjs-vm@4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz#e885e861424e373dbc556278f7259ff3fca5edab" - integrity sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA== - dependencies: - async "^2.1.2" - async-eventemitter "^0.2.2" - core-js-pure "^3.0.1" - ethereumjs-account "^3.0.0" - ethereumjs-block "^2.2.2" - ethereumjs-blockchain "^4.0.3" - ethereumjs-common "^1.5.0" - ethereumjs-tx "^2.1.2" - ethereumjs-util "^6.2.0" - fake-merkle-patricia-tree "^1.0.1" - functional-red-black-tree "^1.0.1" - merkle-patricia-tree "^2.3.2" - rustbn.js "~0.2.0" - safe-buffer "^5.1.1" - util.promisify "^1.0.0" - -ethereumjs-vm@^2.1.0, ethereumjs-vm@^2.3.4, ethereumjs-vm@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-2.6.0.tgz#76243ed8de031b408793ac33907fb3407fe400c6" - integrity sha512-r/XIUik/ynGbxS3y+mvGnbOKnuLo40V5Mj1J25+HEO63aWYREIqvWeRO/hnROlMBE5WoniQmPmhiaN0ctiHaXw== - dependencies: - async "^2.1.2" - async-eventemitter "^0.2.2" - ethereumjs-account "^2.0.3" - ethereumjs-block "~2.2.0" - ethereumjs-common "^1.1.0" - ethereumjs-util "^6.0.0" - fake-merkle-patricia-tree "^1.0.1" - functional-red-black-tree "^1.0.1" - merkle-patricia-tree "^2.3.2" - rustbn.js "~0.2.0" - safe-buffer "^5.1.1" - -ethereumjs-wallet@0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.3.tgz#b0eae6f327637c2aeb9ccb9047b982ac542e6ab1" - integrity sha512-qiXPiZOsStem+Dj/CQHbn5qex+FVkuPmGH7SvSnA9F3tdRDt8dLMyvIj3+U05QzVZNPYh4HXEdnzoYI4dZkr9w== - dependencies: - aes-js "^3.1.1" - bs58check "^2.1.2" - ethereumjs-util "^6.0.0" - hdkey "^1.1.0" - randombytes "^2.0.6" - safe-buffer "^5.1.2" - scrypt.js "^0.3.0" - utf8 "^3.0.0" - uuid "^3.3.2" - -ethereumjs-wallet@0.6.5: - version "0.6.5" - resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.5.tgz#685e9091645cee230ad125c007658833991ed474" - integrity sha512-MDwjwB9VQVnpp/Dc1XzA6J1a3wgHQ4hSvA1uWNatdpOrtCbPVuQSKSyRnjLvS0a+KKMw2pvQ9Ybqpb3+eW8oNA== - dependencies: - aes-js "^3.1.1" - bs58check "^2.1.2" - ethereum-cryptography "^0.1.3" - ethereumjs-util "^6.0.0" - randombytes "^2.0.6" - safe-buffer "^5.1.2" - scryptsy "^1.2.1" - utf8 "^3.0.0" - uuid "^3.3.2" - -ethers@4.0.0-beta.3: - version "4.0.0-beta.3" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.0-beta.3.tgz#15bef14e57e94ecbeb7f9b39dd0a4bd435bc9066" - integrity sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog== - dependencies: - "@types/node" "^10.3.2" - aes-js "3.0.0" - bn.js "^4.4.0" - elliptic "6.3.3" - hash.js "1.1.3" - js-sha3 "0.5.7" - scrypt-js "2.0.3" - setimmediate "1.0.4" - uuid "2.0.1" - xmlhttprequest "1.8.0" - -ethjs-unit@0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" - integrity sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk= - dependencies: - bn.js "4.11.6" - number-to-bn "1.7.0" - -ethjs-util@0.1.6, ethjs-util@^0.1.3: - version "0.1.6" - resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" - integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== - dependencies: - is-hex-prefixed "1.0.0" - strip-hex-prefix "1.0.0" - -eventemitter3@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" - integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== - -eventemitter3@4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384" - integrity sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ== - -events@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379" - integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg== - -evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-tilde@^2.0.0, expand-tilde@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" - integrity sha1-l+gBqgUt8CRU3kawK/YhZCzchQI= - dependencies: - homedir-polyfill "^1.0.1" - -expect@^26.6.1: - version "26.6.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-26.6.2.tgz#c6b996bf26bf3fe18b67b2d0f51fc981ba934417" - integrity sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA== - dependencies: - "@jest/types" "^26.6.2" - ansi-styles "^4.0.0" - jest-get-type "^26.3.0" - jest-matcher-utils "^26.6.2" - jest-message-util "^26.6.2" - jest-regex-util "^26.0.0" - -express@^4.14.0: - version "4.17.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" - integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== - dependencies: - accepts "~1.3.7" - array-flatten "1.1.1" - body-parser "1.19.0" - content-disposition "0.5.3" - content-type "~1.0.4" - cookie "0.4.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~1.1.2" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "~1.1.2" - fresh "0.5.2" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "~2.3.0" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.5" - qs "6.7.0" - range-parser "~1.2.1" - safe-buffer "5.1.2" - send "0.17.1" - serve-static "1.14.1" - setprototypeof "1.1.1" - statuses "~1.5.0" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - -ext@^1.1.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" - integrity sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A== - dependencies: - type "^2.0.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@^3.0.0, extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - -fake-merkle-patricia-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz#4b8c3acfb520afadf9860b1f14cd8ce3402cddd3" - integrity sha1-S4w6z7Ugr635hgsfFM2M40As3dM= - dependencies: - checkpoint-store "^1.1.0" - -fancy-log@^1.3.2: - version "1.3.3" - resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" - integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw== - dependencies: - ansi-gray "^0.1.1" - color-support "^1.1.3" - parse-node-version "^1.0.0" - time-stamp "^1.0.0" - -fast-deep-equal@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz#e6a754cc8f15e58987aa9cbd27af66fd6f4e5af9" - integrity sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk= - -fast-safe-stringify@^2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743" - integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== - -fd-slicer@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= - dependencies: - pend "~1.2.0" - -fetch-ponyfill@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz#ae3ce5f732c645eab87e4ae8793414709b239893" - integrity sha1-rjzl9zLGReq4fkroeTQUcJsjmJM= - dependencies: - node-fetch "~1.7.1" - -file-type@^3.8.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" - integrity sha1-JXoHg4TR24CHvESdEH1SpSZyuek= - -file-type@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6" - integrity sha1-LdvqfHP/42No365J3DOMBYwritY= - -file-type@^6.1.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919" - integrity sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg== - -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -finalhandler@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" - integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.3" - statuses "~1.5.0" - unpipe "~1.0.0" - -find-up@3.0.0, find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - -find-yarn-workspace-root@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz#40eb8e6e7c2502ddfaa2577c176f221422f860db" - integrity sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q== - dependencies: - fs-extra "^4.0.3" - micromatch "^3.1.4" - -findup-sync@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc" - integrity sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw= - dependencies: - detect-file "^1.0.0" - is-glob "^3.1.0" - micromatch "^3.0.4" - resolve-dir "^1.0.1" - -findup-sync@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1" - integrity sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg== - dependencies: - detect-file "^1.0.0" - is-glob "^4.0.0" - micromatch "^3.0.4" - resolve-dir "^1.0.1" - -fined@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fined/-/fined-1.2.0.tgz#d00beccf1aa2b475d16d423b0238b713a2c4a37b" - integrity sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng== - dependencies: - expand-tilde "^2.0.2" - is-plain-object "^2.0.3" - object.defaults "^1.1.0" - object.pick "^1.2.0" - parse-filepath "^1.0.1" - -flagged-respawn@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.1.tgz#e7de6f1279ddd9ca9aac8a5971d618606b3aab41" - integrity sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q== - -flat@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.1.tgz#a392059cc382881ff98642f5da4dde0a959f309b" - integrity sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA== - dependencies: - is-buffer "~2.0.3" - -flow-stoplight@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/flow-stoplight/-/flow-stoplight-1.0.0.tgz#4a292c5bcff8b39fa6cc0cb1a853d86f27eeff7b" - integrity sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s= - -flush-write-stream@^1.0.2: - version "1.1.1" - resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" - integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== - dependencies: - inherits "^2.0.3" - readable-stream "^2.3.6" - -for-each@~0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" - integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== - dependencies: - is-callable "^1.1.3" - -for-in@^1.0.1, for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -for-own@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" - integrity sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs= - dependencies: - for-in "^1.0.1" - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - -form-data@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" - integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -formidable@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/formidable/-/formidable-1.2.2.tgz#bf69aea2972982675f00865342b982986f6b8dd9" - integrity sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q== - -forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== - -fs-extra@^4.0.2, fs-extra@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" - integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-extra@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-minipass@^1.2.5: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" - integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== - dependencies: - minipass "^2.6.0" - -fs-mkdirp-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz#0b7815fc3201c6a69e14db98ce098c16935259eb" - integrity sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes= - dependencies: - graceful-fs "^4.1.11" - through2 "^2.0.3" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^1.2.7: - version "1.2.13" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" - integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" - -fsevents@~2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== - -function-bind@^1.1.1, function-bind@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -ganache-cli@6.12.1-tezos.0: - version "6.12.1-tezos.0" - resolved "https://registry.yarnpkg.com/ganache-cli/-/ganache-cli-6.12.1-tezos.0.tgz#704175be2de10aa0d74ff4bae2a6efc79d99df72" - integrity sha512-ZQDTacJhytx/DQH8HKdbMDhZuQtArShrC95HUjCjvJtMVoB4qEjGKd0GfTy9S4KFPsNmzESmnVuvjBZpnRalaA== - dependencies: - ethereumjs-util "6.1.0" - ganache-core "2.13.2-tezos.2" - source-map-support "0.5.12" - yargs "13.2.4" - optionalDependencies: - deasync "0.1.20" - -ganache-core@2.13.2-tezos.2: - version "2.13.2-tezos.2" - resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.13.2-tezos.2.tgz#bffe59a902e13a64a8854926a176f3ee8f6dee68" - integrity sha512-qWipVxn0zVqN9zt/AExEyTghNNmFN5jN80RDyOaeESGHbclT5L6B51WM/z8eSt36ITux3RW9KRAWnYfP7oq+sw== - dependencies: - abstract-leveldown "3.0.0" - async "2.6.2" - bip39 "2.5.0" - bs58check "^2.1.2" - cachedown "1.0.0" - clone "2.1.2" - debug "3.2.6" - encoding-down "5.0.4" - eth-sig-util "2.3.0" - ethereumjs-abi "0.6.7" - ethereumjs-account "3.0.0" - ethereumjs-block "2.2.2" - ethereumjs-common "1.5.0" - ethereumjs-tx "2.1.2" - ethereumjs-util "6.2.0" - ethereumjs-vm "4.1.3" - heap "0.2.6" - level-sublevel "6.6.4" - levelup "3.1.1" - libsodium-wrappers "0.7.6" - lodash "4.17.14" - merkle-patricia-tree "2.3.2" - seedrandom "3.0.1" - source-map-support "0.5.12" - superagent "5.2.2" - tmp "0.1.0" - web3-provider-engine "14.2.1" - websocket "1.0.29" - optionalDependencies: - ethereumjs-wallet "0.6.3" - web3 "1.2.4" - -ganache-core@^2.11.0-tezos.2: - version "2.13.1" - resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.13.1.tgz#bf60399a2dd084e1090db91cbbc7ed3885dc01e4" - integrity sha512-Ewg+kNcDqXtOohe7jCcP+ZUv9EMzOx2MoqOYYP3BCfxrDh3KjBXXaKK+Let7li0TghAs9lxmBgevZku35j5YzA== - dependencies: - abstract-leveldown "3.0.0" - async "2.6.2" - bip39 "2.5.0" - cachedown "1.0.0" - clone "2.1.2" - debug "3.2.6" - encoding-down "5.0.4" - eth-sig-util "^2.0.0" - ethereumjs-abi "0.6.8" - ethereumjs-account "3.0.0" - ethereumjs-block "2.2.2" - ethereumjs-common "1.5.0" - ethereumjs-tx "2.1.2" - ethereumjs-util "6.2.1" - ethereumjs-vm "4.2.0" - heap "0.2.6" - keccak "3.0.1" - level-sublevel "6.6.4" - levelup "3.1.1" - lodash "4.17.20" - lru-cache "5.1.1" - merkle-patricia-tree "3.0.0" - patch-package "6.2.2" - seedrandom "3.0.1" - source-map-support "0.5.12" - tmp "0.1.0" - web3-provider-engine "14.2.1" - websocket "1.0.32" - optionalDependencies: - ethereumjs-wallet "0.6.5" - web3 "1.2.11" - -get-caller-file@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== - -get-caller-file@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= - -get-intrinsic@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.1.tgz#94a9768fcbdd0595a1c9273aacf4c89d075631be" - integrity sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -get-stream@^2.2.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" - integrity sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4= - dependencies: - object-assign "^4.0.1" - pinkie-promise "^2.0.0" - -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - -get-stream@^4.0.0, get-stream@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - -get-stream@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob-parent@~5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" - integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== - dependencies: - is-glob "^4.0.1" - -glob-stream@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-6.1.0.tgz#7045c99413b3eb94888d83ab46d0b404cc7bdde4" - integrity sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ= - dependencies: - extend "^3.0.0" - glob "^7.1.1" - glob-parent "^3.1.0" - is-negated-glob "^1.0.0" - ordered-read-streams "^1.0.0" - pumpify "^1.3.5" - readable-stream "^2.1.5" - remove-trailing-separator "^1.0.1" - to-absolute-glob "^2.0.0" - unique-stream "^2.0.2" - -glob-watcher@^5.0.3: - version "5.0.5" - resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-5.0.5.tgz#aa6bce648332924d9a8489be41e3e5c52d4186dc" - integrity sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw== - dependencies: - anymatch "^2.0.0" - async-done "^1.2.0" - chokidar "^2.0.0" - is-negated-glob "^1.0.0" - just-debounce "^1.0.0" - normalize-path "^3.0.0" - object.defaults "^1.1.0" - -glob@7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.1.1, glob@^7.1.3, glob@~7.1.6: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -global-modules@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" - integrity sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg== - dependencies: - global-prefix "^1.0.1" - is-windows "^1.0.1" - resolve-dir "^1.0.0" - -global-prefix@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" - integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4= - dependencies: - expand-tilde "^2.0.2" - homedir-polyfill "^1.0.1" - ini "^1.3.4" - is-windows "^1.0.1" - which "^1.2.14" - -global@~4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" - integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== - dependencies: - min-document "^2.19.0" - process "^0.11.10" - -globals@^9.18.0: - version "9.18.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== - -glogg@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.2.tgz#2d7dd702beda22eb3bffadf880696da6d846313f" - integrity sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA== - dependencies: - sparkles "^1.0.0" - -got@9.6.0: - version "9.6.0" - resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" - integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== - dependencies: - "@sindresorhus/is" "^0.14.0" - "@szmarczak/http-timer" "^1.1.2" - cacheable-request "^6.0.0" - decompress-response "^3.3.0" - duplexer3 "^0.1.4" - get-stream "^4.1.0" - lowercase-keys "^1.0.1" - mimic-response "^1.0.1" - p-cancelable "^1.0.0" - to-readable-stream "^1.0.0" - url-parse-lax "^3.0.0" - -got@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" - integrity sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw== - dependencies: - decompress-response "^3.2.0" - duplexer3 "^0.1.4" - get-stream "^3.0.0" - is-plain-obj "^1.1.0" - is-retry-allowed "^1.0.0" - is-stream "^1.0.0" - isurl "^1.0.0-alpha5" - lowercase-keys "^1.0.0" - p-cancelable "^0.3.0" - p-timeout "^1.1.1" - safe-buffer "^5.0.1" - timed-out "^4.0.0" - url-parse-lax "^1.0.0" - url-to-options "^1.0.1" - -graceful-fs@^4.0.0, graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" - integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== - -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - -gulp-cli@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/gulp-cli/-/gulp-cli-2.3.0.tgz#ec0d380e29e52aa45e47977f0d32e18fd161122f" - integrity sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A== - dependencies: - ansi-colors "^1.0.1" - archy "^1.0.0" - array-sort "^1.0.0" - color-support "^1.1.3" - concat-stream "^1.6.0" - copy-props "^2.0.1" - fancy-log "^1.3.2" - gulplog "^1.0.0" - interpret "^1.4.0" - isobject "^3.0.1" - liftoff "^3.1.0" - matchdep "^2.0.0" - mute-stdout "^1.0.0" - pretty-hrtime "^1.0.0" - replace-homedir "^1.0.0" - semver-greatest-satisfied-range "^1.1.0" - v8flags "^3.2.0" - yargs "^7.1.0" - -gulp@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/gulp/-/gulp-4.0.2.tgz#543651070fd0f6ab0a0650c6a3e6ff5a7cb09caa" - integrity sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA== - dependencies: - glob-watcher "^5.0.3" - gulp-cli "^2.2.0" - undertaker "^1.2.1" - vinyl-fs "^3.0.0" - -gulplog@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" - integrity sha1-4oxNRdBey77YGDY86PnFkmIp/+U= - dependencies: - glogg "^1.0.0" - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-symbol-support-x@^1.4.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" - integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== - -has-symbols@^1.0.0, has-symbols@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" - integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== - -has-to-string-tag-x@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" - integrity sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw== - dependencies: - has-symbol-support-x "^1.4.1" - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -has@^1.0.3, has@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -hash.js@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" - integrity sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.0" - -hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -hdkey@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/hdkey/-/hdkey-1.1.2.tgz#c60f9cf6f90fbf24a8a52ea06893f36a0108cd3e" - integrity sha512-PTQ4VKu0oRnCrYfLp04iQZ7T2Cxz0UsEXYauk2j8eh6PJXCpbXuCFhOmtIFtbET0i3PMWmHN9J11gU8LEgUljQ== - dependencies: - bs58check "^2.1.2" - safe-buffer "^5.1.1" - secp256k1 "^3.0.1" - -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= - -he@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -heap@0.2.6: - version "0.2.6" - resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.6.tgz#087e1f10b046932fc8594dd9e6d378afc9d1e5ac" - integrity sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw= - -hmac-drbg@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -home-or-tmp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.1" - -homedir-polyfill@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" - integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== - dependencies: - parse-passwd "^1.0.0" - -hosted-git-info@^2.1.4: - version "2.8.8" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" - integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== - -http-cache-semantics@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== - -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-https@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b" - integrity sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs= - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.2.tgz#ce13d1875b0c3a674bd6a04b7f76b01b1b6ded01" - integrity sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - -idna-uts46-hx@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz#a1dc5c4df37eee522bf66d969cc980e00e8711f9" - integrity sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA== - dependencies: - punycode "2.1.0" - -ieee754@^1.1.13: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -immediate@^3.2.3: - version "3.3.0" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.3.0.tgz#1aef225517836bcdf7f2a2de2600c79ff0269266" - integrity sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q== - -immediate@~3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c" - integrity sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3, inherits@~2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ini@^1.3.4: - version "1.3.7" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84" - integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ== - -interpret@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" - integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== - -invariant@^2.2.2: - version "2.2.4" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== - dependencies: - loose-envify "^1.0.0" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -invert-kv@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" - integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== - -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -is-absolute@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" - integrity sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA== - dependencies: - is-relative "^1.0.0" - is-windows "^1.0.1" - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-arguments@^1.0.4: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9" - integrity sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg== - dependencies: - call-bind "^1.0.0" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= - dependencies: - binary-extensions "^1.0.0" - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-buffer@~2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" - integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== - -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" - integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== - -is-ci@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" - integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== - dependencies: - ci-info "^2.0.0" - -is-core-module@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a" - integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== - dependencies: - has "^1.0.3" - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-date-object@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" - integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.0, is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-finite@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" - integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== - -is-fn@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fn/-/is-fn-1.0.0.tgz#9543d5de7bcf5b08a22ec8a20bae6e286d510d8c" - integrity sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-function@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.2.tgz#4f097f30abf6efadac9833b17ca5dc03f8144e08" - integrity sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ== - -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= - dependencies: - is-extglob "^2.1.0" - -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -is-hex-prefixed@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" - integrity sha1-fY035q135dEnFIkTxXPggtd39VQ= - -is-natural-number@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" - integrity sha1-q5124dtM7VHjXeDHLr7PCfc0zeg= - -is-negated-glob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" - integrity sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI= - -is-negative-zero@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" - integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-object@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" - integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== - -is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-regex@^1.0.4, is-regex@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" - integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== - dependencies: - has-symbols "^1.0.1" - -is-regex@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" - integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== - dependencies: - has "^1.0.3" - -is-relative@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" - integrity sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA== - dependencies: - is-unc-path "^1.0.0" - -is-retry-allowed@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" - integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== - -is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - -is-symbol@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" - integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== - dependencies: - has-symbols "^1.0.1" - -is-typedarray@^1.0.0, is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - -is-unc-path@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" - integrity sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ== - dependencies: - unc-path-regex "^0.1.2" - -is-utf8@^0.2.0, is-utf8@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= - -is-valid-glob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" - integrity sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao= - -is-windows@^1.0.1, is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -isurl@^1.0.0-alpha5: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" - integrity sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w== - dependencies: - has-to-string-tag-x "^1.2.0" - is-object "^1.0.1" - -jest-diff@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394" - integrity sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA== - dependencies: - chalk "^4.0.0" - diff-sequences "^26.6.2" - jest-get-type "^26.3.0" - pretty-format "^26.6.2" - -jest-get-type@^26.3.0: - version "26.3.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" - integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== - -jest-matcher-utils@^26.6.1, jest-matcher-utils@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz#8e6fd6e863c8b2d31ac6472eeb237bc595e53e7a" - integrity sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw== - dependencies: - chalk "^4.0.0" - jest-diff "^26.6.2" - jest-get-type "^26.3.0" - pretty-format "^26.6.2" - -jest-message-util@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.6.2.tgz#58173744ad6fc0506b5d21150b9be56ef001ca07" - integrity sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA== - dependencies: - "@babel/code-frame" "^7.0.0" - "@jest/types" "^26.6.2" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.4" - micromatch "^4.0.2" - pretty-format "^26.6.2" - slash "^3.0.0" - stack-utils "^2.0.2" - -jest-regex-util@^26.0.0: - version "26.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" - integrity sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A== - -js-sha3@0.5.7, js-sha3@^0.5.7: - version "0.5.7" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" - integrity sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc= - -js-sha3@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= - -js-yaml@3.13.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= - -jsesc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" - integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= - -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= - -json-buffer@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= - -json-rpc-engine@^3.4.0, json-rpc-engine@^3.6.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz#9d4ff447241792e1d0a232f6ef927302bb0c62a9" - integrity sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA== - dependencies: - async "^2.0.1" - babel-preset-env "^1.7.0" - babelify "^7.3.0" - json-rpc-error "^2.0.0" - promise-to-callback "^1.0.0" - safe-event-emitter "^1.0.1" - -json-rpc-error@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/json-rpc-error/-/json-rpc-error-2.0.0.tgz#a7af9c202838b5e905c7250e547f1aff77258a02" - integrity sha1-p6+cICg4tekFxyUOVH8a/3cligI= - dependencies: - inherits "^2.0.1" - -json-rpc-random-id@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz#ba49d96aded1444dbb8da3d203748acbbcdec8c8" - integrity sha1-uknZat7RRE27jaPSA3SKy7zeyMg= - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= - -json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - integrity sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8= - dependencies: - jsonify "~0.0.0" - -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - -json5@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= - optionalDependencies: - graceful-fs "^4.1.6" - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -just-debounce@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/just-debounce/-/just-debounce-1.0.0.tgz#87fccfaeffc0b68cd19d55f6722943f929ea35ea" - integrity sha1-h/zPrv/AtozRnVX2cilD+SnqNeo= - -keccak@3.0.1, keccak@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.1.tgz#ae30a0e94dbe43414f741375cff6d64c8bea0bff" - integrity sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA== - dependencies: - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - -keccak@^1.0.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-1.4.0.tgz#572f8a6dbee8e7b3aa421550f9e6408ca2186f80" - integrity sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw== - dependencies: - bindings "^1.2.1" - inherits "^2.0.3" - nan "^2.2.1" - safe-buffer "^5.1.0" - -keccak@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-2.1.0.tgz#734ea53f2edcfd0f42cdb8d5f4c358fef052752b" - integrity sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q== - dependencies: - bindings "^1.5.0" - inherits "^2.0.4" - nan "^2.14.0" - safe-buffer "^5.2.0" - -keyv@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" - integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== - dependencies: - json-buffer "3.0.0" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0, kind-of@^5.0.2: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - -klaw-sync@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" - integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== - dependencies: - graceful-fs "^4.1.11" - -last-run@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/last-run/-/last-run-1.1.1.tgz#45b96942c17b1c79c772198259ba943bebf8ca5b" - integrity sha1-RblpQsF7HHnHchmCWbqUO+v4yls= - dependencies: - default-resolution "^2.0.0" - es6-weak-map "^2.0.1" - -lazystream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" - integrity sha1-9plf4PggOS9hOWvolGJAe7dxaOQ= - dependencies: - readable-stream "^2.0.5" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -lcid@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" - integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== - dependencies: - invert-kv "^2.0.0" - -lead@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" - integrity sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI= - dependencies: - flush-write-stream "^1.0.2" - -level-codec@^9.0.0: - version "9.0.2" - resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-9.0.2.tgz#fd60df8c64786a80d44e63423096ffead63d8cbc" - integrity sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ== - dependencies: - buffer "^5.6.0" - -level-codec@~7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-7.0.1.tgz#341f22f907ce0f16763f24bddd681e395a0fb8a7" - integrity sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ== - -level-errors@^1.0.3: - version "1.1.2" - resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.1.2.tgz#4399c2f3d3ab87d0625f7e3676e2d807deff404d" - integrity sha512-Sw/IJwWbPKF5Ai4Wz60B52yj0zYeqzObLh8k1Tk88jVmD51cJSKWSYpRyhVIvFzZdvsPqlH5wfhp/yxdsaQH4w== - dependencies: - errno "~0.1.1" - -level-errors@^2.0.0, level-errors@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-2.0.1.tgz#2132a677bf4e679ce029f517c2f17432800c05c8" - integrity sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw== - dependencies: - errno "~0.1.1" - -level-errors@~1.0.3: - version "1.0.5" - resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.0.5.tgz#83dbfb12f0b8a2516bdc9a31c4876038e227b859" - integrity sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig== - dependencies: - errno "~0.1.1" - -level-iterator-stream@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-2.0.3.tgz#ccfff7c046dcf47955ae9a86f46dfa06a31688b4" - integrity sha512-I6Heg70nfF+e5Y3/qfthJFexhRw/Gi3bIymCoXAlijZdAcLaPuWSJs3KXyTYf23ID6g0o2QF62Yh+grOXY3Rig== - dependencies: - inherits "^2.0.1" - readable-stream "^2.0.5" - xtend "^4.0.0" - -level-iterator-stream@~1.3.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz#e43b78b1a8143e6fa97a4f485eb8ea530352f2ed" - integrity sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0= - dependencies: - inherits "^2.0.1" - level-errors "^1.0.3" - readable-stream "^1.0.33" - xtend "^4.0.0" - -level-iterator-stream@~3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz#2c98a4f8820d87cdacab3132506815419077c730" - integrity sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g== - dependencies: - inherits "^2.0.1" - readable-stream "^2.3.6" - xtend "^4.0.0" - -level-mem@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/level-mem/-/level-mem-3.0.1.tgz#7ce8cf256eac40f716eb6489654726247f5a89e5" - integrity sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg== - dependencies: - level-packager "~4.0.0" - memdown "~3.0.0" - -level-packager@~4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-4.0.1.tgz#7e7d3016af005be0869bc5fa8de93d2a7f56ffe6" - integrity sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q== - dependencies: - encoding-down "~5.0.0" - levelup "^3.0.0" - -level-post@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/level-post/-/level-post-1.0.7.tgz#19ccca9441a7cc527879a0635000f06d5e8f27d0" - integrity sha512-PWYqG4Q00asOrLhX7BejSajByB4EmG2GaKHfj3h5UmmZ2duciXLPGYWIjBzLECFWUGOZWlm5B20h/n3Gs3HKew== - dependencies: - ltgt "^2.1.2" - -level-sublevel@6.6.4: - version "6.6.4" - resolved "https://registry.yarnpkg.com/level-sublevel/-/level-sublevel-6.6.4.tgz#f7844ae893919cd9d69ae19d7159499afd5352ba" - integrity sha512-pcCrTUOiO48+Kp6F1+UAzF/OtWqLcQVTVF39HLdZ3RO8XBoXt+XVPKZO1vVr1aUoxHZA9OtD2e1v7G+3S5KFDA== - dependencies: - bytewise "~1.1.0" - level-codec "^9.0.0" - level-errors "^2.0.0" - level-iterator-stream "^2.0.3" - ltgt "~2.1.1" - pull-defer "^0.2.2" - pull-level "^2.0.3" - pull-stream "^3.6.8" - typewiselite "~1.0.0" - xtend "~4.0.0" - -level-ws@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-0.0.0.tgz#372e512177924a00424b0b43aef2bb42496d228b" - integrity sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos= - dependencies: - readable-stream "~1.0.15" - xtend "~2.1.1" - -level-ws@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-1.0.0.tgz#19a22d2d4ac57b18cc7c6ecc4bd23d899d8f603b" - integrity sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q== - dependencies: - inherits "^2.0.3" - readable-stream "^2.2.8" - xtend "^4.0.1" - -levelup@3.1.1, levelup@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/levelup/-/levelup-3.1.1.tgz#c2c0b3be2b4dc316647c53b42e2f559e232d2189" - integrity sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg== - dependencies: - deferred-leveldown "~4.0.0" - level-errors "~2.0.0" - level-iterator-stream "~3.0.0" - xtend "~4.0.0" - -levelup@^1.2.1: - version "1.3.9" - resolved "https://registry.yarnpkg.com/levelup/-/levelup-1.3.9.tgz#2dbcae845b2bb2b6bea84df334c475533bbd82ab" - integrity sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ== - dependencies: - deferred-leveldown "~1.2.1" - level-codec "~7.0.0" - level-errors "~1.0.3" - level-iterator-stream "~1.3.0" - prr "~1.0.1" - semver "~5.4.1" - xtend "~4.0.0" - -libsodium-wrappers@0.7.6: - version "0.7.6" - resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.6.tgz#baed4c16d4bf9610104875ad8a8e164d259d48fb" - integrity sha512-OUO2CWW5bHdLr6hkKLHIKI4raEkZrf3QHkhXsJ1yCh6MZ3JDA7jFD3kCATNquuGSG6MjjPHQIQms0y0gBDzjQg== - dependencies: - libsodium "0.7.6" - -libsodium-wrappers@^0.7.8: - version "0.7.9" - resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.9.tgz#4ffc2b69b8f7c7c7c5594a93a4803f80f6d0f346" - integrity sha512-9HaAeBGk1nKTRFRHkt7nzxqCvnkWTjn1pdjKgcUnZxj0FyOP4CnhgFhMdrFfgNsukijBGyBLpP2m2uKT1vuWhQ== - dependencies: - libsodium "^0.7.0" - -libsodium@0.7.6: - version "0.7.6" - resolved "https://registry.yarnpkg.com/libsodium/-/libsodium-0.7.6.tgz#018b80c5728054817845fbffa554274441bda277" - integrity sha512-hPb/04sEuLcTRdWDtd+xH3RXBihpmbPCsKW/Jtf4PsvdyKh+D6z2D2gvp/5BfoxseP+0FCOg66kE+0oGUE/loQ== - -libsodium@^0.7.0: - version "0.7.9" - resolved "https://registry.yarnpkg.com/libsodium/-/libsodium-0.7.9.tgz#4bb7bcbf662ddd920d8795c227ae25bbbfa3821b" - integrity sha512-gfeADtR4D/CM0oRUviKBViMGXZDgnFdMKMzHsvBdqLBHd9ySi6EtYnmuhHVDDYgYpAO8eU8hEY+F8vIUAPh08A== - -liftoff@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-3.1.0.tgz#c9ba6081f908670607ee79062d700df062c52ed3" - integrity sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog== - dependencies: - extend "^3.0.0" - findup-sync "^3.0.0" - fined "^1.0.1" - flagged-respawn "^1.0.0" - is-plain-object "^2.0.4" - object.map "^1.0.0" - rechoir "^0.6.2" - resolve "^1.1.7" - -load-json-file@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" - integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - pinkie-promise "^2.0.0" - strip-bom "^2.0.0" - -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - -lodash@4.17.14: - version "4.17.14" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" - integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== - -lodash@4.17.20, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - -lodash@^4.17.20: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -log-symbols@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== - dependencies: - chalk "^2.4.2" - -looper@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/looper/-/looper-2.0.0.tgz#66cd0c774af3d4fedac53794f742db56da8f09ec" - integrity sha1-Zs0Md0rz1P7axTeU90LbVtqPCew= - -looper@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/looper/-/looper-3.0.0.tgz#2efa54c3b1cbaba9b94aee2e5914b0be57fbb749" - integrity sha1-LvpUw7HLq6m5Su4uWRSwvlf7t0k= - -loose-envify@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - -lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" - integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== - -lowercase-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" - integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== - -lru-cache@5.1.1, lru-cache@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" - integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== - dependencies: - yallist "^3.0.2" - -lru-cache@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-3.2.0.tgz#71789b3b7f5399bec8565dda38aa30d2a097efee" - integrity sha1-cXibO39Tmb7IVl3aOKow0qCX7+4= - dependencies: - pseudomap "^1.0.1" - -ltgt@^2.1.2, ltgt@~2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" - integrity sha1-81ypHEk/e3PaDgdJUwTxezH4fuU= - -ltgt@~2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.1.3.tgz#10851a06d9964b971178441c23c9e52698eece34" - integrity sha1-EIUaBtmWS5cReEQcI8nlJpjuzjQ= - -make-dir@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" - integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== - dependencies: - pify "^3.0.0" - -make-error@^1.1.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - -make-iterator@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6" - integrity sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw== - dependencies: - kind-of "^6.0.2" - -map-age-cleaner@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" - integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== - dependencies: - p-defer "^1.0.0" - -map-cache@^0.2.0, map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - -matchdep@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/matchdep/-/matchdep-2.0.0.tgz#c6f34834a0d8dbc3b37c27ee8bbcb27c7775582e" - integrity sha1-xvNINKDY28OzfCfui7yyfHd1WC4= - dependencies: - findup-sync "^2.0.0" - micromatch "^3.0.4" - resolve "^1.4.0" - stack-trace "0.0.10" - -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -mem@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" - integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== - dependencies: - map-age-cleaner "^0.1.1" - mimic-fn "^2.0.0" - p-is-promise "^2.0.0" - -memdown@^1.0.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/memdown/-/memdown-1.4.1.tgz#b4e4e192174664ffbae41361aa500f3119efe215" - integrity sha1-tOThkhdGZP+65BNhqlAPMRnv4hU= - dependencies: - abstract-leveldown "~2.7.1" - functional-red-black-tree "^1.0.1" - immediate "^3.2.3" - inherits "~2.0.1" - ltgt "~2.2.0" - safe-buffer "~5.1.1" - -memdown@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/memdown/-/memdown-3.0.0.tgz#93aca055d743b20efc37492e9e399784f2958309" - integrity sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA== - dependencies: - abstract-leveldown "~5.0.0" - functional-red-black-tree "~1.0.1" - immediate "~3.2.3" - inherits "~2.0.1" - ltgt "~2.2.0" - safe-buffer "~5.1.1" - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - -merkle-patricia-tree@2.3.2, merkle-patricia-tree@^2.1.2, merkle-patricia-tree@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz#982ca1b5a0fde00eed2f6aeed1f9152860b8208a" - integrity sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g== - dependencies: - async "^1.4.2" - ethereumjs-util "^5.0.0" - level-ws "0.0.0" - levelup "^1.2.1" - memdown "^1.0.0" - readable-stream "^2.0.0" - rlp "^2.0.0" - semaphore ">=1.0.1" - -merkle-patricia-tree@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz#448d85415565df72febc33ca362b8b614f5a58f8" - integrity sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ== - dependencies: - async "^2.6.1" - ethereumjs-util "^5.2.0" - level-mem "^3.0.1" - level-ws "^1.0.0" - readable-stream "^3.0.6" - rlp "^2.0.0" - semaphore ">=1.0.1" - -methods@^1.1.2, methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - -micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -micromatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" - integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== - dependencies: - braces "^3.0.1" - picomatch "^2.0.5" - -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - -mime-db@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" - integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== - -mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.27" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" - integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== - dependencies: - mime-db "1.44.0" - -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -mime@^2.4.4: - version "2.4.6" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.6.tgz#e5b407c90db442f2beb5b162373d07b69affa4d1" - integrity sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA== - -mimic-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -mimic-response@^1.0.0, mimic-response@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== - -min-document@^2.19.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" - integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU= - dependencies: - dom-walk "^0.1.0" - -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= - -minimatch@3.0.4, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.2.0, minimist@^1.2.5, minimist@~1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.2.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" - -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp-promise@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" - integrity sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE= - dependencies: - mkdirp "*" - -mkdirp@*: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - -mkdirp@0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -mkdirp@0.5.5, mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - -mocha@5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" - integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== - dependencies: - browser-stdout "1.3.1" - commander "2.15.1" - debug "3.1.0" - diff "3.5.0" - escape-string-regexp "1.0.5" - glob "7.1.2" - growl "1.10.5" - he "1.1.1" - minimatch "3.0.4" - mkdirp "0.5.1" - supports-color "5.4.0" - -mocha@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.2.0.tgz#01cc227b00d875ab1eed03a75106689cfed5a604" - integrity sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ== - dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - chokidar "3.3.0" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" - growl "1.10.5" - he "1.2.0" - js-yaml "3.13.1" - log-symbols "3.0.0" - minimatch "3.0.4" - mkdirp "0.5.5" - ms "2.1.1" - node-environment-flags "1.0.6" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" - wide-align "1.1.3" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "1.6.0" - -mock-fs@^4.1.0: - version "4.13.0" - resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.13.0.tgz#31c02263673ec3789f90eb7b6963676aa407a598" - integrity sha512-DD0vOdofJdoaRNtnWcrXe6RQbpHkPPmtqGq14uRX0F8ZKJ5nv89CVTYl/BZdppDxBDaV0hl75htg3abpEWlPZA== - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -multibase@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.7.0.tgz#1adfc1c50abe05eefeb5091ac0c2728d6b84581b" - integrity sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg== - dependencies: - base-x "^3.0.8" - buffer "^5.5.0" - -multibase@~0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.6.1.tgz#b76df6298536cc17b9f6a6db53ec88f85f8cc12b" - integrity sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw== - dependencies: - base-x "^3.0.8" - buffer "^5.5.0" - -multicodec@^0.5.5: - version "0.5.7" - resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-0.5.7.tgz#1fb3f9dd866a10a55d226e194abba2dcc1ee9ffd" - integrity sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA== - dependencies: - varint "^5.0.0" - -multicodec@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-1.0.4.tgz#46ac064657c40380c28367c90304d8ed175a714f" - integrity sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg== - dependencies: - buffer "^5.6.0" - varint "^5.0.0" - -multihashes@^0.4.15, multihashes@~0.4.15: - version "0.4.21" - resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-0.4.21.tgz#dc02d525579f334a7909ade8a122dabb58ccfcb5" - integrity sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw== - dependencies: - buffer "^5.5.0" - multibase "^0.7.0" - varint "^5.0.0" - -mute-stdout@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" - integrity sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg== - -nan@^2.0.8, nan@^2.11.0, nan@^2.12.1, nan@^2.14.0, nan@^2.2.1: - version "2.14.2" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" - integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== - -nano-json-stream-parser@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" - integrity sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18= - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - -next-tick@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" - integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= - -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - -node-addon-api@^1.7.1: - version "1.7.2" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.2.tgz#3df30b95720b53c24e59948b49532b662444f54d" - integrity sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg== - -node-addon-api@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" - integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== - -node-environment-flags@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" - integrity sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" - -node-fetch@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" - integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= - -node-fetch@~1.7.1: - version "1.7.3" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" - integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== - dependencies: - encoding "^0.1.11" - is-stream "^1.0.1" - -node-gyp-build@^4.2.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" - integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg== - -normalize-package-data@^2.3.2: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -normalize-url@^4.1.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" - integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== - -now-and-later@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.1.tgz#8e579c8685764a7cc02cb680380e94f43ccb1f7c" - integrity sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ== - dependencies: - once "^1.3.2" - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - dependencies: - path-key "^2.0.0" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -number-to-bn@1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" - integrity sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA= - dependencies: - bn.js "4.11.6" - strip-hex-prefix "1.0.0" - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -object-assign@^4, object-assign@^4.0.0, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-inspect@^1.8.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a" - integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw== - -object-inspect@~1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" - integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== - -object-is@^1.0.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.4.tgz#63d6c83c00a43f4cbc9434eb9757c8a5b8565068" - integrity sha512-1ZvAZ4wlF7IyPVOcE1Omikt7UpaFlOQq0HlSti+ZvDH3UiD2brwGMwDbyV43jao2bKJ+4+WdPJHSd7kgzKYVqg== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object-keys@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" - integrity sha1-KKaq50KN0sOpLz2V8hM13SBOAzY= - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.assign@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - -object.assign@^4.0.4, object.assign@^4.1.0, object.assign@^4.1.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" - object-keys "^1.1.1" - -object.defaults@^1.0.0, object.defaults@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf" - integrity sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8= - dependencies: - array-each "^1.0.1" - array-slice "^1.0.0" - for-own "^1.0.0" - isobject "^3.0.0" - -object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.1.tgz#0dfda8d108074d9c563e80490c883b6661091544" - integrity sha512-6DtXgZ/lIZ9hqx4GtZETobXLR/ZLaa0aqV0kzbn80Rf8Z2e/XFnhA0I7p07N2wH8bBBltr2xQPi6sbKWAY2Eng== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - -object.map@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37" - integrity sha1-z4Plncj8wK1fQlDh94s7gb2AHTc= - dependencies: - for-own "^1.0.0" - make-iterator "^1.0.0" - -object.pick@^1.2.0, object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= - dependencies: - isobject "^3.0.1" - -object.reduce@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object.reduce/-/object.reduce-1.0.1.tgz#6fe348f2ac7fa0f95ca621226599096825bb03ad" - integrity sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60= - dependencies: - for-own "^1.0.0" - make-iterator "^1.0.0" - -oboe@2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.4.tgz#20c88cdb0c15371bb04119257d4fdd34b0aa49f6" - integrity sha1-IMiM2wwVNxuwQRklfU/dNLCqSfY= - dependencies: - http-https "^1.0.0" - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -ordered-read-streams@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e" - integrity sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4= - dependencies: - readable-stream "^2.0.1" - -original-require@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/original-require/-/original-require-1.0.1.tgz#0f130471584cd33511c5ec38c8d59213f9ac5e20" - integrity sha1-DxMEcVhM0zURxew4yNWSE/msXiA= - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.0.0" - -os-locale@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" - integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== - dependencies: - execa "^1.0.0" - lcid "^2.0.0" - mem "^4.0.0" - -os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -p-cancelable@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" - integrity sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw== - -p-cancelable@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" - integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== - -p-defer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" - integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - -p-is-promise@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" - integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== - -p-limit@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - -p-timeout@^1.1.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" - integrity sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y= - dependencies: - p-finally "^1.0.0" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -parse-asn1@^5.0.0, parse-asn1@^5.1.5: - version "5.1.6" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4" - integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw== - dependencies: - asn1.js "^5.2.0" - browserify-aes "^1.0.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - safe-buffer "^5.1.1" - -parse-filepath@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" - integrity sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE= - dependencies: - is-absolute "^1.0.0" - map-cache "^0.2.0" - path-root "^0.1.1" - -parse-headers@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.3.tgz#5e8e7512383d140ba02f0c7aa9f49b4399c92515" - integrity sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA== - -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= - dependencies: - error-ex "^1.2.0" - -parse-node-version@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" - integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA== - -parse-passwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" - integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY= - -parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -patch-package@6.2.2, patch-package@^6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.2.2.tgz#71d170d650c65c26556f0d0fbbb48d92b6cc5f39" - integrity sha512-YqScVYkVcClUY0v8fF0kWOjDYopzIM8e3bj/RU1DPeEF14+dCGm6UeOYm4jvCyxqIEQ5/eJzmbWfDWnUleFNMg== - dependencies: - "@yarnpkg/lockfile" "^1.1.0" - chalk "^2.4.2" - cross-spawn "^6.0.5" - find-yarn-workspace-root "^1.2.1" - fs-extra "^7.0.1" - is-ci "^2.0.0" - klaw-sync "^6.0.0" - minimist "^1.2.0" - rimraf "^2.6.3" - semver "^5.6.0" - slash "^2.0.0" - tmp "^0.0.33" - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= - -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= - dependencies: - pinkie-promise "^2.0.0" - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - -path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - -path-root-regex@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" - integrity sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0= - -path-root@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" - integrity sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc= - dependencies: - path-root-regex "^0.1.0" - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - -path-type@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= - dependencies: - graceful-fs "^4.1.2" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -pathval@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" - integrity sha1-uULm1L3mUwBe9rcTYd74cn0GReA= - -pbkdf2@^3.0.17, pbkdf2@^3.0.3, pbkdf2@^3.0.9, pbkdf2@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.1.tgz#cb8724b0fada984596856d1a6ebafd3584654b94" - integrity sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg== - 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" - -pend@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - -picomatch@^2.0.4, picomatch@^2.0.5: - version "2.2.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" - integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== - -pify@^2.0.0, pify@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - -precond@0.2: - version "0.2.3" - resolved "https://registry.yarnpkg.com/precond/-/precond-0.2.3.tgz#aa9591bcaa24923f1e0f4849d240f47efc1075ac" - integrity sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw= - -prepend-http@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= - -prepend-http@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" - integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= - -pretty-format@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" - integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== - dependencies: - "@jest/types" "^26.6.2" - ansi-regex "^5.0.0" - ansi-styles "^4.0.0" - react-is "^17.0.1" - -pretty-hrtime@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" - integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= - -private@^0.1.6, private@^0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== - -process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -process@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= - -promise-to-callback@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/promise-to-callback/-/promise-to-callback-1.0.0.tgz#5d2a749010bfb67d963598fcd3960746a68feef7" - integrity sha1-XSp0kBC/tn2WNZj805YHRqaP7vc= - dependencies: - is-fn "^1.0.0" - set-immediate-shim "^1.0.1" - -proxy-addr@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" - integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== - dependencies: - forwarded "~0.1.2" - ipaddr.js "1.9.1" - -prr@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= - -pseudomap@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - -psl@^1.1.28: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== - -public-encrypt@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" - integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - safe-buffer "^5.1.2" - -pull-cat@^1.1.9: - version "1.1.11" - resolved "https://registry.yarnpkg.com/pull-cat/-/pull-cat-1.1.11.tgz#b642dd1255da376a706b6db4fa962f5fdb74c31b" - integrity sha1-tkLdElXaN2pwa220+pYvX9t0wxs= - -pull-defer@^0.2.2: - version "0.2.3" - resolved "https://registry.yarnpkg.com/pull-defer/-/pull-defer-0.2.3.tgz#4ee09c6d9e227bede9938db80391c3dac489d113" - integrity sha512-/An3KE7mVjZCqNhZsr22k1Tx8MACnUnHZZNPSJ0S62td8JtYr/AiRG42Vz7Syu31SoTLUzVIe61jtT/pNdjVYA== - -pull-level@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pull-level/-/pull-level-2.0.4.tgz#4822e61757c10bdcc7cf4a03af04c92734c9afac" - integrity sha512-fW6pljDeUThpq5KXwKbRG3X7Ogk3vc75d5OQU/TvXXui65ykm+Bn+fiktg+MOx2jJ85cd+sheufPL+rw9QSVZg== - dependencies: - level-post "^1.0.7" - pull-cat "^1.1.9" - pull-live "^1.0.1" - pull-pushable "^2.0.0" - pull-stream "^3.4.0" - pull-window "^2.1.4" - stream-to-pull-stream "^1.7.1" - -pull-live@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/pull-live/-/pull-live-1.0.1.tgz#a4ecee01e330155e9124bbbcf4761f21b38f51f5" - integrity sha1-pOzuAeMwFV6RJLu89HYfIbOPUfU= - dependencies: - pull-cat "^1.1.9" - pull-stream "^3.4.0" - -pull-pushable@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/pull-pushable/-/pull-pushable-2.2.0.tgz#5f2f3aed47ad86919f01b12a2e99d6f1bd776581" - integrity sha1-Xy867UethpGfAbEqLpnW8b13ZYE= - -pull-stream@^3.2.3, pull-stream@^3.4.0, pull-stream@^3.6.8: - version "3.6.14" - resolved "https://registry.yarnpkg.com/pull-stream/-/pull-stream-3.6.14.tgz#529dbd5b86131f4a5ed636fdf7f6af00781357ee" - integrity sha512-KIqdvpqHHaTUA2mCYcLG1ibEbu/LCKoJZsBWyv9lSYtPkJPBq8m3Hxa103xHi6D2thj5YXa0TqK3L3GUkwgnew== - -pull-window@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/pull-window/-/pull-window-2.1.4.tgz#fc3b86feebd1920c7ae297691e23f705f88552f0" - integrity sha1-/DuG/uvRkgx64pdpHiP3BfiFUvA= - dependencies: - looper "^2.0.0" - -pump@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" - integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pumpify@^1.3.5: - version "1.5.1" - resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" - integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== - dependencies: - duplexify "^3.6.0" - inherits "^2.0.3" - pump "^2.0.0" - -punycode@2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" - integrity sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0= - -punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== - -qs@^6.9.1: - version "6.9.4" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.4.tgz#9090b290d1f91728d3c22e54843ca44aea5ab687" - integrity sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ== - -qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -query-string@^5.0.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" - integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== - dependencies: - decode-uri-component "^0.2.0" - object-assign "^4.1.0" - strict-uri-encode "^1.0.0" - -randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.0.6, randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -randomfill@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" - integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== - dependencies: - randombytes "^2.0.5" - safe-buffer "^5.1.0" - -range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== - dependencies: - bytes "3.1.0" - http-errors "1.7.2" - iconv-lite "0.4.24" - unpipe "1.0.0" - -react-is@^17.0.1: - version "17.0.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339" - integrity sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA== - -read-pkg-up@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= - dependencies: - find-up "^1.0.0" - read-pkg "^1.0.0" - -read-pkg@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= - dependencies: - load-json-file "^1.0.0" - normalize-package-data "^2.3.2" - path-type "^1.0.0" - -readable-stream@^1.0.33: - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.2.8, readable-stream@^2.2.9, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@^3.0.6, readable-stream@^3.4.0, readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readable-stream@~1.0.15: - version "1.0.34" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" - integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readdirp@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - -readdirp@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.2.0.tgz#c30c33352b12c96dfb4b895421a49fd5a9593839" - integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ== - dependencies: - picomatch "^2.0.4" - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= - dependencies: - resolve "^1.1.6" - -regenerate@^1.2.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" - integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== - -regenerator-runtime@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== - -regenerator-transform@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" - integrity sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q== - dependencies: - babel-runtime "^6.18.0" - babel-types "^6.19.0" - private "^0.1.6" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -regexp.prototype.flags@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" - integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - -regexpu-core@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" - integrity sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA= - dependencies: - regenerate "^1.2.1" - regjsgen "^0.2.0" - regjsparser "^0.1.4" - -regjsgen@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" - integrity sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc= - -regjsparser@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" - integrity sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw= - dependencies: - jsesc "~0.5.0" - -remove-bom-buffer@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" - integrity sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ== - dependencies: - is-buffer "^1.1.5" - is-utf8 "^0.2.1" - -remove-bom-stream@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz#05f1a593f16e42e1fb90ebf59de8e569525f9523" - integrity sha1-BfGlk/FuQuH7kOv1nejlaVJflSM= - dependencies: - remove-bom-buffer "^3.0.0" - safe-buffer "^5.1.0" - through2 "^2.0.3" - -remove-trailing-separator@^1.0.1, remove-trailing-separator@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= - dependencies: - is-finite "^1.0.0" - -replace-ext@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.1.tgz#2d6d996d04a15855d967443631dd5f77825b016a" - integrity sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw== - -replace-homedir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/replace-homedir/-/replace-homedir-1.0.0.tgz#e87f6d513b928dde808260c12be7fec6ff6e798c" - integrity sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw= - dependencies: - homedir-polyfill "^1.0.1" - is-absolute "^1.0.0" - remove-trailing-separator "^1.1.0" - -request@^2.79.0, request@^2.85.0: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= - -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - -resolve-dir@^1.0.0, resolve-dir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" - integrity sha1-eaQGRMNivoLybv/nOcm7U4IEb0M= - dependencies: - expand-tilde "^2.0.0" - global-modules "^1.0.0" - -resolve-options@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131" - integrity sha1-MrueOcBtZzONyTeMDW1gdFZq0TE= - dependencies: - value-or-function "^3.0.0" - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.4.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" - integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== - dependencies: - is-core-module "^2.1.0" - path-parse "^1.0.6" - -resolve@~1.17.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" - integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== - dependencies: - path-parse "^1.0.6" - -responselike@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" - integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= - dependencies: - lowercase-keys "^1.0.0" - -resumer@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" - integrity sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k= - dependencies: - through "~2.3.4" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -rimraf@^2.6.3: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" - -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - -rlp@^2.0.0, rlp@^2.2.1, rlp@^2.2.2, rlp@^2.2.3, rlp@^2.2.4: - version "2.2.6" - resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.6.tgz#c80ba6266ac7a483ef1e69e8e2f056656de2fb2c" - integrity sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg== - dependencies: - bn.js "^4.11.1" - -rustbn.js@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" - integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== - -rx-sandbox@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/rx-sandbox/-/rx-sandbox-1.0.4.tgz#821a1d64e5f0d88658da7a5dbbd735b13277648b" - integrity sha512-+/9MHDYNoF9ca/2RR+L2LloXXeQyIR3k/wjK03IicrxxlbkhmKF4ejPiWeafMWDg7otF+pnX5NE/8v/rX6ICJA== - dependencies: - expect "^26.6.1" - jest-matcher-utils "^26.6.1" - -rxjs@^6.6.3: - version "6.6.6" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.6.tgz#14d8417aa5a07c5e633995b525e1e3c0dec03b70" - integrity sha512-/oTwee4N4iWzAMAL9xdGKjkEHmIwupR3oXbQjCKywF1BeFohswF3vZdogbmEF6pZkOsXTzWkrZszrWpQTByYVg== - dependencies: - tslib "^1.9.0" - -safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-event-emitter@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz#5b692ef22329ed8f69fdce607e50ca734f6f20af" - integrity sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg== - dependencies: - events "^3.0.0" - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -scrypt-js@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.3.tgz#bb0040be03043da9a012a2cea9fc9f852cfc87d4" - integrity sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q= - -scrypt-js@^3.0.0, scrypt-js@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" - integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== - -scrypt.js@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/scrypt.js/-/scrypt.js-0.3.0.tgz#6c62d61728ad533c8c376a2e5e3e86d41a95c4c0" - integrity sha512-42LTc1nyFsyv/o0gcHtDztrn+aqpkaCNt5Qh7ATBZfhEZU7IC/0oT/qbBH+uRNoAPvs2fwiOId68FDEoSRA8/A== - dependencies: - scryptsy "^1.2.1" - optionalDependencies: - scrypt "^6.0.2" - -scrypt@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/scrypt/-/scrypt-6.0.3.tgz#04e014a5682b53fa50c2d5cce167d719c06d870d" - integrity sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0= - dependencies: - nan "^2.0.8" - -scryptsy@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-1.2.1.tgz#a3225fa4b2524f802700761e2855bdf3b2d92163" - integrity sha1-oyJfpLJST4AnAHYeKFW987LZIWM= - dependencies: - pbkdf2 "^3.0.3" - -scryptsy@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-2.1.0.tgz#8d1e8d0c025b58fdd25b6fa9a0dc905ee8faa790" - integrity sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w== - -secp256k1@^3.0.1: - version "3.8.0" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.8.0.tgz#28f59f4b01dbee9575f56a47034b7d2e3b3b352d" - integrity sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw== - dependencies: - bindings "^1.5.0" - bip66 "^1.1.5" - bn.js "^4.11.8" - create-hash "^1.2.0" - drbg.js "^1.0.1" - elliptic "^6.5.2" - nan "^2.14.0" - safe-buffer "^5.1.2" - -secp256k1@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" - integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== - dependencies: - elliptic "^6.5.2" - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - -seedrandom@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.1.tgz#eb3dde015bcf55df05a233514e5df44ef9dce083" - integrity sha512-1/02Y/rUeU1CJBAGLebiC5Lbo5FnB22gQbIFFYTLkwvp1xdABZJH1sn4ZT1MzXmPpzv+Rf/Lu2NcsLJiK4rcDg== - -seek-bzip@^1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.6.tgz#35c4171f55a680916b52a07859ecf3b5857f21c4" - integrity sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ== - dependencies: - commander "^2.8.1" - -semaphore@>=1.0.1, semaphore@^1.0.3, semaphore@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa" - integrity sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA== - -semver-greatest-satisfied-range@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz#13e8c2658ab9691cb0cd71093240280d36f77a5b" - integrity sha1-E+jCZYq5aRywzXEJMkAoDTb3els= - dependencies: - sver-compat "^1.5.0" - -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@~5.4.1: - version "5.4.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" - integrity sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg== - -send@0.17.1: - version "0.17.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" - integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== - dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.7.2" - mime "1.6.0" - ms "2.1.1" - on-finished "~2.3.0" - range-parser "~1.2.1" - statuses "~1.5.0" - -serve-static@1.14.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" - integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.17.1" - -servify@^0.1.12: - version "0.1.12" - resolved "https://registry.yarnpkg.com/servify/-/servify-0.1.12.tgz#142ab7bee1f1d033b66d0707086085b17c06db95" - integrity sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw== - dependencies: - body-parser "^1.16.0" - cors "^2.8.1" - express "^4.14.0" - request "^2.79.0" - xhr "^2.3.3" - -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -set-immediate-shim@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" - integrity sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E= - -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setimmediate@1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" - integrity sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48= - -setimmediate@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= - -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - -signal-exit@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== - -simple-concat@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" - integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== - -simple-get@^2.7.0: - version "2.8.1" - resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d" - integrity sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw== - dependencies: - decompress-response "^3.3.0" - once "^1.3.1" - simple-concat "^1.0.0" - -slash@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= - -slash@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" - integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-support@0.5.12: - version "0.5.12" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" - integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-support@^0.4.15: - version "0.4.18" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== - dependencies: - source-map "^0.5.6" - -source-map-support@^0.5.17: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= - -source-map@^0.5.6, source-map@^0.5.7: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -sparkles@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.1.tgz#008db65edce6c50eec0c5e228e1945061dd0437c" - integrity sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw== - -spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.7" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz#e9c18a410e5ed7e12442a549fbd8afa767038d65" - integrity sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -stack-trace@0.0.10: - version "0.0.10" - resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" - integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= - -stack-utils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.3.tgz#cd5f030126ff116b78ccb3c027fe302713b61277" - integrity sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw== - dependencies: - escape-string-regexp "^2.0.0" - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -"statuses@>= 1.5.0 < 2", statuses@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -stream-exhaust@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" - integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== - -stream-shift@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" - integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== - -stream-to-pull-stream@^1.7.1: - version "1.7.3" - resolved "https://registry.yarnpkg.com/stream-to-pull-stream/-/stream-to-pull-stream-1.7.3.tgz#4161aa2d2eb9964de60bfa1af7feaf917e874ece" - integrity sha512-6sNyqJpr5dIOQdgNy/xcDWwDuzAsAwVzhzrWlAPAQ7Lkjx/rv0wgvxEyKwTq6FmNd5rjTrELt/CLmaSw7crMGg== - dependencies: - looper "^3.0.0" - pull-stream "^3.2.3" - -strict-uri-encode@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= - -string-width@^1.0.1, string-width@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^3.0.0, string-width@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - -string.prototype.trim@~1.2.1: - version "1.2.3" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.3.tgz#d23a22fde01c1e6571a7fadcb9be11decd8061a7" - integrity sha512-16IL9pIBA5asNOSukPfxX2W68BaBvxyiRK16H3RA/lWW9BDosh+w7f+LhomPHpXJ82QEe7w7/rY/S1CV97raLg== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - -string.prototype.trimend@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz#a22bd53cca5c7cf44d7c9d5c732118873d6cd18b" - integrity sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - -string.prototype.trimstart@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz#9b4cb590e123bb36564401d59824298de50fd5aa" - integrity sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= - dependencies: - is-utf8 "^0.2.0" - -strip-dirs@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5" - integrity sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g== - dependencies: - is-natural-number "^4.0.1" - -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= - -strip-hex-prefix@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" - integrity sha1-DF8VX+8RUTczd96du1iNoFUA428= - dependencies: - is-hex-prefixed "1.0.0" - -strip-json-comments@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -superagent@5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/superagent/-/superagent-5.2.2.tgz#6ff726c5642795b2c27009e92687c8e69a6bb07d" - integrity sha512-pMWBUnIllK4ZTw7p/UaobiQPwAO5w/1NRRTDpV0FTVNmECztsxKspj3ZWEordVEaqpZtmOQJJna4yTLyC/q7PQ== - dependencies: - component-emitter "^1.3.0" - cookiejar "^2.1.2" - debug "^4.1.1" - fast-safe-stringify "^2.0.7" - form-data "^3.0.0" - formidable "^1.2.1" - methods "^1.1.2" - mime "^2.4.4" - qs "^6.9.1" - readable-stream "^3.4.0" - semver "^6.3.0" - -supports-color@5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" - integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== - dependencies: - has-flag "^3.0.0" - -supports-color@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" - integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== - dependencies: - has-flag "^3.0.0" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -sver-compat@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/sver-compat/-/sver-compat-1.5.0.tgz#3cf87dfeb4d07b4a3f14827bc186b3fd0c645cd8" - integrity sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg= - dependencies: - es6-iterator "^2.0.1" - es6-symbol "^3.1.1" - -swarm-js@0.1.39: - version "0.1.39" - resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.39.tgz#79becb07f291d4b2a178c50fee7aa6e10342c0e8" - integrity sha512-QLMqL2rzF6n5s50BptyD6Oi0R1aWlJC5Y17SRIVXRj6OR1DRIPM7nepvrxxkjA1zNzFz6mUOMjfeqeDaWB7OOg== - dependencies: - bluebird "^3.5.0" - buffer "^5.0.5" - decompress "^4.0.0" - eth-lib "^0.1.26" - fs-extra "^4.0.2" - got "^7.1.0" - mime-types "^2.1.16" - mkdirp-promise "^5.0.1" - mock-fs "^4.1.0" - setimmediate "^1.0.5" - tar "^4.0.2" - xhr-request-promise "^0.1.2" - -swarm-js@^0.1.40: - version "0.1.40" - resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.40.tgz#b1bc7b6dcc76061f6c772203e004c11997e06b99" - integrity sha512-yqiOCEoA4/IShXkY3WKwP5PvZhmoOOD8clsKA7EEcRILMkTEYHCQ21HDCAcVpmIxZq4LyZvWeRJ6quIyHk1caA== - dependencies: - bluebird "^3.5.0" - buffer "^5.0.5" - eth-lib "^0.1.26" - fs-extra "^4.0.2" - got "^7.1.0" - mime-types "^2.1.16" - mkdirp-promise "^5.0.1" - mock-fs "^4.1.0" - setimmediate "^1.0.5" - tar "^4.0.2" - xhr-request "^1.0.1" - -tape@^4.6.3: - version "4.13.3" - resolved "https://registry.yarnpkg.com/tape/-/tape-4.13.3.tgz#51b3d91c83668c7a45b1a594b607dee0a0b46278" - integrity sha512-0/Y20PwRIUkQcTCSi4AASs+OANZZwqPKaipGCEwp10dQMipVvSZwUUCi01Y/OklIGyHKFhIcjock+DKnBfLAFw== - dependencies: - deep-equal "~1.1.1" - defined "~1.0.0" - dotignore "~0.1.2" - for-each "~0.3.3" - function-bind "~1.1.1" - glob "~7.1.6" - has "~1.0.3" - inherits "~2.0.4" - is-regex "~1.0.5" - minimist "~1.2.5" - object-inspect "~1.7.0" - resolve "~1.17.0" - resumer "~0.0.0" - string.prototype.trim "~1.2.1" - through "~2.3.8" - -tar-stream@^1.5.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" - integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A== - dependencies: - bl "^1.0.0" - buffer-alloc "^1.2.0" - end-of-stream "^1.0.0" - fs-constants "^1.0.0" - readable-stream "^2.3.0" - to-buffer "^1.1.1" - xtend "^4.0.0" - -tar@^4.0.2: - version "4.4.13" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" - integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.8.6" - minizlib "^1.2.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.3" - -through2-filter@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-3.0.0.tgz#700e786df2367c2c88cd8aa5be4cf9c1e7831254" - integrity sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA== - dependencies: - through2 "~2.0.0" - xtend "~4.0.0" - -through2@^2.0.0, through2@^2.0.3, through2@~2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" - integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== - dependencies: - readable-stream "~2.3.6" - xtend "~4.0.1" - -through@^2.3.8, through@~2.3.4, through@~2.3.8: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -time-stamp@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" - integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= - -timed-out@^4.0.0, timed-out@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= - -tmp@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.1.0.tgz#ee434a4e22543082e294ba6201dcc6eafefa2877" - integrity sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw== - dependencies: - rimraf "^2.6.3" - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -to-absolute-glob@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz#1865f43d9e74b0822db9f145b78cff7d0f7c849b" - integrity sha1-GGX0PZ50sIItufFFt4z/fQ98hJs= - dependencies: - is-absolute "^1.0.0" - is-negated-glob "^1.0.0" - -to-buffer@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" - integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== - -to-fast-properties@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-readable-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" - integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -to-through@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-through/-/to-through-2.0.0.tgz#fc92adaba072647bc0b67d6b03664aa195093af6" - integrity sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY= - dependencies: - through2 "^2.0.3" - -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= - -truffle@5.5.0-tezos.4: - version "5.5.0-tezos.4" - resolved "https://registry.yarnpkg.com/truffle/-/truffle-5.5.0-tezos.4.tgz#a17407042073cfd5cede159ea4cbd82b503c6c94" - integrity sha512-ZaGStwL90B+oW9aWSvhEfYMZhtmadjKeL2zu8X5biPJKEG2J/xOWgz2l+9OXdSQh3+ILLWrPpohGNoQ+yygouw== - dependencies: - app-module-path "^2.2.0" - ganache-core "^2.11.0-tezos.2" - mocha "5.2.0" - original-require "1.0.1" - -ts-node@^9.0.0: - version "9.1.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.1.1.tgz#51a9a450a3e959401bda5f004a72d54b936d376d" - integrity sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg== - dependencies: - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - source-map-support "^0.5.17" - yn "3.1.1" - -tslib@^1.9.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tweetnacl-util@^0.15.0: - version "0.15.1" - resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" - integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - -tweetnacl@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - -type-detect@^4.0.0, type-detect@^4.0.5: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -type-is@~1.6.17, type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -type@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" - integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== - -type@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/type/-/type-2.1.0.tgz#9bdc22c648cf8cf86dd23d32336a41cfb6475e3f" - integrity sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA== - -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= - -typescript@^4.0.3: - version "4.1.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.2.tgz#6369ef22516fe5e10304aae5a5c4862db55380e9" - integrity sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ== - -typewise-core@^1.2, typewise-core@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/typewise-core/-/typewise-core-1.2.0.tgz#97eb91805c7f55d2f941748fa50d315d991ef195" - integrity sha1-l+uRgFx/VdL5QXSPpQ0xXZke8ZU= - -typewise@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/typewise/-/typewise-1.0.3.tgz#1067936540af97937cc5dcf9922486e9fa284651" - integrity sha1-EGeTZUCvl5N8xdz5kiSG6fooRlE= - dependencies: - typewise-core "^1.2.0" - -typewiselite@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/typewiselite/-/typewiselite-1.0.0.tgz#c8882fa1bb1092c06005a97f34ef5c8508e3664e" - integrity sha1-yIgvobsQksBgBal/NO9chQjjZk4= - -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== - -unbzip2-stream@^1.0.9: - version "1.4.3" - resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz#b0da04c4371311df771cdc215e87f2130991ace7" - integrity sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg== - dependencies: - buffer "^5.2.1" - through "^2.3.8" - -unc-path-regex@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" - integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= - -underscore@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" - integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== - -undertaker-registry@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50" - integrity sha1-XkvaMI5KiirlhPm5pDWaSZglzFA= - -undertaker@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/undertaker/-/undertaker-1.3.0.tgz#363a6e541f27954d5791d6fa3c1d321666f86d18" - integrity sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg== - dependencies: - arr-flatten "^1.0.1" - arr-map "^2.0.0" - bach "^1.0.0" - collection-map "^1.0.0" - es6-weak-map "^2.0.1" - fast-levenshtein "^1.0.0" - last-run "^1.1.0" - object.defaults "^1.0.0" - object.reduce "^1.0.0" - undertaker-registry "^1.0.0" - -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - -unique-stream@^2.0.2: - version "2.3.1" - resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.3.1.tgz#c65d110e9a4adf9a6c5948b28053d9a8d04cbeac" - integrity sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A== - dependencies: - json-stable-stringify-without-jsonify "^1.0.1" - through2-filter "^3.0.0" - -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -unorm@^1.3.3: - version "1.6.0" - resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.6.0.tgz#029b289661fba714f1a9af439eb51d9b16c205af" - integrity sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA== - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -upath@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" - integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== - -uri-js@^4.2.2: - version "4.4.0" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.0.tgz#aa714261de793e8a82347a7bcc9ce74e86f28602" - integrity sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g== - dependencies: - punycode "^2.1.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -url-parse-lax@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= - dependencies: - prepend-http "^1.0.1" - -url-parse-lax@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" - integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= - dependencies: - prepend-http "^2.0.0" - -url-set-query@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" - integrity sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk= - -url-to-options@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" - integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k= - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -utf-8-validate@^5.0.2: - version "5.0.3" - resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.3.tgz#3b64e418ad2ff829809025fdfef595eab2f03a27" - integrity sha512-jtJM6fpGv8C1SoH4PtG22pGto6x+Y8uPprW0tw3//gGFhDDTiuksgradgFN6yRayDP4SyZZa6ZMGHLIa17+M8A== - dependencies: - node-gyp-build "^4.2.0" - -utf8@3.0.0, utf8@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" - integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -util.promisify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.1.tgz#6baf7774b80eeb0f7520d8b81d07982a59abbaee" - integrity sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.2" - has-symbols "^1.0.1" - object.getownpropertydescriptors "^2.1.0" - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -uuid@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" - integrity sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w= - -uuid@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== - -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - -v8flags@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.2.0.tgz#b243e3b4dfd731fa774e7492128109a0fe66d656" - integrity sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg== - dependencies: - homedir-polyfill "^1.0.1" - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -value-or-function@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/value-or-function/-/value-or-function-3.0.0.tgz#1c243a50b595c1be54a754bfece8563b9ff8d813" - integrity sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM= - -varint@^5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" - integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== - -vary@^1, vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -vinyl-fs@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-3.0.3.tgz#c85849405f67428feabbbd5c5dbdd64f47d31bc7" - integrity sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng== - dependencies: - fs-mkdirp-stream "^1.0.0" - glob-stream "^6.1.0" - graceful-fs "^4.0.0" - is-valid-glob "^1.0.0" - lazystream "^1.0.0" - lead "^1.0.0" - object.assign "^4.0.4" - pumpify "^1.3.5" - readable-stream "^2.3.3" - remove-bom-buffer "^3.0.0" - remove-bom-stream "^1.2.0" - resolve-options "^1.1.0" - through2 "^2.0.0" - to-through "^2.0.0" - value-or-function "^3.0.0" - vinyl "^2.0.0" - vinyl-sourcemap "^1.1.0" - -vinyl-sourcemap@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz#92a800593a38703a8cdb11d8b300ad4be63b3e16" - integrity sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY= - dependencies: - append-buffer "^1.0.2" - convert-source-map "^1.5.0" - graceful-fs "^4.1.6" - normalize-path "^2.1.1" - now-and-later "^2.0.0" - remove-bom-buffer "^3.0.0" - vinyl "^2.0.0" - -vinyl@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.2.1.tgz#23cfb8bbab5ece3803aa2c0a1eb28af7cbba1974" - integrity sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw== - dependencies: - clone "^2.1.1" - clone-buffer "^1.0.0" - clone-stats "^1.0.0" - cloneable-readable "^1.0.0" - remove-trailing-separator "^1.0.1" - replace-ext "^1.0.0" - -web3-bzz@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.2.11.tgz#41bc19a77444bd5365744596d778b811880f707f" - integrity sha512-XGpWUEElGypBjeFyUhTkiPXFbDVD6Nr/S5jznE3t8cWUA0FxRf1n3n/NuIZeb0H9RkN2Ctd/jNma/k8XGa3YKg== - dependencies: - "@types/node" "^12.12.6" - got "9.6.0" - swarm-js "^0.1.40" - underscore "1.9.1" - -web3-bzz@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.2.4.tgz#a4adb7a8cba3d260de649bdb1f14ed359bfb3821" - integrity sha512-MqhAo/+0iQSMBtt3/QI1rU83uvF08sYq8r25+OUZ+4VtihnYsmkkca+rdU0QbRyrXY2/yGIpI46PFdh0khD53A== - dependencies: - "@types/node" "^10.12.18" - got "9.6.0" - swarm-js "0.1.39" - underscore "1.9.1" - -web3-core-helpers@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.2.11.tgz#84c681ed0b942c0203f3b324a245a127e8c67a99" - integrity sha512-PEPoAoZd5ME7UfbnCZBdzIerpe74GEvlwT4AjOmHeCVZoIFk7EqvOZDejJHt+feJA6kMVTdd0xzRNN295UhC1A== - dependencies: - underscore "1.9.1" - web3-eth-iban "1.2.11" - web3-utils "1.2.11" - -web3-core-helpers@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.2.4.tgz#ffd425861f4d66b3f38df032afdb39ea0971fc0f" - integrity sha512-U7wbsK8IbZvF3B7S+QMSNP0tni/6VipnJkB0tZVEpHEIV2WWeBHYmZDnULWcsS/x/jn9yKhJlXIxWGsEAMkjiw== - dependencies: - underscore "1.9.1" - web3-eth-iban "1.2.4" - web3-utils "1.2.4" - -web3-core-method@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.2.11.tgz#f880137d1507a0124912bf052534f168b8d8fbb6" - integrity sha512-ff0q76Cde94HAxLDZ6DbdmKniYCQVtvuaYh+rtOUMB6kssa5FX0q3vPmixi7NPooFnbKmmZCM6NvXg4IreTPIw== - dependencies: - "@ethersproject/transactions" "^5.0.0-beta.135" - underscore "1.9.1" - web3-core-helpers "1.2.11" - web3-core-promievent "1.2.11" - web3-core-subscriptions "1.2.11" - web3-utils "1.2.11" - -web3-core-method@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.2.4.tgz#a0fbc50b8ff5fd214021435cc2c6d1e115807aed" - integrity sha512-8p9kpL7di2qOVPWgcM08kb+yKom0rxRCMv6m/K+H+yLSxev9TgMbCgMSbPWAHlyiF3SJHw7APFKahK5Z+8XT5A== - dependencies: - underscore "1.9.1" - web3-core-helpers "1.2.4" - web3-core-promievent "1.2.4" - web3-core-subscriptions "1.2.4" - web3-utils "1.2.4" - -web3-core-promievent@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.11.tgz#51fe97ca0ddec2f99bf8c3306a7a8e4b094ea3cf" - integrity sha512-il4McoDa/Ox9Agh4kyfQ8Ak/9ABYpnF8poBLL33R/EnxLsJOGQG2nZhkJa3I067hocrPSjEdlPt/0bHXsln4qA== - dependencies: - eventemitter3 "4.0.4" - -web3-core-promievent@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.4.tgz#75e5c0f2940028722cdd21ba503ebd65272df6cb" - integrity sha512-gEUlm27DewUsfUgC3T8AxkKi8Ecx+e+ZCaunB7X4Qk3i9F4C+5PSMGguolrShZ7Zb6717k79Y86f3A00O0VAZw== - dependencies: - any-promise "1.3.0" - eventemitter3 "3.1.2" - -web3-core-requestmanager@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.2.11.tgz#fe6eb603fbaee18530293a91f8cf26d8ae28c45a" - integrity sha512-oFhBtLfOiIbmfl6T6gYjjj9igOvtyxJ+fjS+byRxiwFJyJ5BQOz4/9/17gWR1Cq74paTlI7vDGxYfuvfE/mKvA== - dependencies: - underscore "1.9.1" - web3-core-helpers "1.2.11" - web3-providers-http "1.2.11" - web3-providers-ipc "1.2.11" - web3-providers-ws "1.2.11" - -web3-core-requestmanager@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.2.4.tgz#0a7020a23fb91c6913c611dfd3d8c398d1e4b4a8" - integrity sha512-eZJDjyNTDtmSmzd3S488nR/SMJtNnn/GuwxnMh3AzYCqG3ZMfOylqTad2eYJPvc2PM5/Gj1wAMQcRpwOjjLuPg== - dependencies: - underscore "1.9.1" - web3-core-helpers "1.2.4" - web3-providers-http "1.2.4" - web3-providers-ipc "1.2.4" - web3-providers-ws "1.2.4" - -web3-core-subscriptions@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.2.11.tgz#beca908fbfcb050c16f45f3f0f4c205e8505accd" - integrity sha512-qEF/OVqkCvQ7MPs1JylIZCZkin0aKK9lDxpAtQ1F8niEDGFqn7DT8E/vzbIa0GsOjL2fZjDhWJsaW+BSoAW1gg== - dependencies: - eventemitter3 "4.0.4" - underscore "1.9.1" - web3-core-helpers "1.2.11" - -web3-core-subscriptions@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.2.4.tgz#0dc095b5cfd82baa527a39796e3515a846b21b99" - integrity sha512-3D607J2M8ymY9V+/WZq4MLlBulwCkwEjjC2U+cXqgVO1rCyVqbxZNCmHyNYHjDDCxSEbks9Ju5xqJxDSxnyXEw== - dependencies: - eventemitter3 "3.1.2" - underscore "1.9.1" - web3-core-helpers "1.2.4" - -web3-core@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.2.11.tgz#1043cacc1becb80638453cc5b2a14be9050288a7" - integrity sha512-CN7MEYOY5ryo5iVleIWRE3a3cZqVaLlIbIzDPsvQRUfzYnvzZQRZBm9Mq+ttDi2STOOzc1MKylspz/o3yq/LjQ== - dependencies: - "@types/bn.js" "^4.11.5" - "@types/node" "^12.12.6" - bignumber.js "^9.0.0" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-core-requestmanager "1.2.11" - web3-utils "1.2.11" - -web3-core@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.2.4.tgz#2df13b978dcfc59c2abaa887d27f88f21ad9a9d6" - integrity sha512-CHc27sMuET2cs1IKrkz7xzmTdMfZpYswe7f0HcuyneTwS1yTlTnHyqjAaTy0ZygAb/x4iaVox+Gvr4oSAqSI+A== - dependencies: - "@types/bignumber.js" "^5.0.0" - "@types/bn.js" "^4.11.4" - "@types/node" "^12.6.1" - web3-core-helpers "1.2.4" - web3-core-method "1.2.4" - web3-core-requestmanager "1.2.4" - web3-utils "1.2.4" - -web3-eth-abi@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.11.tgz#a887494e5d447c2926d557a3834edd66e17af9b0" - integrity sha512-PkRYc0+MjuLSgg03QVWqWlQivJqRwKItKtEpRUaxUAeLE7i/uU39gmzm2keHGcQXo3POXAbOnMqkDvOep89Crg== - dependencies: - "@ethersproject/abi" "5.0.0-beta.153" - underscore "1.9.1" - web3-utils "1.2.11" - -web3-eth-abi@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.4.tgz#5b73e5ef70b03999227066d5d1310b168845e2b8" - integrity sha512-8eLIY4xZKoU3DSVu1pORluAw9Ru0/v4CGdw5so31nn+7fR8zgHMgwbFe0aOqWQ5VU42PzMMXeIJwt4AEi2buFg== - dependencies: - ethers "4.0.0-beta.3" - underscore "1.9.1" - web3-utils "1.2.4" - -web3-eth-accounts@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.11.tgz#a9e3044da442d31903a7ce035a86d8fa33f90520" - integrity sha512-6FwPqEpCfKIh3nSSGeo3uBm2iFSnFJDfwL3oS9pyegRBXNsGRVpgiW63yhNzL0796StsvjHWwQnQHsZNxWAkGw== - dependencies: - crypto-browserify "3.12.0" - eth-lib "0.2.8" - ethereumjs-common "^1.3.2" - ethereumjs-tx "^2.1.1" - scrypt-js "^3.0.1" - underscore "1.9.1" - uuid "3.3.2" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-utils "1.2.11" - -web3-eth-accounts@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.4.tgz#ada6edc49542354328a85cafab067acd7f88c288" - integrity sha512-04LzT/UtWmRFmi4hHRewP5Zz43fWhuHiK5XimP86sUQodk/ByOkXQ3RoXyGXFMNoRxdcAeRNxSfA2DpIBc9xUw== - dependencies: - "@web3-js/scrypt-shim" "^0.1.0" - any-promise "1.3.0" - crypto-browserify "3.12.0" - eth-lib "0.2.7" - ethereumjs-common "^1.3.2" - ethereumjs-tx "^2.1.1" - underscore "1.9.1" - uuid "3.3.2" - web3-core "1.2.4" - web3-core-helpers "1.2.4" - web3-core-method "1.2.4" - web3-utils "1.2.4" - -web3-eth-contract@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.2.11.tgz#917065902bc27ce89da9a1da26e62ef663663b90" - integrity sha512-MzYuI/Rq2o6gn7vCGcnQgco63isPNK5lMAan2E51AJLknjSLnOxwNY3gM8BcKoy4Z+v5Dv00a03Xuk78JowFow== - dependencies: - "@types/bn.js" "^4.11.5" - underscore "1.9.1" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-core-promievent "1.2.11" - web3-core-subscriptions "1.2.11" - web3-eth-abi "1.2.11" - web3-utils "1.2.11" - -web3-eth-contract@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.2.4.tgz#68ef7cc633232779b0a2c506a810fbe903575886" - integrity sha512-b/9zC0qjVetEYnzRA1oZ8gF1OSSUkwSYi5LGr4GeckLkzXP7osEnp9lkO/AQcE4GpG+l+STnKPnASXJGZPgBRQ== - dependencies: - "@types/bn.js" "^4.11.4" - underscore "1.9.1" - web3-core "1.2.4" - web3-core-helpers "1.2.4" - web3-core-method "1.2.4" - web3-core-promievent "1.2.4" - web3-core-subscriptions "1.2.4" - web3-eth-abi "1.2.4" - web3-utils "1.2.4" - -web3-eth-ens@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.2.11.tgz#26d4d7f16d6cbcfff918e39832b939edc3162532" - integrity sha512-dbW7dXP6HqT1EAPvnniZVnmw6TmQEKF6/1KgAxbo8iBBYrVTMDGFQUUnZ+C4VETGrwwaqtX4L9d/FrQhZ6SUiA== - dependencies: - content-hash "^2.5.2" - eth-ens-namehash "2.0.8" - underscore "1.9.1" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-promievent "1.2.11" - web3-eth-abi "1.2.11" - web3-eth-contract "1.2.11" - web3-utils "1.2.11" - -web3-eth-ens@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.2.4.tgz#b95b3aa99fb1e35c802b9e02a44c3046a3fa065e" - integrity sha512-g8+JxnZlhdsCzCS38Zm6R/ngXhXzvc3h7bXlxgKU4coTzLLoMpgOAEz71GxyIJinWTFbLXk/WjNY0dazi9NwVw== - dependencies: - eth-ens-namehash "2.0.8" - underscore "1.9.1" - web3-core "1.2.4" - web3-core-helpers "1.2.4" - web3-core-promievent "1.2.4" - web3-eth-abi "1.2.4" - web3-eth-contract "1.2.4" - web3-utils "1.2.4" - -web3-eth-iban@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.2.11.tgz#f5f73298305bc7392e2f188bf38a7362b42144ef" - integrity sha512-ozuVlZ5jwFC2hJY4+fH9pIcuH1xP0HEFhtWsR69u9uDIANHLPQQtWYmdj7xQ3p2YT4bQLq/axKhZi7EZVetmxQ== - dependencies: - bn.js "^4.11.9" - web3-utils "1.2.11" - -web3-eth-iban@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.2.4.tgz#8e0550fd3fd8e47a39357d87fe27dee9483ee476" - integrity sha512-D9HIyctru/FLRpXakRwmwdjb5bWU2O6UE/3AXvRm6DCOf2e+7Ve11qQrPtaubHfpdW3KWjDKvlxV9iaFv/oTMQ== - dependencies: - bn.js "4.11.8" - web3-utils "1.2.4" - -web3-eth-personal@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.2.11.tgz#a38b3942a1d87a62070ce0622a941553c3d5aa70" - integrity sha512-42IzUtKq9iHZ8K9VN0vAI50iSU9tOA1V7XU2BhF/tb7We2iKBVdkley2fg26TxlOcKNEHm7o6HRtiiFsVK4Ifw== - dependencies: - "@types/node" "^12.12.6" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-net "1.2.11" - web3-utils "1.2.11" - -web3-eth-personal@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.2.4.tgz#3224cca6851c96347d9799b12c1b67b2a6eb232b" - integrity sha512-5Russ7ZECwHaZXcN3DLuLS7390Vzgrzepl4D87SD6Sn1DHsCZtvfdPIYwoTmKNp69LG3mORl7U23Ga5YxqkICw== - dependencies: - "@types/node" "^12.6.1" - web3-core "1.2.4" - web3-core-helpers "1.2.4" - web3-core-method "1.2.4" - web3-net "1.2.4" - web3-utils "1.2.4" - -web3-eth@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.2.11.tgz#4c81fcb6285b8caf544058fba3ae802968fdc793" - integrity sha512-REvxW1wJ58AgHPcXPJOL49d1K/dPmuw4LjPLBPStOVkQjzDTVmJEIsiLwn2YeuNDd4pfakBwT8L3bz1G1/wVsQ== - dependencies: - underscore "1.9.1" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-core-subscriptions "1.2.11" - web3-eth-abi "1.2.11" - web3-eth-accounts "1.2.11" - web3-eth-contract "1.2.11" - web3-eth-ens "1.2.11" - web3-eth-iban "1.2.11" - web3-eth-personal "1.2.11" - web3-net "1.2.11" - web3-utils "1.2.11" - -web3-eth@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.2.4.tgz#24c3b1f1ac79351bbfb808b2ab5c585fa57cdd00" - integrity sha512-+j+kbfmZsbc3+KJpvHM16j1xRFHe2jBAniMo1BHKc3lho6A8Sn9Buyut6odubguX2AxoRArCdIDCkT9hjUERpA== - dependencies: - underscore "1.9.1" - web3-core "1.2.4" - web3-core-helpers "1.2.4" - web3-core-method "1.2.4" - web3-core-subscriptions "1.2.4" - web3-eth-abi "1.2.4" - web3-eth-accounts "1.2.4" - web3-eth-contract "1.2.4" - web3-eth-ens "1.2.4" - web3-eth-iban "1.2.4" - web3-eth-personal "1.2.4" - web3-net "1.2.4" - web3-utils "1.2.4" - -web3-net@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.2.11.tgz#eda68ef25e5cdb64c96c39085cdb74669aabbe1b" - integrity sha512-sjrSDj0pTfZouR5BSTItCuZ5K/oZPVdVciPQ6981PPPIwJJkCMeVjD7I4zO3qDPCnBjBSbWvVnLdwqUBPtHxyg== - dependencies: - web3-core "1.2.11" - web3-core-method "1.2.11" - web3-utils "1.2.11" - -web3-net@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.2.4.tgz#1d246406d3aaffbf39c030e4e98bce0ca5f25458" - integrity sha512-wKOsqhyXWPSYTGbp7ofVvni17yfRptpqoUdp3SC8RAhDmGkX6irsiT9pON79m6b3HUHfLoBilFQyt/fTUZOf7A== - dependencies: - web3-core "1.2.4" - web3-core-method "1.2.4" - web3-utils "1.2.4" - -web3-provider-engine@14.2.1: - version "14.2.1" - resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-14.2.1.tgz#ef351578797bf170e08d529cb5b02f8751329b95" - integrity sha512-iSv31h2qXkr9vrL6UZDm4leZMc32SjWJFGOp/D92JXfcEboCqraZyuExDkpxKw8ziTufXieNM7LSXNHzszYdJw== - dependencies: - async "^2.5.0" - backoff "^2.5.0" - clone "^2.0.0" - cross-fetch "^2.1.0" - eth-block-tracker "^3.0.0" - eth-json-rpc-infura "^3.1.0" - eth-sig-util "^1.4.2" - ethereumjs-block "^1.2.2" - ethereumjs-tx "^1.2.0" - ethereumjs-util "^5.1.5" - ethereumjs-vm "^2.3.4" - json-rpc-error "^2.0.0" - json-stable-stringify "^1.0.1" - promise-to-callback "^1.0.0" - readable-stream "^2.2.9" - request "^2.85.0" - semaphore "^1.0.3" - ws "^5.1.1" - xhr "^2.2.0" - xtend "^4.0.1" - -web3-providers-http@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.2.11.tgz#1cd03442c61670572d40e4dcdf1faff8bd91e7c6" - integrity sha512-psh4hYGb1+ijWywfwpB2cvvOIMISlR44F/rJtYkRmQ5jMvG4FOCPlQJPiHQZo+2cc3HbktvvSJzIhkWQJdmvrA== - dependencies: - web3-core-helpers "1.2.11" - xhr2-cookies "1.1.0" - -web3-providers-http@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.2.4.tgz#514fcad71ae77832c2c15574296282fbbc5f4a67" - integrity sha512-dzVCkRrR/cqlIrcrWNiPt9gyt0AZTE0J+MfAu9rR6CyIgtnm1wFUVVGaxYRxuTGQRO4Dlo49gtoGwaGcyxqiTw== - dependencies: - web3-core-helpers "1.2.4" - xhr2-cookies "1.1.0" - -web3-providers-ipc@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.2.11.tgz#d16d6c9be1be6e0b4f4536c4acc16b0f4f27ef21" - integrity sha512-yhc7Y/k8hBV/KlELxynWjJDzmgDEDjIjBzXK+e0rHBsYEhdCNdIH5Psa456c+l0qTEU2YzycF8VAjYpWfPnBpQ== - dependencies: - oboe "2.1.4" - underscore "1.9.1" - web3-core-helpers "1.2.11" - -web3-providers-ipc@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.2.4.tgz#9d6659f8d44943fb369b739f48df09092be459bd" - integrity sha512-8J3Dguffin51gckTaNrO3oMBo7g+j0UNk6hXmdmQMMNEtrYqw4ctT6t06YOf9GgtOMjSAc1YEh3LPrvgIsR7og== - dependencies: - oboe "2.1.4" - underscore "1.9.1" - web3-core-helpers "1.2.4" - -web3-providers-ws@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.2.11.tgz#a1dfd6d9778d840561d9ec13dd453046451a96bb" - integrity sha512-ZxnjIY1Er8Ty+cE4migzr43zA/+72AF1myzsLaU5eVgdsfV7Jqx7Dix1hbevNZDKFlSoEyq/3j/jYalh3So1Zg== - dependencies: - eventemitter3 "4.0.4" - underscore "1.9.1" - web3-core-helpers "1.2.11" - websocket "^1.0.31" - -web3-providers-ws@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.2.4.tgz#099ee271ee03f6ea4f5df9cfe969e83f4ce0e36f" - integrity sha512-F/vQpDzeK+++oeeNROl1IVTufFCwCR2hpWe5yRXN0ApLwHqXrMI7UwQNdJ9iyibcWjJf/ECbauEEQ8CHgE+MYQ== - dependencies: - "@web3-js/websocket" "^1.0.29" - underscore "1.9.1" - web3-core-helpers "1.2.4" - -web3-shh@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.2.11.tgz#f5d086f9621c9a47e98d438010385b5f059fd88f" - integrity sha512-B3OrO3oG1L+bv3E1sTwCx66injW1A8hhwpknDUbV+sw3fehFazA06z9SGXUefuFI1kVs4q2vRi0n4oCcI4dZDg== - dependencies: - web3-core "1.2.11" - web3-core-method "1.2.11" - web3-core-subscriptions "1.2.11" - web3-net "1.2.11" - -web3-shh@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.2.4.tgz#5c8ff5ab624a3b14f08af0d24d2b16c10e9f70dd" - integrity sha512-z+9SCw0dE+69Z/Hv8809XDbLj7lTfEv9Sgu8eKEIdGntZf4v7ewj5rzN5bZZSz8aCvfK7Y6ovz1PBAu4QzS4IQ== - dependencies: - web3-core "1.2.4" - web3-core-method "1.2.4" - web3-core-subscriptions "1.2.4" - web3-net "1.2.4" - -web3-utils@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.11.tgz#af1942aead3fb166ae851a985bed8ef2c2d95a82" - integrity sha512-3Tq09izhD+ThqHEaWYX4VOT7dNPdZiO+c/1QMA0s5X2lDFKK/xHJb7cyTRRVzN2LvlHbR7baS1tmQhSua51TcQ== - dependencies: - bn.js "^4.11.9" - eth-lib "0.2.8" - ethereum-bloom-filters "^1.0.6" - ethjs-unit "0.1.6" - number-to-bn "1.7.0" - randombytes "^2.1.0" - underscore "1.9.1" - utf8 "3.0.0" - -web3-utils@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.4.tgz#96832a39a66b05bf8862a5b0bdad2799d709d951" - integrity sha512-+S86Ip+jqfIPQWvw2N/xBQq5JNqCO0dyvukGdJm8fEWHZbckT4WxSpHbx+9KLEWY4H4x9pUwnoRkK87pYyHfgQ== - dependencies: - bn.js "4.11.8" - eth-lib "0.2.7" - ethereum-bloom-filters "^1.0.6" - ethjs-unit "0.1.6" - number-to-bn "1.7.0" - randombytes "^2.1.0" - underscore "1.9.1" - utf8 "3.0.0" - -web3@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.11.tgz#50f458b2e8b11aa37302071c170ed61cff332975" - integrity sha512-mjQ8HeU41G6hgOYm1pmeH0mRAeNKJGnJEUzDMoerkpw7QUQT4exVREgF1MYPvL/z6vAshOXei25LE/t/Bxl8yQ== - dependencies: - web3-bzz "1.2.11" - web3-core "1.2.11" - web3-eth "1.2.11" - web3-eth-personal "1.2.11" - web3-net "1.2.11" - web3-shh "1.2.11" - web3-utils "1.2.11" - -web3@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.4.tgz#6e7ab799eefc9b4648c2dab63003f704a1d5e7d9" - integrity sha512-xPXGe+w0x0t88Wj+s/dmAdASr3O9wmA9mpZRtixGZxmBexAF0MjfqYM+MS4tVl5s11hMTN3AZb8cDD4VLfC57A== - dependencies: - "@types/node" "^12.6.1" - web3-bzz "1.2.4" - web3-core "1.2.4" - web3-eth "1.2.4" - web3-eth-personal "1.2.4" - web3-net "1.2.4" - web3-shh "1.2.4" - web3-utils "1.2.4" - -websocket@1.0.29: - version "1.0.29" - resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.29.tgz#3f83e49d3279657c58b02a22d90749c806101b98" - integrity sha512-WhU8jKXC8sTh6ocLSqpZRlOKMNYGwUvjA5+XcIgIk/G3JCaDfkZUr0zA19sVSxJ0TEvm0i5IBzr54RZC4vzW7g== - dependencies: - debug "^2.2.0" - gulp "^4.0.2" - nan "^2.11.0" - typedarray-to-buffer "^3.1.5" - yaeti "^0.0.6" - -websocket@1.0.32: - version "1.0.32" - resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.32.tgz#1f16ddab3a21a2d929dec1687ab21cfdc6d3dbb1" - integrity sha512-i4yhcllSP4wrpoPMU2N0TQ/q0O94LRG/eUQjEAamRltjQ1oT1PFFKOG4i877OlJgCG8rw6LrrowJp+TYCEWF7Q== - dependencies: - bufferutil "^4.0.1" - debug "^2.2.0" - es5-ext "^0.10.50" - typedarray-to-buffer "^3.1.5" - utf-8-validate "^5.0.2" - yaeti "^0.0.6" - -websocket@^1.0.31: - version "1.0.33" - resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.33.tgz#407f763fc58e74a3fa41ca3ae5d78d3f5e3b82a5" - integrity sha512-XwNqM2rN5eh3G2CUQE3OHZj+0xfdH42+OFK6LdC2yqiC0YU8e5UK0nYre220T0IyyN031V/XOvtHvXozvJYFWA== - dependencies: - bufferutil "^4.0.1" - debug "^2.2.0" - es5-ext "^0.10.50" - typedarray-to-buffer "^3.1.5" - utf-8-validate "^5.0.2" - yaeti "^0.0.6" - -whatwg-fetch@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" - integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== - -which-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" - integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -which@1.3.1, which@^1.2.14, which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -wide-align@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrap-ansi@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" - integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== - dependencies: - ansi-styles "^3.2.0" - string-width "^3.0.0" - strip-ansi "^5.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -ws@^3.0.0: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" - -ws@^5.1.1: - version "5.2.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" - integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== - dependencies: - async-limiter "~1.0.0" - -xhr-request-promise@^0.1.2: - version "0.1.3" - resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz#2d5f4b16d8c6c893be97f1a62b0ed4cf3ca5f96c" - integrity sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg== - dependencies: - xhr-request "^1.1.0" - -xhr-request@^1.0.1, xhr-request@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/xhr-request/-/xhr-request-1.1.0.tgz#f4a7c1868b9f198723444d82dcae317643f2e2ed" - integrity sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA== - dependencies: - buffer-to-arraybuffer "^0.0.5" - object-assign "^4.1.1" - query-string "^5.0.1" - simple-get "^2.7.0" - timed-out "^4.0.1" - url-set-query "^1.0.0" - xhr "^2.0.4" - -xhr2-cookies@1.1.0, xhr2-cookies@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz#7d77449d0999197f155cb73b23df72505ed89d48" - integrity sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg= - dependencies: - cookiejar "^2.1.1" - -xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: - version "2.6.0" - resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.6.0.tgz#b69d4395e792b4173d6b7df077f0fc5e4e2b249d" - integrity sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA== - dependencies: - global "~4.4.0" - is-function "^1.0.1" - parse-headers "^2.0.0" - xtend "^4.0.0" - -xmlhttprequest@1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" - integrity sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw= - -xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -xtend@~2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" - integrity sha1-bv7MKk2tjmlixJAbM3znuoe10os= - dependencies: - object-keys "~0.4.0" - -y18n@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -y18n@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4" - integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== - -yaeti@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" - integrity sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc= - -yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - -yargs-parser@13.1.2, yargs-parser@^13.1.0, yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-parser@5.0.0-security.0: - version "5.0.0-security.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0-security.0.tgz#4ff7271d25f90ac15643b86076a2ab499ec9ee24" - integrity sha512-T69y4Ps64LNesYxeYGYPvfoMTt/7y1XtfpIslUeK4um+9Hu7hlGoRtaDLvdXb7+/tfq4opVa2HRY5xGip022rQ== - dependencies: - camelcase "^3.0.0" - object.assign "^4.1.0" - -yargs-unparser@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" - integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== - dependencies: - flat "^4.1.0" - lodash "^4.17.15" - yargs "^13.3.0" - -yargs@13.2.4: - version "13.2.4" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.4.tgz#0b562b794016eb9651b98bd37acf364aa5d6dc83" - integrity sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - os-locale "^3.1.0" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.0" - -yargs@13.3.2, yargs@^13.3.0: - version "13.3.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.2" - -yargs@^7.1.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.1.tgz#67f0ef52e228d4ee0d6311acede8850f53464df6" - integrity sha512-huO4Fr1f9PmiJJdll5kwoS2e4GqzGSsMT3PPMpOwoVkOK8ckqAewMTZyA6LXVQWflleb/Z8oPBEvNsMft0XE+g== - dependencies: - camelcase "^3.0.0" - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^1.0.2" - which-module "^1.0.0" - y18n "^3.2.1" - yargs-parser "5.0.0-security.0" - -yauzl@^2.4.2: - version "2.10.0" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= - dependencies: - buffer-crc32 "~0.2.3" - fd-slicer "~1.1.0" - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== From 0be16a66c32b204c43dd207be447840de5c65207 Mon Sep 17 00:00:00 2001 From: kstasi Date: Mon, 6 Sep 2021 15:51:52 +0300 Subject: [PATCH 02/22] update tests --- test/BuyToken.spec.ts | 2 +- test/BuyTokenWithRouter.spec.ts | 2 +- test/Default.spec.ts | 2 +- test/DivestLiquidity.spec.ts | 69 ++++++++++++++++----------- test/DivestTTLiquidity.spec.ts | 66 +++++++++++++++---------- test/InitializeExchangeTest.spec.ts | 16 +++---- test/InitializeTTExchangeTest.spec.ts | 12 ++--- test/InvestLiquidity.spec.ts | 4 +- test/InvestTTLiquidity.spec.ts | 4 +- test/MetadataStorage.spec.ts | 2 +- test/RewardDistribution.spec.ts | 2 +- test/SellToken.spec.ts | 2 +- test/SellTokenWithRoute.spec.ts | 2 +- test/SetFunctionsTest.spec.ts | 8 ++-- test/TezToTokenPayment.spec.ts | 2 +- test/TokenAToTokenB.spec.ts | 2 +- test/TokenBToTokenA.spec.ts | 2 +- test/TokenToTezPayment.spec.ts | 2 +- test/Veto.spec.ts | 2 +- test/Vote.spec.ts | 11 +++-- test/helpers/confirmation.ts | 2 +- test/helpers/utils.ts | 4 +- 22 files changed, 128 insertions(+), 92 deletions(-) diff --git a/test/BuyToken.spec.ts b/test/BuyToken.spec.ts index c0a5e1c8..ae5da24e 100644 --- a/test/BuyToken.spec.ts +++ b/test/BuyToken.spec.ts @@ -130,7 +130,7 @@ contract("BuyToken()", function () { amountOut, aliceAddress ), - (err) => { + (err: any) => { ok(err.message == errorMsg, "Error message mismatch"); return true; } diff --git a/test/BuyTokenWithRouter.spec.ts b/test/BuyTokenWithRouter.spec.ts index a4f07fd8..b9ab952a 100644 --- a/test/BuyTokenWithRouter.spec.ts +++ b/test/BuyTokenWithRouter.spec.ts @@ -254,7 +254,7 @@ contract("BuyTokenWithRoute()", function () { amountOut, aliceAddress ), - (err) => { + (err: any) => { ok(err.message == errorMsg, "Error message mismatch"); return true; } diff --git a/test/Default.spec.ts b/test/Default.spec.ts index 0938feb4..26230427 100644 --- a/test/Default.spec.ts +++ b/test/Default.spec.ts @@ -140,7 +140,7 @@ if (standard !== "MIXED") { function defaultFailCase(decription, sender, amount, errorMsg) { it(decription, async function () { await context.updateActor(sender); - await rejects(context.pairs[0].sendReward(amount), (err) => { + await rejects(context.pairs[0].sendReward(amount), (err: any) => { ok(err.message == errorMsg, "Error message mismatch"); return true; }); diff --git a/test/DivestLiquidity.spec.ts b/test/DivestLiquidity.spec.ts index 7aa38ca2..8690761f 100644 --- a/test/DivestLiquidity.spec.ts +++ b/test/DivestLiquidity.spec.ts @@ -34,7 +34,7 @@ if (standard !== "MIXED") { await context.pairs[0].divestLiquidity(1, 1, initTez); await rejects( context.pairs[0].divestLiquidity(1, 1, burntShares), - (err) => { + (err: any) => { ok(err.message == "Dex/not-launched", "Error message mismatch"); return true; } @@ -98,20 +98,23 @@ if (standard !== "MIXED") { before(async () => {}); it("revert in case of 0 burnt shares", async function () { - await rejects(context.pairs[0].divestLiquidity(1, 1, 0), (err) => { + await rejects(context.pairs[0].divestLiquidity(1, 1, 0), (err: any) => { ok(err.message == "Dex/zero-burn-shares", "Error message mismatch"); return true; }); }); it("revert in case of too high expected burnt shares", async function () { - await rejects(context.pairs[0].divestLiquidity(1, 1, 20000), (err) => { - ok( - err.message == "Dex/insufficient-shares", - "Error message mismatch" - ); - return true; - }); + await rejects( + context.pairs[0].divestLiquidity(1, 1, 20000), + (err: any) => { + ok( + err.message == "Dex/insufficient-shares", + "Error message mismatch" + ); + return true; + } + ); }); it("success in case of burnt shares of 1", async function () { @@ -293,10 +296,13 @@ if (standard !== "MIXED") { const share = 1; await context.pairs[0].initializeExchange(initToken, initTez); await context.pairs[0].tokenToTezPayment(100000, 1, bobAddress); - await rejects(context.pairs[0].divestLiquidity(1, 1, share), (err) => { - ok(err.message == "Dex/high-expectation", "Error message mismatch"); - return true; - }); + await rejects( + context.pairs[0].divestLiquidity(1, 1, share), + (err: any) => { + ok(err.message == "Dex/high-expectation", "Error message mismatch"); + return true; + } + ); }); it("revert in case of calculated tokens are zero", async function () { @@ -306,10 +312,13 @@ if (standard !== "MIXED") { await context.pairs[0].initializeExchange(initToken, initTez); await context.pairs[0].tezToTokenPayment(1, 100000, bobAddress); const share = 1; - await rejects(context.pairs[0].divestLiquidity(1, 1, share), (err) => { - ok(err.message == "Dex/high-expectation", "Error message mismatch"); - return true; - }); + await rejects( + context.pairs[0].divestLiquidity(1, 1, share), + (err: any) => { + ok(err.message == "Dex/high-expectation", "Error message mismatch"); + return true; + } + ); }); }); @@ -325,7 +334,7 @@ if (standard !== "MIXED") { const share = 100; await rejects( context.pairs[0].divestLiquidity(1, 100000000, share), - (err) => { + (err: any) => { ok(err.message == "Dex/high-expectation", "Error message mismatch"); return true; } @@ -336,7 +345,7 @@ if (standard !== "MIXED") { const share = 100; await rejects( context.pairs[0].divestLiquidity(100000000, 1, share), - (err) => { + (err: any) => { ok(err.message == "Dex/high-expectation", "Error message mismatch"); return true; } @@ -345,18 +354,24 @@ if (standard !== "MIXED") { it("revert in case of expected tokens are 0", async function () { const share = 1; - await rejects(context.pairs[0].divestLiquidity(0, 1, share), (err) => { - ok(err.message == "Dex/dust-output", "Error message mismatch"); - return true; - }); + await rejects( + context.pairs[0].divestLiquidity(0, 1, share), + (err: any) => { + ok(err.message == "Dex/dust-output", "Error message mismatch"); + return true; + } + ); }); it("revert in case of expected tez are 0", async function () { const share = 1; - await rejects(context.pairs[0].divestLiquidity(1, 0, share), (err) => { - ok(err.message == "Dex/dust-output", "Error message mismatch"); - return true; - }); + await rejects( + context.pairs[0].divestLiquidity(1, 0, share), + (err: any) => { + ok(err.message == "Dex/dust-output", "Error message mismatch"); + return true; + } + ); }); it("success in case the of the expected amount smaller than calculated", async function () { diff --git a/test/DivestTTLiquidity.spec.ts b/test/DivestTTLiquidity.spec.ts index 9ecce765..6d5cc7fd 100644 --- a/test/DivestTTLiquidity.spec.ts +++ b/test/DivestTTLiquidity.spec.ts @@ -36,7 +36,7 @@ contract("DivestTTLiquidity()", function () { await context.dex.divestLiquidity("0", 1, 1, tokenAAmount); await rejects( context.dex.divestLiquidity("0", 1, 1, burntShares), - (err) => { + (err: any) => { ok(err.message == "Dex/not-launched", "Error message mismatch"); return true; } @@ -140,17 +140,23 @@ contract("DivestTTLiquidity()", function () { describe("Test various burnt shares", () => { it("revert in case of 0 burnt shares", async function () { - await rejects(context.dex.divestLiquidity("0", 1, 1, 0), (err) => { + await rejects(context.dex.divestLiquidity("0", 1, 1, 0), (err: any) => { ok(err.message == "Dex/zero-burn-shares", "Error message mismatch"); return true; }); }); it("revert in case of too high expected burnt shares", async function () { - await rejects(context.dex.divestLiquidity("0", 1, 1, 20000), (err) => { - ok(err.message == "Dex/insufficient-shares", "Error message mismatch"); - return true; - }); + await rejects( + context.dex.divestLiquidity("0", 1, 1, 20000), + (err: any) => { + ok( + err.message == "Dex/insufficient-shares", + "Error message mismatch" + ); + return true; + } + ); }); it("success in case of burnt shares of 1", async function () { @@ -437,10 +443,13 @@ contract("DivestTTLiquidity()", function () { 1, bobAddress ); - await rejects(context.dex.divestLiquidity("0", 1, 1, share), (err) => { - ok(err.message == "Dex/high-expectation", "Error message mismatch"); - return true; - }); + await rejects( + context.dex.divestLiquidity("0", 1, 1, share), + (err: any) => { + ok(err.message == "Dex/high-expectation", "Error message mismatch"); + return true; + } + ); await context.dex.divestLiquidity("0", 1, 1, initTokenB); }); @@ -462,10 +471,13 @@ contract("DivestTTLiquidity()", function () { 1, bobAddress ); - await rejects(context.dex.divestLiquidity("0", 1, 1, share), (err) => { - ok(err.message == "Dex/high-expectation", "Error message mismatch"); - return true; - }); + await rejects( + context.dex.divestLiquidity("0", 1, 1, share), + (err: any) => { + ok(err.message == "Dex/high-expectation", "Error message mismatch"); + return true; + } + ); await context.dex.divestLiquidity("0", 1, 1, initTokenA); }); }); @@ -486,7 +498,7 @@ contract("DivestTTLiquidity()", function () { const share = 100; await rejects( context.dex.divestLiquidity("0", 1, 100000000, share), - (err) => { + (err: any) => { ok(err.message == "Dex/high-expectation", "Error message mismatch"); return true; } @@ -497,7 +509,7 @@ contract("DivestTTLiquidity()", function () { const share = 100; await rejects( context.dex.divestLiquidity("0", 100000000, 1, share), - (err) => { + (err: any) => { ok(err.message == "Dex/high-expectation", "Error message mismatch"); return true; } @@ -506,18 +518,24 @@ contract("DivestTTLiquidity()", function () { it("revert in case of expected tokens are 0", async function () { const share = 1; - await rejects(context.dex.divestLiquidity("0", 0, 1, share), (err) => { - ok(err.message == "Dex/dust-output", "Error message mismatch"); - return true; - }); + await rejects( + context.dex.divestLiquidity("0", 0, 1, share), + (err: any) => { + ok(err.message == "Dex/dust-output", "Error message mismatch"); + return true; + } + ); }); it("revert in case of expected tez are 0", async function () { const share = 1; - await rejects(context.dex.divestLiquidity("0", 1, 0, share), (err) => { - ok(err.message == "Dex/dust-output", "Error message mismatch"); - return true; - }); + await rejects( + context.dex.divestLiquidity("0", 1, 0, share), + (err: any) => { + ok(err.message == "Dex/dust-output", "Error message mismatch"); + return true; + } + ); }); it("success in case the of the expected amount smaller than calculated", async function () { diff --git a/test/InitializeExchangeTest.spec.ts b/test/InitializeExchangeTest.spec.ts index 79651189..1f5c3021 100644 --- a/test/InitializeExchangeTest.spec.ts +++ b/test/InitializeExchangeTest.spec.ts @@ -36,7 +36,7 @@ if (standard !== "MIXED") { tezAmount, false ), - (err) => { + (err: any) => { ok( err.message == "FA2_NOT_OPERATOR" || err.message == "NotEnoughAllowance", @@ -54,7 +54,7 @@ if (standard !== "MIXED") { tezAmount: 0, tokenAmount, }), - (err) => { + (err: any) => { strictEqual( err.message, "Dex/not-allowed", @@ -72,7 +72,7 @@ if (standard !== "MIXED") { tezAmount, tokenAmount: 0, }), - (err) => { + (err: any) => { strictEqual( err.message, "Dex/not-allowed", @@ -149,7 +149,7 @@ if (standard !== "MIXED") { tezAmount, tokenAmount, }), - (err) => { + (err: any) => { strictEqual( err.message, "Factory/exchange-launched", @@ -165,7 +165,7 @@ if (standard !== "MIXED") { it("revert in case liquidity isn't zero", async function () { await rejects( context.pairs[0].initializeExchange(tokenAmount, tezAmount), - (err) => { + (err: any) => { strictEqual( err.message, "Dex/non-zero-reserves", @@ -184,7 +184,7 @@ if (standard !== "MIXED") { ); await rejects( context.pairs[0].initializeExchange(tokenAmount, tezAmount, false), - (err) => { + (err: any) => { ok( err.message == "FA2_NOT_OPERATOR" || err.message == "NotEnoughAllowance", @@ -254,7 +254,7 @@ if (standard !== "MIXED") { it("revert in case the amount of token is zero", async function () { await rejects( context.pairs[0].initializeExchange(0, tezAmount), - (err) => { + (err: any) => { strictEqual( err.message, "Dex/non-zero-reserves", @@ -268,7 +268,7 @@ if (standard !== "MIXED") { it("revert in case the amount of XTZ is zero", async function () { await rejects( context.pairs[0].initializeExchange(tokenAmount, 0), - (err) => { + (err: any) => { strictEqual( err.message, "Dex/non-zero-reserves", diff --git a/test/InitializeTTExchangeTest.spec.ts b/test/InitializeTTExchangeTest.spec.ts index a6283c48..788951c7 100644 --- a/test/InitializeTTExchangeTest.spec.ts +++ b/test/InitializeTTExchangeTest.spec.ts @@ -68,7 +68,7 @@ contract("InitializeTTExchange()", function () { tokenAAmount: 0, tokenBAmount, }), - (err) => { + (err: any) => { strictEqual(err.message, "Dex/no-token-a", "Error message mismatch"); return true; } @@ -83,7 +83,7 @@ contract("InitializeTTExchange()", function () { tokenAAmount, tokenBAmount: 0, }), - (err) => { + (err: any) => { strictEqual(err.message, "Dex/no-token-b", "Error message mismatch"); return true; } @@ -174,7 +174,7 @@ contract("InitializeTTExchange()", function () { tokenAAmount, tokenBAmount, }), - (err) => { + (err: any) => { strictEqual( err.message, "Dex/non-zero-reserves", @@ -205,7 +205,7 @@ contract("InitializeTTExchange()", function () { tokenAAmount, tokenBAmount ), - (err) => { + (err: any) => { strictEqual( err.message, "Dex/non-zero-reserves", @@ -302,7 +302,7 @@ contract("InitializeTTExchange()", function () { 0, tokenBAmount ), - (err) => { + (err: any) => { strictEqual(err.message, "Dex/no-token-a", "Error message mismatch"); return true; } @@ -317,7 +317,7 @@ contract("InitializeTTExchange()", function () { tokenAAmount, 0 ), - (err) => { + (err: any) => { strictEqual(err.message, "Dex/no-token-b", "Error message mismatch"); return true; } diff --git a/test/InvestLiquidity.spec.ts b/test/InvestLiquidity.spec.ts index 80eca69d..e5ce26f5 100644 --- a/test/InvestLiquidity.spec.ts +++ b/test/InvestLiquidity.spec.ts @@ -35,7 +35,7 @@ if (standard !== "MIXED") { await context.pairs[0].divestLiquidity(1, 1, initTez); await rejects( context.pairs[0].investLiquidity(tokenAmount, tezAmount, newShares), - (err) => { + (err: any) => { ok(err.message == "Dex/not-launched", "Error message mismatch"); return true; } @@ -329,7 +329,7 @@ if (standard !== "MIXED") { it("revert in case of 0 purchased shares", async function () { await context.pairs[0].tezToTokenPayment(1, 100, bobAddress); - await rejects(context.pairs[0].investLiquidity(1, 1, 1), (err) => { + await rejects(context.pairs[0].investLiquidity(1, 1, 1), (err: any) => { ok(err.message == "Dex/wrong-params", "Error message mismatch"); return true; }); diff --git a/test/InvestTTLiquidity.spec.ts b/test/InvestTTLiquidity.spec.ts index 593ca2a7..e32fa585 100644 --- a/test/InvestTTLiquidity.spec.ts +++ b/test/InvestTTLiquidity.spec.ts @@ -32,7 +32,7 @@ contract("InvestTTLiquidity()", function () { await context.dex.divestLiquidity("0", 1, 1, tokenAAmount); await rejects( context.dex.investLiquidity("0", tokenAAmount, tokenBAmount, 100), - (err) => { + (err: any) => { ok(err.message == "Dex/not-launched", "Error message mismatch"); return true; } @@ -427,7 +427,7 @@ contract("InvestTTLiquidity()", function () { 1, bobAddress ); - await rejects(context.dex.investLiquidity("0", 1, 1, 0), (err) => { + await rejects(context.dex.investLiquidity("0", 1, 1, 0), (err: any) => { ok(err.message == "Dex/wrong-params", "Error message mismatch"); return true; }); diff --git a/test/MetadataStorage.spec.ts b/test/MetadataStorage.spec.ts index 39086a75..67853546 100644 --- a/test/MetadataStorage.spec.ts +++ b/test/MetadataStorage.spec.ts @@ -48,7 +48,7 @@ if (standard !== "MIXED") { it(decription, async function () { let config = await prepareProviderOptions(sender); tezos.setProvider(config); - await rejects(act(), (err) => { + await rejects(act(), (err: any) => { ok(err.message == errorMsg, "Error message mismatch"); return true; }); diff --git a/test/RewardDistribution.spec.ts b/test/RewardDistribution.spec.ts index ddc01271..9caddd7b 100644 --- a/test/RewardDistribution.spec.ts +++ b/test/RewardDistribution.spec.ts @@ -234,7 +234,7 @@ if (standard !== "MIXED") { function defaultFailCase(decription, sender, amount, errorMsg) { it(decription, async function () { await context.updateActor(sender); - await rejects(context.pairs[0].sendReward(amount), (err) => { + await rejects(context.pairs[0].sendReward(amount), (err: any) => { ok(err.message == errorMsg, "Error message mismatch"); return true; }); diff --git a/test/SellToken.spec.ts b/test/SellToken.spec.ts index 5a029aa8..a5edaccd 100644 --- a/test/SellToken.spec.ts +++ b/test/SellToken.spec.ts @@ -130,7 +130,7 @@ contract("SellToken()", function () { amountOut, aliceAddress ), - (err) => { + (err: any) => { ok(err.message == errorMsg, "Error message mismatch"); return true; } diff --git a/test/SellTokenWithRoute.spec.ts b/test/SellTokenWithRoute.spec.ts index 204dfbf1..a49388ee 100644 --- a/test/SellTokenWithRoute.spec.ts +++ b/test/SellTokenWithRoute.spec.ts @@ -251,7 +251,7 @@ contract("SellTokenWithRoute()", function () { amountOut, aliceAddress ), - (err) => { + (err: any) => { ok(err.message == errorMsg, "Error message mismatch"); return true; } diff --git a/test/SetFunctionsTest.spec.ts b/test/SetFunctionsTest.spec.ts index f1e22d4c..bf10cf49 100644 --- a/test/SetFunctionsTest.spec.ts +++ b/test/SetFunctionsTest.spec.ts @@ -56,7 +56,7 @@ if (standard !== "MIXED") { it("revert replacement of Dex functions to Factory", async function () { await rejects( context.factory.setDexFunction(1, "initialize_exchange"), - (err) => { + (err: any) => { strictEqual( err.message, "Factory/function-set", @@ -70,7 +70,7 @@ if (standard !== "MIXED") { it("revert replacement of Token functions to Factory", async function () { await rejects( context.factory.setTokenFunction(1, "transfer"), - (err) => { + (err: any) => { strictEqual( err.message, "Factory/function-set", @@ -86,7 +86,7 @@ if (standard !== "MIXED") { it("revert adding more than 9 exchange functions to Factory", async function () { await rejects( context.factory.setDexFunction(9, "initialize_exchange"), - (err) => { + (err: any) => { strictEqual( err.message, "Factory/wrong-index", @@ -100,7 +100,7 @@ if (standard !== "MIXED") { it("revert adding more than 5 token functions to Factory", async function () { await rejects( context.factory.setTokenFunction(5, "transfer"), - (err) => { + (err: any) => { strictEqual( err.message, "Factory/wrong-index", diff --git a/test/TezToTokenPayment.spec.ts b/test/TezToTokenPayment.spec.ts index 0318d172..0d37eabd 100644 --- a/test/TezToTokenPayment.spec.ts +++ b/test/TezToTokenPayment.spec.ts @@ -123,7 +123,7 @@ if (standard !== "MIXED") { xtzAmount, bobAddress ), - (err) => { + (err: any) => { ok(err.message == errorMsg, "Error message mismatch"); return true; } diff --git a/test/TokenAToTokenB.spec.ts b/test/TokenAToTokenB.spec.ts index 06cee2b9..44666cd3 100644 --- a/test/TokenAToTokenB.spec.ts +++ b/test/TokenAToTokenB.spec.ts @@ -174,7 +174,7 @@ contract("TokenAToTokenB()", function () { tokenBAmount, bobAddress ), - (err) => { + (err: any) => { ok(err.message == errorMsg, "Error message mismatch"); return true; } diff --git a/test/TokenBToTokenA.spec.ts b/test/TokenBToTokenA.spec.ts index 77e30c85..3abb55b3 100644 --- a/test/TokenBToTokenA.spec.ts +++ b/test/TokenBToTokenA.spec.ts @@ -174,7 +174,7 @@ contract("TokenBToTokenA()", function () { tokenBAmount, bobAddress ), - (err) => { + (err: any) => { ok(err.message == errorMsg, "Error message mismatch"); return true; } diff --git a/test/TokenToTezPayment.spec.ts b/test/TokenToTezPayment.spec.ts index 693b45c6..497865e1 100644 --- a/test/TokenToTezPayment.spec.ts +++ b/test/TokenToTezPayment.spec.ts @@ -116,7 +116,7 @@ if (standard !== "MIXED") { xtzAmount, bobAddress ), - (err) => { + (err: any) => { ok(err.message == errorMsg, "Error message mismatch"); return true; } diff --git a/test/Veto.spec.ts b/test/Veto.spec.ts index ead877e6..02eb580f 100644 --- a/test/Veto.spec.ts +++ b/test/Veto.spec.ts @@ -128,7 +128,7 @@ if (standard !== "MIXED") { function vetoFailCase(decription, sender, vetor, value, errorMsg) { it(decription, async function () { await context.updateActor(sender); - await rejects(context.pairs[0].veto(vetor, value), (err) => { + await rejects(context.pairs[0].veto(vetor, value), (err: any) => { ok(err.message == errorMsg, "Error message mismatch"); return true; }); diff --git a/test/Vote.spec.ts b/test/Vote.spec.ts index bb2b7218..45510cde 100644 --- a/test/Vote.spec.ts +++ b/test/Vote.spec.ts @@ -126,10 +126,13 @@ if (standard !== "MIXED") { ) { it(decription, async function () { await context.updateActor(sender); - await rejects(context.pairs[0].vote(voter, candidate, value), (err) => { - ok(err.message == errorMsg, "Error message mismatch"); - return true; - }); + await rejects( + context.pairs[0].vote(voter, candidate, value), + (err: any) => { + ok(err.message == errorMsg, "Error message mismatch"); + return true; + } + ); }); } diff --git a/test/helpers/confirmation.ts b/test/helpers/confirmation.ts index 2f654599..867861b2 100644 --- a/test/helpers/confirmation.ts +++ b/test/helpers/confirmation.ts @@ -46,7 +46,7 @@ export async function confirmOperation( return opEntry; } } - } catch (err) { + } catch (err: any) { if (process.env.NODE_ENV === "development") { console.error(err); } diff --git a/test/helpers/utils.ts b/test/helpers/utils.ts index 285c4a0a..e4868d84 100644 --- a/test/helpers/utils.ts +++ b/test/helpers/utils.ts @@ -12,14 +12,14 @@ export function getLigo(isDockerizedLigo: boolean): string { path = `docker run -v $PWD:$PWD --rm -i ligolang/ligo:${ligoVersion}`; try { execSync(`${path} --help`); - } catch (err) { + } catch (err: any) { path = "ligo"; execSync(`${path} --help`); } } else { try { execSync(`${path} --help`); - } catch (err) { + } catch (err: any) { path = `docker run -v $PWD:$PWD --rm -i ligolang/ligo:${ligoVersion}`; execSync(`${path} --help`); } From 0d41ef52db38b1d76f21e55494eb493fa3249dda Mon Sep 17 00:00:00 2001 From: KStasi Date: Mon, 13 Sep 2021 14:31:18 +0200 Subject: [PATCH 03/22] update tests for granada --- package.json | 2 +- test/Vote.spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 203e4145..4326da2f 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "migrate-granadanet-reset": "yarn clean && truffle migrate --network granadanet --reset", "compile-dex": "node scripts/cli.js build-dex --no-json -o contracts", "compile": "yarn clean && yarn compile-dex && truffle compile", - "start-sandbox": "docker run --rm --name my-sandbox -e flextesa_node_cors_origin='*' -e block_time=1 --detach -p 8732:20000 tqtezos/flextesa:20210602 granabox start", + "start-sandbox": "docker run --rm --name my-sandbox -e flextesa_node_cors_origin='*' -e block_time=1 --detach -p 8732:20000 tqtezos/flextesa:20210602 granabox start --add-bootstrap-account eve,edpku9qEgcyfNNDK6EpMvu5SqXDqWRLuxdMxdyH12ivTUuB1KXfGP4,tz1MnmtP4uAcgMpeZN6JtyziXeFqqwQG6yn6,unencrypted:edsk3Sb16jcx9KrgMDsbZDmKnuN11v4AbTtPBgBSBTqYftd8Cq3i1e@1000000000000 --no-daemons-for eve", "test": "yarn clean && yarn compile && truffle test ", "test:quick": "truffle test", "postinstall": "patch-package" diff --git a/test/Vote.spec.ts b/test/Vote.spec.ts index 45510cde..6729da16 100644 --- a/test/Vote.spec.ts +++ b/test/Vote.spec.ts @@ -244,7 +244,7 @@ if (standard !== "MIXED") { aliceAddress, "tz1gaRjULm9qy4D83VCvb4ABWLKpz4XXfqjx", 1000, - "(permanent) proto.008-PtEdo2Zk.contract.manager.unregistered_delegate" + "(permanent) proto.010-PtGRANAD.contract.manager.unregistered_delegate" ); voteFailCase( "revert in case of voting for unregistered candidate with power that makes him delegate", @@ -252,7 +252,7 @@ if (standard !== "MIXED") { aliceAddress, "tz1gaRjULm9qy4D83VCvb4ABWLKpz4XXfqjx", 5000, - "(permanent) proto.008-PtEdo2Zk.contract.manager.unregistered_delegate" + "(permanent) proto.010-PtGRANAD.contract.manager.unregistered_delegate" ); describe("", async function () { From 67d7f401bd1d885f4b8a008d6c8bdbcd0b12c6d6 Mon Sep 17 00:00:00 2001 From: KStasi Date: Mon, 13 Sep 2021 15:20:36 +0200 Subject: [PATCH 04/22] update confirmation period --- test/helpers/confirmation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/helpers/confirmation.ts b/test/helpers/confirmation.ts index 867861b2..b3bf3a39 100644 --- a/test/helpers/confirmation.ts +++ b/test/helpers/confirmation.ts @@ -6,7 +6,7 @@ import { import { TezosToolkit, OpKind } from "@taquito/taquito"; export const SYNC_INTERVAL = 0; -export const CONFIRM_TIMEOUT = 30_000 * 3; +export const CONFIRM_TIMEOUT = 30_000 * 4; export type ConfirmOperationOptions = { initializedAt?: number; From 21bf9ba328a871b056abfc8725fc01f212fc2fec Mon Sep 17 00:00:00 2001 From: KStasi Date: Tue, 14 Sep 2021 14:48:12 +0200 Subject: [PATCH 05/22] add balance checks --- contracts/partials/ITTDex.ligo | 37 +- contracts/partials/TTDex.ligo | 9 +- contracts/partials/TTMethodDex.ligo | 507 ++++++++++++++++++++++++---- 3 files changed, 488 insertions(+), 65 deletions(-) diff --git a/contracts/partials/ITTDex.ligo b/contracts/partials/ITTDex.ligo index 3eefe12e..99e34ae7 100644 --- a/contracts/partials/ITTDex.ligo +++ b/contracts/partials/ITTDex.ligo @@ -10,18 +10,25 @@ type account_info is record [ type token_transfer_params_fa2 is list (transfer_param) type token_identifier_fa2 is record [ - token_address : address; - token_id : nat; - ] + token_address : address; + token_id : nat; +] type token_transfer_params_fa12 is michelson_pair(address, "from", michelson_pair(address, "to", nat, "value"), "") type token_identifier_fa12 is address type transfer_type_fa12 is TransferTypeFA12 of token_transfer_params_fa12 type transfer_type_fa2 is TransferTypeFA2 of token_transfer_params_fa2 +type balance_of_fa12_params is address * contract(nat) +type balance_of_fa12_type is BalanceOfTypeFA12 of balance_of_fa12_params +type balance_of_fa2_type is BalanceOfTypeFA2 of balance_params type token_type is | Fa12 | Fa2 +type token_name is +| A +| B + type pair_info is record [ token_a_pool : nat; (* token A reserves in the pool *) token_b_pool : nat; (* token B reserves in the pool *) @@ -39,9 +46,15 @@ type tokens_info is record [ type token_pair is bytes +type balance_info is record [ + balance_a : option (nat); + balance_b : option (nat); +] + (* record for the dex storage *) type dex_storage is record [ entered : bool; (* reentrancy protection *) + tmp : balance_info; pairs_count : nat; (* total shares count *) tokens : big_map(nat, tokens_info); (* all the tokens list *) token_to_id : big_map(token_pair, nat); (* all the tokens list *) @@ -90,6 +103,14 @@ type token_to_token_route_params is receiver : address; (* tokens receiver *) ] +type ensured_route_params is + [@layout:comb] + record [ + swaps : list(swap_slice_type); (* swap operations list*) + min_amount_out : nat; (* min amount of tokens received to accept exchange *) + receiver : address; (* tokens receiver *) + ] + type initialize_params is [@layout:comb] record [ @@ -107,6 +128,13 @@ type invest_liquidity_params is token_b_in : nat; (* min amount of tokens B invested *) ] +type ensured_invest_params is + [@layout:comb] + record [ + pair : tokens_info; (* exchange pair info *) + shares : nat; (* the amount of shares to receive *) + ] + type divest_liquidity_params is [@layout:comb] record [ @@ -118,8 +146,11 @@ type divest_liquidity_params is type dex_action is | AddPair of initialize_params (* sets initial liquidity *) +| EnsuredAddPair of tokens_info (* sets initial liquidity *) | Swap of token_to_token_route_params (* exchanges token to another token and sends them to receiver *) +| EnsuredSwap of ensured_route_params (* exchanges token to another token and sends them to receiver *) | Invest of invest_liquidity_params (* mints min shares after investing tokens *) +| EnsuredInvest of ensured_invest_params (* mints min shares after investing tokens *) | Divest of divest_liquidity_params (* burns shares and sends tokens to the owner *) type use_params is dex_action diff --git a/contracts/partials/TTDex.ligo b/contracts/partials/TTDex.ligo index 7f0de231..bafcedf5 100644 --- a/contracts/partials/TTDex.ligo +++ b/contracts/partials/TTDex.ligo @@ -16,9 +16,12 @@ based on the argument type. block { const idx : nat = case p of | AddPair(n) -> 0n - | Swap(n) -> 1n - | Invest(n) -> 2n - | Divest(n) -> 3n + | EnsuredAddPair(n) -> 1n + | Swap(n) -> 2n + | EnsuredSwap(n) -> 3n + | Invest(n) -> 4n + | EnsuredInvest(n) -> 5n + | Divest(n) -> 6n end; const res : return = case s.dex_lambdas[idx] of Some(f) -> f(p, s.storage, this) diff --git a/contracts/partials/TTMethodDex.ligo b/contracts/partials/TTMethodDex.ligo index d8fb092d..0344c88b 100644 --- a/contracts/partials/TTMethodDex.ligo +++ b/contracts/partials/TTMethodDex.ligo @@ -122,6 +122,26 @@ function get_fa12_token_contract( | None -> (failwith("Dex/not-token") : contract(transfer_type_fa12)) end; +(* Helper function to get fa2 token contract *) +function get_fa2_balance_entrypoint( + const token_address : address) : contract(transfer_type_fa2) is + case (Tezos.get_entrypoint_opt( + "%transfer", + token_address) : option(contract(transfer_type_fa2))) of + Some(contr) -> contr + | None -> (failwith("Dex/not-token") : contract(transfer_type_fa2)) + end; + +(* Helper function to get fa1.2 token contract *) +function get_fa12_balance_entrypoint( + const token_address : address) : contract(transfer_type_fa12) is + case (Tezos.get_entrypoint_opt( + "%transfer", + token_address) : option(contract(transfer_type_fa12))) of + Some(contr) -> contr + | None -> (failwith("Dex/not-token") : contract(transfer_type_fa12)) + end; + (* Helper function to get the reentrancy entrypoint of the current contract *) function get_close_entrypoint( const contract_address : address) : contract(unit) is @@ -163,6 +183,72 @@ function transfer_fa12( get_fa12_token_contract(contract_address) ); +function get_bal_fa12_a(const self : address) : contract(nat) is + case (Tezos.get_entrypoint_opt("%balanceAFA12", self) : option(contract(nat))) of + | Some(contr) -> contr + | None -> (failwith("Dex/balanceAFa12") : contract(nat)) + end +function get_bal_fa12_b(const self : address) : contract(nat) is + case (Tezos.get_entrypoint_opt("%balanceBFA12", self) : option(contract(nat))) of + | Some(contr) -> contr + | None -> (failwith("Dex/balanceBFa12") : contract(nat)) + end + +function get_bal_fa2_a(const self : address) : contract(list(balance_of_response)) is + case (Tezos.get_entrypoint_opt("%balanceAFA2", self) : option(contract(list(balance_of_response)))) of + | Some(contr) -> contr + | None -> (failwith("Dex/balanceAFa2") : contract(list(balance_of_response))) + end + +function get_bal_fa2_b(const self : address) : contract(list(balance_of_response)) is + case (Tezos.get_entrypoint_opt("%balanceBFA2", self) : option(contract(list(balance_of_response)))) of + | Some(contr) -> contr + | None -> (failwith("Dex/balanceBFa2") : contract(list(balance_of_response))) + end + +function get_fa12_balance_entrypoint(const token : address) : contract(balance_of_fa12_params) is + case (Tezos.get_entrypoint_opt("%getBalance", token): option(contract(balance_of_fa12_params))) of + | Some(contr) -> contr + | None -> (failwith("Dex/balance-of-ep") : contract(balance_of_fa12_params)) + end + +function get_fa2_balance_entrypoint(const token : address): contract(balance_params) is + case (Tezos.get_entrypoint_opt("%balance_of", token): option(contract(balance_params))) of + | Some(contr) -> contr + | None -> (failwith("Dex/balance-of-ep") : contract(balance_params)) + end + +(* Helper function to transfer fa2 tokens *) +function get_balance_fa2( + const user : address; + const token_id : nat; + const contract_address : address; + const callback : contract(list(balance_of_response))) : operation is + Tezos.transaction( + record [ + requests = list [ + record [ + owner = user; + token_id = token_id; + ] + ]; + callback = callback + ], + 0mutez, + get_fa2_balance_entrypoint(contract_address) + ); + +(* Helper function to transfer fa1.2 tokens *) +function get_balance_fa12( + const user : address; + const contract_address : address; + const callback : contract(nat)) : operation is + Tezos.transaction( + (user, callback), + 0mutez, + get_fa12_balance_entrypoint(contract_address) + ); + (* Helper function to transfer the asset based on its standard *) function typed_transfer( const sender_ : address; @@ -185,6 +271,43 @@ function typed_transfer( contract_address) end; +(* Helper function to transfer the asset based on its standard *) +function typed_get_balance( + const account : address; + const token_id : nat; + const contract_address : address; + const standard: token_type; + const name : token_name) : operation is + block { + var op : option(operation) := (None : option(operation)); + case standard of + Fa12 -> { + const callback : contract(nat) = case name of + | A -> get_bal_fa12_a(contract_address) + | B -> get_bal_fa12_b(contract_address) + end; + op := Some(get_balance_fa12( + account, + contract_address, + callback)); + } + | Fa2 -> { + const callback : contract(list(balance_of_response)) = case name of + | A -> get_bal_fa2_a(contract_address) + | B -> get_bal_fa2_b(contract_address) + end; + op := Some(get_balance_fa2( + account, + token_id, + contract_address, + callback)); + } + end; + } with case op of + | Some(o) -> o + | None -> (failwith("Dex/no-balance") : operation) + end + (* Helper function to transfer the asset based on its standard *) function check_token_id( const token_id : nat; @@ -206,52 +329,66 @@ function initialize_exchange( block { var operations: list(operation) := list[]; case p of - AddPair(params) -> { - if s.entered + EnsuredAddPair(params) -> { + if not s.entered + then failwith("Dex/reentrancy") + else s.entered := True; + if Tezos.sender =/= this then failwith("Dex/reentrancy") else s.entered := True; (* check preconditions *) - if params.pair.token_a_address = params.pair.token_b_address - and params.pair.token_a_id >= params.pair.token_b_id + if params.token_a_address = params.token_b_address + and params.token_a_id >= params.token_b_id then failwith("Dex/wrong-token-id") else skip; - if params.pair.token_a_address > params.pair.token_b_address + if params.token_a_address > params.token_b_address then failwith("Dex/wrong-pair") else skip; (* check fa1.2 token ids *) - check_token_id(params.pair.token_a_id, params.pair.token_a_type); - check_token_id(params.pair.token_b_id, params.pair.token_b_type); + check_token_id(params.token_a_id, params.token_a_type); + check_token_id(params.token_b_id, params.token_b_type); (* read pair info*) - const res : (pair_info * nat) = get_pair(params.pair, s); + const res : (pair_info * nat) = get_pair(params, s); const pair : pair_info = res.0; const token_id : nat = res.1; (* update counter if needed *) if s.pairs_count = token_id then { - s.token_to_id[Bytes.pack(params.pair)] := token_id; + s.token_to_id[Bytes.pack(params)] := token_id; s.pairs_count := s.pairs_count + 1n; } else skip; + var token_a_in : nat := 0n; + var token_b_in : nat := 0n; + case s.tmp.balance_a of + | Some(balance_a) -> token_a_in := balance_a + | None -> failwith("Dex/balanca-a-not-updated") + end; + case s.tmp.balance_b of + | Some(balance_b) -> token_b_in := balance_b + | None -> failwith("Dex/balanca-b-not-updated") + end; + (* check preconditions *) if pair.token_a_pool * pair.token_b_pool =/= 0n (* no reserves *) then failwith("Dex/non-zero-reserves") else skip; if pair.total_supply =/= 0n (* no shares owned *) then failwith("Dex/non-zero-shares") else skip; - if params.token_a_in < 1n (* no token A invested *) + if token_a_in < 1n (* no token A invested *) then failwith("Dex/no-token-a") else skip; - if params.token_b_in < 1n (* no token B invested *) + if token_b_in < 1n (* no token B invested *) then failwith("Dex/no-token-b") else skip; (* update pool reserves *) - pair.token_a_pool := params.token_a_in; - pair.token_b_pool := params.token_b_in; + pair.token_a_pool := token_a_in; + pair.token_b_pool := token_b_in; (* calculate initial shares *) const init_shares : nat = - if params.token_a_in < params.token_b_in then - params.token_a_in - else params.token_b_in; + if token_a_in < token_b_in then + token_a_in + else token_b_in; (* distribute initial shares *) s.ledger[(Tezos.sender, token_id)] := record [ @@ -262,10 +399,66 @@ function initialize_exchange( (* update storage *) s.pairs[token_id] := pair; - s.tokens[token_id] := params.pair; + s.tokens[token_id] := params; + + (* prepare operations to get change if any *) + // operations := + // typed_transfer( + // Tezos.sender, + // this, + // params.token_a_in, + // params.pair.token_a_id, + // params.pair.token_a_address, + // params.pair.token_a_type + // ) # operations; + // operations := + // typed_transfer( + // Tezos.sender, + // this, + // params.token_b_in, + // params.pair.token_b_id, + // params.pair.token_b_address, + // params.pair.token_b_type + // ) # operations; + } + | AddPair(n) -> skip + | Swap(n) -> skip + | EnsuredSwap(n) -> skip + | Invest(n) -> skip + | EnsuredInvest(n) -> skip + | Divest(n) -> skip + end +} with (operations, s) + +(* Initialize exchange after the previous liquidity was drained *) +function preinitialize_exchange( + const p : dex_action; + const s : dex_storage; + const this: address) : return is + block { + var operations: list(operation) := list[]; + case p of + AddPair(params) -> { + if s.entered + then failwith("Dex/reentrancy") + else s.entered := True; (* prepare operations to get initial liquidity *) - operations := + operations := list [ + typed_get_balance( + this, + params.pair.token_a_id, + params.pair.token_a_address, + params.pair.token_a_type, + A(unit) + ); + typed_get_balance( + this, + params.pair.token_b_id, + params.pair.token_b_address, + params.pair.token_b_type, + B(unit) + ); typed_transfer( Tezos.sender, this, @@ -273,8 +466,7 @@ function initialize_exchange( params.pair.token_a_id, params.pair.token_a_address, params.pair.token_a_type - ) # operations; - operations := + ); typed_transfer( Tezos.sender, this, @@ -282,10 +474,29 @@ function initialize_exchange( params.pair.token_b_id, params.pair.token_b_address, params.pair.token_b_type - ) # operations; + ); + typed_get_balance( + this, + params.pair.token_a_id, + params.pair.token_a_address, + params.pair.token_a_type, + A(unit) + ); + typed_get_balance( + this, + params.pair.token_b_id, + params.pair.token_b_address, + params.pair.token_b_type, + B(unit) + ) + // TODO: continue execution + ]; } + | EnsuredAddPair(n) -> skip | Swap(n) -> skip + | EnsuredSwap(n) -> skip | Invest(n) -> skip + | EnsuredInvest(n) -> skip | Divest(n) -> skip end } with (operations, s) @@ -385,35 +596,116 @@ function token_to_token_route( | None -> (failwith("Dex/zero-swaps") : swap_slice_type) end; - (* declare helper variables *) - var token_id_in : nat := first_swap.pair.token_a_id; - var token_address_in : address := first_swap.pair.token_a_address; - (* prepare operation to withdraw user's tokens *) case first_swap.operation of | Sell -> { - operations := - (* from *) - typed_transfer(Tezos.sender, - this, - params.amount_in, - first_swap.pair.token_a_id, - first_swap.pair.token_a_address, - first_swap.pair.token_a_type - ) # operations; + operations := list [ + (* from *) + typed_get_balance( + this, + first_swap.pair.token_a_id, + first_swap.pair.token_a_address, + first_swap.pair.token_a_type, + A(unit) + ); + typed_transfer(Tezos.sender, + this, + params.amount_in, + first_swap.pair.token_a_id, + first_swap.pair.token_a_address, + first_swap.pair.token_a_type + ) ; + typed_get_balance( + this, + first_swap.pair.token_a_id, + first_swap.pair.token_a_address, + first_swap.pair.token_a_type, + A(unit) + ); + ]; + (* TODO : add continue *) } | Buy -> { - token_id_in := first_swap.pair.token_b_id; - token_address_in := first_swap.pair.token_b_address; - operations := + operations := list [ (* from *) + typed_get_balance( + this, + first_swap.pair.token_b_id, + first_swap.pair.token_b_address, + first_swap.pair.token_b_type, + B(unit) + ); typed_transfer(Tezos.sender, this, params.amount_in, first_swap.pair.token_b_id, first_swap.pair.token_b_address, first_swap.pair.token_b_type - ) # operations; + ); + typed_get_balance( + this, + first_swap.pair.token_b_id, + first_swap.pair.token_b_address, + first_swap.pair.token_b_type, + B(unit) + ); + ]; + (* TODO : add continue *) + } + end; + } + | EnsuredAddPair(n) -> skip + | EnsuredSwap(n) -> skip + | Invest(n) -> skip + | EnsuredInvest(n) -> skip + | Divest(n) -> skip + end + } with (operations, s) + +(* Exchange tokens to tokens with multiple hops, +note: tokens should be approved before the operation *) +function ensured_route( + const p : dex_action; + const s : dex_storage; + const this : address) : return is + block { + var operations: list(operation) := list[]; + case p of + | AddPair(n) -> skip + | EnsuredSwap(params) -> { + if not s.entered + then failwith("Dex/reentrancy") + else s.entered := True; + if Tezos.sender =/= this + then failwith("Dex/reentrancy") + else s.entered := True; + + (* get the first exchange info *) + const first_swap : swap_slice_type = case List.head_opt(params.swaps) of + Some(swap) -> swap + | None -> (failwith("Dex/zero-swaps") : swap_slice_type) + end; + + (* declare helper variables *) + var token_id_in : nat := first_swap.pair.token_a_id; + var token_address_in : address := first_swap.pair.token_a_address; + var amount_in : nat := 0n; + + (* prepare operation to withdraw user's tokens *) + case first_swap.operation of + | Sell -> { + case s.tmp.balance_a of + | Some(balance_a) -> amount_in := balance_a + | None -> failwith("Dex/balanca-a-not-updated") + end; + } + | Buy -> { + token_id_in := first_swap.pair.token_b_id; + token_address_in := first_swap.pair.token_b_address; + case s.tmp.balance_b of + | Some(balance_b) -> amount_in := balance_b + | None -> failwith("Dex/balanca-b-not-updated") + end; } end; @@ -423,7 +715,7 @@ function token_to_token_route( params.swaps, record [ s = s; - amount_in = params.amount_in; + amount_in = amount_in; operation = (None : option(operation)); sender = this; receiver = params.receiver; @@ -446,7 +738,10 @@ function token_to_token_route( end; operations := last_operation # operations; } + | EnsuredAddPair(n) -> skip + | Swap(n) -> skip | Invest(n) -> skip + | EnsuredInvest(n) -> skip | Divest(n) -> skip end } with (operations, s) @@ -467,6 +762,81 @@ function invest_liquidity( then failwith("Dex/reentrancy") else s.entered := True; + (* prepare operations to get initial liquidity *) + operations := list [ + typed_get_balance( + this, + params.pair.token_a_id, + params.pair.token_a_address, + params.pair.token_a_type, + A(unit) + ); + typed_get_balance( + this, + params.pair.token_b_id, + params.pair.token_b_address, + params.pair.token_b_type, + B(unit) + ); + typed_transfer( + Tezos.sender, + this, + params.token_a_in, + params.pair.token_a_id, + params.pair.token_a_address, + params.pair.token_a_type + ); + typed_transfer( + Tezos.sender, + this, + params.token_b_in, + params.pair.token_b_id, + params.pair.token_b_address, + params.pair.token_b_type + ); + typed_get_balance( + this, + params.pair.token_a_id, + params.pair.token_a_address, + params.pair.token_a_type, + A(unit) + ); + typed_get_balance( + this, + params.pair.token_b_id, + params.pair.token_b_address, + params.pair.token_b_type, + B(unit) + ) + // TODO: continue execution + ]; + } + | EnsuredAddPair(n) -> skip + | EnsuredSwap(n) -> skip + | EnsuredInvest(n) -> skip + | Divest(n) -> skip + end + } with (operations, s) + +(* Provide liquidity (both tokens) to the pool, +note: tokens should be approved before the operation *) +function ensured_invest( + const p : dex_action; + const s : dex_storage; + const this: address) : return is + block { + var operations: list(operation) := list[]; + case p of + | AddPair(n) -> skip + | Swap(n) -> skip + | EnsuredInvest(params) -> { + if not s.entered + then failwith("Dex/reentrancy") + else s.entered := True; + if Tezos.sender =/= this + then failwith("Dex/reentrancy") + else s.entered := True; + (* check preconditions *) if params.pair.token_a_address = params.pair.token_b_address and params.pair.token_a_id >= params.pair.token_b_id @@ -499,14 +869,26 @@ function invest_liquidity( tokens_b_required * pair.total_supply then tokens_b_required := tokens_b_required + 1n else skip; + (* update pool reserves *) + const token_a_in : nat = 0n; + const token_b_in : nat = 0n; + case s.tmp.balance_a of + | Some(balance_a) -> token_a_in := balance_a + | None -> failwith("Dex/balanca-a-not-updated") + end; + case s.tmp.balance_b of + | Some(balance_b) -> token_b_in := balance_b + | None -> failwith("Dex/balanca-b-not-updated") + end; + (* ensure *) if tokens_a_required = 0n (* providing liquidity won't impact on price *) then failwith("Dex/zero-token-a-in") else skip; if tokens_b_required = 0n (* providing liquidity won't impact on price *) then failwith("Dex/zero-token-b-in") else skip; - if tokens_a_required > params.token_a_in (* required tokens doesn't exceed max allowed by user *) + if tokens_a_required > token_a_in (* required tokens doesn't exceed max allowed by user *) then failwith("Dex/low-max-token-a-in") else skip; - if tokens_b_required > params.token_b_in (* required tez doesn't exceed max allowed by user *) + if tokens_b_required > token_b_in (* required tez doesn't exceed max allowed by user *) then failwith("Dex/low-max-token-b-in") else skip; var account : account_info := get_account((Tezos.sender, token_id), s); @@ -525,25 +907,29 @@ function invest_liquidity( s.pairs[token_id] := pair; (* prepare operations to get initial liquidity *) - operations := - typed_transfer( - Tezos.sender, - this, - tokens_a_required, - params.pair.token_a_id, - params.pair.token_a_address, - params.pair.token_a_type - ) # operations; - operations := - typed_transfer( - Tezos.sender, - this, - tokens_b_required, - params.pair.token_b_id, - params.pair.token_b_address, - params.pair.token_b_type - ) # operations; + (* TODO: send change if any *) + // operations := + // typed_transfer( + // Tezos.sender, + // this, + // tokens_a_required, + // params.pair.token_a_id, + // params.pair.token_a_address, + // params.pair.token_a_type + // ) # operations; + // operations := + // typed_transfer( + // Tezos.sender, + // this, + // tokens_b_required, + // params.pair.token_b_id, + // params.pair.token_b_address, + // params.pair.token_b_type + // ) # operations; } + | EnsuredAddPair(n) -> skip + | EnsuredSwap(n) -> skip + | Invest(n) -> skip | Divest(n) -> skip end } with (operations, s) @@ -557,8 +943,11 @@ function divest_liquidity( var operations: list(operation) := list[]; case p of | AddPair(token_amount) -> skip + | EnsuredAddPair(n) -> skip | Swap(n) -> skip + | EnsuredSwap(n) -> skip | Invest(n) -> skip + | EnsuredInvest(n) -> skip | Divest(params) -> { if s.entered then failwith("Dex/reentrancy") From a48fb7f1f1d168e0c730f41e31ef9fd857e21dba Mon Sep 17 00:00:00 2001 From: KStasi Date: Tue, 14 Sep 2021 16:00:25 +0200 Subject: [PATCH 06/22] continue callbacks added --- contracts/partials/ITTDex.ligo | 10 ++- contracts/partials/TTMethodDex.ligo | 128 +++++++++++++++++++--------- 2 files changed, 98 insertions(+), 40 deletions(-) diff --git a/contracts/partials/ITTDex.ligo b/contracts/partials/ITTDex.ligo index 99e34ae7..29c9353a 100644 --- a/contracts/partials/ITTDex.ligo +++ b/contracts/partials/ITTDex.ligo @@ -132,9 +132,17 @@ type ensured_invest_params is [@layout:comb] record [ pair : tokens_info; (* exchange pair info *) + receiver : address; (* exchange pair info *) shares : nat; (* the amount of shares to receive *) ] +type ensured_add_params is + [@layout:comb] + record [ + pair : tokens_info; (* exchange pair info *) + receiver : address; (* exchange pair info *) + ] + type divest_liquidity_params is [@layout:comb] record [ @@ -146,7 +154,7 @@ type divest_liquidity_params is type dex_action is | AddPair of initialize_params (* sets initial liquidity *) -| EnsuredAddPair of tokens_info (* sets initial liquidity *) +| EnsuredAddPair of ensured_add_params (* sets initial liquidity *) | Swap of token_to_token_route_params (* exchanges token to another token and sends them to receiver *) | EnsuredSwap of ensured_route_params (* exchanges token to another token and sends them to receiver *) | Invest of invest_liquidity_params (* mints min shares after investing tokens *) diff --git a/contracts/partials/TTMethodDex.ligo b/contracts/partials/TTMethodDex.ligo index 0344c88b..715ef83f 100644 --- a/contracts/partials/TTMethodDex.ligo +++ b/contracts/partials/TTMethodDex.ligo @@ -218,6 +218,24 @@ function get_fa2_balance_entrypoint(const token : address): contract(balance_par | None -> (failwith("Dex/balance-of-ep") : contract(balance_params)) end +function get_ensured_initialize_entrypoint(const token : address): contract(ensured_add_params) is + case (Tezos.get_entrypoint_opt("%ensuredAddPair", token): option(contract(ensured_add_params))) of + | Some(contr) -> contr + | None -> (failwith("Dex/no-entrypoint") : contract(ensured_add_params)) + end + +function get_ensured_invest_entrypoint(const token : address): contract(ensured_invest_params) is + case (Tezos.get_entrypoint_opt("%ensuredInvest", token): option(contract(ensured_invest_params))) of + | Some(contr) -> contr + | None -> (failwith("Dex/no-entrypoint") : contract(ensured_invest_params)) + end + +function get_ensured_swap_entrypoint(const token : address): contract(ensured_route_params) is + case (Tezos.get_entrypoint_opt("%ensuredSwap", token): option(contract(ensured_route_params))) of + | Some(contr) -> contr + | None -> (failwith("Dex/no-entrypoint") : contract(ensured_route_params)) + end + (* Helper function to transfer fa2 tokens *) function get_balance_fa2( const user : address; @@ -338,24 +356,24 @@ function initialize_exchange( else s.entered := True; (* check preconditions *) - if params.token_a_address = params.token_b_address - and params.token_a_id >= params.token_b_id + if params.pair.token_a_address = params.pair.token_b_address + and params.pair.token_a_id >= params.pair.token_b_id then failwith("Dex/wrong-token-id") else skip; - if params.token_a_address > params.token_b_address + if params.pair.token_a_address > params.pair.token_b_address then failwith("Dex/wrong-pair") else skip; (* check fa1.2 token ids *) - check_token_id(params.token_a_id, params.token_a_type); - check_token_id(params.token_b_id, params.token_b_type); + check_token_id(params.pair.token_a_id, params.pair.token_a_type); + check_token_id(params.pair.token_b_id, params.pair.token_b_type); (* read pair info*) - const res : (pair_info * nat) = get_pair(params, s); + const res : (pair_info * nat) = get_pair(params.pair, s); const pair : pair_info = res.0; const token_id : nat = res.1; (* update counter if needed *) if s.pairs_count = token_id then { - s.token_to_id[Bytes.pack(params)] := token_id; + s.token_to_id[Bytes.pack(params.pair)] := token_id; s.pairs_count := s.pairs_count + 1n; } else skip; @@ -391,7 +409,7 @@ function initialize_exchange( else token_b_in; (* distribute initial shares *) - s.ledger[(Tezos.sender, token_id)] := record [ + s.ledger[(params.receiver, token_id)] := record [ balance = init_shares; allowances = (set [] : set(address)); ]; @@ -399,7 +417,7 @@ function initialize_exchange( (* update storage *) s.pairs[token_id] := pair; - s.tokens[token_id] := params; + s.tokens[token_id] := params.pair; (* prepare operations to get change if any *) // operations := @@ -488,8 +506,15 @@ function preinitialize_exchange( params.pair.token_b_address, params.pair.token_b_type, B(unit) - ) - // TODO: continue execution + ); + Tezos.transaction( + record [ + pair=params.pair; + receiver=Tezos.sender; + ], + 0mutez, + get_ensured_initialize_entrypoint(this) + ); ]; } | EnsuredAddPair(n) -> skip @@ -622,35 +647,52 @@ function token_to_token_route( first_swap.pair.token_a_type, A(unit) ); + Tezos.transaction( + record [ + swaps=params.swaps; + min_amount_out=params.min_amount_out; + receiver=Tezos.sender; + ], + 0mutez, + get_ensured_swap_entrypoint(this) + ); ]; (* TODO : add continue *) } | Buy -> { operations := list [ - (* from *) - typed_get_balance( - this, - first_swap.pair.token_b_id, - first_swap.pair.token_b_address, - first_swap.pair.token_b_type, - B(unit) - ); - typed_transfer(Tezos.sender, - this, - params.amount_in, - first_swap.pair.token_b_id, - first_swap.pair.token_b_address, - first_swap.pair.token_b_type - ); - typed_get_balance( - this, - first_swap.pair.token_b_id, - first_swap.pair.token_b_address, - first_swap.pair.token_b_type, - B(unit) - ); - ]; - (* TODO : add continue *) + (* from *) + typed_get_balance( + this, + first_swap.pair.token_b_id, + first_swap.pair.token_b_address, + first_swap.pair.token_b_type, + B(unit) + ); + typed_transfer(Tezos.sender, + this, + params.amount_in, + first_swap.pair.token_b_id, + first_swap.pair.token_b_address, + first_swap.pair.token_b_type + ); + typed_get_balance( + this, + first_swap.pair.token_b_id, + first_swap.pair.token_b_address, + first_swap.pair.token_b_type, + B(unit) + ); + Tezos.transaction( + record [ + swaps=params.swaps; + min_amount_out=params.min_amount_out; + receiver=Tezos.sender; + ], + 0mutez, + get_ensured_swap_entrypoint(this) + ); + ]; } end; } @@ -807,8 +849,16 @@ function invest_liquidity( params.pair.token_b_address, params.pair.token_b_type, B(unit) - ) - // TODO: continue execution + ); + Tezos.transaction( + record [ + pair=params.pair; + shares=params.shares; + receiver=Tezos.sender; + ], + 0mutez, + get_ensured_invest_entrypoint(this) + ); ]; } | EnsuredAddPair(n) -> skip @@ -891,12 +941,12 @@ function ensured_invest( if tokens_b_required > token_b_in (* required tez doesn't exceed max allowed by user *) then failwith("Dex/low-max-token-b-in") else skip; - var account : account_info := get_account((Tezos.sender, token_id), s); + var account : account_info := get_account((params.receiver, token_id), s); const share : nat = account.balance; (* update user's shares *) account.balance := share + params.shares; - s.ledger[(Tezos.sender, token_id)] := account; + s.ledger[(params.receiver, token_id)] := account; (* update reserves *) pair.token_a_pool := pair.token_a_pool + tokens_a_required; From ec53aa87136c2a395a1a07e23988a7a8d3abd688 Mon Sep 17 00:00:00 2001 From: KStasi Date: Wed, 15 Sep 2021 11:11:26 +0200 Subject: [PATCH 07/22] Add balance entrypoint --- contracts/main/TTDex.ligo | 2 +- contracts/partials/ITTDex.ligo | 13 +- contracts/partials/TTDex.ligo | 16 +- contracts/partials/TTMethodDex.ligo | 187 +++++++++++++++++++++- migrations/2_deploy_token_to_token_dex.js | 2 +- storage/TTDex.js | 4 + storage/TTFunctions.js | 28 ++++ test/storage/TTDex.ts | 4 + test/storage/TTFunctions.ts | 28 ++++ 9 files changed, 271 insertions(+), 13 deletions(-) diff --git a/contracts/main/TTDex.ligo b/contracts/main/TTDex.ligo index f6bf038b..8593eb5d 100644 --- a/contracts/main/TTDex.ligo +++ b/contracts/main/TTDex.ligo @@ -15,6 +15,6 @@ function main (const p : full_action; const s : full_dex_storage) : full_return | Update_operators(params) -> call_token(IUpdate_operators(params), this, 1n, s) | Get_reserves(params) -> get_reserves(params, s) | Close -> ((nil:list(operation)), close(s)) - | SetDexFunction(params) -> ((nil:list(operation)), if params.index > 3n then (failwith("Dex/wrong-index") : full_dex_storage) else set_dex_function(params.index, params.func, s)) + | SetDexFunction(params) -> ((nil:list(operation)), if params.index > 9n then (failwith("Dex/wrong-index") : full_dex_storage) else set_dex_function(params.index, params.func, s)) | SetTokenFunction(params) -> ((nil:list(operation)), if params.index > 2n then (failwith("Dex/wrong-index") : full_dex_storage) else set_token_function(params.index, params.func, s)) end diff --git a/contracts/partials/ITTDex.ligo b/contracts/partials/ITTDex.ligo index 29c9353a..f8887143 100644 --- a/contracts/partials/ITTDex.ligo +++ b/contracts/partials/ITTDex.ligo @@ -153,13 +153,20 @@ type divest_liquidity_params is ] type dex_action is +(* User's entrypoints *) | AddPair of initialize_params (* sets initial liquidity *) -| EnsuredAddPair of ensured_add_params (* sets initial liquidity *) | Swap of token_to_token_route_params (* exchanges token to another token and sends them to receiver *) -| EnsuredSwap of ensured_route_params (* exchanges token to another token and sends them to receiver *) | Invest of invest_liquidity_params (* mints min shares after investing tokens *) -| EnsuredInvest of ensured_invest_params (* mints min shares after investing tokens *) | Divest of divest_liquidity_params (* burns shares and sends tokens to the owner *) +(* For internal usage*) +| EnsuredAddPair of ensured_add_params (* sets initial liquidity *) +| EnsuredSwap of ensured_route_params (* exchanges token to another token and sends them to receiver *) +| EnsuredInvest of ensured_invest_params (* mints min shares after investing tokens *) +(* Callback *) +| BalanceAFA12 of nat (* process token balance *) +| BalanceBFA12 of nat (* process token balance *) +| BalanceAFA2 of list(balance_of_response) (* process token balance *) +| BalanceBFA2 of list(balance_of_response) (* process token balance *) type use_params is dex_action type get_reserves_params is record [ diff --git a/contracts/partials/TTDex.ligo b/contracts/partials/TTDex.ligo index bafcedf5..21750e57 100644 --- a/contracts/partials/TTDex.ligo +++ b/contracts/partials/TTDex.ligo @@ -16,12 +16,16 @@ based on the argument type. block { const idx : nat = case p of | AddPair(n) -> 0n - | EnsuredAddPair(n) -> 1n - | Swap(n) -> 2n - | EnsuredSwap(n) -> 3n - | Invest(n) -> 4n - | EnsuredInvest(n) -> 5n - | Divest(n) -> 6n + | Swap(n) -> 1n + | Invest(n) -> 2n + | Divest(n) -> 3n + | EnsuredAddPair(n) -> 4n + | EnsuredSwap(n) -> 5n + | EnsuredInvest(n) -> 6n + | BalanceAFA12(n) -> 7n + | BalanceBFA12(n) -> 8n + | BalanceAFA2(n) -> 9n + | BalanceBFA2(n) -> 10n end; const res : return = case s.dex_lambdas[idx] of Some(f) -> f(p, s.storage, this) diff --git a/contracts/partials/TTMethodDex.ligo b/contracts/partials/TTMethodDex.ligo index 715ef83f..7195473f 100644 --- a/contracts/partials/TTMethodDex.ligo +++ b/contracts/partials/TTMethodDex.ligo @@ -340,7 +340,7 @@ function check_token_id( #include "../partials/TTMethodFA2.ligo" (* Initialize exchange after the previous liquidity was drained *) -function initialize_exchange( +function ensured_initialize_exchange( const p : dex_action; const s : dex_storage; const this: address) : return is @@ -445,11 +445,15 @@ function initialize_exchange( | Invest(n) -> skip | EnsuredInvest(n) -> skip | Divest(n) -> skip + | BalanceAFA12(n) -> skip + | BalanceBFA12(n) -> skip + | BalanceAFA2(n) -> skip + | BalanceBFA2(n) -> skip end } with (operations, s) (* Initialize exchange after the previous liquidity was drained *) -function preinitialize_exchange( +function initialize_exchange( const p : dex_action; const s : dex_storage; const this: address) : return is @@ -461,6 +465,11 @@ function preinitialize_exchange( then failwith("Dex/reentrancy") else s.entered := True; + s.tmp := record [ + balance_a = (None : option(nat)); + balance_b = (None : option(nat)); + ]; + (* prepare operations to get initial liquidity *) operations := list [ typed_get_balance( @@ -523,6 +532,10 @@ function preinitialize_exchange( | Invest(n) -> skip | EnsuredInvest(n) -> skip | Divest(n) -> skip + | BalanceAFA12(n) -> skip + | BalanceBFA12(n) -> skip + | BalanceAFA2(n) -> skip + | BalanceBFA2(n) -> skip end } with (operations, s) @@ -615,6 +628,11 @@ function token_to_token_route( if params.min_amount_out = 0n (* non-zero amount of tokens to receive *) then failwith ("Dex/zero-min-amount-out") else skip; + s.tmp := record [ + balance_a = (None : option(nat)); + balance_b = (None : option(nat)); + ]; + (* get the first exchange info *) const first_swap : swap_slice_type = case List.head_opt(params.swaps) of Some(swap) -> swap @@ -701,6 +719,10 @@ function token_to_token_route( | Invest(n) -> skip | EnsuredInvest(n) -> skip | Divest(n) -> skip + | BalanceAFA12(n) -> skip + | BalanceBFA12(n) -> skip + | BalanceAFA2(n) -> skip + | BalanceBFA2(n) -> skip end } with (operations, s) @@ -785,6 +807,10 @@ function ensured_route( | Invest(n) -> skip | EnsuredInvest(n) -> skip | Divest(n) -> skip + | BalanceAFA12(n) -> skip + | BalanceBFA12(n) -> skip + | BalanceAFA2(n) -> skip + | BalanceBFA2(n) -> skip end } with (operations, s) @@ -804,6 +830,11 @@ function invest_liquidity( then failwith("Dex/reentrancy") else s.entered := True; + s.tmp := record [ + balance_a = (None : option(nat)); + balance_b = (None : option(nat)); + ]; + (* prepare operations to get initial liquidity *) operations := list [ typed_get_balance( @@ -865,6 +896,10 @@ function invest_liquidity( | EnsuredSwap(n) -> skip | EnsuredInvest(n) -> skip | Divest(n) -> skip + | BalanceAFA12(n) -> skip + | BalanceBFA12(n) -> skip + | BalanceAFA2(n) -> skip + | BalanceBFA2(n) -> skip end } with (operations, s) @@ -981,6 +1016,10 @@ function ensured_invest( | EnsuredSwap(n) -> skip | Invest(n) -> skip | Divest(n) -> skip + | BalanceAFA12(n) -> skip + | BalanceBFA12(n) -> skip + | BalanceAFA2(n) -> skip + | BalanceBFA2(n) -> skip end } with (operations, s) @@ -1079,5 +1118,149 @@ function divest_liquidity( params.pair.token_b_type ) # operations; } + | BalanceAFA12(n) -> skip + | BalanceBFA12(n) -> skip + | BalanceAFA2(n) -> skip + | BalanceBFA2(n) -> skip + end + } with (operations, s) + +(* Remove liquidity (both tokens) from the pool by burning shares *) +function update_balance_fa_12_a( + const p : dex_action; + const s : dex_storage; + const this: address) : return is + block { + var operations: list(operation) := list[]; + case p of + | AddPair(token_amount) -> skip + | EnsuredAddPair(n) -> skip + | Swap(n) -> skip + | EnsuredSwap(n) -> skip + | Invest(n) -> skip + | EnsuredInvest(n) -> skip + | Divest(n) -> skip + | BalanceAFA12(new_balance) -> { + s.tmp.balance_a := Some(case s.tmp.balance_a of + | Some(prev_balance) -> + if prev_balance < new_balance + then (failwith("Dex/balance-decremented") : nat) + else abs(prev_balance - new_balance) + | None -> new_balance + end); + } + | BalanceBFA12(n) -> skip + | BalanceAFA2(n) -> skip + | BalanceBFA2(n) -> skip + end + } with (operations, s) + +(* Remove liquidity (both tokens) from the pool by burning shares *) +function update_balance_fa_12_b( + const p : dex_action; + const s : dex_storage; + const this: address) : return is + block { + var operations: list(operation) := list[]; + case p of + | AddPair(token_amount) -> skip + | EnsuredAddPair(n) -> skip + | Swap(n) -> skip + | EnsuredSwap(n) -> skip + | Invest(n) -> skip + | EnsuredInvest(n) -> skip + | Divest(n) -> skip + | BalanceAFA12(n) -> skip + | BalanceBFA12(new_balance) -> { + s.tmp.balance_b := Some(case s.tmp.balance_b of + | Some(prev_balance) -> + if prev_balance < new_balance + then (failwith("Dex/balance-decremented") : nat) + else abs(prev_balance - new_balance) + | None -> new_balance + end); + } + | BalanceAFA2(n) -> skip + | BalanceBFA2(n) -> skip + end + } with (operations, s) + +(* Remove liquidity (both tokens) from the pool by burning shares *) +function update_balance_fa_2_a( + const p : dex_action; + const s : dex_storage; + const this: address) : return is + block { + var operations: list(operation) := list[]; + case p of + | AddPair(token_amount) -> skip + | EnsuredAddPair(n) -> skip + | Swap(n) -> skip + | EnsuredSwap(n) -> skip + | Invest(n) -> skip + | EnsuredInvest(n) -> skip + | Divest(n) -> skip + | BalanceAFA12(n) -> skip + | BalanceBFA12(n) -> skip + | BalanceAFA2(responses) -> { + const response : balance_of_response = + case List.head_opt(responses) of + | Some(head) -> head + | None -> (failwith("Dex/no-balance-response") : balance_of_response) + end; + + if response.request.owner =/= this + then failwith("Dex/wrong-balance-owner") + else skip; + + s.tmp.balance_a := Some(case s.tmp.balance_a of + | Some(prev_balance) -> + if prev_balance < response.balance + then (failwith("Dex/balance-decremented") : nat) + else abs(prev_balance - response.balance) + | None -> response.balance + end); + } + | BalanceBFA2(n) -> skip + end + } with (operations, s) + +(* Remove liquidity (both tokens) from the pool by burning shares *) +function update_balance_fa_2_b( + const p : dex_action; + const s : dex_storage; + const this: address) : return is + block { + var operations: list(operation) := list[]; + case p of + | AddPair(token_amount) -> skip + | EnsuredAddPair(n) -> skip + | Swap(n) -> skip + | EnsuredSwap(n) -> skip + | Invest(n) -> skip + | EnsuredInvest(n) -> skip + | Divest(n) -> skip + | BalanceAFA12(n) -> skip + | BalanceBFA12(n) -> skip + | BalanceAFA2(n) -> skip + | BalanceBFA2(responses) -> { + const response : balance_of_response = + case List.head_opt(responses) of + | Some(head) -> head + | None -> (failwith("Dex/no-balance-response") : balance_of_response) + end; + + if response.request.owner =/= this + then failwith("Dex/wrong-balance-owner") + else skip; + + s.tmp.balance_b := Some(case s.tmp.balance_b of + | Some(prev_balance) -> + if prev_balance < response.balance + then (failwith("Dex/balance-decremented") : nat) + else abs(prev_balance - response.balance) + | None -> response.balance + end); + } end } with (operations, s) diff --git a/migrations/2_deploy_token_to_token_dex.js b/migrations/2_deploy_token_to_token_dex.js index 95bc84dd..3a094fd8 100644 --- a/migrations/2_deploy_token_to_token_dex.js +++ b/migrations/2_deploy_token_to_token_dex.js @@ -23,7 +23,7 @@ const defaultTokenId = 0; module.exports = async (deployer, network, accounts) => { tezos = new TezosToolkit(tezos.rpc.url); - if (network === "development") return; + // if (network === "development") return; const secretKey = accountsStored.alice.sk.trim(); tezos.setProvider({ config: { diff --git a/storage/TTDex.js b/storage/TTDex.js index 094b75fb..b8c5599d 100644 --- a/storage/TTDex.js +++ b/storage/TTDex.js @@ -3,6 +3,10 @@ const { MichelsonMap } = require("@taquito/michelson-encoder"); module.exports = { storage: { pairs_count: "0", + tmp: { + balance_a: null, + balance_b: null, + }, tokens: MichelsonMap.fromLiteral({}), token_to_id: MichelsonMap.fromLiteral({}), pairs: MichelsonMap.fromLiteral({}), diff --git a/storage/TTFunctions.js b/storage/TTFunctions.js index 104d256d..4a9f76d0 100644 --- a/storage/TTFunctions.js +++ b/storage/TTFunctions.js @@ -15,6 +15,34 @@ module.exports.dexFunctions = [ index: 3, name: "divest_liquidity", }, + { + index: 4, + name: "ensured_initialize_exchange", + }, + { + index: 5, + name: "ensured_route", + }, + { + index: 6, + name: "ensured_invest", + }, + { + index: 7, + name: "update_balance_fa_12_a", + }, + { + index: 8, + name: "update_balance_fa_12_b", + }, + { + index: 9, + name: "update_balance_fa_2_a", + }, + { + index: 10, + name: "update_balance_fa_2_b", + }, ]; let tokenFunctions = [ diff --git a/test/storage/TTDex.ts b/test/storage/TTDex.ts index a53e834c..ee2a6e11 100644 --- a/test/storage/TTDex.ts +++ b/test/storage/TTDex.ts @@ -3,6 +3,10 @@ import { MichelsonMap } from "@taquito/michelson-encoder"; export default { storage: { pairs_count: "0", + tmp: { + balance_a: null, + balance_b: null, + }, tokens: MichelsonMap.fromLiteral({}), token_to_id: MichelsonMap.fromLiteral({}), pairs: MichelsonMap.fromLiteral({}), diff --git a/test/storage/TTFunctions.ts b/test/storage/TTFunctions.ts index 8cceb0f3..89c6b1b3 100644 --- a/test/storage/TTFunctions.ts +++ b/test/storage/TTFunctions.ts @@ -15,6 +15,34 @@ export let dexFunctions = [ index: 3, name: "divest_liquidity", }, + { + index: 4, + name: "ensured_initialize_exchange", + }, + { + index: 5, + name: "ensured_route", + }, + { + index: 6, + name: "ensured_invest", + }, + { + index: 7, + name: "update_balance_fa_12_a", + }, + { + index: 8, + name: "update_balance_fa_12_b", + }, + { + index: 9, + name: "update_balance_fa_2_a", + }, + { + index: 10, + name: "update_balance_fa_2_b", + }, ]; export let tokenFunctions = [ From ba533cc85b9b5b162643c50c2ed901d0142a83d2 Mon Sep 17 00:00:00 2001 From: KStasi Date: Wed, 15 Sep 2021 12:30:43 +0200 Subject: [PATCH 08/22] fixes --- contracts/main/TTDex.ligo | 2 +- migrations/2_deploy_token_to_token_dex.js | 2 +- scripts/sandbox/accounts.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/main/TTDex.ligo b/contracts/main/TTDex.ligo index 8593eb5d..c6750653 100644 --- a/contracts/main/TTDex.ligo +++ b/contracts/main/TTDex.ligo @@ -15,6 +15,6 @@ function main (const p : full_action; const s : full_dex_storage) : full_return | Update_operators(params) -> call_token(IUpdate_operators(params), this, 1n, s) | Get_reserves(params) -> get_reserves(params, s) | Close -> ((nil:list(operation)), close(s)) - | SetDexFunction(params) -> ((nil:list(operation)), if params.index > 9n then (failwith("Dex/wrong-index") : full_dex_storage) else set_dex_function(params.index, params.func, s)) + | SetDexFunction(params) -> ((nil:list(operation)), if params.index > 10n then (failwith("Dex/wrong-index") : full_dex_storage) else set_dex_function(params.index, params.func, s)) | SetTokenFunction(params) -> ((nil:list(operation)), if params.index > 2n then (failwith("Dex/wrong-index") : full_dex_storage) else set_token_function(params.index, params.func, s)) end diff --git a/migrations/2_deploy_token_to_token_dex.js b/migrations/2_deploy_token_to_token_dex.js index 3a094fd8..95bc84dd 100644 --- a/migrations/2_deploy_token_to_token_dex.js +++ b/migrations/2_deploy_token_to_token_dex.js @@ -23,7 +23,7 @@ const defaultTokenId = 0; module.exports = async (deployer, network, accounts) => { tezos = new TezosToolkit(tezos.rpc.url); - // if (network === "development") return; + if (network === "development") return; const secretKey = accountsStored.alice.sk.trim(); tezos.setProvider({ config: { diff --git a/scripts/sandbox/accounts.js b/scripts/sandbox/accounts.js index 36f13ce3..bc9ef595 100755 --- a/scripts/sandbox/accounts.js +++ b/scripts/sandbox/accounts.js @@ -10,7 +10,7 @@ module.exports = { pk: "edpkurPsQ8eUApnLUJ9ZPDvu98E8VNj4KtJa1aZr16Cr5ow5VHKnz4", }, eve: { - pkh: "tz1aSkwEot3L2kmUvcoxzjMomb9mvBNuzFK6", + pkh: "tz1MnmtP4uAcgMpeZN6JtyziXeFqqwQG6yn6", sk: "edsk3Sb16jcx9KrgMDsbZDmKnuN11v4AbTtPBgBSBTqYftd8Cq3i1e", pk: "edpku9qEgcyfNNDK6EpMvu5SqXDqWRLuxdMxdyH12ivTUuB1KXfGP4", }, From c85055e9aba13131fe8524a883fb5fe0c5132a69 Mon Sep 17 00:00:00 2001 From: KStasi Date: Wed, 15 Sep 2021 14:30:07 +0200 Subject: [PATCH 09/22] update get balance & other fixes --- contracts/main/TTDex.ligo | 7 +- contracts/partials/ITTDex.ligo | 21 +++- contracts/partials/TTDex.ligo | 39 ++++-- contracts/partials/TTMethodDex.ligo | 141 ++++++---------------- migrations/2_deploy_token_to_token_dex.js | 41 +++++-- storage/TTDex.js | 1 + storage/TTFunctions.js | 11 +- test/helpers/ttContext.ts | 16 ++- test/helpers/ttdexFA2.ts | 21 +++- test/storage/TTDex.ts | 1 + test/storage/TTFunctions.ts | 11 +- 11 files changed, 174 insertions(+), 136 deletions(-) diff --git a/contracts/main/TTDex.ligo b/contracts/main/TTDex.ligo index c6750653..6251213b 100644 --- a/contracts/main/TTDex.ligo +++ b/contracts/main/TTDex.ligo @@ -13,8 +13,13 @@ function main (const p : full_action; const s : full_dex_storage) : full_return | Transfer(params) -> call_token(ITransfer(params), this, 0n, s) | Balance_of(params) -> call_token(IBalance_of(params), this, 2n, s) | Update_operators(params) -> call_token(IUpdate_operators(params), this, 1n, s) + | BalanceAFA12(params) -> call_balance(IBalanceAFA12(params), this, 0n, s) + | BalanceBFA12(params) -> call_balance(IBalanceBFA12(params), this, 1n, s) + | BalanceAFA2(params) -> call_balance(IBalanceAFA2(params), this, 2n, s) + | BalanceBFA2(params) -> call_balance(IBalanceBFA2(params), this, 3n, s) | Get_reserves(params) -> get_reserves(params, s) | Close -> ((nil:list(operation)), close(s)) - | SetDexFunction(params) -> ((nil:list(operation)), if params.index > 10n then (failwith("Dex/wrong-index") : full_dex_storage) else set_dex_function(params.index, params.func, s)) + | SetBalanceFunction(params) -> ((nil:list(operation)), if params.index > 3n then (failwith("Dex/wrong-index") : full_dex_storage) else set_balance_function(params.index, params.func, s)) + | SetDexFunction(params) -> ((nil:list(operation)), if params.index > 6n then (failwith("Dex/wrong-index") : full_dex_storage) else set_dex_function(params.index, params.func, s)) | SetTokenFunction(params) -> ((nil:list(operation)), if params.index > 2n then (failwith("Dex/wrong-index") : full_dex_storage) else set_token_function(params.index, params.func, s)) end diff --git a/contracts/partials/ITTDex.ligo b/contracts/partials/ITTDex.ligo index f8887143..775db6d8 100644 --- a/contracts/partials/ITTDex.ligo +++ b/contracts/partials/ITTDex.ligo @@ -162,11 +162,13 @@ type dex_action is | EnsuredAddPair of ensured_add_params (* sets initial liquidity *) | EnsuredSwap of ensured_route_params (* exchanges token to another token and sends them to receiver *) | EnsuredInvest of ensured_invest_params (* mints min shares after investing tokens *) + +type balance_action is (* Callback *) -| BalanceAFA12 of nat (* process token balance *) -| BalanceBFA12 of nat (* process token balance *) -| BalanceAFA2 of list(balance_of_response) (* process token balance *) -| BalanceBFA2 of list(balance_of_response) (* process token balance *) +| IBalanceAFA12 of nat (* process token balance *) +| IBalanceBFA12 of nat (* process token balance *) +| IBalanceAFA2 of list(balance_of_response) (* process token balance *) +| IBalanceBFA2 of list(balance_of_response) (* process token balance *) type use_params is dex_action type get_reserves_params is record [ @@ -186,11 +188,16 @@ type token_action is type return is list (operation) * dex_storage type dex_func is (dex_action * dex_storage * address) -> return type token_func is (token_action * dex_storage * address) -> return +type bal_func is (balance_action * dex_storage * address) -> return type set_token_function_params is record [ func : token_func; (* code of the function *) index : nat; (* the key in functions map *) ] +type set_bal_function_params is record [ + func : bal_func; (* code of the function *) + index : nat; (* the key in functions map *) +] type set_dex_function_params is record [ func : dex_func; (* code of the function *) @@ -205,8 +212,13 @@ type full_action is | Update_operators of update_operator_params (* updates the token operators *) | Get_reserves of get_reserves_params (* returns the underlying token reserves *) | Close of unit (* entrypoint to prevent reentrancy *) +| BalanceAFA12 of nat (* process token balance *) +| BalanceBFA12 of nat (* process token balance *) +| BalanceAFA2 of list(balance_of_response) (* process token balance *) +| BalanceBFA2 of list(balance_of_response) (* process token balance *) | SetDexFunction of set_dex_function_params (* sets the dex specific function. Is used before the whole system is launched *) | SetTokenFunction of set_token_function_params (* sets the FA function, is used before the whole system is launched *) +| SetBalanceFunction of set_bal_function_params (* sets the FA function, is used before the whole system is launched *) (* real dex storage *) type full_dex_storage is record @@ -214,6 +226,7 @@ type full_dex_storage is record metadata : big_map(string, bytes); (* metadata storage according to TZIP-016 *) dex_lambdas : big_map(nat, dex_func); (* map with exchange-related functions code *) token_lambdas : big_map(nat, token_func); (* map with token-related functions code *) + balance_lambdas : big_map(nat, bal_func); (* map with token-related functions code *) end type full_return is list (operation) * full_dex_storage diff --git a/contracts/partials/TTDex.ligo b/contracts/partials/TTDex.ligo index 21750e57..eca70fc5 100644 --- a/contracts/partials/TTDex.ligo +++ b/contracts/partials/TTDex.ligo @@ -1,3 +1,16 @@ +[@inline] function call_balance( + const p : balance_action; + const this : address; + const idx : nat; + const s : full_dex_storage) : full_return is +block { + const res : return = case s.balance_lambdas[idx] of + Some(f) -> f(p, s.storage, this) + | None -> (failwith("Dex/function-not-set") : return) + end; + s.storage := res.1; +} with (res.0, s) + (* Route exchange-specific action Due to the fabulous storage, gas and operation size limits @@ -22,20 +35,18 @@ block { | EnsuredAddPair(n) -> 4n | EnsuredSwap(n) -> 5n | EnsuredInvest(n) -> 6n - | BalanceAFA12(n) -> 7n - | BalanceBFA12(n) -> 8n - | BalanceAFA2(n) -> 9n - | BalanceBFA2(n) -> 10n end; const res : return = case s.dex_lambdas[idx] of Some(f) -> f(p, s.storage, this) | None -> (failwith("Dex/function-not-set") : return) end; s.storage := res.1; - res.0 := Tezos.transaction( - unit, - 0mutez, - get_close_entrypoint(this)) # res.0; + if idx > 2n then + res.0 := Tezos.transaction( + unit, + 0mutez, + get_close_entrypoint(this)) # res.0 + else skip; } with (res.0, s) (* Route token-specific action @@ -116,4 +127,16 @@ block { Some(n) -> failwith("Dex/function-set") | None -> s.token_lambdas[idx] := f end; +} with s + +(* Set the token function code to factory storage *) +[@inline] function set_balance_function( + const idx : nat; + const f : bal_func; + const s : full_dex_storage) : full_dex_storage is +block { + case s.balance_lambdas[idx] of + Some(n) -> failwith("Dex/function-set") + | None -> s.balance_lambdas[idx] := f + end; } with s \ No newline at end of file diff --git a/contracts/partials/TTMethodDex.ligo b/contracts/partials/TTMethodDex.ligo index 7195473f..dad388b3 100644 --- a/contracts/partials/TTMethodDex.ligo +++ b/contracts/partials/TTMethodDex.ligo @@ -301,8 +301,8 @@ function typed_get_balance( case standard of Fa12 -> { const callback : contract(nat) = case name of - | A -> get_bal_fa12_a(contract_address) - | B -> get_bal_fa12_b(contract_address) + | A -> get_bal_fa12_a(account) + | B -> get_bal_fa12_b(account) end; op := Some(get_balance_fa12( account, @@ -311,8 +311,8 @@ function typed_get_balance( } | Fa2 -> { const callback : contract(list(balance_of_response)) = case name of - | A -> get_bal_fa2_a(contract_address) - | B -> get_bal_fa2_b(contract_address) + | A -> get_bal_fa2_a(account) + | B -> get_bal_fa2_b(account) end; op := Some(get_balance_fa2( account, @@ -348,12 +348,9 @@ function ensured_initialize_exchange( var operations: list(operation) := list[]; case p of EnsuredAddPair(params) -> { - if not s.entered - then failwith("Dex/reentrancy") - else s.entered := True; if Tezos.sender =/= this - then failwith("Dex/reentrancy") - else s.entered := True; + then failwith("Dex/not-self") + else skip; (* check preconditions *) if params.pair.token_a_address = params.pair.token_b_address @@ -445,10 +442,6 @@ function ensured_initialize_exchange( | Invest(n) -> skip | EnsuredInvest(n) -> skip | Divest(n) -> skip - | BalanceAFA12(n) -> skip - | BalanceBFA12(n) -> skip - | BalanceAFA2(n) -> skip - | BalanceBFA2(n) -> skip end } with (operations, s) @@ -532,10 +525,6 @@ function initialize_exchange( | Invest(n) -> skip | EnsuredInvest(n) -> skip | Divest(n) -> skip - | BalanceAFA12(n) -> skip - | BalanceBFA12(n) -> skip - | BalanceAFA2(n) -> skip - | BalanceBFA2(n) -> skip end } with (operations, s) @@ -719,10 +708,6 @@ function token_to_token_route( | Invest(n) -> skip | EnsuredInvest(n) -> skip | Divest(n) -> skip - | BalanceAFA12(n) -> skip - | BalanceBFA12(n) -> skip - | BalanceAFA2(n) -> skip - | BalanceBFA2(n) -> skip end } with (operations, s) @@ -737,12 +722,9 @@ function ensured_route( case p of | AddPair(n) -> skip | EnsuredSwap(params) -> { - if not s.entered - then failwith("Dex/reentrancy") - else s.entered := True; if Tezos.sender =/= this - then failwith("Dex/reentrancy") - else s.entered := True; + then failwith("Dex/not-self") + else skip; (* get the first exchange info *) const first_swap : swap_slice_type = case List.head_opt(params.swaps) of @@ -807,10 +789,6 @@ function ensured_route( | Invest(n) -> skip | EnsuredInvest(n) -> skip | Divest(n) -> skip - | BalanceAFA12(n) -> skip - | BalanceBFA12(n) -> skip - | BalanceAFA2(n) -> skip - | BalanceBFA2(n) -> skip end } with (operations, s) @@ -896,10 +874,6 @@ function invest_liquidity( | EnsuredSwap(n) -> skip | EnsuredInvest(n) -> skip | Divest(n) -> skip - | BalanceAFA12(n) -> skip - | BalanceBFA12(n) -> skip - | BalanceAFA2(n) -> skip - | BalanceBFA2(n) -> skip end } with (operations, s) @@ -915,12 +889,9 @@ function ensured_invest( | AddPair(n) -> skip | Swap(n) -> skip | EnsuredInvest(params) -> { - if not s.entered - then failwith("Dex/reentrancy") - else s.entered := True; if Tezos.sender =/= this - then failwith("Dex/reentrancy") - else s.entered := True; + then failwith("Dex/not-self") + else skip; (* check preconditions *) if params.pair.token_a_address = params.pair.token_b_address @@ -1016,10 +987,6 @@ function ensured_invest( | EnsuredSwap(n) -> skip | Invest(n) -> skip | Divest(n) -> skip - | BalanceAFA12(n) -> skip - | BalanceBFA12(n) -> skip - | BalanceAFA2(n) -> skip - | BalanceBFA2(n) -> skip end } with (operations, s) @@ -1118,91 +1085,66 @@ function divest_liquidity( params.pair.token_b_type ) # operations; } - | BalanceAFA12(n) -> skip - | BalanceBFA12(n) -> skip - | BalanceAFA2(n) -> skip - | BalanceBFA2(n) -> skip end } with (operations, s) (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_12_a( - const p : dex_action; + const p : balance_action; const s : dex_storage; const this: address) : return is block { var operations: list(operation) := list[]; case p of - | AddPair(token_amount) -> skip - | EnsuredAddPair(n) -> skip - | Swap(n) -> skip - | EnsuredSwap(n) -> skip - | Invest(n) -> skip - | EnsuredInvest(n) -> skip - | Divest(n) -> skip - | BalanceAFA12(new_balance) -> { + | IBalanceAFA12(new_balance) -> { s.tmp.balance_a := Some(case s.tmp.balance_a of | Some(prev_balance) -> - if prev_balance < new_balance + if prev_balance > new_balance then (failwith("Dex/balance-decremented") : nat) - else abs(prev_balance - new_balance) + else abs(new_balance - prev_balance) | None -> new_balance end); } - | BalanceBFA12(n) -> skip - | BalanceAFA2(n) -> skip - | BalanceBFA2(n) -> skip + | IBalanceBFA12(n) -> skip + | IBalanceAFA2(n) -> skip + | IBalanceBFA2(n) -> skip end } with (operations, s) (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_12_b( - const p : dex_action; + const p : balance_action; const s : dex_storage; const this: address) : return is block { var operations: list(operation) := list[]; case p of - | AddPair(token_amount) -> skip - | EnsuredAddPair(n) -> skip - | Swap(n) -> skip - | EnsuredSwap(n) -> skip - | Invest(n) -> skip - | EnsuredInvest(n) -> skip - | Divest(n) -> skip - | BalanceAFA12(n) -> skip - | BalanceBFA12(new_balance) -> { + | IBalanceAFA12(n) -> skip + | IBalanceBFA12(new_balance) -> { s.tmp.balance_b := Some(case s.tmp.balance_b of | Some(prev_balance) -> - if prev_balance < new_balance + if prev_balance > new_balance then (failwith("Dex/balance-decremented") : nat) - else abs(prev_balance - new_balance) + else abs(new_balance - prev_balance) | None -> new_balance end); } - | BalanceAFA2(n) -> skip - | BalanceBFA2(n) -> skip + | IBalanceAFA2(n) -> skip + | IBalanceBFA2(n) -> skip end } with (operations, s) (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_2_a( - const p : dex_action; + const p : balance_action; const s : dex_storage; const this: address) : return is block { var operations: list(operation) := list[]; case p of - | AddPair(token_amount) -> skip - | EnsuredAddPair(n) -> skip - | Swap(n) -> skip - | EnsuredSwap(n) -> skip - | Invest(n) -> skip - | EnsuredInvest(n) -> skip - | Divest(n) -> skip - | BalanceAFA12(n) -> skip - | BalanceBFA12(n) -> skip - | BalanceAFA2(responses) -> { + | IBalanceAFA12(n) -> skip + | IBalanceBFA12(n) -> skip + | IBalanceAFA2(responses) -> { const response : balance_of_response = case List.head_opt(responses) of | Some(head) -> head @@ -1215,35 +1157,28 @@ function update_balance_fa_2_a( s.tmp.balance_a := Some(case s.tmp.balance_a of | Some(prev_balance) -> - if prev_balance < response.balance + if prev_balance > response.balance then (failwith("Dex/balance-decremented") : nat) - else abs(prev_balance - response.balance) + else abs(response.balance - prev_balance) | None -> response.balance end); } - | BalanceBFA2(n) -> skip + | IBalanceBFA2(n) -> skip end } with (operations, s) (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_2_b( - const p : dex_action; + const p : balance_action; const s : dex_storage; const this: address) : return is block { var operations: list(operation) := list[]; case p of - | AddPair(token_amount) -> skip - | EnsuredAddPair(n) -> skip - | Swap(n) -> skip - | EnsuredSwap(n) -> skip - | Invest(n) -> skip - | EnsuredInvest(n) -> skip - | Divest(n) -> skip - | BalanceAFA12(n) -> skip - | BalanceBFA12(n) -> skip - | BalanceAFA2(n) -> skip - | BalanceBFA2(responses) -> { + | IBalanceAFA12(n) -> skip + | IBalanceBFA12(n) -> skip + | IBalanceAFA2(n) -> skip + | IBalanceBFA2(responses) -> { const response : balance_of_response = case List.head_opt(responses) of | Some(head) -> head @@ -1256,9 +1191,9 @@ function update_balance_fa_2_b( s.tmp.balance_b := Some(case s.tmp.balance_b of | Some(prev_balance) -> - if prev_balance < response.balance + if prev_balance > response.balance then (failwith("Dex/balance-decremented") : nat) - else abs(prev_balance - response.balance) + else abs(response.balance - prev_balance) | None -> response.balance end); } diff --git a/migrations/2_deploy_token_to_token_dex.js b/migrations/2_deploy_token_to_token_dex.js index 95bc84dd..f5cfc17f 100644 --- a/migrations/2_deploy_token_to_token_dex.js +++ b/migrations/2_deploy_token_to_token_dex.js @@ -6,7 +6,11 @@ const dexStorage = require("../storage/TTDex"); const { TezosToolkit } = require("@taquito/taquito"); const { InMemorySigner } = require("@taquito/signer"); const { MichelsonMap } = require("@taquito/michelson-encoder"); -const { dexFunctions, tokenFunctions } = require("../storage/TTFunctions"); +const { + dexFunctions, + tokenFunctions, + balFunctions, +} = require("../storage/TTFunctions"); const { execSync } = require("child_process"); const Token = artifacts.require("Token" + usedStandard); const TokenFA12 = artifacts.require("TokenFA12"); @@ -16,6 +20,7 @@ const tokenFA12Storage = require("../storage/TokenFA12"); const tokenFA2Storage = require("../storage/TokenFA2"); const { getLigo } = require("../scripts/utils"); const accountsStored = require("../scripts/sandbox/accounts"); +const { confirmOperation } = require("./confirmation"); const initialTezAmount = 1; const initialTokenAmount = 1000000; @@ -48,6 +53,7 @@ module.exports = async (deployer, network, accounts) => { const ligo = getLigo(true); for (dexFunction of dexFunctions) { + console.log(dexFunction); const stdout = execSync( `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TTDex.ligo main 'SetDexFunction(record index =${dexFunction.index}n; func = ${dexFunction.name}; end)'`, { maxBuffer: 1024 * 500 } @@ -57,12 +63,29 @@ module.exports = async (deployer, network, accounts) => { amount: 0, parameter: { entrypoint: "setDexFunction", - value: JSON.parse(stdout.toString()).args[0].args[0].args[0], + value: JSON.parse(stdout.toString()).args[0].args[0].args[0].args[0], }, }); - await operation.confirmation(); + await confirmOperation(tezos, operation.hash); + } + for (balFunction of balFunctions) { + console.log(balFunction); + const stdout = execSync( + `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TTDex.ligo main 'SetBalanceFunction(record index =${balFunction.index}n; func = ${balFunction.name}; end)'`, + { maxBuffer: 1024 * 500 } + ); + const operation = await tezos.contract.transfer({ + to: dexInstance.address, + amount: 0, + parameter: { + entrypoint: "setBalanceFunction", + value: JSON.parse(stdout.toString()).args[0].args[0].args[0].args[0], + }, + }); + await confirmOperation(tezos, operation.hash); } for (tokenFunction of tokenFunctions[standard]) { + console.log(tokenFunction); const stdout = execSync( `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TTDex.ligo main 'SetTokenFunction(record index =${tokenFunction.index}n; func = ${tokenFunction.name}; end)'`, { maxBuffer: 1024 * 500 } @@ -72,10 +95,10 @@ module.exports = async (deployer, network, accounts) => { amount: 0, parameter: { entrypoint: "setTokenFunction", - value: JSON.parse(stdout.toString()).args[0].args[0].args[0], + value: JSON.parse(stdout.toString()).args[0].args[0].args[0].args[0], }, }); - await operation.confirmation(); + await confirmOperation(tezos, operation.hash); } if (network !== "mainnet") { @@ -99,7 +122,7 @@ module.exports = async (deployer, network, accounts) => { let operation = await token0Instance.methods .approve(dexInstance.address.toString(), initialTokenAmount) .send(); - await operation.confirmation(); + await confirmOperation(tezos, operation.hash); operation = await token1Instance.methods .approve(dexInstance.address.toString(), initialTokenAmount) .send(); @@ -116,7 +139,7 @@ module.exports = async (deployer, network, accounts) => { }, ]) .send(); - await operation.confirmation(); + await confirmOperation(tezos, operation.hash); if (standard == "MIXED") { operation = await token1Instance.methods .approve(dexInstance.address.toString(), initialTokenAmount) @@ -134,7 +157,7 @@ module.exports = async (deployer, network, accounts) => { ]) .send(); } - await operation.confirmation(); + await confirmOperation(tezos, operation.hash); } operation = await dex.methods .use( @@ -156,6 +179,6 @@ module.exports = async (deployer, network, accounts) => { ) .send(); - await operation.confirmation(); + await confirmOperation(tezos, operation.hash); } }; diff --git a/storage/TTDex.js b/storage/TTDex.js index b8c5599d..7b45ab23 100644 --- a/storage/TTDex.js +++ b/storage/TTDex.js @@ -14,5 +14,6 @@ module.exports = { }, metadata: MichelsonMap.fromLiteral({}), dex_lambdas: MichelsonMap.fromLiteral({}), + balance_lambdas: MichelsonMap.fromLiteral({}), token_lambdas: MichelsonMap.fromLiteral({}), }; diff --git a/storage/TTFunctions.js b/storage/TTFunctions.js index 4a9f76d0..6ebcf6d0 100644 --- a/storage/TTFunctions.js +++ b/storage/TTFunctions.js @@ -27,20 +27,23 @@ module.exports.dexFunctions = [ index: 6, name: "ensured_invest", }, +]; + +module.exports.balFunctions = [ { - index: 7, + index: 0, name: "update_balance_fa_12_a", }, { - index: 8, + index: 1, name: "update_balance_fa_12_b", }, { - index: 9, + index: 2, name: "update_balance_fa_2_a", }, { - index: 10, + index: 3, name: "update_balance_fa_2_b", }, ]; diff --git a/test/helpers/ttContext.ts b/test/helpers/ttContext.ts index e84ef210..8558fe9a 100644 --- a/test/helpers/ttContext.ts +++ b/test/helpers/ttContext.ts @@ -7,7 +7,11 @@ import { prepareProviderOptions } from "./utils"; import dexStorage from "../storage/TTDex"; import tokenFA12Storage from "../storage/TokenFA12"; import tokenFA2Storage from "../storage/TokenFA2"; -import { dexFunctions, tokenFunctions } from "../storage/TTFunctions"; +import { + dexFunctions, + tokenFunctions, + balFunctions, +} from "../storage/TTFunctions"; import { TokenFA2 } from "./tokenFA2"; import { Token } from "./token"; import { TezosToolkit } from "@taquito/taquito"; @@ -91,6 +95,7 @@ export class TTContext { async setDexFunctions(): Promise { for (let dexFunction of dexFunctions) { + console.log(dexFunction); await this.dex.setDexFunction(dexFunction.index, dexFunction.name); } await this.dex.updateStorage({ @@ -118,10 +123,19 @@ export class TTContext { token_lambdas: [...Array(5).keys()], }); } + async setBalanceDexFunctions(): Promise { + for (let balFunction of balFunctions["FA2"]) { + await this.dex.setBalFunction(balFunction.index, balFunction.name); + } + await this.dex.updateStorage({ + token_lambdas: [...Array(5).keys()], + }); + } async setAllDexFunctions(): Promise { await this.setDexFunctions(); await this.setTokenDexFunctions(); + await this.setBalanceDexFunctions(); await this.dex.updateStorage({ dex_lambdas: [...Array(9).keys()], token_lambdas: [...Array(5).keys()], diff --git a/test/helpers/ttdexFA2.ts b/test/helpers/ttdexFA2.ts index 754c6589..54455e59 100644 --- a/test/helpers/ttdexFA2.ts +++ b/test/helpers/ttdexFA2.ts @@ -383,7 +383,7 @@ export class TTDex extends TokenFA2 { amount: 0, parameter: { entrypoint: "setDexFunction", - value: JSON.parse(stdout.toString()).args[0].args[0].args[0], + value: JSON.parse(stdout.toString()).args[0].args[0].args[0].args[0], }, }); await confirmOperation(tezos, operation.hash); @@ -400,7 +400,24 @@ export class TTDex extends TokenFA2 { amount: 0, parameter: { entrypoint: "setTokenFunction", - value: JSON.parse(stdout.toString()).args[0].args[0].args[0], + value: JSON.parse(stdout.toString()).args[0].args[0].args[0].args[0], + }, + }); + await confirmOperation(tezos, operation.hash); + } + + async setBalFunction(index: number, lambdaName: string): Promise { + let ligo = getLigo(true); + const stdout = execSync( + `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TTDex.ligo main 'SetBalanceFunction(record index =${index}n; func = ${lambdaName}; end)'`, + { maxBuffer: 1024 * 500 } + ); + const operation = await tezos.contract.transfer({ + to: this.contract.address, + amount: 0, + parameter: { + entrypoint: "setBalanceFunction", + value: JSON.parse(stdout.toString()).args[0].args[0].args[0].args[0], }, }); await confirmOperation(tezos, operation.hash); diff --git a/test/storage/TTDex.ts b/test/storage/TTDex.ts index ee2a6e11..1db17286 100644 --- a/test/storage/TTDex.ts +++ b/test/storage/TTDex.ts @@ -14,5 +14,6 @@ export default { }, metadata: MichelsonMap.fromLiteral({}), dex_lambdas: MichelsonMap.fromLiteral({}), + balance_lambdas: MichelsonMap.fromLiteral({}), token_lambdas: MichelsonMap.fromLiteral({}), }; diff --git a/test/storage/TTFunctions.ts b/test/storage/TTFunctions.ts index 89c6b1b3..2cada84d 100644 --- a/test/storage/TTFunctions.ts +++ b/test/storage/TTFunctions.ts @@ -27,20 +27,23 @@ export let dexFunctions = [ index: 6, name: "ensured_invest", }, +]; + +export let balFunctions = [ { - index: 7, + index: 0, name: "update_balance_fa_12_a", }, { - index: 8, + index: 1, name: "update_balance_fa_12_b", }, { - index: 9, + index: 2, name: "update_balance_fa_2_a", }, { - index: 10, + index: 3, name: "update_balance_fa_2_b", }, ]; From 9a72cfc0dd997eb6b5a4e035482162cfa82051bc Mon Sep 17 00:00:00 2001 From: KStasi Date: Wed, 15 Sep 2021 14:40:20 +0200 Subject: [PATCH 10/22] fix init tests --- migrations/2_deploy_token_to_token_dex.js | 3 --- test/InitializeTTExchangeTest.spec.ts | 3 +-- test/helpers/ttContext.ts | 4 +++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/migrations/2_deploy_token_to_token_dex.js b/migrations/2_deploy_token_to_token_dex.js index f5cfc17f..f86c9c84 100644 --- a/migrations/2_deploy_token_to_token_dex.js +++ b/migrations/2_deploy_token_to_token_dex.js @@ -53,7 +53,6 @@ module.exports = async (deployer, network, accounts) => { const ligo = getLigo(true); for (dexFunction of dexFunctions) { - console.log(dexFunction); const stdout = execSync( `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TTDex.ligo main 'SetDexFunction(record index =${dexFunction.index}n; func = ${dexFunction.name}; end)'`, { maxBuffer: 1024 * 500 } @@ -69,7 +68,6 @@ module.exports = async (deployer, network, accounts) => { await confirmOperation(tezos, operation.hash); } for (balFunction of balFunctions) { - console.log(balFunction); const stdout = execSync( `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TTDex.ligo main 'SetBalanceFunction(record index =${balFunction.index}n; func = ${balFunction.name}; end)'`, { maxBuffer: 1024 * 500 } @@ -85,7 +83,6 @@ module.exports = async (deployer, network, accounts) => { await confirmOperation(tezos, operation.hash); } for (tokenFunction of tokenFunctions[standard]) { - console.log(tokenFunction); const stdout = execSync( `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TTDex.ligo main 'SetTokenFunction(record index =${tokenFunction.index}n; func = ${tokenFunction.name}; end)'`, { maxBuffer: 1024 * 500 } diff --git a/test/InitializeTTExchangeTest.spec.ts b/test/InitializeTTExchangeTest.spec.ts index 788951c7..14796ac7 100644 --- a/test/InitializeTTExchangeTest.spec.ts +++ b/test/InitializeTTExchangeTest.spec.ts @@ -14,8 +14,7 @@ contract("InitializeTTExchange()", function () { before(async () => { context = await TTContext.init([], false, "alice", false); - await context.setDexFunction(0, "initialize_exchange"); - await context.setDexFunction(3, "divest_liquidity"); + await context.setAllDexFunctions(); }); it("should have an empty token list after deployment", async function () { diff --git a/test/helpers/ttContext.ts b/test/helpers/ttContext.ts index 8558fe9a..9820fe21 100644 --- a/test/helpers/ttContext.ts +++ b/test/helpers/ttContext.ts @@ -117,6 +117,7 @@ export class TTContext { async setTokenDexFunctions(): Promise { for (let tokenFunction of tokenFunctions["FA2"]) { + console.log(tokenFunction); await this.dex.setTokenFunction(tokenFunction.index, tokenFunction.name); } await this.dex.updateStorage({ @@ -124,7 +125,8 @@ export class TTContext { }); } async setBalanceDexFunctions(): Promise { - for (let balFunction of balFunctions["FA2"]) { + for (let balFunction of balFunctions) { + console.log(balFunction); await this.dex.setBalFunction(balFunction.index, balFunction.name); } await this.dex.updateStorage({ From ba211fbcbaa8c56e8fc0ce28b017d8a3e5d78934 Mon Sep 17 00:00:00 2001 From: KStasi Date: Wed, 15 Sep 2021 14:59:09 +0200 Subject: [PATCH 11/22] remove old Dex contracts --- contracts/main/BakerRegistry.ligo | 8 - contracts/main/DexFA12.ligo | 16 - contracts/main/DexFA12.tz | 445 --------------- contracts/main/DexFA2.ligo | 15 - contracts/main/DexFA2.tz | 382 ------------- contracts/main/FactoryFA12.ligo | 3 - contracts/main/FactoryFA2.ligo | 4 - contracts/main/TestFactoryFA12.ligo | 2 - contracts/main/TestFactoryFA2.ligo | 2 - contracts/partials/ActionFA12.ligo | 23 - contracts/partials/ActionFA2.ligo | 16 - contracts/partials/BakerRegistryMethods.ligo | 18 - contracts/partials/Common.ligo | 111 ---- contracts/partials/Dex.ligo | 79 --- contracts/partials/Factory.ligo | 132 ----- contracts/partials/IDex.ligo | 125 ----- contracts/partials/IFactory.ligo | 69 --- contracts/partials/MethodDex.ligo | 557 ------------------- contracts/partials/MethodFA12.ligo | 120 ---- contracts/partials/MethodFA2.ligo | 154 ----- migrations/3_baker_registry_migration.js | 8 - migrations/4_deploy_dex.js | 155 ------ package.json | 5 +- scripts/cli.js | 31 -- test/Default.spec.ts | 196 ------- test/DivestLiquidity.spec.ts | 508 ----------------- test/InitializeExchangeTest.spec.ts | 283 ---------- test/InvestLiquidity.spec.ts | 339 ----------- test/RewardDistribution.spec.ts | 356 ------------ test/SetFunctionsTest.spec.ts | 115 ---- test/TezToTokenPayment.spec.ts | 194 ------- test/TokenToTezPayment.spec.ts | 190 ------- test/TokenToTokenPayment.spec.ts | 173 ------ test/Veto.spec.ts | 274 --------- test/Vote.spec.ts | 328 ----------- test/helpers/context.ts | 190 ------- test/helpers/dexFA12.ts | 258 --------- test/helpers/dexFA2.ts | 278 --------- test/helpers/factory.ts | 208 ------- test/storage/Factory.ts | 16 - test/storage/Functions.ts | 80 --- 41 files changed, 2 insertions(+), 6464 deletions(-) delete mode 100644 contracts/main/BakerRegistry.ligo delete mode 100644 contracts/main/DexFA12.ligo delete mode 100644 contracts/main/DexFA12.tz delete mode 100644 contracts/main/DexFA2.ligo delete mode 100644 contracts/main/DexFA2.tz delete mode 100644 contracts/main/FactoryFA12.ligo delete mode 100644 contracts/main/FactoryFA2.ligo delete mode 100644 contracts/main/TestFactoryFA12.ligo delete mode 100644 contracts/main/TestFactoryFA2.ligo delete mode 100644 contracts/partials/ActionFA12.ligo delete mode 100644 contracts/partials/ActionFA2.ligo delete mode 100644 contracts/partials/BakerRegistryMethods.ligo delete mode 100644 contracts/partials/Common.ligo delete mode 100644 contracts/partials/Dex.ligo delete mode 100644 contracts/partials/Factory.ligo delete mode 100644 contracts/partials/IDex.ligo delete mode 100644 contracts/partials/IFactory.ligo delete mode 100644 contracts/partials/MethodDex.ligo delete mode 100644 contracts/partials/MethodFA12.ligo delete mode 100644 contracts/partials/MethodFA2.ligo delete mode 100644 migrations/3_baker_registry_migration.js delete mode 100644 migrations/4_deploy_dex.js delete mode 100644 test/Default.spec.ts delete mode 100644 test/DivestLiquidity.spec.ts delete mode 100644 test/InitializeExchangeTest.spec.ts delete mode 100644 test/InvestLiquidity.spec.ts delete mode 100644 test/RewardDistribution.spec.ts delete mode 100644 test/SetFunctionsTest.spec.ts delete mode 100644 test/TezToTokenPayment.spec.ts delete mode 100644 test/TokenToTezPayment.spec.ts delete mode 100644 test/TokenToTokenPayment.spec.ts delete mode 100644 test/Veto.spec.ts delete mode 100644 test/Vote.spec.ts delete mode 100644 test/helpers/context.ts delete mode 100644 test/helpers/dexFA12.ts delete mode 100644 test/helpers/dexFA2.ts delete mode 100644 test/helpers/factory.ts delete mode 100644 test/storage/Factory.ts delete mode 100644 test/storage/Functions.ts diff --git a/contracts/main/BakerRegistry.ligo b/contracts/main/BakerRegistry.ligo deleted file mode 100644 index cd407ae7..00000000 --- a/contracts/main/BakerRegistry.ligo +++ /dev/null @@ -1,8 +0,0 @@ -#include "../partials/BakerRegistryMethods.ligo" - -(* BakerRegistry - Contract to register the baker *) -function main (const p : registry_action; const s : registry_storage) : (list (operation) * registry_storage) is - case p of - | Validate(baker) -> validate(baker, s) - | Register(baker) -> register(baker, s) - end diff --git a/contracts/main/DexFA12.ligo b/contracts/main/DexFA12.ligo deleted file mode 100644 index 260b5810..00000000 --- a/contracts/main/DexFA12.ligo +++ /dev/null @@ -1,16 +0,0 @@ -#include "../partials/Dex.ligo" - -(* DexFA12 - Contract for exchanges for XTZ - FA1.2 token pair *) -function main (const p : full_action; const s : full_dex_storage) : full_return is - block { - const this: address = Tezos.self_address; - } with case p of - | Default -> use_default(s) - | Use(params) -> call_dex(params, this, s) - | Transfer(params) -> call_token(ITransfer(params), this, 0n, s) - | Approve(params) -> call_token(IApprove(params), this, 1n, s) - | GetBalance(params) -> call_token(IGetBalance(params), this, 2n, s) - | GetAllowance(params) -> call_token(IGetAllowance(params), this, 3n, s) - | GetTotalSupply(params) -> call_token(IGetTotalSupply(params), this, 4n, s) - | GetReserves(params) -> get_reserves(params, s) - end diff --git a/contracts/main/DexFA12.tz b/contracts/main/DexFA12.tz deleted file mode 100644 index f82ec5be..00000000 --- a/contracts/main/DexFA12.tz +++ /dev/null @@ -1,445 +0,0 @@ -{ parameter - (or (or (or (pair %approve (address %spender) (nat %value)) (unit %default)) - (or (pair %getAllowance (pair (address %owner) (address %spender)) (contract nat)) - (pair %getBalance (address %owner) (contract nat)))) - (or (or (contract %getReserves (pair nat nat)) (pair %getTotalSupply unit (contract nat))) - (or (pair %transfer (address %from) (pair (address %to) (nat %value))) - (or %use - (or (or (pair %divestLiquidity (pair (nat %min_tez) (nat %min_tokens)) (nat %shares)) - (nat %initializeExchange)) - (or (nat %investLiquidity) - (pair %tezToTokenPayment (nat %min_out) (address %receiver)))) - (or (or (pair %tokenToTezPayment (pair (nat %amount) (nat %min_out)) (address %receiver)) - (pair %veto (nat %value) (address %voter))) - (or (pair %vote (pair (key_hash %candidate) (nat %value)) (address %voter)) - (address %withdrawProfit))))))) ; - storage - (pair (pair (big_map %dex_lambdas - nat - (lambda - (pair (pair (or (or (or (pair %divestLiquidity (pair (nat %min_tez) (nat %min_tokens)) (nat %shares)) - (nat %initializeExchange)) - (or (nat %investLiquidity) - (pair %tezToTokenPayment (nat %min_out) (address %receiver)))) - (or (or (pair %tokenToTezPayment (pair (nat %amount) (nat %min_out)) (address %receiver)) - (pair %veto (nat %value) (address %voter))) - (or (pair %vote (pair (key_hash %candidate) (nat %value)) (address %voter)) - (address %withdrawProfit)))) - (pair (pair (pair (pair (pair (address %baker_validator) (option %current_candidate key_hash)) - (pair (option %current_delegated key_hash) (timestamp %last_update_time))) - (pair (pair (timestamp %last_veto) - (big_map %ledger - address - (pair (pair (map %allowances address nat) (nat %balance)) (nat %frozen_balance)))) - (pair (timestamp %period_finish) (nat %reward)))) - (pair (pair (pair (nat %reward_paid) (nat %reward_per_sec)) - (pair (nat %reward_per_share) (nat %tez_pool))) - (pair (pair (address %token_address) (nat %token_pool)) - (pair (nat %total_reward) (nat %total_supply))))) - (pair (pair (pair (nat %total_votes) - (big_map %user_rewards address (pair (nat %reward) (nat %reward_paid)))) - (pair (nat %veto) (big_map %vetos key_hash timestamp))) - (pair (big_map %voters - address - (pair (pair (option %candidate key_hash) (timestamp %last_veto)) - (pair (nat %veto) (nat %vote)))) - (big_map %votes key_hash nat))))) - address) - (pair (list operation) - (pair (pair (pair (pair (pair (address %baker_validator) (option %current_candidate key_hash)) - (pair (option %current_delegated key_hash) (timestamp %last_update_time))) - (pair (pair (timestamp %last_veto) - (big_map %ledger - address - (pair (pair (map %allowances address nat) (nat %balance)) (nat %frozen_balance)))) - (pair (timestamp %period_finish) (nat %reward)))) - (pair (pair (pair (nat %reward_paid) (nat %reward_per_sec)) - (pair (nat %reward_per_share) (nat %tez_pool))) - (pair (pair (address %token_address) (nat %token_pool)) - (pair (nat %total_reward) (nat %total_supply))))) - (pair (pair (pair (nat %total_votes) - (big_map %user_rewards address (pair (nat %reward) (nat %reward_paid)))) - (pair (nat %veto) (big_map %vetos key_hash timestamp))) - (pair (big_map %voters - address - (pair (pair (option %candidate key_hash) (timestamp %last_veto)) - (pair (nat %veto) (nat %vote)))) - (big_map %votes key_hash nat))))))) - (big_map %metadata string bytes)) - (pair (pair %storage - (pair (pair (pair (pair (address %baker_validator) (option %current_candidate key_hash)) - (pair (option %current_delegated key_hash) (timestamp %last_update_time))) - (pair (pair (timestamp %last_veto) - (big_map %ledger - address - (pair (pair (map %allowances address nat) (nat %balance)) (nat %frozen_balance)))) - (pair (timestamp %period_finish) (nat %reward)))) - (pair (pair (pair (nat %reward_paid) (nat %reward_per_sec)) - (pair (nat %reward_per_share) (nat %tez_pool))) - (pair (pair (address %token_address) (nat %token_pool)) - (pair (nat %total_reward) (nat %total_supply))))) - (pair (pair (pair (nat %total_votes) - (big_map %user_rewards address (pair (nat %reward) (nat %reward_paid)))) - (pair (nat %veto) (big_map %vetos key_hash timestamp))) - (pair (big_map %voters - address - (pair (pair (option %candidate key_hash) (timestamp %last_veto)) - (pair (nat %veto) (nat %vote)))) - (big_map %votes key_hash nat)))) - (big_map %token_lambdas - nat - (lambda - (pair (pair (or (or (or (pair %iApprove (address %spender) (nat %value)) - (pair %iGetAllowance (pair (address %owner) (address %spender)) (contract nat))) - (or (pair %iGetBalance (address %owner) (contract nat)) - (pair %iGetTotalSupply unit (contract nat)))) - (pair %iTransfer (address %from) (pair (address %to) (nat %value)))) - (pair (pair (pair (pair (pair (address %baker_validator) (option %current_candidate key_hash)) - (pair (option %current_delegated key_hash) (timestamp %last_update_time))) - (pair (pair (timestamp %last_veto) - (big_map %ledger - address - (pair (pair (map %allowances address nat) (nat %balance)) (nat %frozen_balance)))) - (pair (timestamp %period_finish) (nat %reward)))) - (pair (pair (pair (nat %reward_paid) (nat %reward_per_sec)) - (pair (nat %reward_per_share) (nat %tez_pool))) - (pair (pair (address %token_address) (nat %token_pool)) - (pair (nat %total_reward) (nat %total_supply))))) - (pair (pair (pair (nat %total_votes) - (big_map %user_rewards address (pair (nat %reward) (nat %reward_paid)))) - (pair (nat %veto) (big_map %vetos key_hash timestamp))) - (pair (big_map %voters - address - (pair (pair (option %candidate key_hash) (timestamp %last_veto)) - (pair (nat %veto) (nat %vote)))) - (big_map %votes key_hash nat))))) - address) - (pair (list operation) - (pair (pair (pair (pair (pair (address %baker_validator) (option %current_candidate key_hash)) - (pair (option %current_delegated key_hash) (timestamp %last_update_time))) - (pair (pair (timestamp %last_veto) - (big_map %ledger - address - (pair (pair (map %allowances address nat) (nat %balance)) (nat %frozen_balance)))) - (pair (timestamp %period_finish) (nat %reward)))) - (pair (pair (pair (nat %reward_paid) (nat %reward_per_sec)) - (pair (nat %reward_per_share) (nat %tez_pool))) - (pair (pair (address %token_address) (nat %token_pool)) - (pair (nat %total_reward) (nat %total_supply))))) - (pair (pair (pair (nat %total_votes) - (big_map %user_rewards address (pair (nat %reward) (nat %reward_paid)))) - (pair (nat %veto) (big_map %vetos key_hash timestamp))) - (pair (big_map %voters - address - (pair (pair (option %candidate key_hash) (timestamp %last_veto)) - (pair (nat %veto) (nat %vote)))) - (big_map %votes key_hash nat))))))))) ; - code { DUP ; - CDR ; - SWAP ; - CAR ; - SELF ; - ADDRESS ; - SWAP ; - IF_LEFT - { IF_LEFT - { IF_LEFT - { DIG 2 ; - PUSH nat 1 ; - PAIR ; - DUG 2 ; - LEFT (pair (pair address address) (contract nat)) ; - LEFT (or (pair address (contract nat)) (pair unit (contract nat))) ; - LEFT (pair address (pair address nat)) ; - DIG 2 ; - DUP ; - CDR ; - SWAP ; - CAR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - GET ; - IF_NONE - { SWAP ; DROP ; SWAP ; DROP ; PUSH string "Dex/function-not-set" ; FAILWITH } - { DIG 3 ; DIG 2 ; DUP ; DUG 3 ; CDR ; CAR ; DIG 4 ; PAIR ; PAIR ; EXEC } ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - PAIR ; - DIG 2 ; - CAR ; - PAIR ; - SWAP ; - CAR ; - PAIR } - { DROP 2 ; - DUP ; - CAR ; - CAR ; - PUSH nat 8 ; - GET ; - IF_NONE - { PUSH string "Dex/function-not-set" ; FAILWITH } - { SELF ; - ADDRESS ; - DIG 2 ; - DUP ; - DUG 3 ; - CDR ; - CAR ; - PUSH nat 0 ; - RIGHT (pair (pair nat nat) nat) ; - LEFT (or nat (pair nat address)) ; - LEFT (or (or (pair (pair nat nat) address) (pair nat address)) - (or (pair (pair key_hash nat) address) address)) ; - PAIR ; - PAIR ; - EXEC } ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - PAIR ; - DIG 2 ; - CAR ; - PAIR ; - SWAP ; - CAR ; - PAIR } } - { IF_LEFT - { DIG 2 ; - PUSH nat 3 ; - PAIR ; - DUG 2 ; - RIGHT (pair address nat) ; - LEFT (or (pair address (contract nat)) (pair unit (contract nat))) ; - LEFT (pair address (pair address nat)) ; - DIG 2 ; - DUP ; - CDR ; - SWAP ; - CAR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - GET ; - IF_NONE - { SWAP ; DROP ; SWAP ; DROP ; PUSH string "Dex/function-not-set" ; FAILWITH } - { DIG 3 ; DIG 2 ; DUP ; DUG 3 ; CDR ; CAR ; DIG 4 ; PAIR ; PAIR ; EXEC } ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - PAIR ; - DIG 2 ; - CAR ; - PAIR ; - SWAP ; - CAR ; - PAIR } - { DIG 2 ; - PUSH nat 2 ; - PAIR ; - DUG 2 ; - LEFT (pair unit (contract nat)) ; - RIGHT (or (pair address nat) (pair (pair address address) (contract nat))) ; - LEFT (pair address (pair address nat)) ; - DIG 2 ; - DUP ; - CDR ; - SWAP ; - CAR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - GET ; - IF_NONE - { SWAP ; DROP ; SWAP ; DROP ; PUSH string "Dex/function-not-set" ; FAILWITH } - { DIG 3 ; DIG 2 ; DUP ; DUG 3 ; CDR ; CAR ; DIG 4 ; PAIR ; PAIR ; EXEC } ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - PAIR ; - DIG 2 ; - CAR ; - PAIR ; - SWAP ; - CAR ; - PAIR } } } - { IF_LEFT - { IF_LEFT - { SWAP ; - DROP ; - SWAP ; - DUP ; - DUG 2 ; - NIL operation ; - DIG 2 ; - PUSH mutez 0 ; - DIG 4 ; - DUP ; - DUG 5 ; - CDR ; - CAR ; - CAR ; - CDR ; - CDR ; - CAR ; - CDR ; - DIG 5 ; - CDR ; - CAR ; - CAR ; - CDR ; - CAR ; - CDR ; - CDR ; - PAIR ; - TRANSFER_TOKENS ; - CONS ; - PAIR } - { DIG 2 ; - PUSH nat 4 ; - PAIR ; - DUG 2 ; - RIGHT (pair address (contract nat)) ; - RIGHT (or (pair address nat) (pair (pair address address) (contract nat))) ; - LEFT (pair address (pair address nat)) ; - DIG 2 ; - DUP ; - CDR ; - SWAP ; - CAR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - GET ; - IF_NONE - { SWAP ; DROP ; SWAP ; DROP ; PUSH string "Dex/function-not-set" ; FAILWITH } - { DIG 3 ; DIG 2 ; DUP ; DUG 3 ; CDR ; CAR ; DIG 4 ; PAIR ; PAIR ; EXEC } ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - PAIR ; - DIG 2 ; - CAR ; - PAIR ; - SWAP ; - CAR ; - PAIR } } - { IF_LEFT - { DIG 2 ; - PUSH nat 0 ; - PAIR ; - DUG 2 ; - RIGHT - (or (or (pair address nat) (pair (pair address address) (contract nat))) - (or (pair address (contract nat)) (pair unit (contract nat)))) ; - DIG 2 ; - DUP ; - CDR ; - SWAP ; - CAR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - GET ; - IF_NONE - { SWAP ; DROP ; SWAP ; DROP ; PUSH string "Dex/function-not-set" ; FAILWITH } - { DIG 3 ; DIG 2 ; DUP ; DUG 3 ; CDR ; CAR ; DIG 4 ; PAIR ; PAIR ; EXEC } ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - PAIR ; - DIG 2 ; - CAR ; - PAIR ; - SWAP ; - CAR ; - PAIR } - { DIG 2 ; - DUP ; - DUG 3 ; - CAR ; - CAR ; - SWAP ; - DUP ; - DUG 2 ; - IF_LEFT - { IF_LEFT - { IF_LEFT { DROP ; PUSH nat 5 } { DROP ; PUSH nat 0 } } - { IF_LEFT { DROP ; PUSH nat 4 } { DROP ; PUSH nat 1 } } } - { IF_LEFT - { IF_LEFT { DROP ; PUSH nat 2 } { DROP ; PUSH nat 7 } } - { IF_LEFT { DROP ; PUSH nat 6 } { DROP ; PUSH nat 3 } } } ; - GET ; - IF_NONE - { DROP 2 ; PUSH string "Dex/function-not-set" ; FAILWITH } - { DIG 2 ; DIG 3 ; DUP ; DUG 4 ; CDR ; CAR ; DIG 3 ; PAIR ; PAIR ; EXEC } ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - PAIR ; - DIG 2 ; - CAR ; - PAIR ; - SWAP ; - CAR ; - PAIR } } } } } - diff --git a/contracts/main/DexFA2.ligo b/contracts/main/DexFA2.ligo deleted file mode 100644 index 290e72cb..00000000 --- a/contracts/main/DexFA2.ligo +++ /dev/null @@ -1,15 +0,0 @@ -#define FA2_STANDARD_ENABLED -#include "../partials/Dex.ligo" - -(* DexFA2 - Contract for exchanges for XTZ - FA2 token pair *) -function main (const p : full_action; const s : full_dex_storage) : full_return is - block { - const this: address = Tezos.self_address; - } with case p of - | Default -> use_default(s) - | Use(params) -> call_dex(params, this, s) - | Transfer(params) -> call_token(ITransfer(params), this, 0n, s) - | Balance_of(params) -> call_token(IBalance_of(params), this, 2n, s) - | Update_operators(params) -> call_token(IUpdate_operators(params), this, 1n, s) - | Get_reserves(params) -> get_reserves(params, s) - end diff --git a/contracts/main/DexFA2.tz b/contracts/main/DexFA2.tz deleted file mode 100644 index e7365194..00000000 --- a/contracts/main/DexFA2.tz +++ /dev/null @@ -1,382 +0,0 @@ -{ parameter - (or (or (or (pair %balance_of - (list %requests (pair (address %owner) (nat %token_id))) - (contract %callback - (list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))))) - (unit %default)) - (or (contract %get_reserves (pair nat nat)) - (list %transfer - (pair (address %from_) - (list %txs (pair (address %to_) (pair (nat %token_id) (nat %amount)))))))) - (or (list %update_operators - (or (pair %add_operator (address %owner) (pair (address %operator) (nat %token_id))) - (pair %remove_operator (address %owner) (pair (address %operator) (nat %token_id))))) - (or %use - (or (or (pair %divestLiquidity (pair (nat %min_tez) (nat %min_tokens)) (nat %shares)) - (nat %initializeExchange)) - (or (nat %investLiquidity) - (pair %tezToTokenPayment (nat %min_out) (address %receiver)))) - (or (or (pair %tokenToTezPayment (pair (nat %amount) (nat %min_out)) (address %receiver)) - (pair %veto (nat %value) (address %voter))) - (or (pair %vote (pair (key_hash %candidate) (nat %value)) (address %voter)) - (address %withdrawProfit)))))) ; - storage - (pair (pair (big_map %dex_lambdas - nat - (lambda - (pair (pair (or (or (or (pair %divestLiquidity (pair (nat %min_tez) (nat %min_tokens)) (nat %shares)) - (nat %initializeExchange)) - (or (nat %investLiquidity) - (pair %tezToTokenPayment (nat %min_out) (address %receiver)))) - (or (or (pair %tokenToTezPayment (pair (nat %amount) (nat %min_out)) (address %receiver)) - (pair %veto (nat %value) (address %voter))) - (or (pair %vote (pair (key_hash %candidate) (nat %value)) (address %voter)) - (address %withdrawProfit)))) - (pair (pair (pair (pair (pair (address %baker_validator) (option %current_candidate key_hash)) - (pair (option %current_delegated key_hash) (timestamp %last_update_time))) - (pair (pair (timestamp %last_veto) - (big_map %ledger - address - (pair (pair (set %allowances address) (nat %balance)) (nat %frozen_balance)))) - (pair (timestamp %period_finish) (nat %reward)))) - (pair (pair (pair (nat %reward_paid) (nat %reward_per_sec)) - (pair (nat %reward_per_share) (nat %tez_pool))) - (pair (pair (address %token_address) (nat %token_id)) - (pair (nat %token_pool) (nat %total_reward))))) - (pair (pair (pair (nat %total_supply) (nat %total_votes)) - (pair (big_map %user_rewards address (pair (nat %reward) (nat %reward_paid))) - (nat %veto))) - (pair (pair (big_map %vetos key_hash timestamp) - (big_map %voters - address - (pair (pair (option %candidate key_hash) (timestamp %last_veto)) - (pair (nat %veto) (nat %vote))))) - (big_map %votes key_hash nat))))) - address) - (pair (list operation) - (pair (pair (pair (pair (pair (address %baker_validator) (option %current_candidate key_hash)) - (pair (option %current_delegated key_hash) (timestamp %last_update_time))) - (pair (pair (timestamp %last_veto) - (big_map %ledger - address - (pair (pair (set %allowances address) (nat %balance)) (nat %frozen_balance)))) - (pair (timestamp %period_finish) (nat %reward)))) - (pair (pair (pair (nat %reward_paid) (nat %reward_per_sec)) - (pair (nat %reward_per_share) (nat %tez_pool))) - (pair (pair (address %token_address) (nat %token_id)) - (pair (nat %token_pool) (nat %total_reward))))) - (pair (pair (pair (nat %total_supply) (nat %total_votes)) - (pair (big_map %user_rewards address (pair (nat %reward) (nat %reward_paid))) - (nat %veto))) - (pair (pair (big_map %vetos key_hash timestamp) - (big_map %voters - address - (pair (pair (option %candidate key_hash) (timestamp %last_veto)) - (pair (nat %veto) (nat %vote))))) - (big_map %votes key_hash nat))))))) - (big_map %metadata string bytes)) - (pair (pair %storage - (pair (pair (pair (pair (address %baker_validator) (option %current_candidate key_hash)) - (pair (option %current_delegated key_hash) (timestamp %last_update_time))) - (pair (pair (timestamp %last_veto) - (big_map %ledger - address - (pair (pair (set %allowances address) (nat %balance)) (nat %frozen_balance)))) - (pair (timestamp %period_finish) (nat %reward)))) - (pair (pair (pair (nat %reward_paid) (nat %reward_per_sec)) - (pair (nat %reward_per_share) (nat %tez_pool))) - (pair (pair (address %token_address) (nat %token_id)) - (pair (nat %token_pool) (nat %total_reward))))) - (pair (pair (pair (nat %total_supply) (nat %total_votes)) - (pair (big_map %user_rewards address (pair (nat %reward) (nat %reward_paid))) - (nat %veto))) - (pair (pair (big_map %vetos key_hash timestamp) - (big_map %voters - address - (pair (pair (option %candidate key_hash) (timestamp %last_veto)) - (pair (nat %veto) (nat %vote))))) - (big_map %votes key_hash nat)))) - (big_map %token_lambdas - nat - (lambda - (pair (pair (or (or (pair %iBalance_of - (list %requests (pair (address %owner) (nat %token_id))) - (contract %callback - (list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))))) - (list %iTransfer - (pair (address %from_) - (list %txs (pair (address %to_) (pair (nat %token_id) (nat %amount))))))) - (list %iUpdate_operators - (or (pair %add_operator (address %owner) (pair (address %operator) (nat %token_id))) - (pair %remove_operator (address %owner) (pair (address %operator) (nat %token_id)))))) - (pair (pair (pair (pair (pair (address %baker_validator) (option %current_candidate key_hash)) - (pair (option %current_delegated key_hash) (timestamp %last_update_time))) - (pair (pair (timestamp %last_veto) - (big_map %ledger - address - (pair (pair (set %allowances address) (nat %balance)) (nat %frozen_balance)))) - (pair (timestamp %period_finish) (nat %reward)))) - (pair (pair (pair (nat %reward_paid) (nat %reward_per_sec)) - (pair (nat %reward_per_share) (nat %tez_pool))) - (pair (pair (address %token_address) (nat %token_id)) - (pair (nat %token_pool) (nat %total_reward))))) - (pair (pair (pair (nat %total_supply) (nat %total_votes)) - (pair (big_map %user_rewards address (pair (nat %reward) (nat %reward_paid))) - (nat %veto))) - (pair (pair (big_map %vetos key_hash timestamp) - (big_map %voters - address - (pair (pair (option %candidate key_hash) (timestamp %last_veto)) - (pair (nat %veto) (nat %vote))))) - (big_map %votes key_hash nat))))) - address) - (pair (list operation) - (pair (pair (pair (pair (pair (address %baker_validator) (option %current_candidate key_hash)) - (pair (option %current_delegated key_hash) (timestamp %last_update_time))) - (pair (pair (timestamp %last_veto) - (big_map %ledger - address - (pair (pair (set %allowances address) (nat %balance)) (nat %frozen_balance)))) - (pair (timestamp %period_finish) (nat %reward)))) - (pair (pair (pair (nat %reward_paid) (nat %reward_per_sec)) - (pair (nat %reward_per_share) (nat %tez_pool))) - (pair (pair (address %token_address) (nat %token_id)) - (pair (nat %token_pool) (nat %total_reward))))) - (pair (pair (pair (nat %total_supply) (nat %total_votes)) - (pair (big_map %user_rewards address (pair (nat %reward) (nat %reward_paid))) - (nat %veto))) - (pair (pair (big_map %vetos key_hash timestamp) - (big_map %voters - address - (pair (pair (option %candidate key_hash) (timestamp %last_veto)) - (pair (nat %veto) (nat %vote))))) - (big_map %votes key_hash nat))))))))) ; - code { DUP ; - CDR ; - SWAP ; - CAR ; - SELF ; - ADDRESS ; - SWAP ; - IF_LEFT - { IF_LEFT - { IF_LEFT - { DIG 2 ; - PUSH nat 2 ; - PAIR ; - DUG 2 ; - LEFT (list (pair address (list (pair address (pair nat nat))))) ; - LEFT (list (or (pair address (pair address nat)) (pair address (pair address nat)))) ; - DIG 2 ; - DUP ; - CDR ; - SWAP ; - CAR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - GET ; - IF_NONE - { SWAP ; DROP ; SWAP ; DROP ; PUSH string "Dex/function-not-set" ; FAILWITH } - { DIG 3 ; DIG 2 ; DUP ; DUG 3 ; CDR ; CAR ; DIG 4 ; PAIR ; PAIR ; EXEC } ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - PAIR ; - DIG 2 ; - CAR ; - PAIR ; - SWAP ; - CAR ; - PAIR } - { DROP 2 ; - DUP ; - CAR ; - CAR ; - PUSH nat 8 ; - GET ; - IF_NONE - { PUSH string "Dex/function-not-set" ; FAILWITH } - { SELF ; - ADDRESS ; - DIG 2 ; - DUP ; - DUG 3 ; - CDR ; - CAR ; - PUSH nat 0 ; - RIGHT (pair (pair nat nat) nat) ; - LEFT (or nat (pair nat address)) ; - LEFT (or (or (pair (pair nat nat) address) (pair nat address)) - (or (pair (pair key_hash nat) address) address)) ; - PAIR ; - PAIR ; - EXEC } ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - PAIR ; - DIG 2 ; - CAR ; - PAIR ; - SWAP ; - CAR ; - PAIR } } - { IF_LEFT - { SWAP ; - DROP ; - SWAP ; - DUP ; - DUG 2 ; - NIL operation ; - DIG 2 ; - PUSH mutez 0 ; - DIG 4 ; - DUP ; - DUG 5 ; - CDR ; - CAR ; - CAR ; - CDR ; - CDR ; - CDR ; - CAR ; - DIG 5 ; - CDR ; - CAR ; - CAR ; - CDR ; - CAR ; - CDR ; - CDR ; - PAIR ; - TRANSFER_TOKENS ; - CONS ; - PAIR } - { DIG 2 ; - PUSH nat 0 ; - PAIR ; - DUG 2 ; - RIGHT (pair (list (pair address nat)) (contract (list (pair (pair address nat) nat)))) ; - LEFT (list (or (pair address (pair address nat)) (pair address (pair address nat)))) ; - DIG 2 ; - DUP ; - CDR ; - SWAP ; - CAR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - GET ; - IF_NONE - { SWAP ; DROP ; SWAP ; DROP ; PUSH string "Dex/function-not-set" ; FAILWITH } - { DIG 3 ; DIG 2 ; DUP ; DUG 3 ; CDR ; CAR ; DIG 4 ; PAIR ; PAIR ; EXEC } ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - PAIR ; - DIG 2 ; - CAR ; - PAIR ; - SWAP ; - CAR ; - PAIR } } } - { IF_LEFT - { DIG 2 ; - PUSH nat 1 ; - PAIR ; - DUG 2 ; - RIGHT - (or (pair (list (pair address nat)) (contract (list (pair (pair address nat) nat)))) - (list (pair address (list (pair address (pair nat nat)))))) ; - DIG 2 ; - DUP ; - CDR ; - SWAP ; - CAR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - GET ; - IF_NONE - { SWAP ; DROP ; SWAP ; DROP ; PUSH string "Dex/function-not-set" ; FAILWITH } - { DIG 3 ; DIG 2 ; DUP ; DUG 3 ; CDR ; CAR ; DIG 4 ; PAIR ; PAIR ; EXEC } ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - PAIR ; - DIG 2 ; - CAR ; - PAIR ; - SWAP ; - CAR ; - PAIR } - { DIG 2 ; - DUP ; - DUG 3 ; - CAR ; - CAR ; - SWAP ; - DUP ; - DUG 2 ; - IF_LEFT - { IF_LEFT - { IF_LEFT { DROP ; PUSH nat 5 } { DROP ; PUSH nat 0 } } - { IF_LEFT { DROP ; PUSH nat 4 } { DROP ; PUSH nat 1 } } } - { IF_LEFT - { IF_LEFT { DROP ; PUSH nat 2 } { DROP ; PUSH nat 7 } } - { IF_LEFT { DROP ; PUSH nat 6 } { DROP ; PUSH nat 3 } } } ; - GET ; - IF_NONE - { DROP 2 ; PUSH string "Dex/function-not-set" ; FAILWITH } - { DIG 2 ; DIG 3 ; DUP ; DUG 4 ; CDR ; CAR ; DIG 3 ; PAIR ; PAIR ; EXEC } ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - CDR ; - SWAP ; - DUP ; - DUG 2 ; - CDR ; - PAIR ; - DIG 2 ; - CAR ; - PAIR ; - SWAP ; - CAR ; - PAIR } } } } - diff --git a/contracts/main/FactoryFA12.ligo b/contracts/main/FactoryFA12.ligo deleted file mode 100644 index f0f174dc..00000000 --- a/contracts/main/FactoryFA12.ligo +++ /dev/null @@ -1,3 +0,0 @@ -#include "../partials/Factory.ligo" - -(* FactoryFA1.2 - Singleton used to deploy new exchange pair that exchanges tokens of FA1.2 standard *) diff --git a/contracts/main/FactoryFA2.ligo b/contracts/main/FactoryFA2.ligo deleted file mode 100644 index 64319216..00000000 --- a/contracts/main/FactoryFA2.ligo +++ /dev/null @@ -1,4 +0,0 @@ -#define FA2_STANDARD_ENABLED (* switch the standard *) -#include "../partials/Factory.ligo" - -(* FactoryFA2 - Singleton used to deploy new exchange pair that exchanges tokens of FA2 standard *) \ No newline at end of file diff --git a/contracts/main/TestFactoryFA12.ligo b/contracts/main/TestFactoryFA12.ligo deleted file mode 100644 index 3186cf80..00000000 --- a/contracts/main/TestFactoryFA12.ligo +++ /dev/null @@ -1,2 +0,0 @@ -#define TEST_ENABLED (* turn on the test mode *) -#include "./FactoryFA12.ligo" diff --git a/contracts/main/TestFactoryFA2.ligo b/contracts/main/TestFactoryFA2.ligo deleted file mode 100644 index 61d77a52..00000000 --- a/contracts/main/TestFactoryFA2.ligo +++ /dev/null @@ -1,2 +0,0 @@ -#define TEST_ENABLED (* turn on the test mode *) -#include "./FactoryFA2.ligo" diff --git a/contracts/partials/ActionFA12.ligo b/contracts/partials/ActionFA12.ligo deleted file mode 100644 index d886b2d6..00000000 --- a/contracts/partials/ActionFA12.ligo +++ /dev/null @@ -1,23 +0,0 @@ -(* Main function parameter types specific for FA1.2 standard*) -type transfer_params is michelson_pair(address, "from", michelson_pair(address, "to", nat, "value"), "") -type approve_params is michelson_pair(address, "spender", nat, "value") -type balance_params is michelson_pair(address, "owner", contract(nat), "") -type allowance_params is michelson_pair(michelson_pair(address, "owner", address, "spender"), "", contract(nat), "") -type total_supply_params is (unit * contract(nat)) - -type token_action is -| ITransfer of transfer_params -| IApprove of approve_params -| IGetBalance of balance_params -| IGetAllowance of allowance_params -| IGetTotalSupply of total_supply_params - -type full_action is -| Use of use_params -| Default of default_params -| Transfer of transfer_params -| Approve of approve_params -| GetBalance of balance_params -| GetAllowance of allowance_params -| GetTotalSupply of total_supply_params -| GetReserves of get_reserves_params diff --git a/contracts/partials/ActionFA2.ligo b/contracts/partials/ActionFA2.ligo deleted file mode 100644 index c7cbb4bc..00000000 --- a/contracts/partials/ActionFA2.ligo +++ /dev/null @@ -1,16 +0,0 @@ -(* Main function parameter types specific for FA2 standard*) -type transfer_params is list (transfer_param) -type update_operator_params is list (update_operator_param) - -type token_action is -| ITransfer of transfer_params -| IBalance_of of balance_params -| IUpdate_operators of update_operator_params - -type full_action is -| Use of use_params -| Default of default_params -| Transfer of transfer_params -| Balance_of of balance_params -| Update_operators of update_operator_params -| Get_reserves of get_reserves_params diff --git a/contracts/partials/BakerRegistryMethods.ligo b/contracts/partials/BakerRegistryMethods.ligo deleted file mode 100644 index 09d113f0..00000000 --- a/contracts/partials/BakerRegistryMethods.ligo +++ /dev/null @@ -1,18 +0,0 @@ -type registry_storage is big_map (key_hash, bool) -type registry_action is -| Validate of key_hash -| Register of key_hash - -(* Ensure the key_hash belongs to baker *) -function register (const baker : key_hash; const s : registry_storage) : (list (operation) * registry_storage) is -block { - s[baker] := True; - const operations : list (operation) = list [set_delegate(Some(baker))]; -} with (operations, s) - -(* Validate the received address is in the list of the validates bakers *) -function validate (const baker : key_hash; const s : registry_storage) : (list (operation) * registry_storage) is - case s[baker] of - | Some(v) -> ((nil : list(operation)), s) - | None -> register(baker, s) - end; diff --git a/contracts/partials/Common.ligo b/contracts/partials/Common.ligo deleted file mode 100644 index a93d7a3b..00000000 --- a/contracts/partials/Common.ligo +++ /dev/null @@ -1,111 +0,0 @@ -(* Helper function to get account *) -function get_account (const addr : address; const s : dex_storage) : account_info is - case s.ledger[addr] of - None -> record [ - balance = 0n; - frozen_balance = 0n; -#if FA2_STANDARD_ENABLED - allowances = (set [] : set (address)); -#else - allowances = (map [] : map(address, nat)); -#endif - ] - | Some(instance) -> instance - end; - -(* Helper function to prepare the token transfer *) -function wrap_transfer_trx(const owner : address; const receiver : address; const value : nat; const s : dex_storage) : transfer_type is -#if FA2_STANDARD_ENABLED - TransferType(list[ - record[ - from_ = owner; - txs = list [ record [ - to_ = receiver; - token_id = s.token_id; - amount = value; - ] ] - ] - ]) -#else - TransferType(owner, (receiver, value)) -#endif - -(* Helper function to get token contract *) -function get_token_contract(const token_address : address) : contract(transfer_type) is - case (Tezos.get_entrypoint_opt("%transfer", token_address) : option(contract(transfer_type))) of - Some(contr) -> contr - | None -> (failwith("Dex/not-token") : contract(transfer_type)) - end; - -(* Helper function to get token contract *) -function get_validator_contract(const token_address : address) : contract(key_hash) is - case (Tezos.get_entrypoint_opt("%validate", token_address) : option(contract(key_hash))) of - Some(contr) -> contr - | None -> (failwith("Dex/not-validator") : contract(key_hash)) - end; - -(* Helper function to get voter info *) -function get_voter (const addr : address; const s : dex_storage) : vote_info is - case s.voters[addr] of - None -> record [ - candidate = (None : option(key_hash)); - vote = 0n; - veto = 0n; - last_veto = Tezos.now; - ] - | Some(instance) -> instance - end; - -(* Helper function to get user reward info *) -function get_user_reward_info (const addr : address; const s : dex_storage) : user_reward_info is - case s.user_rewards[addr] of - None -> record [ - reward = 0n; - reward_paid = 0n; - ] - | Some(instance) -> instance - end; - - -(* Helper function to update global rewards info *) -function update_reward (const s : dex_storage) : dex_storage is - block { - (* update loyalty info *) - const rewards_time : timestamp = if Tezos.now > s.period_finish then - s.period_finish - else Tezos.now; - const new_reward : nat = abs(rewards_time - s.last_update_time) * s.reward_per_sec; - s.reward_per_share := s.reward_per_share + new_reward / s.total_supply; - s.last_update_time := Tezos.now; - - (* update reward info *) - if Tezos.now > s.period_finish then block { - const periods_duration : int = ((Tezos.now - s.period_finish) / voting_period + 1) * voting_period; - s.reward_per_sec := s.reward * accurancy_multiplier / abs(periods_duration); - const new_reward : nat = abs(Tezos.now - s.period_finish) * s.reward_per_sec; - s.period_finish := s.period_finish + periods_duration; - s.reward_per_share := s.reward_per_share + new_reward / s.total_supply; - s.reward := 0n; - s.total_reward := s.total_reward + s.reward_per_sec * abs(periods_duration) / accurancy_multiplier; - } else skip; - } with s - -(* Helper function to update user rewards info *) -function update_user_reward (const addr : address; const account: account_info; const new_balance: nat; const s : dex_storage) : dex_storage is - block { - var user_reward_info : user_reward_info := get_user_reward_info(addr, s); - - (* calculate user's reward *) - const current_reward : nat = (account.balance + account.frozen_balance) * s.reward_per_share; - user_reward_info.reward := user_reward_info.reward + abs(current_reward - user_reward_info.reward_paid); - user_reward_info.reward_paid := new_balance * s.reward_per_share; - - (* update user's reward *) - s.user_rewards[addr] := user_reward_info; - } with s - -#if FA2_STANDARD_ENABLED -#include "../partials/MethodFA2.ligo" -#else -#include "../partials/MethodFA12.ligo" -#endif diff --git a/contracts/partials/Dex.ligo b/contracts/partials/Dex.ligo deleted file mode 100644 index 898fd9a5..00000000 --- a/contracts/partials/Dex.ligo +++ /dev/null @@ -1,79 +0,0 @@ -#include "./IDex.ligo" - -(* Route exchange-specific action - -Due to the fabulous storage, gas and operation size limits -the only way to have all the nessary functions is to store -them in big_map and dispatch the exact function code before -the execution. - -The function is responsible for fiding the appropriate method -based on the argument type. - -*) -[@inline] function call_dex (const p : dex_action; const this : address; const s : full_dex_storage) : full_return is -block { - const idx : nat = case p of - | InitializeExchange(n) -> 0n - | TezToTokenPayment(n) -> 1n - | TokenToTezPayment(n) -> 2n - | InvestLiquidity(n) -> 4n - | DivestLiquidity(n) -> 5n - | Vote(n) -> 6n - | Veto(voter) -> 7n - | WithdrawProfit(receiver) -> 3n - end; - const res : return = case s.dex_lambdas[idx] of - Some(f) -> f(p, s.storage, this) - | None -> (failwith("Dex/function-not-set") : return) - end; - s.storage := res.1; -} with (res.0, s) - -(* Route token-specific action - -Due to the fabulous storage, gas and operation size limits -the only way to have all the nessary functions is to store -them in big_map and dispatch the exact function code before -the execution. - -The function is responsible for fiding the appropriate method -based on the provided index. - -*) -[@inline] function call_token (const p : token_action; const this : address; const idx : nat; const s : full_dex_storage) : full_return is -block { - const res : return = case s.token_lambdas[idx] of - Some(f) -> f(p, s.storage, this) - | None -> (failwith("Dex/function-not-set") : return) - end; - s.storage := res.1; -} with (res.0, s) - -(* Route the simple XTZ transfers - -Due to the fabulous storage, gas and operation size limits -the only way to have all the nessary functions is to store -them in big_map and dispatch the exact function code before -the execution. - -*) -[@inline] function use_default (const s : full_dex_storage) : full_return is -block { - const res : return = case s.dex_lambdas[8n] of - Some(f) -> f(InitializeExchange(0n), s.storage, Tezos.self_address) - | None -> (failwith("Dex/function-not-set") : return) - end; - s.storage := res.1; -} with (res.0, s) - - -(* Return the reserves to the contracts. *) -[@inline] function get_reserves (const receiver : contract(nat * nat); const s : full_dex_storage) : full_return is - (list [ - Tezos.transaction(( - s.storage.tez_pool, - s.storage.token_pool), - 0tez, - receiver) - ], s) diff --git a/contracts/partials/Factory.ligo b/contracts/partials/Factory.ligo deleted file mode 100644 index e2833d11..00000000 --- a/contracts/partials/Factory.ligo +++ /dev/null @@ -1,132 +0,0 @@ -#include "./IFactory.ligo" -#include "./Common.ligo" -#include "./MethodDex.ligo" - -(* Michelson code snipped to deploy the Exchange Pair code. - -By some reasons the contract code cannot be inserted into the -Tezos.create_contract and the michelson code is embeded. - -Kudos to Tom Jack for help. - -*) -const create_dex : create_dex_func = -[%Michelson ( {| { UNPPAIIR ; - CREATE_CONTRACT -#if FA2_STANDARD_ENABLED -#include "../main/DexFA2.tz" -#else -#include "../main/DexFA12.tz" -#endif - ; - PAIR } |} - : create_dex_func)]; - -(* Create the pool contract for Tez-Token pair *) -[@inline] function launch_exchange (const self : address; const token : token_identifier; const token_amount : nat; var s : exchange_storage) : full_factory_return is - block { - (* check requirements *) - case s.token_to_exchange[token] of - Some(n) -> failwith("Factory/exchange-launched") - | None -> skip - end; - if Tezos.amount < 1mutez or token_amount < 1n then - failwith("Dex/not-allowed") - else skip; - - (* register in the supported assets list *) - s.token_list[s.counter] := token; - s.counter := s.counter + 1n; - s.ledger[Tezos.sender] := record [ - balance = Tezos.amount / 1mutez; - frozen_balance = 0n; -#if FA2_STANDARD_ENABLED - allowances = (set [] : set(address)); -#else - allowances = (map [] : map(address, nat)); -#endif - ]; - - (* prepare storage traking into account the token standard *) - const storage : dex_storage = record [ -#if FA2_STANDARD_ENABLED - token_id = token.1; -#endif - tez_pool = Tezos.amount / 1mutez; - token_pool = token_amount; - baker_validator = s.baker_validator; - total_supply = Tezos.amount / 1mutez; -#if FA2_STANDARD_ENABLED - token_address = token.0; -#else - token_address = token; -#endif - ledger = s.ledger; - voters = s.voters; - vetos = s.vetos; - votes = s.votes; - veto = 0n; - last_veto = Tezos.now; - current_delegated = (None: option(key_hash)); - current_candidate = (None: option(key_hash)); - total_votes = 0n; - total_reward = 0n; - reward_paid = 0n; - reward = 0n; - reward_per_share = 0n; - last_update_time = Tezos.now; - period_finish = Tezos.now; - reward_per_sec = 0n; - user_rewards = s.user_rewards; - ]; - - (* prepare theoperation to originate the Pair contract; note: the XTZ for initial liquidity are sent *) - const res : (operation * address) = create_dex((None : option(key_hash)), Tezos.amount, record [ - storage = storage; - dex_lambdas = s.dex_lambdas; - metadata = s.metadata; - token_lambdas = s.token_lambdas; - ]); - - (* remove key *) - remove Tezos.sender from map s.ledger; - - (* add the address of new Pair contract to storage *) - s.token_to_exchange[token] := res.1; - } with (list[res.0; (* originate contract *) - transaction( (* provide initial tokens liquidity to the Pair *) - wrap_transfer_trx(Tezos.sender, res.1, token_amount, storage), - 0mutez, -#if FA2_STANDARD_ENABLED - get_token_contract(token.0) -#else - get_token_contract(token) -#endif - ) - ], s) - -(* Set the dex function code to factory storage *) -[@inline] function set_dex_function (const idx : nat; const f : dex_func; const s : exchange_storage) : exchange_storage is -block { - case s.dex_lambdas[idx] of - Some(n) -> failwith("Factory/function-set") - | None -> s.dex_lambdas[idx] := f - end; -} with s - -(* Set the token function code to factory storage *) -[@inline] function set_token_function (const idx : nat; const f : token_func; const s : exchange_storage) : exchange_storage is -block { - case s.token_lambdas[idx] of - Some(n) -> failwith("Factory/function-set") - | None -> s.token_lambdas[idx] := f - end; -} with s - -(* Factory - Singleton used to deploy new exchange pair that exchanges tokens *) -function main (const p : exchange_action; const s : exchange_storage) : full_factory_return is - case p of - | LaunchExchange(params) -> launch_exchange(Tezos.self_address, params.token, params.token_amount, s) - | SetDexFunction(params) -> ((nil:list(operation)), if params.index > 8n then (failwith("Factory/wrong-index") : exchange_storage) else set_dex_function(params.index, params.func, s)) - | SetTokenFunction(params) -> ((nil:list(operation)), if params.index > token_func_count then (failwith("Factory/wrong-index") : exchange_storage) else set_token_function(params.index, params.func, s)) - end diff --git a/contracts/partials/IDex.ligo b/contracts/partials/IDex.ligo deleted file mode 100644 index 4e31ae1b..00000000 --- a/contracts/partials/IDex.ligo +++ /dev/null @@ -1,125 +0,0 @@ -#if FA2_STANDARD_ENABLED -#include "./TypesFA2.ligo" -#endif - -(* Storage types *) - -(* record that represents account shares *) -type account_info is record [ - balance : nat; (* liquid tokens *) - frozen_balance : nat; (* tokens frozen to grant the veto or voting power *) -#if FA2_STANDARD_ENABLED - allowances : set (address); (* accounts allowed to act on behalf of the user *) -#else - allowances : map (address, nat); (* pairs of the accounts and the amount of tokens they are approed to use *) -#endif -] - -(* record that represents account voting info *) -type vote_info is record [ - candidate : option(key_hash); (* last chosen candidate *) - vote : nat; (* number of shares to be used for voting *) - veto : nat; (* number of shares to be used for voting agains the current delegate*) - last_veto : timestamp; (* time of the last veto proposal by user *) -] - -(* record that represents account baker rewards info *) -type user_reward_info is record [ - reward : nat; (* collected rewards *) - reward_paid : nat; (* last reward accumulator calculated as user_loyalty * reward_per_loyalty *) -] - -(* record for the dex storage *) -type dex_storage is record [ -#if FA2_STANDARD_ENABLED - token_id : token_id; (* token identifier *) -#endif - tez_pool : nat; (* tez reserves in the pool *) - token_pool : nat; (* token reserves in the pool *) - token_address : address; (* address of the traded asset *) - baker_validator : address; (* address of the traded asset *) - total_supply : nat; (* total shares count *) - ledger : big_map(address, account_info); (* account info per address *) - voters : big_map(address, vote_info); (* voting info per user *) - vetos : big_map(key_hash, timestamp); (* time until the banned delegates can't be chosen *) - votes : big_map(key_hash, nat); (* votes per candidate *) - veto : nat; (* collected vetos for current delegated *) - last_veto : timestamp; (* last time the delegate was banned *) - current_delegated : option(key_hash); (* the account XTZ are currently delegated for *) - current_candidate : option(key_hash); (* the best candidate to become next delegated *) - total_votes : nat; (* total votes participated in voting*) - reward : nat; (* collected rewards *) - total_reward : nat; (* total collected rewards *) - reward_paid : nat; (* total paid rewards *) - reward_per_share : nat; (* loyalty score per each share *) - reward_per_sec : nat; (* loyalty score per each share *) - last_update_time : timestamp; (* last time the data was updated *) - period_finish : timestamp; (* time current period ends *) - user_rewards : big_map(address, user_reward_info); (* rawards info per account *) -] - -(* Entrypoint arguments *) - -type tez_to_token_payment_params is record [ - min_out : nat; (* min amount of tokens received to accept exchange *) - receiver : address; (* tokens receiver *) -] - -type token_to_tez_payment_params is record [ - amount : nat; (* amount of tokens to be exchanged *) - min_out : nat; (* min amount of XTZ received to accept exchange *) - receiver : address; (* tokens receiver *) -] - -type divest_liquidity_params is record [ - min_tez : nat; (* min amount of XTZ received to accept the divestment *) - min_tokens : nat; (* min amount of tokens received to accept the divestment *) - shares : nat; (* amount of shares to be burnt *) -] - -type vote_params is record [ - candidate : key_hash; (* the chosen baker *) - value : nat; (* amount of shares that are used to vote *) - voter : address; (* the account from which the voting is done *) -] - -type veto_params is record [ - value : nat; (* amount of shares that are used to vote against the chosen baker *) - voter : address; (* the account from which the veto voting is done *) -] - -type dex_action is -| InitializeExchange of (nat) (* sets initial liquidity *) -| TezToTokenPayment of tez_to_token_payment_params (* exchanges XTZ to tokens and sends them to receiver *) -| TokenToTezPayment of token_to_tez_payment_params (* exchanges tokens to XTZ and sends them to receiver *) -| InvestLiquidity of (nat) (* mints min shares after investing tokens and XTZ *) -| DivestLiquidity of divest_liquidity_params (* burns shares and sends tokens and XTZ to the owner *) -| Vote of vote_params (* votes for candidate with shares of voter *) -| Veto of veto_params (* vote for banning candidate with shares of voter *) -| WithdrawProfit of (address) (* withdraws delegation reward of the sender to receiver address *) - -type default_params is unit -type use_params is dex_action -type get_reserves_params is contract(nat * nat) - -#if FA2_STANDARD_ENABLED -#include "./ActionFA2.ligo" -#else -#include "./ActionFA12.ligo" -#endif - -type return is list (operation) * dex_storage -type dex_func is (dex_action * dex_storage * address) -> return -type token_func is (token_action * dex_storage * address) -> return - -(* real dex storage *) -type full_dex_storage is record - storage : dex_storage; (* real dex storage *) - dex_lambdas : big_map(nat, dex_func); (* map with exchange-related functions code *) - metadata : big_map(string, bytes); (* metadata storage according to TZIP-016 *) - token_lambdas : big_map(nat, token_func); (* map with token-related functions code *) -end - -type full_return is list (operation) * full_dex_storage - -const fee_rate : nat = 333n; (* exchange fee rate distributed among the liquidity providers *) diff --git a/contracts/partials/IFactory.ligo b/contracts/partials/IFactory.ligo deleted file mode 100644 index 80067eb2..00000000 --- a/contracts/partials/IFactory.ligo +++ /dev/null @@ -1,69 +0,0 @@ -#include "./IDex.ligo" - -(* Storage types *) - -#if FA2_STANDARD_ENABLED -type token_identifier is (address * nat) -#else -type token_identifier is address -#endif - -(* record for factory storage *) -type exchange_storage is record [ - counter : nat; - baker_validator : address; - token_list : big_map(nat, token_identifier); (* all the tokens list *) - token_to_exchange : big_map(token_identifier, address); (* token to exchange pairs *) - dex_lambdas : big_map(nat, dex_func); (* map with exchange-related functions code *) - token_lambdas : big_map(nat, token_func); (* map with token-related functions code *) - voters : big_map(address, vote_info); (* voting info per user *) - vetos : big_map(key_hash, timestamp); (* time until the banned delegates can't be chosen *) - votes : big_map(key_hash, nat); (* votes per candidate *) - user_rewards : big_map(address, user_reward_info); (* rawards info per account *) - metadata : big_map(string, bytes); (* metadata storage according to TZIP-016 *) - ledger : big_map(address, account_info); (* account info per address *) -] - -type create_dex_func is (option(key_hash) * tez * full_dex_storage) -> (operation * address) - -type factory_return is list(operation) * exchange_storage - -type full_factory_return is list(operation) * exchange_storage - -(* Entrypoint types *) - -type launch_exchange_params is record [ - token : token_identifier; (* identifier of the token*) - token_amount : nat; (* number of tokens sent as initial liquidity *) -] - -type set_token_function_params is record [ - func : token_func; (* code of the function *) - index : nat; (* the key in functions map *) -] - -type set_dex_function_params is record [ - func : dex_func; (* code of the function *) - index : nat; (* the key in functions map *) -] - -type exchange_action is -| LaunchExchange of launch_exchange_params (* deploys a new empty Dex for token, stores the address of the new contract, and puts initial liquidity *) -| SetDexFunction of set_dex_function_params (* sets the dex specific function. Is used before the whole system is launched *) -| SetTokenFunction of set_token_function_params (* sets the FA function, is used before the whole system is launched *) - -#if TEST_ENABLED -const voting_period : int = 10; (* seconds between baker rewards distribution *) -#else -const voting_period : int = 2592000; (* seconds between baker rewards distribution *) -#endif -const accurancy_multiplier : nat = 1000000000000000n; (* used to improve calculations accuracy *) -const veto_period : int = 7889229; (* seconds to ban the user for *) - -type transfer_type is TransferType of transfer_params - -#if FA2_STANDARD_ENABLED -const token_func_count : nat = 2n; -#else -const token_func_count : nat = 4n; -#endif diff --git a/contracts/partials/MethodDex.ligo b/contracts/partials/MethodDex.ligo deleted file mode 100644 index 0ce92115..00000000 --- a/contracts/partials/MethodDex.ligo +++ /dev/null @@ -1,557 +0,0 @@ -(* Initialize exchange after the previous liquidity was drained *) -function initialize_exchange (const p : dex_action ; const s : dex_storage ; const this: address) : return is - block { - var operations : list(operation) := list[]; - case p of - | InitializeExchange(token_amount) -> { - (* check preconditions *) - if s.tez_pool * s.token_pool =/= 0n (* no reserves *) - then failwith("Dex/non-zero-reserves") else skip; - if s.total_supply =/= 0n (* no shares owned *) - then failwith("Dex/non-zero-shares") else skip; - if Tezos.amount < 1mutez (* XTZ provided *) - then failwith("Dex/no-xtz") else skip; - if token_amount < 1n (* tokens provided *) - then failwith("Dex/no-tokens") else skip; - - s.token_pool := token_amount; - s.tez_pool := Tezos.amount / 1mutez; - s.ledger[Tezos.sender] := record [ - balance = Tezos.amount / 1mutez; - frozen_balance = 0n; -#if FA2_STANDARD_ENABLED - allowances = (set [] : set(address)); -#else - allowances = (map [] : map(address, nat)); -#endif - ]; - s.total_supply := Tezos.amount / 1mutez; - - (* update rewards info *) - s.reward := 0n; - s.reward_per_share := 0n; - s.last_update_time := Tezos.now; - s.period_finish := Tezos.now; - s.reward_per_sec := 0n; - s.total_reward := 0n; - - (* prepare operations to get initial liquidity *) - operations := list[ transaction( - wrap_transfer_trx(Tezos.sender, this, token_amount, s), - 0mutez, - get_token_contract(s.token_address) - )]; - } - | TezToTokenPayment(n) -> skip - | TokenToTezPayment(n) -> skip - | InvestLiquidity(n) -> skip - | DivestLiquidity(n) -> skip - | Vote(n) -> skip - | Veto(n) -> skip - | WithdrawProfit(n) -> skip - end - } with (operations, s) - -(* Vote for the baker by freezing shares *) -function vote (const p : dex_action; const s : dex_storage; const this: address) : return is - block { - var operations: list(operation) := list[]; - case p of - | InitializeExchange(token_amount) -> skip - | TezToTokenPayment(n) -> skip - | TokenToTezPayment(n) -> skip - | InvestLiquidity(n) -> skip - | DivestLiquidity(n) -> skip - | Vote(args) -> { - case s.ledger[args.voter] of - | None -> failwith ("Dex/no-shares") - | Some(account) -> { - const share : nat = account.balance; - - (* ensure candidate isn't banned *) - case s.vetos[args.candidate] of None -> skip - | Some(c) -> if c > Tezos.now then - failwith ("Dex/veto-candidate") - else - remove args.candidate from map s.vetos - end; - - const voter_info : vote_info = get_voter(args.voter, s); - - (* ensure there are enough shares to vote *) - if account.balance + voter_info.vote < args.value then - failwith("Dex/not-enough-balance") - else skip; - - (* ensure permissions to vote on behalf the voter *) -#if FA2_STANDARD_ENABLED - if args.voter = Tezos.sender or account.allowances contains Tezos.sender then - skip - else failwith("Dex/not-enough-allowance"); -#else - if args.voter =/= Tezos.sender then block { - const spender_allowance : nat = get_allowance(account, Tezos.sender, s); - if spender_allowance < args.value then - failwith("Dex/not-enough-allowance") - else skip; - account.allowances[Tezos.sender] := abs(spender_allowance - args.value); - } else skip; -#endif - (* remove votes for previous candidate *) - case voter_info.candidate of - | None -> skip - | Some(candidate) -> - case s.votes[candidate] of - | None -> failwith("Dex/no-votes") - | Some(v) -> - s.votes[candidate] := abs(v - voter_info.vote) - end - end; - - (* update liquid/frozen user's balances *) - account.balance := abs(account.balance + voter_info.vote - args.value); - account.frozen_balance := abs(account.frozen_balance - voter_info.vote + args.value); - s.ledger[args.voter] := account; - - (* update total votes *) - s.total_votes := abs(s.total_votes + args.value - voter_info.vote); - - (* update user's candidate *) - voter_info.candidate := if args.value = 0n then (None : option(key_hash)) else Some(args.candidate); - - (* update user's votes *) - voter_info.vote := args.value; - s.voters[args.voter] := voter_info; - - (* update candidates votes *) - const prev_votes: nat = (case s.votes[args.candidate] of None -> 0n | Some(v) -> v end); - const new_votes: nat = prev_votes + args.value; - s.votes[args.candidate] := new_votes; - - (* ensure the candidate is registered baker *) - if case s.current_delegated of - | None -> prev_votes =/= 0n - | Some(delegate) -> args.candidate = delegate - end - then skip - else { - operations := list [Tezos.transaction(args.candidate, - 0mutez, - get_validator_contract(s.baker_validator))]; - }; - - (* check if current best candidate and delegated should be updated *) - if args.value =/= 0n and (case s.current_candidate of None -> case s.current_delegated of - | None -> True - | Some(current) -> current =/= args.candidate - end - | Some(candidate) -> (case s.votes[candidate] of None -> 0n | Some(v) -> v end) < new_votes or candidate = args.candidate - end) then if case s.current_delegated of - | None -> True - | Some(current) -> (case s.votes[current] of None -> 0n | Some(v) -> v end) < new_votes - end then { - (* update both candidate and delegate records *) - s.current_candidate := s.current_delegated; - s.current_delegated := Some(args.candidate); - - (* prepare operation to change the delegated *) - operations := list [set_delegate(s.current_delegated)]; - } else s.current_candidate := Some(args.candidate); (* update current candidate *) - else skip; - } - end - } - | Veto(n) -> skip - | WithdrawProfit(n) -> skip - end - } with (operations, s) - -(* Vote for veto the current delegated baker by freezing shares *) -function veto (const p : dex_action; const s : dex_storage; const this: address) : return is - block { - var operations: list(operation) := list[]; - case p of - | InitializeExchange(token_amount) -> skip - | TezToTokenPayment(n) -> skip - | TokenToTezPayment(n) -> skip - | InvestLiquidity(n) -> skip - | DivestLiquidity(n) -> skip - | Vote(n) -> skip - | Veto(args) -> { - case s.ledger[args.voter] of - | None -> failwith ("Dex/no-shares") - | Some(account) -> { - const share : nat = account.balance; - - const voter_info : vote_info = get_voter(args.voter, s); - - (* ensure there are enough shares to vote *) - if account.balance + voter_info.veto < args.value then - failwith("Dex/not-enough-balance") - else skip; - - (* ensure permissions to act in behalf of account *) -#if FA2_STANDARD_ENABLED - if args.voter = Tezos.sender or account.allowances contains Tezos.sender then - skip - else failwith("Dex/not-enough-allowance"); -#else - if args.voter =/= Tezos.sender then block { - const spender_allowance : nat = get_allowance(account, Tezos.sender, s); - if spender_allowance < args.value then - failwith("Dex/not-enough-allowance") - else skip; - account.allowances[Tezos.sender] := abs(spender_allowance - args.value); - } else skip; -#endif - - (* update liquid/frozen balance *) - account.balance := abs(account.balance + voter_info.veto - args.value); - account.frozen_balance := abs(account.frozen_balance - voter_info.veto + args.value); - s.ledger[args.voter] := account; - - (* remove last if the delegate has changed since last user's veto *) - if s.last_veto >= voter_info.last_veto then - voter_info.veto := 0n - else skip; - - (* update total veto *) - s.veto := abs(s.veto + args.value - voter_info.veto); - - (* update user's vetos *) - voter_info.veto := args.value; - voter_info.last_veto := Tezos.now; - s.voters[args.voter] := voter_info; - - (* check if ban should be applied *) - if s.veto > s.total_votes / 3n then { - (* reset veto counter *) - s.veto := 0n; - - (* update time of the last veto *) - s.last_veto := Tezos.now; - - (* update current delegated and candidate *) - case s.current_delegated of None -> skip - | Some(d) -> { - s.vetos[d] := Tezos.now + veto_period; - case s.current_candidate of None -> - s.current_delegated := s.current_candidate - | Some(c) -> { - s.current_delegated := if d = c then (None: option(key_hash)) - else s.current_candidate; - s.current_candidate := (None: option(key_hash)); - } - end; - } - end; - - (* prepare delegate operation *) - operations := set_delegate(s.current_delegated) # operations; - } else skip; - } - end - } - | WithdrawProfit(n) -> skip - end - } with (operations, s) - -(* Exchange Tez to tokens *) -function tez_to_token (const p : dex_action; const s : dex_storage; const this : address) : return is - block { - var operations : list(operation) := list[]; - case p of - | InitializeExchange(n) -> skip - | TezToTokenPayment(args) -> { - (* ensure *) - if Tezos.amount / 1mutez > 0n (* non-zero amount of tokens exchanged *) - then skip - else failwith ("Dex/zero-amount-in"); - - if args.min_out > 0n (* non-zero amount of tokens exchanged *) - then skip - else failwith ("Dex/zero-min-amount-out"); - - (* calculate amount out *) - const tez_in_with_fee : nat = Tezos.amount / 1mutez * 997n; - const numerator : nat = tez_in_with_fee * s.token_pool; - const denominator : nat = s.tez_pool * 1000n + tez_in_with_fee; - - (* calculate swapped token amount *) - const tokens_out : nat = numerator / denominator; - - (* ensure requirements *) - if tokens_out >= args.min_out (* sutisfy minimal requested amount *) - then skip else failwith("Dex/wrong-min-out"); - - if tokens_out > s.token_pool / 3n (* not cause a high price impact *) - then failwith("Dex/high-out") - else skip; - - (* update reserves *) - s.token_pool := abs(s.token_pool - tokens_out); - s.tez_pool := s.tez_pool + Tezos.amount / 1mutez; - - (* prepare the transfer operation *) - operations := Tezos.transaction( - wrap_transfer_trx(this, args.receiver, tokens_out, s), - 0mutez, - get_token_contract(s.token_address) - ) # operations; - } - | TokenToTezPayment(n) -> skip - | InvestLiquidity(n) -> skip - | DivestLiquidity(n) -> skip - | Vote(n) -> skip - | Veto(voter) -> skip - | WithdrawProfit(n) -> skip - end - } with (operations, s) - -(* Exchange tokens to tez, note: tokens should be approved before the operation *) -function token_to_tez (const p : dex_action; const s : dex_storage; const this : address) : return is - block { - var operations : list(operation) := list[]; - case p of - | InitializeExchange(n) -> skip - | TezToTokenPayment(n) -> skip - | TokenToTezPayment(args) -> { - (* ensure *) - if args.amount > 0n (* non-zero amount of tokens exchanged *) - then skip - else failwith ("Dex/zero-amount-in"); - - if args.min_out > 0n (* non-zero amount of tokens exchanged *) - then skip - else failwith ("Dex/zero-min-amount-out"); - - (* calculate amount out *) - const token_in_with_fee : nat = args.amount * 997n; - const numerator : nat = token_in_with_fee * s.tez_pool; - const denominator : nat = s.token_pool * 1000n + token_in_with_fee; - const tez_out : nat = numerator / denominator; - - (* ensure requirements *) - if tez_out >= args.min_out (* sutisfy minimal requested amount *) - then skip - else failwith("Dex/wrong-min-out"); - if tez_out <= s.tez_pool / 3n (* not cause a high price impact *) - then skip - else failwith("Dex/high-out"); - - (* update reserves *) - s.token_pool := s.token_pool + args.amount; - s.tez_pool := abs(s.tez_pool - tez_out); - - (* prepare operations to withdraw user's tokens and transfer XTZ *) - operations := list [Tezos.transaction( - wrap_transfer_trx(Tezos.sender, this, args.amount, s), - 0mutez, - get_token_contract(s.token_address)); - Tezos.transaction( - unit, - tez_out * 1mutez, - (get_contract(args.receiver) : contract(unit))); - ]; - } - | InvestLiquidity(n) -> skip - | DivestLiquidity(n) -> skip - | Vote(n) -> skip - | Veto(voter) -> skip - | WithdrawProfit(n) -> skip - end - } with (operations, s) - -(* Provide liquidity (both tokens and tez) to the pool, note: tokens should be approved before the operation *) -function invest_liquidity (const p : dex_action; const s : dex_storage; const this: address) : return is - block { - var operations: list(operation) := list[]; - case p of - | InitializeExchange(n) -> skip - | TezToTokenPayment(n) -> skip - | TokenToTezPayment(n) -> skip - | InvestLiquidity(max_tokens) -> { - (* ensure there is liquidity *) - if s.tez_pool * s.token_pool > 0n then - skip - else failwith("Dex/not-launched"); - - const shares_purchased : nat = Tezos.amount / 1mutez * s.total_supply / s.tez_pool; - - (* ensure *) - if shares_purchased > 0n (* purchsed shares satisfy required minimum *) - then skip - else failwith("Dex/wrong-params"); - - (* update loyalty and rewards globaly *) - s := update_reward(s); - - (* calculate tokens to be withdrawn *) - var tokens_required : nat := shares_purchased * s.token_pool / s.total_supply; - if shares_purchased * s.token_pool > tokens_required * s.total_supply then - tokens_required := tokens_required + 1n - else skip; - - (* ensure *) - if tokens_required = 0n (* required tokens doesn't exceed max allowed by user *) - then failwith("Dex/zero-tokens-in") else skip; - if tokens_required > max_tokens (* required tez doesn't exceed max allowed by user *) - then failwith("Dex/low-max-token-in") else skip; - - var account : account_info := get_account(Tezos.sender, s); - const share : nat = account.balance; - - (* update user's loyalty and shares *) - s := update_user_reward(Tezos.sender, account, share + shares_purchased + account.frozen_balance, s); - - (* update user's shares *) - account.balance := share + shares_purchased; - s.ledger[Tezos.sender] := account; - - (* update reserves *) - s.tez_pool := s.tez_pool + Tezos.amount / 1mutez; - s.token_pool := s.token_pool + tokens_required; - - (* update total number of shares *) - s.total_supply := s.total_supply + shares_purchased; - operations := list[Tezos.transaction( - wrap_transfer_trx(Tezos.sender, this, tokens_required, s), - 0mutez, - get_token_contract(s.token_address) - )]; - } - | DivestLiquidity(n) -> skip - | Vote(n) -> skip - | Veto(voter) -> skip - | WithdrawProfit(n) -> skip - end - } with (operations, s) - -(* Remove liquidity (both tokens and tez) from the pool by burning shares *) -function divest_liquidity (const p : dex_action; const s : dex_storage; const this: address) : return is - block { - var operations: list(operation) := list[]; - case p of - | InitializeExchange(token_amount) -> skip - | TezToTokenPayment(n) -> skip - | TokenToTezPayment(n) -> skip - | InvestLiquidity(min_shares) -> skip - | DivestLiquidity(args) -> { - (* ensure there is liquidity *) - if s.tez_pool * s.token_pool > 0n then - skip - else failwith("Dex/not-launched"); - var account : account_info := get_account(Tezos.sender, s); - const share : nat = account.balance; - - (* ensure *) - if args.shares > 0n (* minimal burn's shares are non-zero *) - then skip - else failwith("Dex/zero-burn-shares"); - if args.shares <= share (* burnt shares are lower than liquid balance *) - then skip - else failwith("Dex/insufficient-shares"); - - (* update loyalty and rewards globaly *) - s := update_reward(s); - - (* update user's loyalty and shares *) - s := update_user_reward(Tezos.sender, account, abs(share - args.shares) + account.frozen_balance,s); - - (* update users shares *) - account.balance := abs(share - args.shares); - s.ledger[Tezos.sender] := account; - - (* calculate amount of token's sent to user *) - const tez_divested : nat = s.tez_pool * args.shares / s.total_supply; - const tokens_divested : nat = s.token_pool * args.shares / s.total_supply; - - (* ensure minimal amounts out are non-zero *) - if args.min_tez > 0n and args.min_tokens > 0n then - skip - else failwith("Dex/dust-output"); - - (* ensure minimal amounts are satisfied *) - if tez_divested >= args.min_tez and tokens_divested >= args.min_tokens then - skip - else failwith("Dex/high-expectation"); - - (* update total shares *) - s.total_supply := abs(s.total_supply - args.shares); - - (* update reserves *) - s.tez_pool := abs(s.tez_pool - tez_divested); - s.token_pool := abs(s.token_pool - tokens_divested); - - (* prepare operations with XTZ and tokens to user *) - operations := list [ - Tezos.transaction( - wrap_transfer_trx(this, Tezos.sender, tokens_divested, s), - 0mutez, - get_token_contract(s.token_address) - ); - Tezos.transaction( - unit, - tez_divested * 1mutez, - (get_contract(Tezos.sender) : contract(unit))); - ]; - } - | Vote(n) -> skip - | Veto(voter) -> skip - | WithdrawProfit(n) -> skip - end - } with (operations, s) - -(* The default method to be called when no entrypoint is chosen *) -function receive_reward (const p : dex_action; const s : dex_storage; const this : address) : return is - block { - (* update loyalty and rewards globaly *) - s := update_reward(s); - - (* update collected rewards amount *) - s.reward := s.reward + Tezos.amount / 1mutez; - s.tez_pool := abs(Tezos.balance / 1mutez + s.reward_paid - s.reward - s.total_reward); - } with ((nil : list(operation)), s) - -(* Withdraw reward from baker *) -function withdraw_profit (const p : dex_action; const s : dex_storage; const this : address) : return is - block { - var operations: list(operation) := list[]; - case p of - | InitializeExchange(n) -> skip - | TezToTokenPayment(n) -> skip - | TokenToTezPayment(n) -> skip - | InvestLiquidity(n) -> skip - | DivestLiquidity(n) -> skip - | Vote(n) -> skip - | Veto(voter) -> skip - | WithdrawProfit(receiver) -> { - var account : account_info := get_account(Tezos.sender, s); - const share : nat = account.balance; - - (* update loyalty and rewards globaly *) - s := update_reward(s); - - (* update user's loyalty and shares *) - s := update_user_reward(Tezos.sender, account, account.balance + account.frozen_balance, s); - - var user_reward_info : user_reward_info := get_user_reward_info(Tezos.sender, s); - const reward : nat = user_reward_info.reward; - - (* reset user's reward *) - user_reward_info.reward := abs (reward - reward / accurancy_multiplier * accurancy_multiplier); - s.user_rewards[Tezos.sender] := user_reward_info; - - (* update total paid rewards *) - s.reward_paid := s.reward_paid + reward / accurancy_multiplier; - - (* prepare transfer operations if there are tokens to sent *) - if reward >= accurancy_multiplier then { - operations := list [Tezos.transaction( - unit, - reward / accurancy_multiplier * 1mutez, - (get_contract(receiver) : contract(unit)))]; - } else skip; - } - end - } with (operations, s) \ No newline at end of file diff --git a/contracts/partials/MethodFA12.ligo b/contracts/partials/MethodFA12.ligo deleted file mode 100644 index f86c4789..00000000 --- a/contracts/partials/MethodFA12.ligo +++ /dev/null @@ -1,120 +0,0 @@ -(* Helper function to get allowance for an account *) -function get_allowance (const owner_account : account_info; const spender : address; const s : dex_storage) : nat is - case owner_account.allowances[spender] of - Some (nat) -> nat - | None -> 0n - end; - -(* Transfer token to another account *) -function transfer (const p : token_action; const s : dex_storage; const this : address) : return is - block { - var operations: list(operation) := list[]; - case p of - | ITransfer(params) -> { - s := update_reward(s); - - const value : nat = params.1.1; - if params.0 = params.1.0 then - failwith("Dex/selt-transfer") - else skip; - const sender_account : account_info = get_account(params.0, s); - if sender_account.balance < value then - failwith("Dex/not-enough-balance") - else skip; - if params.0 =/= Tezos.sender then block { - const spender_allowance : nat = get_allowance(sender_account, Tezos.sender, s); - if spender_allowance < value then - failwith("Dex/not-enough-allowance") - else skip; - sender_account.allowances[Tezos.sender] := abs(spender_allowance - value); - } else skip; - - s := update_user_reward(params.0, sender_account, abs(sender_account.balance - value) + sender_account.frozen_balance, s); - - sender_account.balance := abs(sender_account.balance - value); - s.ledger[params.0] := sender_account; - - var dest_account : account_info := get_account(params.1.0, s); - - s := update_user_reward(params.1.0, dest_account, dest_account.balance + value + dest_account.frozen_balance, s); - - dest_account.balance := dest_account.balance + value; - s.ledger[params.1.0] := dest_account; - } - | IApprove(params) -> skip - | IGetBalance(params) -> skip - | IGetAllowance(params) -> skip - | IGetTotalSupply(params) -> skip - end - } with (operations, s) - -(* Approve an nat to be spent by another address in the name of the sender *) -function approve (const p : token_action; const s : dex_storage; const this : address) : return is - block { - case p of - | ITransfer(params) -> skip - | IApprove(params) -> { - if params.0 = Tezos.sender then - failwith("Dex/selt-approval") - else skip; - var sender_account : account_info := get_account(Tezos.sender, s); - const spender_allowance : nat = get_allowance(sender_account, params.0, s); - if spender_allowance > 0n and params.1 > 0n then - failwith("UnsafeAllowanceChange") - else skip; - sender_account.allowances[params.0] := params.1; - s.ledger[Tezos.sender] := sender_account; - } - | IGetBalance(params) -> skip - | IGetAllowance(params) -> skip - | IGetTotalSupply(params) -> skip - end - } with ((nil : list(operation)), s) - -(* View function that forwards the balance of source to a contract *) -function get_balance (const p : token_action; const s : dex_storage; const this : address) : return is - block { - var operations : list(operation) := list[]; - case p of - | ITransfer(params) -> skip - | IApprove(params) -> skip - | IGetBalance(params) -> { - const owner_account : account_info = get_account(params.0, s); - operations := list [transaction(owner_account.balance, 0tz, params.1)]; - } - | IGetAllowance(params) -> skip - | IGetTotalSupply(params) -> skip - end - } with (operations, s) - -(* View function that forwards the total_supply to a contract *) -function get_total_supply (const p : token_action; const s : dex_storage; const this : address) : return is - block { - var operations : list(operation) := list[]; - case p of - | ITransfer(params) -> skip - | IApprove(params) -> skip - | IGetBalance(params) -> skip - | IGetAllowance(params) -> skip - | IGetTotalSupply(params) -> { - operations := list [transaction(s.total_supply, 0tz, params.1)]; - } - end - } with (operations, s) - -(* View function that forwards the allowance amt of spender in the name of tokenOwner to a contract *) -function get_allowance_to_contract (const p : token_action; const s : dex_storage; const this : address) : return is - block { - var operations : list(operation) := list[]; - case p of - | ITransfer(params) -> skip - | IApprove(params) -> skip - | IGetBalance(params) -> skip - | IGetAllowance(params) -> { - const owner_account : account_info = get_account(params.0.0, s); - const spender_allowance : nat = get_allowance(owner_account, params.0.1, s); - operations := list [transaction(spender_allowance, 0tz, params.1)]; - } - | IGetTotalSupply(params) -> skip - end - } with (operations, s) diff --git a/contracts/partials/MethodFA2.ligo b/contracts/partials/MethodFA2.ligo deleted file mode 100644 index 235983fa..00000000 --- a/contracts/partials/MethodFA2.ligo +++ /dev/null @@ -1,154 +0,0 @@ -(* Helper function to get allowance for an account *) -function get_allowance (const owner_account : account_info; const spender : address; const s : dex_storage) : bool is - owner_account.allowances contains spender - -(* Perform transfers from one owner *) -[@inline] function iterate_transfer (const s : dex_storage; const user_trx_params : transfer_param) : dex_storage is - block { - - (* Perform single transfer *) - function make_transfer(const s : dex_storage; const transfer : transfer_destination) : dex_storage is - block { - (* Retrieve sender account from storage *) - const sender_account : account_info = get_account(user_trx_params.from_, s); - - (* Check permissions *) - if user_trx_params.from_ = Tezos.sender or sender_account.allowances contains Tezos.sender then - skip - else failwith("FA2_NOT_OPERATOR"); - - (* Token id check *) - if default_token_id =/= transfer.token_id then - failwith("FA2_TOKEN_UNDEFINED") - else skip; - - (* Balance check *) - if sender_account.balance < transfer.amount then - failwith("FA2_INSUFFICIENT_BALANCE") - else skip; - - s := update_user_reward(user_trx_params.from_, sender_account, abs(sender_account.balance - transfer.amount) + sender_account.frozen_balance, s); - - (* Update sender balance *) - sender_account.balance := abs(sender_account.balance - transfer.amount); - - (* Update storage *) - s.ledger[user_trx_params.from_] := sender_account; - - (* Create or get destination account *) - var dest_account : account_info := get_account(transfer.to_, s); - - s := update_user_reward(transfer.to_, dest_account, dest_account.balance + transfer.amount + dest_account.frozen_balance, s); - - (* Update destination balance *) - dest_account.balance := dest_account.balance + transfer.amount; - - (* Update storage *) - s.ledger[transfer.to_] := dest_account; - } with s; -} with (List.fold (make_transfer, user_trx_params.txs, s)) - -(* Perform single operator update *) -function iterate_update_operator (const s : dex_storage; const params : update_operator_param) : dex_storage is - block { - case params of - | Add_operator(param) -> { - (* Token id check *) - if default_token_id =/= param.token_id then - failwith("FA2_TOKEN_UNDEFINED") - else skip; - - (* Check an owner *) - if Tezos.sender =/= param.owner then - failwith("FA2_NOT_OWNER") - else skip; - - (* Create or get sender account *) - var sender_account : account_info := get_account(param.owner, s); - - (* Set operator *) - sender_account.allowances := Set.add(param.operator, sender_account.allowances); - - (* Update storage *) - s.ledger[param.owner] := sender_account; - } - | Remove_operator(param) -> { - (* Token id check *) - if default_token_id =/= param.token_id then - failwith("FA2_TOKEN_UNDEFINED") - else skip; - - (* Check an owner *) - if Tezos.sender =/= param.owner then - failwith("FA2_NOT_OWNER") - else skip; - - (* Create or get sender account *) - var sender_account : account_info := get_account(param.owner, s); - - (* Set operator *) - sender_account.allowances := Set.remove(param.operator, sender_account.allowances); - - (* Update storage *) - s.ledger[param.owner] := sender_account; - } - end - } with s - - -function transfer (const p : token_action; var s : dex_storage; const this : address) : return is - block { - var operations: list(operation) := list[]; - case p of - | ITransfer(params) -> { - s := update_reward(s); - s := List.fold(iterate_transfer, params, s); - } - | IBalance_of(params) -> skip - | IUpdate_operators(params) -> skip - end - } with (operations, s) - -function get_balance_of (const p : token_action; const s : dex_storage; const this : address) : return is - block { - var operations: list(operation) := list[]; - case p of - | ITransfer(params) -> skip - | IBalance_of(balance_params) -> { - (* Perform single balance lookup *) - function look_up_balance(const l: list (balance_of_response); const request : balance_of_request) : list (balance_of_response) is - block { - (* Token id check *) - if default_token_id =/= request.token_id then - failwith("FA2_TOKEN_UNDEFINED") - else skip; - - (* Retrieve the asked account balance from storage *) - const sender_account : account_info = get_account(request.owner, s); - - (* Form the response *) - const response : balance_of_response = record [ - request = request; - balance = sender_account.balance; - ]; - } with response # l; - - (* Collect balances info *) - const accumulated_response : list (balance_of_response) = List.fold(look_up_balance, balance_params.requests, (nil: list(balance_of_response))); - operations := list[Tezos.transaction(accumulated_response, 0mutez, balance_params.callback)]; - } - | IUpdate_operators(params) -> skip - end - } with (operations, s) - -function update_operators (const p : token_action; const s : dex_storage; const this : address) : return is - block { - var operations: list(operation) := list[]; - case p of - | ITransfer(params) -> skip - | IBalance_of(params) -> skip - | IUpdate_operators(params) -> { - s := List.fold(iterate_update_operator, params, s); - } - end - } with (operations, s) \ No newline at end of file diff --git a/migrations/3_baker_registry_migration.js b/migrations/3_baker_registry_migration.js deleted file mode 100644 index 22dea056..00000000 --- a/migrations/3_baker_registry_migration.js +++ /dev/null @@ -1,8 +0,0 @@ -const BakerRegistry = artifacts.require("BakerRegistry"); -const { MichelsonMap } = require("@taquito/michelson-encoder"); - -module.exports = async (deployer) => { - await deployer.deploy(BakerRegistry, MichelsonMap.fromLiteral({})); - const bakerRegistryInstance = await BakerRegistry.deployed(); - console.log(`BakerRegistry address: ${bakerRegistryInstance.address}`); -}; diff --git a/migrations/4_deploy_dex.js b/migrations/4_deploy_dex.js deleted file mode 100644 index b9c0505c..00000000 --- a/migrations/4_deploy_dex.js +++ /dev/null @@ -1,155 +0,0 @@ -const standard = process.env.EXCHANGE_TOKEN_STANDARD; -if (["FA2", "FA12"].includes(standard)) { - const Factory = artifacts.require("Factory" + standard); - const MetadataStorage = artifacts.require("MetadataStorage"); - const factoryStorage = require("../storage/Factory"); - const { TezosToolkit } = require("@taquito/taquito"); - const { InMemorySigner } = require("@taquito/signer"); - const { MichelsonMap } = require("@taquito/michelson-encoder"); - const { dexFunctions, tokenFunctions } = require("../storage/Functions"); - const { execSync } = require("child_process"); - const Token = artifacts.require("Token" + standard); - const tokenStorage = require("../storage/Token" + standard); - const { getLigo } = require("../scripts/utils"); - const accountsStored = require("../scripts/sandbox/accounts"); - const BakerRegistry = artifacts.require("BakerRegistry"); - const { confirmOperation } = require("./confirmation"); - - const initialTezAmount = 1; - const initialTokenAmount = 1000000; - const defaultTokenId = 0; - - module.exports = async (deployer, network, accounts) => { - tezos = new TezosToolkit(tezos.rpc.url); - if (network === "development") return; - const secretKey = accountsStored.alice.sk.trim(); - tezos.setProvider({ - config: { - confirmationPollingTimeoutSecond: 500, - }, - signer: await InMemorySigner.fromSecretKey(secretKey), - }); - - const metadataStorageInstance = await MetadataStorage.deployed(); - factoryStorage.baker_validator = ( - await BakerRegistry.deployed() - ).address.toString(); - factoryStorage.metadata = MichelsonMap.fromLiteral({ - "": Buffer( - "tezos-storage://" + - metadataStorageInstance.address.toString() + - "/quipu", - "ascii" - ).toString("hex"), - }); - await deployer.deploy(Factory, factoryStorage); - const factoryInstance = await Factory.deployed(); - console.log(`Factory address: ${factoryInstance.address}`); - - const ligo = getLigo(true); - - for (dexFunction of dexFunctions) { - const stdout = execSync( - `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/Factory${standard}.ligo main 'SetDexFunction(record index =${dexFunction.index}n; func = ${dexFunction.name}; end)'`, - { maxBuffer: 1024 * 500 } - ); - const operation = await tezos.contract.transfer({ - to: factoryInstance.address, - amount: 0, - parameter: { - entrypoint: "setDexFunction", - value: JSON.parse(stdout.toString()).args[0].args[0], - }, - }); - await confirmOperation(tezos, operation.hash); - } - for (tokenFunction of tokenFunctions[standard]) { - const stdout = execSync( - `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/Factory${standard}.ligo main 'SetTokenFunction(record index =${tokenFunction.index}n; func = ${tokenFunction.name}; end)'`, - { maxBuffer: 1024 * 500 } - ); - const operation = await tezos.contract.transfer({ - to: factoryInstance.address, - amount: 0, - parameter: { - entrypoint: "setTokenFunction", - value: JSON.parse(stdout.toString()).args[0], - }, - }); - await confirmOperation(tezos, operation.hash); - } - - if (network !== "mainnet") { - let token0Instance = await tezos.contract.at( - (await Token.new(tokenStorage)).address.toString() - ); - let token1Instance = await tezos.contract.at( - (await Token.new(tokenStorage)).address.toString() - ); - console.log(`Token 1 address: ${token0Instance.address}`); - console.log(`Token 2 address: ${token1Instance.address}`); - - if (standard === "FA12") { - let operation = await token0Instance.methods - .approve(factoryInstance.address.toString(), initialTokenAmount) - .send(); - await confirmOperation(tezos, operation.hash); - operation = await token1Instance.methods - .approve(factoryInstance.address.toString(), initialTokenAmount) - .send(); - await confirmOperation(tezos, operation.hash); - await factoryInstance.launchExchange( - token0Instance.address.toString(), - initialTokenAmount, - { amount: initialTezAmount } - ); - await factoryInstance.launchExchange( - token1Instance.address.toString(), - initialTokenAmount, - { amount: initialTezAmount } - ); - } else { - let operation = await token0Instance.methods - .update_operators([ - { - add_operator: { - owner: accounts[0], - operator: factoryInstance.address.toString(), - token_id: defaultTokenId, - }, - }, - ]) - .send(); - await confirmOperation(tezos, operation.hash); - operation = await token1Instance.methods - .update_operators([ - { - add_operator: { - owner: accounts[0], - operator: factoryInstance.address.toString(), - token_id: defaultTokenId, - }, - }, - ]) - .send(); - await confirmOperation(tezos, operation.hash); - operation = await factoryInstance.launchExchange( - token0Instance.address.toString(), - defaultTokenId, - initialTokenAmount, - { amount: initialTezAmount } - ); - await confirmOperation(tezos, operation.hash); - operation = await factoryInstance.launchExchange( - token1Instance.address.toString(), - defaultTokenId, - initialTokenAmount, - { amount: initialTezAmount } - ); - await confirmOperation(tezos, operation.hash); - } - } - }; -} else { - module.exports = async (deployer) => {}; -} diff --git a/package.json b/package.json index 4326da2f..ac9faa9f 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,8 @@ "migrate": "yarn clean && truffle migrate", "migrate-granadanet": "yarn clean && truffle migrate --network granadanet", "migrate-granadanet-reset": "yarn clean && truffle migrate --network granadanet --reset", - "compile-dex": "node scripts/cli.js build-dex --no-json -o contracts", - "compile": "yarn clean && yarn compile-dex && truffle compile", - "start-sandbox": "docker run --rm --name my-sandbox -e flextesa_node_cors_origin='*' -e block_time=1 --detach -p 8732:20000 tqtezos/flextesa:20210602 granabox start --add-bootstrap-account eve,edpku9qEgcyfNNDK6EpMvu5SqXDqWRLuxdMxdyH12ivTUuB1KXfGP4,tz1MnmtP4uAcgMpeZN6JtyziXeFqqwQG6yn6,unencrypted:edsk3Sb16jcx9KrgMDsbZDmKnuN11v4AbTtPBgBSBTqYftd8Cq3i1e@1000000000000 --no-daemons-for eve", + "compile": "yarn clean && truffle compile", + "start-sandbox": "docker run --rm --name my-sandbox -e flextesa_node_cors_origin='*' -e block_time=1 -p 8732:20000 --detach tqtezos/flextesa:20210602 granabox start --add-bootstrap-account eve,edpku9qEgcyfNNDK6EpMvu5SqXDqWRLuxdMxdyH12ivTUuB1KXfGP4,tz1MnmtP4uAcgMpeZN6JtyziXeFqqwQG6yn6,unencrypted:edsk3Sb16jcx9KrgMDsbZDmKnuN11v4AbTtPBgBSBTqYftd8Cq3i1e@1000000000000 --no-daemons-for eve", "test": "yarn clean && yarn compile && truffle test ", "test:quick": "truffle test", "postinstall": "patch-package" diff --git a/scripts/cli.js b/scripts/cli.js index dada158e..a2be8560 100755 --- a/scripts/cli.js +++ b/scripts/cli.js @@ -63,35 +63,4 @@ program } }); -program - .command("build-dex") - .description( - "builds core contracts of the QuipuSwap (standard is selected based on EXCHANGE_TOKEN_STANDARD env variable)" - ) - .option("-o, --output_dir ", "Where store builds", "build") - .option("-i, --input_dir ", "Where files are located", "contracts") - .option("-j, --no-json", "The format of output file") - .option("-g, --no-dockerized_ligo", "Switch global ligo") - .action(function (options) { - if (process.env.EXCHANGE_TOKEN_STANDARD == "MIXED") return; - let contractName = `./main/Dex${process.env.EXCHANGE_TOKEN_STANDARD}`; - exec("mkdir -p " + options.output_dir); - if (contractName === "*") { - fs.readdirSync(options.input_dir).forEach((file) => { - let fileParts = file.split("."); - if (fileParts.length === 2 && fileParts.pop() === "ligo") { - buildContract(fileParts[0], options.input_dir, options.output_dir); - } - }); - } else { - buildContract( - contractName, - options.input_dir, - options.output_dir, - options.json, - options.dockerized_ligo - ); - } - }); - program.parse(process.argv); diff --git a/test/Default.spec.ts b/test/Default.spec.ts deleted file mode 100644 index 26230427..00000000 --- a/test/Default.spec.ts +++ /dev/null @@ -1,196 +0,0 @@ -import { Context } from "./helpers/context"; -import { strictEqual, ok, notStrictEqual, rejects } from "assert"; -import BigNumber from "bignumber.js"; -import { calculateFee, bakeBlocks } from "./helpers/utils"; -import accounts from "./accounts/accounts"; -import { defaultAccountInfo, accuracy } from "./constants"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; - -if (standard !== "MIXED") { - contract("Default()", function () { - let context: Context; - let tokenAddress: string; - let pairAddress: string; - - before(async () => { - context = await Context.init([], false, "alice", false); - await context.setDexFactoryFunction(0, "initialize_exchange"); - await context.setDexFactoryFunction(3, "withdraw_profit"); - await context.setDexFactoryFunction(4, "invest_liquidity"); - await context.setDexFactoryFunction(5, "divest_liquidity"); - await context.setDexFactoryFunction(8, "receive_reward"); - pairAddress = await context.createPair({ - tezAmount: 100, - tokenAmount: 100, - }); - tokenAddress = await context.pairs[0].contract.address; - }); - - function defaultSuccessCase(decription, sender, wait, amount) { - it(decription, async function () { - await context.updateActor(sender); - await context.pairs[0].updateStorage(); - const initRewardInfo = context.pairs[0].storage; - const initTotalSupply = context.pairs[0].storage.total_supply; - if (wait) { - await bakeBlocks(wait); - } - await context.pairs[0].sendReward(amount); - await context.pairs[0].updateStorage(); - const finalRewardInfo = context.pairs[0].storage; - const accumulatedReward = new BigNumber(1) - .multipliedBy( - Math.floor( - (Date.parse(finalRewardInfo.last_update_time) - - Date.parse(initRewardInfo.last_update_time)) / - 1000 - ) - ) - .multipliedBy(initRewardInfo.reward_per_sec); - if (initRewardInfo.period_finish == finalRewardInfo.period_finish) { - strictEqual( - finalRewardInfo.reward.toString(), - initRewardInfo.reward.plus(amount).toString() - ); - - strictEqual( - finalRewardInfo.reward.toNumber(), - initRewardInfo.reward.toNumber() + amount - ); - strictEqual( - finalRewardInfo.reward_per_share.toString(), - initRewardInfo.reward_per_share - .plus( - accumulatedReward - .div(initRewardInfo.total_supply) - .integerValue(BigNumber.ROUND_DOWN) - ) - .toString() - ); - strictEqual( - finalRewardInfo.total_reward.toNumber(), - initRewardInfo.total_reward.toNumber() - ); - } else { - strictEqual(finalRewardInfo.reward.toString(), amount.toString()); - const periodDuration = - (Math.floor( - Math.floor( - (Date.parse(finalRewardInfo.last_update_time) - - Date.parse(initRewardInfo.period_finish)) / - 1000 - ) / 10 - ) + - 1) * - 10; - strictEqual( - finalRewardInfo.reward_per_sec.toString(), - initRewardInfo.reward - .multipliedBy(accuracy) - .div(periodDuration) - .integerValue(BigNumber.ROUND_DOWN) - .toString() - ); - strictEqual( - finalRewardInfo.total_reward.toString(), - finalRewardInfo.reward_per_sec - .multipliedBy(periodDuration) - .div(accuracy) - .integerValue(BigNumber.ROUND_DOWN) - .plus(initRewardInfo.total_reward) - .toString() - ); - const accumulatedReward = new BigNumber(1) - .multipliedBy( - Math.floor( - (Date.parse(initRewardInfo.period_finish) - - Date.parse(initRewardInfo.last_update_time)) / - 1000 - ) - ) - .multipliedBy(initRewardInfo.reward_per_sec); - const accumulatedThisCycleReward = new BigNumber(1) - .multipliedBy( - Math.floor( - (Date.parse(finalRewardInfo.last_update_time) - - Date.parse(initRewardInfo.period_finish)) / - 1000 - ) - ) - .multipliedBy(finalRewardInfo.reward_per_sec); - strictEqual( - finalRewardInfo.reward_per_share.toString(), - initRewardInfo.reward_per_share - .plus( - accumulatedReward - .div(initRewardInfo.total_supply) - .integerValue(BigNumber.ROUND_DOWN) - ) - .plus( - accumulatedThisCycleReward - .div(initRewardInfo.total_supply) - .integerValue(BigNumber.ROUND_DOWN) - ) - .toString() - ); - } - }); - } - - function defaultFailCase(decription, sender, amount, errorMsg) { - it(decription, async function () { - await context.updateActor(sender); - await rejects(context.pairs[0].sendReward(amount), (err: any) => { - ok(err.message == errorMsg, "Error message mismatch"); - return true; - }); - }); - } - - describe("Test the rewards assessment in case of differrent shares", () => { - defaultSuccessCase("success in case of some shares", "alice", 0, 1000); - describe("", async function () { - before(async function () { - await context.updateActor("alice"); - await context.pairs[0].divestLiquidity(1, 1, 100); - }); - defaultFailCase( - "revert in case of no shares", - "alice", - 1000, - "DIV by 0" - ); - after(async function () { - await context.updateActor("alice"); - await context.pairs[0].initializeExchange(100, 100); - }); - }); - }); - - describe("Test the rewards assessment in case of differrent reward sent", () => { - defaultSuccessCase("success in case of some xtz sent", "alice", 0, 1000); - defaultSuccessCase("success in case of no xtz sent", "alice", 0, 0); - }); - - describe("Test the total rewards assessments in case of different periods", () => { - defaultSuccessCase( - "success in case of before period finished", - "alice", - 0, - 1000 - ); - defaultSuccessCase( - "success in case of after period finished", - "alice", - 10, - 1000 - ); - defaultSuccessCase( - "success in case of in the middle of the second period", - "alice", - 0, - 1000 - ); - }); - }); -} diff --git a/test/DivestLiquidity.spec.ts b/test/DivestLiquidity.spec.ts deleted file mode 100644 index 8690761f..00000000 --- a/test/DivestLiquidity.spec.ts +++ /dev/null @@ -1,508 +0,0 @@ -import { Context } from "./helpers/context"; -import { strictEqual, ok, notStrictEqual, rejects } from "assert"; -import BigNumber from "bignumber.js"; -import accounts from "./accounts/accounts"; -import { defaultAccountInfo } from "./constants"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; -if (standard !== "MIXED") { - contract("DivestLiquidity()", function () { - let context: Context; - let tokenAddress: string; - let pairAddress: string; - const aliceAddress: string = accounts.alice.pkh; - const bobAddress: string = accounts.bob.pkh; - const receivedTezAmount: number = 200; - const receivedTokenAmount: number = 20000; - const burntShares: number = 200; - - before(async () => { - context = await Context.init([], false, "alice", false); - await context.setDexFactoryFunction(0, "initialize_exchange"); - await context.setDexFactoryFunction(1, "tez_to_token"); - await context.setDexFactoryFunction(2, "token_to_tez"); - await context.setDexFactoryFunction(4, "invest_liquidity"); - await context.setDexFactoryFunction(5, "divest_liquidity"); - pairAddress = await context.createPair(); - tokenAddress = await context.pairs[0].contract.address; - }); - - describe("Test if the diivestment is allowed", () => { - const initToken = 1000000; - const initTez = 10000; - - it("revert in case no liquidity is provided", async function () { - await context.pairs[0].divestLiquidity(1, 1, initTez); - await rejects( - context.pairs[0].divestLiquidity(1, 1, burntShares), - (err: any) => { - ok(err.message == "Dex/not-launched", "Error message mismatch"); - return true; - } - ); - }); - - it("success in case the exchange is launched", async function () { - await context.pairs[0].initializeExchange(initToken, initTez); - await context.tokens[0].updateStorage({ ledger: [aliceAddress] }); - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenBalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - await context.pairs[0].divestLiquidity(1, 1, burntShares); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceFinalTokenBalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - strictEqual( - aliceInitTokenBalance.toNumber() + receivedTokenAmount, - aliceFinalTokenBalance.toNumber() - ); - ok( - aliceInitTezBalance.toNumber() + receivedTezAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual( - pairTokenBalance.toNumber(), - initToken - receivedTokenAmount - ); - strictEqual(pairTezBalance.toNumber(), initTez - receivedTezAmount); - strictEqual( - context.pairs[0].storage.ledger[aliceAddress].balance.toNumber(), - initTez - burntShares - ); - strictEqual( - context.pairs[0].storage.total_supply.toNumber(), - initTez - burntShares - ); - strictEqual( - context.pairs[0].storage.tez_pool.toNumber(), - initTez - receivedTezAmount - ); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - initToken - receivedTokenAmount - ); - }); - }); - - describe("Test various burnt shares", () => { - before(async () => {}); - - it("revert in case of 0 burnt shares", async function () { - await rejects(context.pairs[0].divestLiquidity(1, 1, 0), (err: any) => { - ok(err.message == "Dex/zero-burn-shares", "Error message mismatch"); - return true; - }); - }); - - it("revert in case of too high expected burnt shares", async function () { - await rejects( - context.pairs[0].divestLiquidity(1, 1, 20000), - (err: any) => { - ok( - err.message == "Dex/insufficient-shares", - "Error message mismatch" - ); - return true; - } - ); - }); - - it("success in case of burnt shares of 1", async function () { - const minBurntShares = 10; - const minReceivedTezAmount: number = 10; - const minReceivedTokenAmount: number = 1000; - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - await context.tokens[0].updateStorage({ ledger: [aliceAddress] }); - const initialStorage = await context.pairs[0].storage; - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenBalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - await context.pairs[0].divestLiquidity(1, 1, minBurntShares); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceFinalTokenBalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - strictEqual( - aliceInitTokenBalance.toNumber() + minReceivedTokenAmount, - aliceFinalTokenBalance.toNumber() - ); - ok( - aliceInitTezBalance.toNumber() + minReceivedTezAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual( - pairTokenBalance.toNumber(), - initialStorage.token_pool.toNumber() - minReceivedTokenAmount - ); - strictEqual( - pairTezBalance.toNumber(), - initialStorage.tez_pool.toNumber() - minReceivedTezAmount - ); - strictEqual( - context.pairs[0].storage.ledger[aliceAddress].balance.toNumber(), - initialStorage.ledger[aliceAddress].balance.toNumber() - - minBurntShares - ); - strictEqual( - context.pairs[0].storage.total_supply.toNumber(), - initialStorage.total_supply.toNumber() - minBurntShares - ); - strictEqual( - context.pairs[0].storage.tez_pool.toNumber(), - initialStorage.tez_pool.toNumber() - minReceivedTezAmount - ); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - initialStorage.token_pool.toNumber() - minReceivedTokenAmount - ); - }); - - it("success in case the medium burnt shares", async function () { - const minBurntShares = 100; - const minReceivedTezAmount: number = 100; - const minReceivedTokenAmount: number = 10000; - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - await context.tokens[0].updateStorage({ ledger: [aliceAddress] }); - const initialStorage = await context.pairs[0].storage; - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenBalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - await context.pairs[0].divestLiquidity(1, 1, minBurntShares); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceFinalTokenBalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - strictEqual( - aliceInitTokenBalance.toNumber() + minReceivedTokenAmount, - aliceFinalTokenBalance.toNumber() - ); - ok( - aliceInitTezBalance.toNumber() + minReceivedTezAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual( - pairTokenBalance.toNumber(), - initialStorage.token_pool.toNumber() - minReceivedTokenAmount - ); - strictEqual( - pairTezBalance.toNumber(), - initialStorage.tez_pool.toNumber() - minReceivedTezAmount - ); - strictEqual( - context.pairs[0].storage.ledger[aliceAddress].balance.toNumber(), - initialStorage.ledger[aliceAddress].balance.toNumber() - - minBurntShares - ); - strictEqual( - context.pairs[0].storage.total_supply.toNumber(), - initialStorage.total_supply.toNumber() - minBurntShares - ); - strictEqual( - context.pairs[0].storage.tez_pool.toNumber(), - initialStorage.tez_pool.toNumber() - minReceivedTezAmount - ); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - initialStorage.token_pool.toNumber() - minReceivedTokenAmount - ); - }); - - it("success in case of exact burnt shares", async function () { - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - await context.tokens[0].updateStorage({ ledger: [aliceAddress] }); - const initialStorage = await context.pairs[0].storage; - const minBurntShares = - initialStorage.ledger[aliceAddress].balance.toNumber(); - const minReceivedTezAmount: number = minBurntShares; - const minReceivedTokenAmount: number = minBurntShares * 100; - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenBalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - await context.pairs[0].divestLiquidity(1, 1, minBurntShares); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceFinalTokenBalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - strictEqual( - aliceInitTokenBalance.toNumber() + minReceivedTokenAmount, - aliceFinalTokenBalance.toNumber() - ); - ok( - aliceInitTezBalance.toNumber() + minReceivedTezAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual( - pairTokenBalance.toNumber(), - initialStorage.token_pool.toNumber() - minReceivedTokenAmount - ); - strictEqual( - pairTezBalance.toNumber(), - initialStorage.tez_pool.toNumber() - minReceivedTezAmount - ); - strictEqual( - context.pairs[0].storage.ledger[aliceAddress].balance.toNumber(), - 0 - ); - strictEqual(context.pairs[0].storage.total_supply.toNumber(), 0); - strictEqual(context.pairs[0].storage.tez_pool.toNumber(), 0); - strictEqual(context.pairs[0].storage.token_pool.toNumber(), 0); - }); - }); - - describe("Test calculated received amount", () => { - it("revert in case of calculated tez are zero", async function () { - const initToken = 1000000; - const initTez = 100; - const share = 1; - await context.pairs[0].initializeExchange(initToken, initTez); - await context.pairs[0].tokenToTezPayment(100000, 1, bobAddress); - await rejects( - context.pairs[0].divestLiquidity(1, 1, share), - (err: any) => { - ok(err.message == "Dex/high-expectation", "Error message mismatch"); - return true; - } - ); - }); - - it("revert in case of calculated tokens are zero", async function () { - const initTez = 1000000; - const initToken = 100; - await context.pairs[0].divestLiquidity(1, 1, initToken); - await context.pairs[0].initializeExchange(initToken, initTez); - await context.pairs[0].tezToTokenPayment(1, 100000, bobAddress); - const share = 1; - await rejects( - context.pairs[0].divestLiquidity(1, 1, share), - (err: any) => { - ok(err.message == "Dex/high-expectation", "Error message mismatch"); - return true; - } - ); - }); - }); - - describe("Test expected amount when", () => { - before(async () => { - const initTez = 1000000; - const initToken = 100; - await context.pairs[0].divestLiquidity(1, 1, initTez); - await context.pairs[0].initializeExchange(initToken, initTez); - }); - - it("revert in case of expected tez are higher", async function () { - const share = 100; - await rejects( - context.pairs[0].divestLiquidity(1, 100000000, share), - (err: any) => { - ok(err.message == "Dex/high-expectation", "Error message mismatch"); - return true; - } - ); - }); - - it("revert in case of expected tokens are higher", async function () { - const share = 100; - await rejects( - context.pairs[0].divestLiquidity(100000000, 1, share), - (err: any) => { - ok(err.message == "Dex/high-expectation", "Error message mismatch"); - return true; - } - ); - }); - - it("revert in case of expected tokens are 0", async function () { - const share = 1; - await rejects( - context.pairs[0].divestLiquidity(0, 1, share), - (err: any) => { - ok(err.message == "Dex/dust-output", "Error message mismatch"); - return true; - } - ); - }); - - it("revert in case of expected tez are 0", async function () { - const share = 1; - await rejects( - context.pairs[0].divestLiquidity(1, 0, share), - (err: any) => { - ok(err.message == "Dex/dust-output", "Error message mismatch"); - return true; - } - ); - }); - - it("success in case the of the expected amount smaller than calculated", async function () { - const expectedTez = 100000; - const expectedToken = 10; - const minBurntShares = 500000; - const minReceivedTezAmount: number = 500000; - const minReceivedTokenAmount: number = 50; - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - await context.tokens[0].updateStorage({ ledger: [aliceAddress] }); - const initialStorage = await context.pairs[0].storage; - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenBalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - await context.pairs[0].divestLiquidity( - expectedToken, - expectedTez, - minBurntShares - ); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceFinalTokenBalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - strictEqual( - aliceInitTokenBalance.toNumber() + minReceivedTokenAmount, - aliceFinalTokenBalance.toNumber() - ); - ok( - aliceInitTezBalance.toNumber() + minReceivedTezAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual( - pairTokenBalance.toNumber(), - initialStorage.token_pool.toNumber() - minReceivedTokenAmount - ); - strictEqual( - pairTezBalance.toNumber(), - initialStorage.tez_pool.toNumber() - minReceivedTezAmount - ); - strictEqual( - context.pairs[0].storage.ledger[aliceAddress].balance.toNumber(), - initialStorage.ledger[aliceAddress].balance.toNumber() - - minBurntShares - ); - strictEqual( - context.pairs[0].storage.total_supply.toNumber(), - initialStorage.total_supply.toNumber() - minBurntShares - ); - strictEqual( - context.pairs[0].storage.tez_pool.toNumber(), - initialStorage.tez_pool.toNumber() - minReceivedTezAmount - ); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - initialStorage.token_pool.toNumber() - minReceivedTokenAmount - ); - }); - - it("success in case the of the exact expected tez and tokens", async function () { - const minBurntShares = 500000; - const minReceivedTezAmount: number = 500000; - const minReceivedTokenAmount: number = 50; - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - await context.tokens[0].updateStorage({ ledger: [aliceAddress] }); - const initialStorage = await context.pairs[0].storage; - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenBalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - await context.pairs[0].divestLiquidity( - minReceivedTokenAmount, - minReceivedTezAmount, - minBurntShares - ); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceFinalTokenBalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - strictEqual( - aliceInitTokenBalance.toNumber() + minReceivedTokenAmount, - aliceFinalTokenBalance.toNumber() - ); - ok( - aliceInitTezBalance.toNumber() + minReceivedTezAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual( - pairTokenBalance.toNumber(), - initialStorage.token_pool.toNumber() - minReceivedTokenAmount - ); - strictEqual( - pairTezBalance.toNumber(), - initialStorage.tez_pool.toNumber() - minReceivedTezAmount - ); - strictEqual( - context.pairs[0].storage.ledger[aliceAddress].balance.toNumber(), - initialStorage.ledger[aliceAddress].balance.toNumber() - - minBurntShares - ); - strictEqual( - context.pairs[0].storage.total_supply.toNumber(), - initialStorage.total_supply.toNumber() - minBurntShares - ); - strictEqual( - context.pairs[0].storage.tez_pool.toNumber(), - initialStorage.tez_pool.toNumber() - minReceivedTezAmount - ); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - initialStorage.token_pool.toNumber() - minReceivedTokenAmount - ); - }); - }); - }); -} diff --git a/test/InitializeExchangeTest.spec.ts b/test/InitializeExchangeTest.spec.ts deleted file mode 100644 index 1f5c3021..00000000 --- a/test/InitializeExchangeTest.spec.ts +++ /dev/null @@ -1,283 +0,0 @@ -import { Context } from "./helpers/context"; -import { strictEqual, ok, notStrictEqual, rejects } from "assert"; -import accounts from "./accounts/accounts"; -import { defaultAccountInfo } from "./constants"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; - -if (standard !== "MIXED") { - contract("InitializeExchange()", function () { - let context: Context; - let aliceAddress: string = accounts.alice.pkh; - const tezAmount: number = 10000; - const tokenAmount: number = 1000; - - before(async () => { - context = await Context.init([], false, "alice", false); - await context.setDexFactoryFunction(0, "initialize_exchange"); - await context.setDexFactoryFunction(5, "divest_liquidity"); - }); - - it("should have an empty token list after deployment", async function () { - await context.factory.updateStorage(); - strictEqual(context.factory.storage.token_list.length, 0); - }); - - describe("Test initialize during the deployment", () => { - let tokenAddress: string; - before(async () => { - tokenAddress = await context.createToken(); - }); - - it("revert in case the amount of tokens isn't approved", async function () { - await rejects( - context.factory.launchExchange( - tokenAddress, - tokenAmount, - tezAmount, - false - ), - (err: any) => { - ok( - err.message == "FA2_NOT_OPERATOR" || - err.message == "NotEnoughAllowance", - "Error message mismatch" - ); - return true; - } - ); - }); - - it("revert in case the amount of XTZ is zero", async function () { - await rejects( - context.createPair({ - tokenAddress, - tezAmount: 0, - tokenAmount, - }), - (err: any) => { - strictEqual( - err.message, - "Dex/not-allowed", - "Error message mismatch" - ); - return true; - } - ); - }); - - it("revert in case the amount of tokens is zero", async function () { - await rejects( - context.createPair({ - tokenAddress, - tezAmount, - tokenAmount: 0, - }), - (err: any) => { - strictEqual( - err.message, - "Dex/not-allowed", - "Error message mismatch" - ); - return true; - } - ); - }); - - it("success in case the pair doesn't exist", async function () { - await context.tokens[0].updateStorage({ ledger: [aliceAddress] }); - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenBalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - const pairAddress = await context.createPair({ - tokenAddress, - tezAmount, - tokenAmount, - }); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - const aliceFinalTokenBalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - - strictEqual( - aliceInitTokenBalance.toNumber() - tokenAmount, - aliceFinalTokenBalance.toNumber() - ); - ok( - aliceInitTezBalance.toNumber() - tezAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual(pairTokenBalance.toNumber(), tokenAmount); - strictEqual(pairTezBalance.toNumber(), tezAmount); - strictEqual(context.factory.storage.token_list.length, 1); - notStrictEqual( - context.factory.storage.token_to_exchange[ - context.factory.storage.token_list[0] - ], - null - ); - strictEqual( - context.pairs[0].storage.ledger[aliceAddress].balance.toNumber(), - tezAmount - ); - strictEqual( - context.pairs[0].storage.total_supply.toNumber(), - tezAmount - ); - strictEqual(context.pairs[0].storage.tez_pool.toNumber(), tezAmount); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - tokenAmount - ); - strictEqual(context.pairs[0].storage.token_address, tokenAddress); - }); - - it("revert in case the pair exists", async function () { - const tokenAddress = context.factory.storage.token_list[0]; - await rejects( - context.createPair({ - tokenAddress, - tezAmount, - tokenAmount, - }), - (err: any) => { - strictEqual( - err.message, - "Factory/exchange-launched", - "Error message mismatch" - ); - return true; - } - ); - }); - }); - - describe("Test initialize after liquidity withdrawn when", () => { - it("revert in case liquidity isn't zero", async function () { - await rejects( - context.pairs[0].initializeExchange(tokenAmount, tezAmount), - (err: any) => { - strictEqual( - err.message, - "Dex/non-zero-reserves", - "Error message mismatch" - ); - return true; - } - ); - }); - - it("revert in case the amount of tokens isn't approved", async function () { - await context.pairs[0].divestLiquidity(1, 1, tezAmount); - await context.pairs[0].approveToken( - 0, - context.pairs[0].contract.address - ); - await rejects( - context.pairs[0].initializeExchange(tokenAmount, tezAmount, false), - (err: any) => { - ok( - err.message == "FA2_NOT_OPERATOR" || - err.message == "NotEnoughAllowance", - "Error message mismatch" - ); - return true; - } - ); - }); - - it("success in case liquidity is zero", async function () { - const tokenAddress = context.tokens[0].contract.address; - const pairAddress = context.pairs[0].contract.address; - await context.tokens[0].updateStorage({ ledger: [aliceAddress] }); - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenBalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - await context.pairs[0].initializeExchange(tokenAmount, tezAmount); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - const aliceFinalTokenBalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - - strictEqual( - aliceInitTokenBalance.toNumber() - tokenAmount, - aliceFinalTokenBalance.toNumber() - ); - ok( - aliceInitTezBalance.toNumber() - tezAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual(pairTokenBalance.toNumber(), tokenAmount); - strictEqual(pairTezBalance.toNumber(), tezAmount); - strictEqual(context.factory.storage.token_list.length, 1); - notStrictEqual( - context.factory.storage.token_to_exchange[ - context.factory.storage.token_list[0] - ], - null - ); - strictEqual( - context.pairs[0].storage.ledger[aliceAddress].balance.toNumber(), - tezAmount - ); - strictEqual( - context.pairs[0].storage.total_supply.toNumber(), - tezAmount - ); - strictEqual(context.pairs[0].storage.tez_pool.toNumber(), tezAmount); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - tokenAmount - ); - strictEqual(context.pairs[0].storage.token_address, tokenAddress); - }); - - it("revert in case the amount of token is zero", async function () { - await rejects( - context.pairs[0].initializeExchange(0, tezAmount), - (err: any) => { - strictEqual( - err.message, - "Dex/non-zero-reserves", - "Error message mismatch" - ); - return true; - } - ); - }); - - it("revert in case the amount of XTZ is zero", async function () { - await rejects( - context.pairs[0].initializeExchange(tokenAmount, 0), - (err: any) => { - strictEqual( - err.message, - "Dex/non-zero-reserves", - "Error message mismatch" - ); - return true; - } - ); - }); - }); - }); -} diff --git a/test/InvestLiquidity.spec.ts b/test/InvestLiquidity.spec.ts deleted file mode 100644 index e5ce26f5..00000000 --- a/test/InvestLiquidity.spec.ts +++ /dev/null @@ -1,339 +0,0 @@ -import { Context } from "./helpers/context"; -import { strictEqual, ok, notStrictEqual, rejects } from "assert"; -import accounts from "./accounts/accounts"; -import { defaultAccountInfo } from "./constants"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; - -if (standard !== "MIXED") { - contract("InvestLiquidity()", function () { - let context: Context; - let tokenAddress: string; - let pairAddress: string; - const aliceAddress: string = accounts.alice.pkh; - const bobAddress: string = accounts.bob.pkh; - const tezAmount: number = 1000; - const tokenAmount: number = 100000; - const newShares: number = 1000; - - before(async () => { - context = await Context.init([], false, "alice", false); - await context.setDexFactoryFunction(0, "initialize_exchange"); - await context.setDexFactoryFunction(1, "tez_to_token"); - await context.setDexFactoryFunction(4, "invest_liquidity"); - await context.setDexFactoryFunction(5, "divest_liquidity"); - pairAddress = await context.createPair(); - tokenAddress = await context.pairs[0].contract.address; - }); - - describe("Test if the investment is allowed", () => { - const initToken = 1000000; - const initTez = 10000; - - before(async () => {}); - - it("revert in case no liquidity is provided", async function () { - await context.pairs[0].divestLiquidity(1, 1, initTez); - await rejects( - context.pairs[0].investLiquidity(tokenAmount, tezAmount, newShares), - (err: any) => { - ok(err.message == "Dex/not-launched", "Error message mismatch"); - return true; - } - ); - }); - - it("success in case the exchange is launched", async function () { - await context.pairs[0].initializeExchange(initToken, initTez); - await context.tokens[0].updateStorage({ ledger: [aliceAddress] }); - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenBalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - await context.pairs[0].investLiquidity( - tokenAmount, - tezAmount, - newShares - ); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceFinalTokenBalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - strictEqual( - aliceInitTokenBalance.toNumber() - tokenAmount, - aliceFinalTokenBalance.toNumber() - ); - ok( - aliceInitTezBalance.toNumber() - tezAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual(pairTokenBalance.toNumber(), initToken + tokenAmount); - strictEqual(pairTezBalance.toNumber(), initTez + tezAmount); - strictEqual( - context.pairs[0].storage.ledger[aliceAddress].balance.toNumber(), - initTez + newShares - ); - strictEqual( - context.pairs[0].storage.total_supply.toNumber(), - initTez + newShares - ); - strictEqual( - context.pairs[0].storage.tez_pool.toNumber(), - initTez + tezAmount - ); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - initToken + tokenAmount - ); - }); - }); - - describe("Test various min shared", () => { - before(async () => {}); - - it("success in case of min shares of 1", async function () { - await context.pairs[0].updateStorage(); - const initialStorage = await context.pairs[0].storage; - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenBalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - await context.pairs[0].investLiquidity(tokenAmount, tezAmount, 1); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceFinalTokenBalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - strictEqual( - aliceInitTokenBalance.toNumber() - tokenAmount, - aliceFinalTokenBalance.toNumber() - ); - ok( - aliceInitTezBalance.toNumber() - tezAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual( - pairTokenBalance.toNumber(), - initialStorage.token_pool.toNumber() + tokenAmount - ); - strictEqual( - pairTezBalance.toNumber(), - initialStorage.tez_pool.toNumber() + tezAmount - ); - strictEqual( - context.pairs[0].storage.ledger[aliceAddress].balance.toNumber(), - initialStorage.total_supply.toNumber() + newShares - ); - strictEqual( - context.pairs[0].storage.total_supply.toNumber(), - initialStorage.total_supply.toNumber() + newShares - ); - strictEqual( - context.pairs[0].storage.tez_pool.toNumber(), - initialStorage.tez_pool.toNumber() + tezAmount - ); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - initialStorage.token_pool.toNumber() + tokenAmount - ); - }); - - it("success in case of exact min shares", async function () { - await context.pairs[0].updateStorage(); - const initialStorage = await context.pairs[0].storage; - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenBalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - await context.pairs[0].investLiquidity(tokenAmount, tezAmount, 100); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceFinalTokenBalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - strictEqual( - aliceInitTokenBalance.toNumber() - tokenAmount, - aliceFinalTokenBalance.toNumber() - ); - ok( - aliceInitTezBalance.toNumber() - tezAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual( - pairTokenBalance.toNumber(), - initialStorage.token_pool.toNumber() + tokenAmount - ); - strictEqual( - pairTezBalance.toNumber(), - initialStorage.tez_pool.toNumber() + tezAmount - ); - strictEqual( - context.pairs[0].storage.ledger[aliceAddress].balance.toNumber(), - initialStorage.total_supply.toNumber() + newShares - ); - strictEqual( - context.pairs[0].storage.total_supply.toNumber(), - initialStorage.total_supply.toNumber() + newShares - ); - strictEqual( - context.pairs[0].storage.tez_pool.toNumber(), - initialStorage.tez_pool.toNumber() + tezAmount - ); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - initialStorage.token_pool.toNumber() + tokenAmount - ); - }); - - it("success in case of medium min shares", async function () { - await context.pairs[0].updateStorage(); - const initialStorage = await context.pairs[0].storage; - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenBalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - await context.pairs[0].investLiquidity(tokenAmount, tezAmount, 50); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceFinalTokenBalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - strictEqual( - aliceInitTokenBalance.toNumber() - tokenAmount, - aliceFinalTokenBalance.toNumber() - ); - ok( - aliceInitTezBalance.toNumber() - tezAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual( - pairTokenBalance.toNumber(), - initialStorage.token_pool.toNumber() + tokenAmount - ); - strictEqual( - pairTezBalance.toNumber(), - initialStorage.tez_pool.toNumber() + tezAmount - ); - strictEqual( - context.pairs[0].storage.ledger[aliceAddress].balance.toNumber(), - initialStorage.total_supply.toNumber() + newShares - ); - strictEqual( - context.pairs[0].storage.total_supply.toNumber(), - initialStorage.total_supply.toNumber() + newShares - ); - strictEqual( - context.pairs[0].storage.tez_pool.toNumber(), - initialStorage.tez_pool.toNumber() + tezAmount - ); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - initialStorage.token_pool.toNumber() + tokenAmount - ); - }); - }); - - describe("Test purchased shares", () => { - before(async () => {}); - - it("success in case of more then 0 tokens purchesed", async function () { - await context.pairs[0].updateStorage(); - const initialStorage = await context.pairs[0].storage; - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenBalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - await context.pairs[0].investLiquidity( - tokenAmount, - tezAmount, - newShares - ); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.pairs[0].updateStorage({ ledger: [aliceAddress] }); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceFinalTokenBalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - strictEqual( - aliceInitTokenBalance.toNumber() - tokenAmount, - aliceFinalTokenBalance.toNumber() - ); - ok( - aliceInitTezBalance.toNumber() - tezAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual( - pairTokenBalance.toNumber(), - initialStorage.token_pool.toNumber() + tokenAmount - ); - strictEqual( - pairTezBalance.toNumber(), - initialStorage.tez_pool.toNumber() + tezAmount - ); - strictEqual( - context.pairs[0].storage.ledger[aliceAddress].balance.toNumber(), - initialStorage.total_supply.toNumber() + newShares - ); - strictEqual( - context.pairs[0].storage.total_supply.toNumber(), - initialStorage.total_supply.toNumber() + newShares - ); - strictEqual( - context.pairs[0].storage.tez_pool.toNumber(), - initialStorage.tez_pool.toNumber() + tezAmount - ); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - initialStorage.token_pool.toNumber() + tokenAmount - ); - }); - - it("revert in case of 0 purchased shares", async function () { - await context.pairs[0].tezToTokenPayment(1, 100, bobAddress); - await rejects(context.pairs[0].investLiquidity(1, 1, 1), (err: any) => { - ok(err.message == "Dex/wrong-params", "Error message mismatch"); - return true; - }); - }); - }); - }); -} diff --git a/test/RewardDistribution.spec.ts b/test/RewardDistribution.spec.ts deleted file mode 100644 index 9caddd7b..00000000 --- a/test/RewardDistribution.spec.ts +++ /dev/null @@ -1,356 +0,0 @@ -import { Context } from "./helpers/context"; -import { strictEqual, ok, notStrictEqual, rejects } from "assert"; -import BigNumber from "bignumber.js"; -import { calculateFee, bakeBlocks } from "./helpers/utils"; -import accounts from "./accounts/accounts"; -import { defaultAccountInfo, accuracy } from "./constants"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; - -if (standard !== "MIXED") { - contract("RewardsDistribution()", function () { - let context: Context; - let tokenAddress: string; - let pairAddress: string; - const aliceAddress: string = accounts.alice.pkh; - const bobAddress: string = accounts.bob.pkh; - - before(async () => { - context = await Context.init([], false, "alice", false); - await context.setDexFactoryFunction(0, "initialize_exchange"); - await context.setDexFactoryFunction(3, "withdraw_profit"); - await context.setDexFactoryFunction(4, "invest_liquidity"); - await context.setDexFactoryFunction(5, "divest_liquidity"); - await context.setDexFactoryFunction(6, "vote"); - await context.setDexFactoryFunction(7, "veto"); - await context.setDexFactoryFunction(8, "receive_reward"); - await context.factory.setTokenFunction(0, "transfer"); - await context.factory.setTokenFunction( - 1, - standard == "FA2" ? "update_operators" : "approve" - ); - pairAddress = await context.createPair({ - tezAmount: 100, - tokenAmount: 100, - }); - tokenAddress = await context.pairs[0].contract.address; - await context.tokens[0].transfer(aliceAddress, bobAddress, 1000000); - await context.pairs[0].sendReward(1000); - }); - - function defaultSuccessCase( - decription, - sender, - wait, - action, - rewardWithdrawn = false, - receiver = undefined - ) { - it(decription, async function () { - await context.updateActor(sender); - const senderAddress: string = accounts[sender].pkh; - receiver = receiver || senderAddress; - const aliceInitTezBalance = new BigNumber( - await tezos.tz.getBalance(receiver) - ); - await context.pairs[0].updateStorage({ - ledger: [senderAddress], - user_rewards: [senderAddress], - }); - const initRewardInfo = context.pairs[0].storage; - const initRecord = - (await context.pairs[0].storage.ledger[senderAddress]) || - defaultAccountInfo; - const initTotalSupply = context.pairs[0].storage.total_supply; - const initUserRewards = context.pairs[0].storage.user_rewards[ - senderAddress - ] || { - reward: new BigNumber(0), - reward_paid: new BigNumber(0), - }; - if (wait) { - await bakeBlocks(wait); - } - const op = await action(); - const fee = - receiver == senderAddress - ? await calculateFee([op], senderAddress) - : 0; - await context.pairs[0].updateStorage({ - user_rewards: [senderAddress], - ledger: [senderAddress], - }); - const finalRewardInfo = context.pairs[0].storage; - const finalTotalSupply = context.pairs[0].storage.total_supply; - const finalUserRewards = context.pairs[0].storage.user_rewards[ - senderAddress - ] || { - reward: new BigNumber(0), - reward_paid: new BigNumber(0), - }; - const finalRecord = - (await context.pairs[0].storage.ledger[senderAddress]) || - defaultAccountInfo; - const aliceFinalTezBalance = new BigNumber( - await tezos.tz.getBalance(receiver) - ); - const accumulatedReward = new BigNumber(1) - .multipliedBy( - Math.floor( - (Date.parse(finalRewardInfo.last_update_time) - - Date.parse(initRewardInfo.last_update_time)) / - 1000 - ) - ) - .multipliedBy(initRewardInfo.reward_per_sec); - const expectedUserReward = initUserRewards.reward.plus( - initRecord.balance - .plus(initRecord.frozen_balance) - .multipliedBy(finalRewardInfo.reward_per_share) - .minus(initUserRewards.reward_paid) - ); - const expectedRewardPaid = finalRecord.balance - .plus(finalRecord.frozen_balance) - .multipliedBy(finalRewardInfo.reward_per_share); - strictEqual( - finalUserRewards.reward_paid.toString(), - expectedRewardPaid.toString() - ); - if (rewardWithdrawn) { - ok(finalUserRewards.reward.lt(new BigNumber("1000000000000000"))); - const realReward = expectedUserReward - .div(accuracy) - .integerValue(BigNumber.ROUND_DOWN); - ok( - aliceFinalTezBalance - .plus(fee) - .minus(aliceInitTezBalance) - .eq(realReward) - ); - } else { - strictEqual( - finalUserRewards.reward.toString(), - expectedUserReward.toString() - ); - ok( - aliceFinalTezBalance - .minus(aliceInitTezBalance) - .lte(expectedUserReward) - ); - } - if (initRewardInfo.period_finish == finalRewardInfo.period_finish) { - const accumulatedReward = new BigNumber(1) - .multipliedBy( - Math.floor( - (Date.parse(finalRewardInfo.last_update_time) - - Date.parse(initRewardInfo.last_update_time)) / - 1000 - ) - ) - .multipliedBy(initRewardInfo.reward_per_sec); - strictEqual( - finalRewardInfo.reward.toNumber(), - initRewardInfo.reward.toNumber() - ); - strictEqual( - finalRewardInfo.total_reward.toNumber(), - initRewardInfo.total_reward.toNumber() - ); - strictEqual( - finalRewardInfo.reward_per_share.toString(), - initRewardInfo.reward_per_share - .plus( - accumulatedReward - .div(initRewardInfo.total_supply) - .integerValue(BigNumber.ROUND_DOWN) - ) - .toString() - ); - } else { - strictEqual(finalRewardInfo.reward.toString(), "0"); - const periodDuration = - (Math.floor( - Math.floor( - (Date.parse(finalRewardInfo.last_update_time) - - Date.parse(initRewardInfo.period_finish)) / - 1000 - ) / 10 - ) + - 1) * - 10; - strictEqual( - finalRewardInfo.total_reward.toString(), - finalRewardInfo.reward_per_sec - .multipliedBy(periodDuration) - .div(accuracy) - .integerValue(BigNumber.ROUND_DOWN) - .plus(initRewardInfo.total_reward) - .toString() - ); - strictEqual( - finalRewardInfo.reward_per_sec.toString(), - initRewardInfo.reward - .multipliedBy(accuracy) - .div(periodDuration) - .integerValue(BigNumber.ROUND_DOWN) - .toString() - ); - const accumulatedReward = new BigNumber(1) - .multipliedBy( - Math.floor( - (Date.parse(initRewardInfo.period_finish) - - Date.parse(initRewardInfo.last_update_time)) / - 1000 - ) - ) - .multipliedBy(initRewardInfo.reward_per_sec); - const accumulatedThisCycleReward = new BigNumber(1) - .multipliedBy( - Math.floor( - (Date.parse(finalRewardInfo.last_update_time) - - Date.parse(initRewardInfo.period_finish)) / - 1000 - ) - ) - .multipliedBy(finalRewardInfo.reward_per_sec); - strictEqual( - finalRewardInfo.reward_per_share.toString(), - initRewardInfo.reward_per_share - .plus( - accumulatedReward - .div(initRewardInfo.total_supply) - .integerValue(BigNumber.ROUND_DOWN) - ) - .plus( - accumulatedThisCycleReward - .div(initRewardInfo.total_supply) - .integerValue(BigNumber.ROUND_DOWN) - ) - .toString() - ); - } - }); - } - - function defaultFailCase(decription, sender, amount, errorMsg) { - it(decription, async function () { - await context.updateActor(sender); - await rejects(context.pairs[0].sendReward(amount), (err: any) => { - ok(err.message == errorMsg, "Error message mismatch"); - return true; - }); - }); - } - - describe("Test the loyalty assessment", () => { - defaultSuccessCase( - "success in case of update liquidity", - "alice", - 0, - function () { - return context.pairs[0].withdrawProfit(aliceAddress); - }, - true - ); - defaultSuccessCase( - "success in case of user makes new investment", - "bob", - 0, - function () { - return context.pairs[0].investLiquidity(100, 100, 50); - } - ); - defaultSuccessCase( - "success in case of user withdraws shares", - "alice", - 0, - function () { - return context.pairs[0].divestLiquidity(10, 10, 10); - } - ); - defaultSuccessCase( - "success in case of user transfers shares", - "alice", - 0, - function () { - return context.pairs[0].transfer(aliceAddress, bobAddress, 10); - } - ); - }); - - describe("Test the user's reward distribution", () => { - defaultSuccessCase( - "success in case of reward is claimed before period finished", - "alice", - 0, - function () { - return context.pairs[0].withdrawProfit(aliceAddress); - }, - true - ); - defaultSuccessCase( - "success in case of reward is claimed after period finished", - "bob", - 7, - function () { - return context.pairs[0].withdrawProfit(aliceAddress); - }, - true, - accounts["alice"].pkh - ); - defaultSuccessCase( - "success in case of reward is claimed in the middle of the second period", - "alice", - 3, - function () { - return context.pairs[0].withdrawProfit(bobAddress); - }, - true, - accounts["bob"].pkh - ); - }); - - describe("Test the user's reward distribution with different total rewards", () => { - defaultSuccessCase( - "success in case of no reward", - "alice", - 0, - function () { - return context.pairs[0].withdrawProfit(aliceAddress); - }, - true - ); - describe("", async function () { - before(async function () { - await context.updateActor("bob"); - await context.pairs[0].sendReward(2000); - }); - defaultSuccessCase( - "success in case of reward is accumulated", - "bob", - 7, - function () { - return context.pairs[0].withdrawProfit(aliceAddress); - }, - true, - accounts["alice"].pkh - ); - }); - describe("", async function () { - before(async function () { - await context.updateActor("alice"); - await context.pairs[0].divestLiquidity(1, 1, 80); - }); - defaultSuccessCase( - "success in case of reward is claimed in the middle of the second period", - "alice", - 0, - function () { - return context.pairs[0].withdrawProfit(bobAddress); - }, - true, - accounts["bob"].pkh - ); - }); - }); - }); -} diff --git a/test/SetFunctionsTest.spec.ts b/test/SetFunctionsTest.spec.ts deleted file mode 100644 index bf10cf49..00000000 --- a/test/SetFunctionsTest.spec.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { Context } from "./helpers/context"; -import { strictEqual, ok, notStrictEqual, rejects } from "assert"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; - -if (standard !== "MIXED") { - contract("SetXFunctions()", function () { - let context: Context; - let tokenAddress: string; - let pairAddress: string; - - before(async () => { - context = await Context.init([], false, "alice", false); - pairAddress = await context.createPair(); - tokenAddress = await context.pairs[0].contract.address; - }); - - describe("Test function with different intention can be set", () => { - it("success in case of setting all exchange functions to Factory", async function () { - // ensure no functions are stored - await context.factory.updateStorage(); - Object.values(context.factory.storage.dex_lambdas).forEach((value) => { - strictEqual(value, null); - }); - - // set all Dex functions - await context.setDexFactoryFunctions(); - - // ensure code added - Object.values(context.factory.storage.dex_lambdas).forEach((value) => { - notStrictEqual(value, null); - }); - }); - - it("success in case of setting all token functions to Factory", async function () { - // ensure no functions are stored - await context.factory.updateStorage(); - Object.values(context.factory.storage.token_lambdas).forEach( - (value) => { - strictEqual(value, null); - } - ); - - // set all Token functions - await context.setTokenFactoryFunctions(); - - // ensure code added - Object.values(context.factory.storage.token_lambdas).forEach( - (value) => { - notStrictEqual(value, null); - } - ); - }); - }); - - describe("Test function replacement", () => { - it("revert replacement of Dex functions to Factory", async function () { - await rejects( - context.factory.setDexFunction(1, "initialize_exchange"), - (err: any) => { - strictEqual( - err.message, - "Factory/function-set", - "Error message mismatch" - ); - return true; - } - ); - }); - - it("revert replacement of Token functions to Factory", async function () { - await rejects( - context.factory.setTokenFunction(1, "transfer"), - (err: any) => { - strictEqual( - err.message, - "Factory/function-set", - "Error message mismatch" - ); - return true; - } - ); - }); - }); - - describe("Test functions count", () => { - it("revert adding more than 9 exchange functions to Factory", async function () { - await rejects( - context.factory.setDexFunction(9, "initialize_exchange"), - (err: any) => { - strictEqual( - err.message, - "Factory/wrong-index", - "Error message mismatch" - ); - return true; - } - ); - }); - - it("revert adding more than 5 token functions to Factory", async function () { - await rejects( - context.factory.setTokenFunction(5, "transfer"), - (err: any) => { - strictEqual( - err.message, - "Factory/wrong-index", - "Error message mismatch" - ); - return true; - } - ); - }); - }); - }); -} diff --git a/test/TezToTokenPayment.spec.ts b/test/TezToTokenPayment.spec.ts deleted file mode 100644 index 0d37eabd..00000000 --- a/test/TezToTokenPayment.spec.ts +++ /dev/null @@ -1,194 +0,0 @@ -import { Context } from "./helpers/context"; -import { strictEqual, ok, notStrictEqual, rejects } from "assert"; -import BigNumber from "bignumber.js"; -import accounts from "./accounts/accounts"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; - -if (standard !== "MIXED") { - contract("TezToTokenPayment()", function () { - let context: Context; - let tokenAddress: string; - let pairAddress: string; - const aliceAddress: string = accounts.alice.pkh; - const bobAddress: string = accounts.bob.pkh; - - before(async () => { - context = await Context.init([], false, "alice", false); - await context.setDexFactoryFunction(0, "initialize_exchange"); - await context.setDexFactoryFunction(1, "tez_to_token"); - await context.setDexFactoryFunction(4, "invest_liquidity"); - await context.setDexFactoryFunction(5, "divest_liquidity"); - pairAddress = await context.createPair({ - tezAmount: 100, - tokenAmount: 100, - }); - tokenAddress = await context.pairs[0].contract.address; - }); - - function tezToTokenSuccessCase( - decription, - xtzAmount, - tokensAmount, - tokensLeftover - ) { - it(decription, async function () { - const pairAddress = context.pairs[0].contract.address; - await context.tokens[0].updateStorage({ - ledger: [bobAddress, aliceAddress, pairAddress], - }); - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const aliceInitTokenLedger = await context.tokens[0].storage.ledger[ - aliceAddress - ]; - const aliceInitTokenBalance = aliceInitTokenLedger - ? aliceInitTokenLedger.balance - : new BigNumber(0); - const bobInitTokenLedger = await context.tokens[0].storage.ledger[ - bobAddress - ]; - const bobInitTokenBalance = bobInitTokenLedger - ? bobInitTokenLedger.balance - : new BigNumber(0); - const prevPairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const prevPairTezBalance = await tezos.tz.getBalance(pairAddress); - await context.pairs[0].updateStorage(); - const prevStorage = context.pairs[0].storage; - await context.tokens[0].updateStorage({ - ledger: [bobAddress, aliceAddress], - }); - await context.pairs[0].tezToTokenPayment( - tokensAmount, - xtzAmount, - bobAddress - ); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, bobAddress, pairAddress], - }); - const aliceFinalTokenLedger = await context.tokens[0].storage.ledger[ - aliceAddress - ]; - const aliceFinalTokenBalance = aliceFinalTokenLedger - ? aliceFinalTokenLedger.balance - : new BigNumber(0); - const bobFinalTokenLedger = await context.tokens[0].storage.ledger[ - bobAddress - ]; - const bobFinalTokenBalance = bobFinalTokenLedger - ? bobFinalTokenLedger.balance - : new BigNumber(0); - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - strictEqual( - bobInitTokenBalance.toNumber() + tokensAmount + tokensLeftover, - bobFinalTokenBalance.toNumber() - ); - strictEqual( - aliceInitTokenBalance.toNumber(), - aliceFinalTokenBalance.toNumber() - ); - strictEqual( - pairTokenBalance.toNumber(), - prevPairTokenBalance.toNumber() - tokensAmount - tokensLeftover - ); - ok( - aliceInitTezBalance.toNumber() + xtzAmount >= - aliceFinalTezBalance.toNumber() - ); - strictEqual( - pairTezBalance.toNumber(), - prevPairTezBalance.toNumber() + xtzAmount - ); - await context.pairs[0].updateStorage(); - strictEqual( - context.pairs[0].storage.tez_pool.toNumber(), - prevStorage.tez_pool.toNumber() + xtzAmount - ); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - prevStorage.token_pool.toNumber() - tokensAmount - tokensLeftover - ); - }); - } - - function tezToTokenFailCase(decription, xtzAmount, tokensAmount, errorMsg) { - it(decription, async function () { - await rejects( - context.pairs[0].tezToTokenPayment( - tokensAmount, - xtzAmount, - bobAddress - ), - (err: any) => { - ok(err.message == errorMsg, "Error message mismatch"); - return true; - } - ); - }); - } - - describe("Test different amount of XTZ to be swapped", () => { - tezToTokenFailCase( - "revert in case of 0 XTZ to be swapped", - 0, - 1, - "Dex/zero-amount-in" - ); - tezToTokenFailCase( - "revert in case of 100% of reserves to be swapped", - 100, - 1, - "Dex/high-out" - ); - tezToTokenFailCase( - "revert in case of 10000% of reserves to be swapped", - 10000, - 1, - "Dex/high-out" - ); - tezToTokenFailCase( - "revert in case of 1% of reserves to be swapped", - 1, - 1, - "Dex/wrong-min-out" - ); - tezToTokenSuccessCase( - "success in case of ~30% of reserves to be swapped", - 31, - 23, - 0 - ); - }); - - describe("Test different minimal desirable output amount", () => { - tezToTokenFailCase( - "reevert in case of 0 tokens expected", - 10, - 0, - "Dex/zero-min-amount-out" - ); - tezToTokenFailCase( - "revert in case of too many tokens expected", - 10, - 7, - "Dex/wrong-min-out" - ); - tezToTokenSuccessCase( - "success in case of exact amount of tokens expected", - 10, - 5, - 0 - ); - tezToTokenSuccessCase( - "success in case of smaller amount of tokens expected", - 10, - 3, - 1 - ); - }); - }); -} diff --git a/test/TokenToTezPayment.spec.ts b/test/TokenToTezPayment.spec.ts deleted file mode 100644 index 497865e1..00000000 --- a/test/TokenToTezPayment.spec.ts +++ /dev/null @@ -1,190 +0,0 @@ -import { Context } from "./helpers/context"; -import { strictEqual, ok, notStrictEqual, rejects } from "assert"; -import BigNumber from "bignumber.js"; -import accounts from "./accounts/accounts"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; - -if (standard !== "MIXED") { - contract("TokenToTezPayment()", function () { - let context: Context; - let tokenAddress: string; - let pairAddress: string; - const aliceAddress: string = accounts.alice.pkh; - const bobAddress: string = accounts.bob.pkh; - - before(async () => { - context = await Context.init([], false, "alice", false); - await context.setDexFactoryFunction(0, "initialize_exchange"); - await context.setDexFactoryFunction(2, "token_to_tez"); - await context.setDexFactoryFunction(4, "invest_liquidity"); - await context.setDexFactoryFunction(5, "divest_liquidity"); - pairAddress = await context.createPair({ - tezAmount: 100, - tokenAmount: 100, - }); - tokenAddress = await context.pairs[0].contract.address; - }); - - function tokenToTezSuccessCase( - decription, - xtzAmount, - tokensAmount, - tezLeftover - ) { - it(decription, async function () { - const pairAddress = context.pairs[0].contract.address; - await context.tokens[0].updateStorage({ - ledger: [bobAddress, aliceAddress, pairAddress], - }); - const aliceInitTezBalance = await tezos.tz.getBalance(aliceAddress); - const bobInitTezBalance = await tezos.tz.getBalance(bobAddress); - const aliceInitTokenLedger = await context.tokens[0].storage.ledger[ - aliceAddress - ]; - const aliceInitTokenBalance = aliceInitTokenLedger - ? aliceInitTokenLedger.balance - : new BigNumber(0); - const prevPairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const prevPairTezBalance = await tezos.tz.getBalance(pairAddress); - await context.pairs[0].updateStorage(); - const prevStorage = context.pairs[0].storage; - await context.tokens[0].updateStorage({ - ledger: [bobAddress, aliceAddress], - }); - await context.pairs[0].tokenToTezPayment( - tokensAmount, - xtzAmount, - bobAddress - ); - const aliceFinalTezBalance = await tezos.tz.getBalance(aliceAddress); - const bobFinalTezBalance = await tezos.tz.getBalance(bobAddress); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, bobAddress, pairAddress], - }); - const aliceFinalTokenLedger = await context.tokens[0].storage.ledger[ - aliceAddress - ]; - const aliceFinalTokenBalance = aliceFinalTokenLedger - ? aliceFinalTokenLedger.balance - : new BigNumber(0); - const bobFinalTokenLedger = await context.tokens[0].storage.ledger[ - bobAddress - ]; - const bobFinalTokenBalance = bobFinalTokenLedger - ? bobFinalTokenLedger.balance - : new BigNumber(0); - const pairTokenBalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTezBalance = await tezos.tz.getBalance(pairAddress); - strictEqual( - bobInitTezBalance.toNumber() + xtzAmount, - bobFinalTezBalance.toNumber() - ); - strictEqual( - aliceInitTokenBalance.toNumber() - tokensAmount, - aliceFinalTokenBalance.toNumber() - ); - strictEqual( - pairTokenBalance.toNumber(), - prevPairTokenBalance.toNumber() + tokensAmount - ); - ok(aliceInitTezBalance.toNumber() > aliceFinalTezBalance.toNumber()); - strictEqual( - pairTezBalance.toNumber(), - prevPairTezBalance.toNumber() - xtzAmount - tezLeftover - ); - await context.pairs[0].updateStorage(); - strictEqual( - context.pairs[0].storage.tez_pool.toNumber(), - prevStorage.tez_pool.toNumber() - xtzAmount - tezLeftover - ); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - prevStorage.token_pool.toNumber() + tokensAmount - ); - }); - } - - function tokenToTezFailCase(decription, xtzAmount, tokensAmount, errorMsg) { - it(decription, async function () { - await rejects( - context.pairs[0].tokenToTezPayment( - tokensAmount, - xtzAmount, - bobAddress - ), - (err: any) => { - ok(err.message == errorMsg, "Error message mismatch"); - return true; - } - ); - }); - } - - describe("Test different amount of tokens to be swapped", () => { - tokenToTezFailCase( - "revert in case of 0 tokens to be swapped", - 1, - 0, - "Dex/zero-amount-in" - ); - tokenToTezFailCase( - "revert in case of 100% of reserves to be swapped", - 1, - 100, - "Dex/high-out" - ); - - tokenToTezFailCase( - "revert in case of 10000% of reserves to be swapped", - 1, - 10000, - "Dex/high-out" - ); - - tokenToTezFailCase( - "revert in case of 1% of reserves to be swapped", - 1, - 1, - "Dex/wrong-min-out" - ); - - tokenToTezSuccessCase( - "success in case of ~30% of reserves to be swapped", - 23, - 31, - 0 - ); - }); - - describe("Test different minimal desirable output amount", () => { - tokenToTezFailCase( - "reevert in case of 0 XTZ expected", - 0, - 10, - "Dex/zero-min-amount-out" - ); - tokenToTezFailCase( - "revert in case of too many XTZ expected", - 10, - 10, - "Dex/wrong-min-out" - ); - tokenToTezSuccessCase( - "success in case of exact amount of XTZ expected", - 5, - 11, - 0 - ); - tokenToTezSuccessCase( - "success in case of smaller amount of XTZ expected", - 4, - 10, - 0 - ); - }); - }); -} diff --git a/test/TokenToTokenPayment.spec.ts b/test/TokenToTokenPayment.spec.ts deleted file mode 100644 index a67d1943..00000000 --- a/test/TokenToTokenPayment.spec.ts +++ /dev/null @@ -1,173 +0,0 @@ -import { Context } from "./helpers/context"; -import { strictEqual, ok, notStrictEqual, rejects } from "assert"; -import BigNumber from "bignumber.js"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; - -if (standard !== "MIXED") { - contract("TokenToTokenPayment()", function () { - let context: Context; - let tokenAddress: string; - const tezInitAmount0 = 10000; - const tezInitAmount1 = 20000; - const tokenInitAmount0 = 1000000; - const tokenInitAmount1 = 10000; - - before(async () => { - context = await Context.init([], false, "alice", false); - await context.setDexFactoryFunction(0, "initialize_exchange"); - await context.setDexFactoryFunction(1, "tez_to_token"); - await context.setDexFactoryFunction(2, "token_to_tez"); - await context.setDexFactoryFunction(4, "invest_liquidity"); - await context.setDexFactoryFunction(5, "divest_liquidity"); - await context.createPairs([ - { tezAmount: tezInitAmount0, tokenAmount: tokenInitAmount0 }, - { tezAmount: tezInitAmount1, tokenAmount: tokenInitAmount1 }, - ]); - tokenAddress = await context.pairs[0].contract.address; - }); - - it("should exchnge token to token and update dex state", async function () { - this.timeout(5000000); - let tokenAmount = 1000; - let middleTezAmount = 9; - let minTokensOut = 4; - - let firstDexContract = context.pairs[0].contract; - let secondDexContract = context.pairs[1].contract; - let aliceAddress = await tezos.signer.publicKeyHash(); - - // update keys - await context.updateActor("carol"); - let carolAddress = await tezos.signer.publicKeyHash(); - await context.updateActor("bob"); - let bobAddress = await tezos.signer.publicKeyHash(); - await context.updateActor(); - - // send tokens to bob - await context.tokens[0].transfer(aliceAddress, bobAddress, tokenAmount); - await context.updateActor("bob"); - - // check initial balance - let bobInitTezBalance = await tezos.tz.getBalance(bobAddress); - await context.tokens[0].updateStorage({ ledger: [bobAddress] }); - await context.tokens[1].updateStorage({ - ledger: [bobAddress, carolAddress], - }); - let bobInitFirstTokenLedger = await context.tokens[0].storage.ledger[ - bobAddress - ]; - let bobInitSecondTokenLedger = await context.tokens[1].storage.ledger[ - bobAddress - ]; - let bobInitFirstTokenBalance = bobInitFirstTokenLedger - ? bobInitFirstTokenLedger.balance - : new BigNumber(0); - let bobInitSecondTokenBalance = bobInitSecondTokenLedger - ? bobInitSecondTokenLedger.balance - : new BigNumber(0); - let carolInitSecondTokenLedger = await context.tokens[1].storage.ledger[ - carolAddress - ]; - let carolInitSecondTokenBalance = carolInitSecondTokenLedger - ? carolInitSecondTokenLedger.balance - : new BigNumber(0); - - // swap tokens liquidity - await context.pairs[0].tokenToTokenPayment( - tokenAmount, - minTokensOut, - secondDexContract, - middleTezAmount, - carolAddress - ); - - // checks - let bobFinalTezBalance = await tezos.tz.getBalance(bobAddress); - await context.tokens[0].updateStorage({ - ledger: [bobAddress, firstDexContract.address], - }); - await context.tokens[1].updateStorage({ - ledger: [bobAddress, carolAddress, secondDexContract.address], - }); - let bobFinalFirstTokenBalance = await context.tokens[0].storage.ledger[ - bobAddress - ].balance; - let bobFinalSecondTokenLedger = await context.tokens[1].storage.ledger[ - bobAddress - ]; - let bobFinalSecondTokenBalance = bobFinalSecondTokenLedger - ? bobFinalSecondTokenLedger.balance - : new BigNumber(0); - - let carolFinalSecondTokenBalance = await context.tokens[1].storage.ledger[ - carolAddress - ].balance; - - let firstPairTokenBalance = await context.tokens[0].storage.ledger[ - firstDexContract.address - ].balance; - let firstPairTezBalance = await tezos.tz.getBalance( - firstDexContract.address - ); - let secondPairTokenBalance = await context.tokens[1].storage.ledger[ - secondDexContract.address - ].balance; - let secondPairTezBalance = await tezos.tz.getBalance( - secondDexContract.address - ); - - // 1. check tez balances - ok(bobInitTezBalance.toNumber() > bobFinalTezBalance.toNumber()); - strictEqual( - firstPairTezBalance.toNumber(), - tezInitAmount0 - middleTezAmount - ); - strictEqual( - secondPairTezBalance.toNumber(), - tezInitAmount1 + middleTezAmount - ); - - // 2. check tokens balances - strictEqual( - bobInitFirstTokenBalance.toNumber() - tokenAmount, - bobFinalFirstTokenBalance.toNumber() - ); - strictEqual( - bobInitSecondTokenBalance.toNumber(), - bobFinalSecondTokenBalance.toNumber() - ); - strictEqual( - carolInitSecondTokenBalance.toNumber() + minTokensOut, - carolFinalSecondTokenBalance.toNumber() - ); - strictEqual( - firstPairTokenBalance.toNumber(), - tokenInitAmount0 + tokenAmount - ); - strictEqual( - secondPairTokenBalance.toNumber(), - tokenInitAmount1 - minTokensOut - ); - - // 3. new pairs state - await context.pairs[0].updateStorage(); - await context.pairs[1].updateStorage(); - strictEqual( - context.pairs[0].storage.tez_pool.toNumber(), - tezInitAmount0 - middleTezAmount - ); - strictEqual( - context.pairs[0].storage.token_pool.toNumber(), - tokenInitAmount0 + tokenAmount - ); - strictEqual( - context.pairs[1].storage.tez_pool.toNumber(), - tezInitAmount1 + middleTezAmount - ); - strictEqual( - context.pairs[1].storage.token_pool.toNumber(), - tezInitAmount0 - minTokensOut - ); - }); - }); -} diff --git a/test/Veto.spec.ts b/test/Veto.spec.ts deleted file mode 100644 index 02eb580f..00000000 --- a/test/Veto.spec.ts +++ /dev/null @@ -1,274 +0,0 @@ -import { Context } from "./helpers/context"; -import { strictEqual, ok, notStrictEqual, rejects } from "assert"; -import BigNumber from "bignumber.js"; -import accounts from "./accounts/accounts"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; - -if (standard !== "MIXED") { - contract("Veto()", function () { - let context: Context; - let tokenAddress: string; - let pairAddress: string; - const aliceAddress: string = accounts.alice.pkh; - const bobAddress: string = accounts.bob.pkh; - const carolAddress: string = accounts.carol.pkh; - - before(async () => { - context = await Context.init([], false, "alice", false); - await context.setDexFactoryFunction(0, "initialize_exchange"); - await context.setDexFactoryFunction(4, "invest_liquidity"); - await context.setDexFactoryFunction(6, "vote"); - await context.setDexFactoryFunction(7, "veto"); - await context.factory.setTokenFunction(0, "transfer"); - await context.factory.setTokenFunction( - 1, - standard == "FA2" ? "update_operators" : "approve" - ); - pairAddress = await context.createPair(); - tokenAddress = await context.pairs[0].contract.address; - }); - - function vetoSuccessCase( - decription, - sender, - voter, - vetor, - candidate, - vote, - veto - ) { - it(decription, async function () { - if (vote) { - await context.updateActor(voter); - const voterAddress = accounts[voter].pkh; - await context.pairs[0].vote(voterAddress, candidate, vote); - } - await context.updateActor(sender); - await context.pairs[0].updateStorage(); - const prevDelegated = context.pairs[0].storage.current_delegated; - await context.pairs[0].updateStorage({ - ledger: [vetor], - voters: [vetor], - vetos: [prevDelegated], - }); - const voterInitVoteInfo = context.pairs[0].storage.voters[vetor] || { - candidate: undefined, - vote: new BigNumber(0), - veto: new BigNumber(0), - }; - const voterInitSharesInfo = context.pairs[0].storage.ledger[vetor] || { - balance: new BigNumber(0), - frozen_balance: new BigNumber(0), - allowances: {}, - }; - const voterInitCandidateVotes = - context.pairs[0].storage.votes[candidate] || new BigNumber(0); - const initVotes = context.pairs[0].storage.total_votes; - const initVeto = context.pairs[0].storage.veto; - const prevCurrentCandidate = context.pairs[0].storage.current_candidate; - await context.pairs[0].veto(vetor, veto); - await context.pairs[0].updateStorage({ - ledger: [vetor], - voters: [vetor], - vetos: [candidate, prevDelegated], - }); - const voterFinalVoteInfo = context.pairs[0].storage.voters[vetor] || { - candidate: undefined, - vote: new BigNumber(0), - veto: new BigNumber(0), - }; - const voterFinalSharesInfo = context.pairs[0].storage.ledger[vetor] || { - balance: new BigNumber(0), - frozen_balance: new BigNumber(0), - allowances: {}, - }; - const prevDelegateFinalVetos = context.pairs[0].storage.vetos[ - prevDelegated - ] - ? Date.parse(context.pairs[0].storage.vetos[prevDelegated]) / 1000 - : 0; - const finalVeto = context.pairs[0].storage.veto; - const finalCurrentCandidate = - context.pairs[0].storage.current_candidate; - const finalCurrentDelegated = - context.pairs[0].storage.current_delegated; - strictEqual( - voterFinalSharesInfo.balance.toNumber(), - voterInitSharesInfo.balance.plus(voterInitVoteInfo.veto).toNumber() - - veto - ); - strictEqual( - voterFinalSharesInfo.frozen_balance.toNumber(), - voterInitSharesInfo.frozen_balance - .minus(voterInitVoteInfo.veto) - .toNumber() + veto - ); - if ( - initVeto - .minus(voterInitVoteInfo.veto) - .plus(new BigNumber(veto)) - .gt(initVotes.div(new BigNumber(3))) - ) { - notStrictEqual(prevDelegateFinalVetos, 0); - strictEqual(finalVeto.toNumber(), 0); - strictEqual(finalCurrentCandidate, null); - strictEqual( - finalCurrentDelegated, - prevCurrentCandidate == prevDelegated ? null : prevCurrentCandidate - ); - } else { - strictEqual(prevDelegateFinalVetos, 0); - strictEqual(finalCurrentCandidate, prevCurrentCandidate); - strictEqual(finalCurrentDelegated, prevDelegated); - } - strictEqual(voterFinalVoteInfo.veto.toNumber(), veto); - }); - } - - function vetoFailCase(decription, sender, vetor, value, errorMsg) { - it(decription, async function () { - await context.updateActor(sender); - await rejects(context.pairs[0].veto(vetor, value), (err: any) => { - ok(err.message == errorMsg, "Error message mismatch"); - return true; - }); - }); - } - - describe("Test the user's veto power", () => { - vetoSuccessCase( - "success in case of enough liquid shares", - "alice", - "alice", - aliceAddress, - bobAddress, - 9000, - 500 - ); - vetoSuccessCase( - "success in case of exactly equal to liquid balance", - "alice", - "alice", - aliceAddress, - carolAddress, - 1000, - 9000 - ); - vetoSuccessCase( - "success in case of enough shaes after delegate removal", - "alice", - "alice", - aliceAddress, - bobAddress, - 1000, - 100 - ); - vetoSuccessCase( - "success in case of 0 shares", - "alice", - "alice", - aliceAddress, - aliceAddress, - 0, - 0 - ); - vetoFailCase( - "revert in case of more than liquid shares", - "alice", - aliceAddress, - 20000, - "Dex/not-enough-balance" - ); - vetoFailCase( - "revert in case of no shares", - "bob", - bobAddress, - 0, - "Dex/no-shares" - ); - }); - - describe("Test veto permissions", () => { - before(async () => { - await context.updateActor("alice"); - await context.pairs[0].approve(bobAddress, 5000); - }); - vetoSuccessCase( - "success in case of veto by the user", - "alice", - "alice", - aliceAddress, - bobAddress, - 3000, - 500 - ); - vetoSuccessCase( - "success in case of veto be the approved user", - "bob", - "alice", - aliceAddress, - bobAddress, - 0, - 100 - ); - vetoFailCase( - "revert in case of not approved user", - "carol", - aliceAddress, - 100, - "Dex/not-enough-allowance" - ); - }); - - describe("Test different delegates", () => { - vetoSuccessCase( - "success in case of veto against delegate", - "alice", - "alice", - aliceAddress, - bobAddress, - 1000, - 4000 - ); - vetoSuccessCase( - "success in case of veto against no delegate", - "alice", - "alice", - aliceAddress, - bobAddress, - 0, - 4000 - ); - }); - - describe("Test the veto limit", () => { - vetoSuccessCase( - "success in case of too little votes for veto", - "alice", - "alice", - aliceAddress, - aliceAddress, - 3000, - 10 - ); - vetoSuccessCase( - "success in case of exctly 1/3 of votes", - "alice", - "alice", - aliceAddress, - aliceAddress, - 3000, - 1000 - ); - vetoSuccessCase( - "success in case of enough votes for veto", - "alice", - "alice", - aliceAddress, - aliceAddress, - 3000, - 2000 - ); - }); - }); -} diff --git a/test/Vote.spec.ts b/test/Vote.spec.ts deleted file mode 100644 index 6729da16..00000000 --- a/test/Vote.spec.ts +++ /dev/null @@ -1,328 +0,0 @@ -import { Context } from "./helpers/context"; -import { strictEqual, ok, notStrictEqual, rejects } from "assert"; -import BigNumber from "bignumber.js"; -import accounts from "./accounts/accounts"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; - -if (standard !== "MIXED") { - contract("Vote()", function () { - let context: Context; - let tokenAddress: string; - let pairAddress: string; - const aliceAddress: string = accounts.alice.pkh; - const bobAddress: string = accounts.bob.pkh; - const carolAddress: string = accounts.carol.pkh; - - before(async () => { - context = await Context.init([], false, "alice", false); - await context.setDexFactoryFunction(0, "initialize_exchange"); - await context.setDexFactoryFunction(4, "invest_liquidity"); - await context.setDexFactoryFunction(5, "divest_liquidity"); - await context.setDexFactoryFunction(6, "vote"); - await context.setDexFactoryFunction(7, "veto"); - await context.factory.setTokenFunction(0, "transfer"); - await context.factory.setTokenFunction( - 1, - standard == "FA2" ? "update_operators" : "approve" - ); - pairAddress = await context.createPair(); - tokenAddress = await context.pairs[0].contract.address; - }); - - function voteSuccessCase(decription, sender, voter, candidate, value) { - it(decription, async function () { - await context.updateActor(sender); - const senderAddress: string = accounts[sender].pkh; - await context.pairs[0].updateStorage({ - ledger: [senderAddress, voter], - voters: [senderAddress, voter], - votes: [candidate], - }); - const voterInitVoteInfo = context.pairs[0].storage.voters[voter] || { - candidate: undefined, - vote: new BigNumber(0), - veto: new BigNumber(0), - }; - const voterInitSharesInfo = context.pairs[0].storage.ledger[voter] || { - balance: new BigNumber(0), - frozen_balance: new BigNumber(0), - allowances: {}, - }; - const voterInitCandidateVotes = - context.pairs[0].storage.votes[candidate] || new BigNumber(0); - const initVotes = context.pairs[0].storage.total_votes; - await context.pairs[0].vote(voter, candidate, value); - const prevDelegated = context.pairs[0].storage.current_delegated; - await context.pairs[0].updateStorage({ - ledger: [senderAddress, voter], - voters: [senderAddress, voter], - votes: [candidate, prevDelegated], - }); - - const voterFinalVoteInfo = context.pairs[0].storage.voters[voter] || { - candidate: undefined, - vote: new BigNumber(0), - veto: new BigNumber(0), - }; - const voterFinalSharesInfo = context.pairs[0].storage.ledger[voter] || { - balance: new BigNumber(0), - frozen_balance: new BigNumber(0), - allowances: {}, - }; - const prevDelegateFinalCandidateVotes = - context.pairs[0].storage.votes[prevDelegated] || new BigNumber(0); - const voterFinalCandidateVotes = - context.pairs[0].storage.votes[candidate] || new BigNumber(0); - const finalVotes = context.pairs[0].storage.total_votes; - const finalCurrentCandidate = - context.pairs[0].storage.current_candidate; - const finalCurrentDelegated = - context.pairs[0].storage.current_delegated; - - strictEqual( - voterFinalSharesInfo.balance.toNumber(), - voterInitSharesInfo.balance.plus(voterInitVoteInfo.vote).toNumber() - - value - ); - strictEqual( - voterFinalSharesInfo.frozen_balance.toNumber(), - voterInitSharesInfo.frozen_balance - .minus(voterInitVoteInfo.vote) - .toNumber() + value - ); - strictEqual(voterFinalVoteInfo.candidate, value ? candidate : null); - strictEqual(voterFinalVoteInfo.vote.toNumber(), value); - - if (value) { - if (voterInitVoteInfo.candidate == candidate) { - strictEqual( - voterFinalCandidateVotes.toNumber(), - voterInitCandidateVotes.minus(voterInitVoteInfo.vote).toNumber() + - value - ); - } else { - strictEqual( - voterFinalCandidateVotes.toNumber(), - voterInitCandidateVotes.toNumber() + value - ); - } - } - strictEqual( - initVotes.minus(voterInitVoteInfo.vote).toNumber() + value, - finalVotes.toNumber() - ); - if (value > prevDelegateFinalCandidateVotes.toNumber()) - strictEqual(finalCurrentDelegated, candidate); - }); - } - - function voteFailCase( - decription, - sender, - voter, - candidate, - value, - errorMsg - ) { - it(decription, async function () { - await context.updateActor(sender); - await rejects( - context.pairs[0].vote(voter, candidate, value), - (err: any) => { - ok(err.message == errorMsg, "Error message mismatch"); - return true; - } - ); - }); - } - - describe("Test the user's vote power", () => { - voteSuccessCase( - "success in case of enough liquid shares", - "alice", - aliceAddress, - aliceAddress, - 1000 - ); - voteSuccessCase( - "success in case of exactly equal to liquid balance", - "alice", - aliceAddress, - aliceAddress, - 10000 - ); - voteSuccessCase( - "success in case of enough liquid shares for revoting", - "alice", - aliceAddress, - bobAddress, - 1000 - ); - voteSuccessCase( - "success in case of enough liquid shares for revoting", - "alice", - aliceAddress, - bobAddress, - 0 - ); - voteSuccessCase( - "success in case of 0 shares with no candidate", - "alice", - aliceAddress, - bobAddress, - 0 - ); - voteFailCase( - "revert in case of more than liquid shares", - "alice", - aliceAddress, - aliceAddress, - 20000, - "Dex/not-enough-balance" - ); - voteFailCase( - "revert in case of no shares", - "bob", - bobAddress, - bobAddress, - 0, - "Dex/no-shares" - ); - }); - - describe("Test voting permissions", () => { - before(async () => { - await context.updateActor("alice"); - await context.pairs[0].approve(bobAddress, 5000); - }); - voteFailCase( - "revert in case of voting by the unapproved user", - "alice", - bobAddress, - bobAddress, - 0, - "Dex/no-shares" - ); - voteSuccessCase( - "success in case of vote by user", - "alice", - aliceAddress, - aliceAddress, - 1000 - ); - voteSuccessCase( - "success in case of vote by approved user", - "bob", - aliceAddress, - bobAddress, - 5000 - ); - }); - - describe("Test different candidates", () => { - before(async () => { - await context.updateActor("alice"); - await context.pairs[0].transfer(aliceAddress, bobAddress, 5000); - }); - voteSuccessCase( - "success in case of voting for new candidate", - "alice", - aliceAddress, - aliceAddress, - 1000 - ); - voteSuccessCase( - "success in case of voting for candidate with votes", - "bob", - bobAddress, - bobAddress, - 4000 - ); - voteFailCase( - "revert in case of voting for unregistered candidate with power that won't makes him delegate", - "alice", - aliceAddress, - "tz1gaRjULm9qy4D83VCvb4ABWLKpz4XXfqjx", - 1000, - "(permanent) proto.010-PtGRANAD.contract.manager.unregistered_delegate" - ); - voteFailCase( - "revert in case of voting for unregistered candidate with power that makes him delegate", - "alice", - aliceAddress, - "tz1gaRjULm9qy4D83VCvb4ABWLKpz4XXfqjx", - 5000, - "(permanent) proto.010-PtGRANAD.contract.manager.unregistered_delegate" - ); - - describe("", async function () { - before(async function () { - await context.updateActor("bob"); - await context.pairs[0].vote(bobAddress, carolAddress, 2000); - await context.updateActor("alice"); - await context.pairs[0].veto(aliceAddress, 2000); - }); - voteFailCase( - "revert in case of voting for banned candidate", - "bob", - bobAddress, - carolAddress, - 3000, - "Dex/veto-candidate" - ); - }); - }); - - describe("Test candidate replacement", () => { - before(async () => { - await context.updateActor("alice"); - await context.flushPairs(); - pairAddress = await context.createPair(); - tokenAddress = await context.pairs[0].contract.address; - await context.pairs[0].transfer(aliceAddress, bobAddress, 5000); - }); - voteSuccessCase( - "success in case of voting for new candidate if no delegate", - "alice", - aliceAddress, - aliceAddress, - 1000 - ); - voteSuccessCase( - "success in case of voting for new candidate if there is delegate with lower votes", - "bob", - bobAddress, - bobAddress, - 4000 - ); - voteSuccessCase( - "success in case of voting for new candidate if delegate with higher votes", - "alice", - aliceAddress, - carolAddress, - 1000 - ); - voteSuccessCase( - "success in case of voting for new candidate if there is delegate with the same votes", - "alice", - aliceAddress, - aliceAddress, - 4000 - ); - voteSuccessCase( - "success in case of removing votes for delegate", - "bob", - bobAddress, - bobAddress, - 2000 - ); - voteSuccessCase( - "success in case of voting for the delegate", - "alice", - aliceAddress, - bobAddress, - 4300 - ); - }); - }); -} diff --git a/test/helpers/context.ts b/test/helpers/context.ts deleted file mode 100644 index b8a5ea70..00000000 --- a/test/helpers/context.ts +++ /dev/null @@ -1,190 +0,0 @@ -const standard = process.env.EXCHANGE_TOKEN_STANDARD; - -import { Dex as DexFA12 } from "./dexFA12"; -import { Dex as DexFA2 } from "./dexFA2"; -import { Factory } from "./factory"; -import { TokenFA12 } from "./tokenFA12"; -import { prepareProviderOptions } from "./utils"; - -import factoryStorage from "../storage/Factory"; -import tokenFA12Storage from "../storage/TokenFA12"; -import tokenFA2Storage from "../storage/TokenFA2"; -import { dexFunctions, tokenFunctions } from "../storage/Functions"; -import { TokenFA2 } from "./tokenFA2"; -import { Token } from "./token"; -import { TezosToolkit } from "@taquito/taquito"; - -let tokenStorage, CDex, CToken, CFactory; -type Dex = DexFA12 | DexFA2; -const BakerRegistry = artifacts.require("BakerRegistry"); -if (standard == "FA12") { - tokenStorage = tokenFA12Storage; - CDex = artifacts.require("DexFA12"); - CToken = artifacts.require("TokenFA12"); - CFactory = artifacts.require("TestFactoryFA12"); -} else { - tokenStorage = tokenFA2Storage; - CDex = artifacts.require("DexFA2"); - CToken = artifacts.require("TokenFA2"); - CFactory = artifacts.require("TestFactoryFA2"); -} - -export class Context { - public factory: Factory; - public pairs: Dex[]; - public tokens: Token[]; - - constructor(factory: Factory, pairs: Dex[], tokens: Token[]) { - this.factory = factory; - this.pairs = pairs; - this.tokens = tokens; - } - - static async init( - pairsConfigs: { tezAmount: number; tokenAmount: number }[] = [ - { tezAmount: 10000, tokenAmount: 1000000 }, - ], - setFactoryFunctions: boolean = false, - accountName: string = "alice", - useDeployedFactory: boolean = true - ): Promise { - let config = await prepareProviderOptions(accountName); - tezos = new TezosToolkit(tezos.rpc.url); - tezos.setProvider(config); - - factoryStorage.baker_validator = ( - await BakerRegistry.deployed() - ).address.toString(); - - const currentBlock = await tezos.rpc.getBlock(); - let factoryInstance = useDeployedFactory - ? await CFactory.deployed() - : await CFactory.new( - factoryStorage, - currentBlock.protocol.startsWith("PsDELPH1") - ? { - gas: 490000, - fee: 10000000, - } - : {} - ); - let factory = await Factory.init(factoryInstance.address.toString()); - let context = new Context(factory, [], []); - if (setFactoryFunctions) { - await context.setAllFactoryFunctions(); - } - - await context.createPairs(pairsConfigs); - - return context; - } - - async updateActor(accountName: string = "alice"): Promise { - await this.factory.updateProvider(accountName); - } - - async flushPairs(): Promise { - this.tokens = []; - this.pairs = []; - await this.updateActor(); - } - - async createToken(): Promise { - let tokenInstance = await CToken.new(tokenStorage); - let tokenAddress = tokenInstance.address.toString(); - this.tokens.push( - standard === "FA2" - ? await TokenFA2.init(tokenAddress) - : await TokenFA12.init(tokenAddress) - ); - return tokenAddress; - } - - async setDexFactoryFunctions(): Promise { - for (let dexFunction of dexFunctions) { - await this.factory.setDexFunction(dexFunction.index, dexFunction.name); - } - await this.factory.updateStorage({ - dex_lambdas: [...Array(9).keys()], - }); - } - - async setDexFactoryFunction(index: number, name: string): Promise { - await this.factory.updateStorage({ - dex_lambdas: [index], - }); - if (!this.factory.storage.dex_lambdas[index]) { - await this.factory.setDexFunction(index, name); - await this.factory.updateStorage({ - dex_lambdas: [index], - }); - } - } - - async setTokenFactoryFunctions(): Promise { - for (let tokenFunction of tokenFunctions[standard]) { - await this.factory.setTokenFunction( - tokenFunction.index, - tokenFunction.name - ); - } - await this.factory.updateStorage({ - token_lambdas: [...Array(5).keys()], - }); - } - - async setAllFactoryFunctions(): Promise { - await this.setDexFactoryFunctions(); - await this.setTokenFactoryFunctions(); - await this.factory.updateStorage({ - dex_lambdas: [...Array(9).keys()], - token_lambdas: [...Array(5).keys()], - }); - } - - async createPair( - pairConfig: { - tezAmount: number; - tokenAmount: number; - tokenAddress?: string | null; - } = { - tezAmount: 10000, - tokenAmount: 1000000, - } - ): Promise { - pairConfig.tokenAddress = - pairConfig.tokenAddress || (await this.createToken()); - await this.factory.launchExchange( - pairConfig.tokenAddress, - pairConfig.tokenAmount, - pairConfig.tezAmount - ); - this.pairs.push( - standard == "FA12" - ? await DexFA12.init( - this.factory.storage.token_to_exchange[pairConfig.tokenAddress] - ) - : await DexFA2.init( - this.factory.storage.token_to_exchange[pairConfig.tokenAddress] - ) - ); - return this.factory.storage.token_to_exchange[pairConfig.tokenAddress]; - } - - async createPairs( - pairConfigs: { - tezAmount: number; - tokenAmount: number; - tokenAddress?: string | null; - }[] = [ - { - tezAmount: 10000, - tokenAmount: 1000000, - }, - ] - ): Promise { - for (let pairConfig of pairConfigs) { - await this.createPair(pairConfig); - } - } -} diff --git a/test/helpers/dexFA12.ts b/test/helpers/dexFA12.ts deleted file mode 100644 index b4ca8f45..00000000 --- a/test/helpers/dexFA12.ts +++ /dev/null @@ -1,258 +0,0 @@ -import { ContractAbstraction, ContractProvider } from "@taquito/taquito"; -import { BatchOperation } from "@taquito/taquito/dist/types/operations/batch-operation"; -import { TransactionOperation } from "@taquito/taquito/dist/types/operations/transaction-operation"; -import { confirmOperation } from "./confirmation"; -import { TokenFA12 } from "./tokenFA12"; -import { DexStorage } from "./types"; -import { tezPrecision } from "./utils"; - -export class Dex extends TokenFA12 { - public contract: ContractAbstraction; - public storage: DexStorage; - - constructor(contract: ContractAbstraction) { - super(contract); - } - - static async init(dexAddress: string): Promise { - return new Dex(await tezos.contract.at(dexAddress)); - } - - async updateStorage( - maps: { - ledger?: string[]; - voters?: string[]; - vetos?: string[]; - votes?: string[]; - user_rewards?: string[]; - } = {} - ): Promise { - const storage: any = await this.contract.storage(); - this.storage = { - tez_pool: storage.storage.tez_pool, - token_pool: storage.storage.token_pool, - baker_validator: storage.storage.baker_validator, - token_address: storage.storage.token_address, - total_supply: storage.storage.total_supply, - last_veto: storage.storage.last_veto, - ledger: {}, - voters: {}, - vetos: {}, - votes: {}, - veto: storage.storage.veto, - current_delegated: storage.storage.current_delegated, - current_candidate: storage.storage.current_candidate, - total_votes: storage.storage.total_votes, - reward: storage.storage.reward, - total_reward: storage.storage.total_reward, - reward_per_share: storage.storage.reward_per_share, - reward_per_sec: storage.storage.reward_per_sec, - last_update_time: storage.storage.last_update_time, - period_finish: storage.storage.period_finish, - user_rewards: {}, - }; - for (let key in maps) { - this.storage[key] = await maps[key].reduce(async (prev, current) => { - try { - return { - ...(await prev), - [current]: await storage.storage[key].get(current), - }; - } catch (ex) { - return { - ...(await prev), - }; - } - }, Promise.resolve({})); - } - } - async initializeExchange( - tokenAmount: number, - tezAmount: number, - approve: boolean = true - ): Promise { - if (approve) await this.approveToken(tokenAmount, this.contract.address); - const operation = await this.contract.methods - .use("initializeExchange", tokenAmount) - .send({ amount: tezAmount / tezPrecision }); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async tezToTokenPayment( - minTokens: number, - tezAmount: number, - receiver: string - ): Promise { - const operation = await this.contract.methods - .use("tezToTokenPayment", minTokens, receiver) - .send({ amount: tezAmount / tezPrecision }); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async tezToTokenSwap( - minTokens: number, - tezAmount: number - ): Promise { - return await this.tezToTokenPayment( - minTokens, - tezAmount, - await tezos.signer.publicKeyHash() - ); - } - - async tokenToTezPayment( - tokenAmount: number, - minTezOut: number, - receiver: string - ): Promise { - const tokensOperation = await this.approveToken( - tokenAmount, - this.contract.address - ); - const operation = await this.contract.methods - .use("tokenToTezPayment", tokenAmount, minTezOut, receiver) - .send(); - await confirmOperation(tezos, operation.hash); - return [tokensOperation, operation]; - } - - async tokenToTezSwap( - tokenAmount: number, - minTezOut: number - ): Promise { - return await this.tokenToTezPayment( - tokenAmount, - minTezOut, - await tezos.signer.publicKeyHash() - ); - } - - async tokenToTokenPayment( - tokenAmount: number, - minTokensOut: number, - secondDexContract: ContractAbstraction, - middleTezAmount: number, - receiver: string - ): Promise { - await this.updateStorage(); - let token = await tezos.contract.at(this.storage.token_address); - const minTez = Math.floor(middleTezAmount * 0.9); - const batch = tezos - .batch([]) - .withTransfer( - token.methods - .approve(this.contract.address, tokenAmount) - .toTransferParams() - ) - .withTransfer( - this.contract.methods - .use( - "tokenToTezPayment", - tokenAmount, - middleTezAmount ? middleTezAmount : 1, - await tezos.signer.publicKeyHash() - ) - .toTransferParams() - ) - .withTransfer( - secondDexContract.methods - .use("tezToTokenPayment", minTokensOut, receiver) - .toTransferParams({ amount: middleTezAmount / tezPrecision }) - ); - const operation = await batch.send(); - await confirmOperation(tezos, operation.hash); - return [operation]; - } - - async tokenToTokenSwap( - tokenAmount: number, - minTokensOut: number, - secondDexContract: ContractAbstraction, - middleTezAmount: number - ): Promise { - return await this.tokenToTokenPayment( - tokenAmount, - minTokensOut, - secondDexContract, - middleTezAmount, - await tezos.signer.publicKeyHash() - ); - } - - async investLiquidity( - tokenAmount: number, - tezAmount: number, - minShares: number - ): Promise { - await this.approveToken(tokenAmount, this.contract.address); - const operation = await this.contract.methods - .use("investLiquidity", tokenAmount) - .send({ amount: tezAmount / tezPrecision }); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async divestLiquidity( - tokenAmount: number, - tezAmount: number, - sharesBurned: number - ): Promise { - const operation = await this.contract.methods - .use("divestLiquidity", tezAmount, tokenAmount, sharesBurned) - .send(); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async vote( - voter: string, - delegate: string, - value: number - ): Promise { - const operation = await this.contract.methods - .use("vote", delegate, value, voter) - .send(); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async veto(voter: string, value: number): Promise { - const operation = await this.contract.methods - .use("veto", value, voter) - .send(); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async withdrawProfit(receiver: string): Promise { - const operation = await this.contract.methods - .use("withdrawProfit", receiver) - .send(); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async sendReward(amount: number): Promise { - const operation = await tezos.contract.transfer({ - to: this.contract.address, - amount: amount, - mutez: true, - }); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async approveToken( - tokenAmount: number, - address: string - ): Promise { - await this.updateStorage(); - let tokenAddress = this.storage.token_address; - let token = await tezos.contract.at(tokenAddress); - let operation = await token.methods.approve(address, tokenAmount).send(); - await confirmOperation(tezos, operation.hash); - return operation; - } -} diff --git a/test/helpers/dexFA2.ts b/test/helpers/dexFA2.ts deleted file mode 100644 index 60d8d963..00000000 --- a/test/helpers/dexFA2.ts +++ /dev/null @@ -1,278 +0,0 @@ -import { ContractAbstraction, ContractProvider } from "@taquito/taquito"; -import { BatchOperation } from "@taquito/taquito/dist/types/operations/batch-operation"; -import { TransactionOperation } from "@taquito/taquito/dist/types/operations/transaction-operation"; -import { confirmOperation } from "./confirmation"; -import { TokenFA2 } from "./tokenFA2"; -import { defaultTokenId } from "./tokenFA2"; -import { DexStorage } from "./types"; -import { tezPrecision } from "./utils"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; -export class Dex extends TokenFA2 { - public contract: ContractAbstraction; - public storage: DexStorage; - - constructor(contract: ContractAbstraction) { - super(contract); - } - - static async init(dexAddress: string): Promise { - return new Dex(await tezos.contract.at(dexAddress)); - } - - async updateStorage( - maps: { - ledger?: string[]; - voters?: string[]; - vetos?: string[]; - votes?: string[]; - user_rewards?: string[]; - } = {} - ): Promise { - const storage: any = await this.contract.storage(); - this.storage = { - tez_pool: storage.storage.tez_pool, - token_pool: storage.storage.token_pool, - baker_validator: storage.storage.baker_validator, - token_address: storage.storage.token_address, - total_supply: storage.storage.total_supply, - last_veto: storage.storage.last_veto, - ledger: {}, - voters: {}, - vetos: {}, - votes: {}, - veto: storage.storage.veto, - current_delegated: storage.storage.current_delegated, - current_candidate: storage.storage.current_candidate, - total_votes: storage.storage.total_votes, - reward: storage.storage.reward, - total_reward: storage.storage.total_reward, - reward_per_share: storage.storage.reward_per_share, - reward_per_sec: storage.storage.reward_per_sec, - last_update_time: storage.storage.last_update_time, - period_finish: storage.storage.period_finish, - user_rewards: {}, - }; - for (let key in maps) { - this.storage[key] = await maps[key].reduce(async (prev, current) => { - try { - return { - ...(await prev), - [current]: await storage.storage[key].get(current), - }; - } catch (ex) { - return { - ...(await prev), - }; - } - }, Promise.resolve({})); - } - } - async initializeExchange( - tokenAmount: number, - tezAmount: number, - approve: boolean = true - ): Promise { - if (approve) await this.approveToken(tokenAmount, this.contract.address); - const operation = await this.contract.methods - .use("initializeExchange", tokenAmount) - .send({ amount: tezAmount / tezPrecision }); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async tezToTokenPayment( - minTokens: number, - tezAmount: number, - receiver: string - ): Promise { - const operation = await this.contract.methods - .use("tezToTokenPayment", minTokens, receiver) - .send({ amount: tezAmount / tezPrecision }); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async tezToTokenSwap( - minTokens: number, - tezAmount: number - ): Promise { - return await this.tezToTokenPayment( - minTokens, - tezAmount, - await tezos.signer.publicKeyHash() - ); - } - - async tokenToTezPayment( - tokenAmount: number, - minTezOut: number, - receiver: string - ): Promise { - const tokensOperation = await this.approveToken( - tokenAmount, - this.contract.address - ); - const operation = await this.contract.methods - .use("tokenToTezPayment", tokenAmount, minTezOut, receiver) - .send(); - await confirmOperation(tezos, operation.hash); - return [tokensOperation, operation]; - } - - async tokenToTezSwap( - tokenAmount: number, - minTezOut: number - ): Promise { - return await this.tokenToTezPayment( - tokenAmount, - minTezOut, - await tezos.signer.publicKeyHash() - ); - } - - async tokenToTokenPayment( - tokenAmount: number, - minTokensOut: number, - secondDexContract: ContractAbstraction, - middleTezAmount: number, - receiver: string - ): Promise { - await this.updateStorage(); - let token = await tezos.contract.at(this.storage.token_address); - const minTez = Math.floor(middleTezAmount * 0.9); - const batch = tezos - .batch([]) - .withTransfer( - token.methods - .update_operators([ - { - add_operator: { - owner: await tezos.signer.publicKeyHash(), - operator: this.contract.address, - token_id: defaultTokenId, - }, - }, - ]) - .toTransferParams() - ) - .withTransfer( - this.contract.methods - .use( - "tokenToTezPayment", - tokenAmount, - middleTezAmount ? middleTezAmount : 1, - await tezos.signer.publicKeyHash() - ) - .toTransferParams() - ) - .withTransfer( - secondDexContract.methods - .use("tezToTokenPayment", minTokensOut, receiver) - .toTransferParams({ amount: middleTezAmount / tezPrecision }) - ); - const operation = await batch.send(); - await confirmOperation(tezos, operation.hash); - return [operation]; - } - - async tokenToTokenSwap( - tokenAmount: number, - minTokensOut: number, - secondDexContract: ContractAbstraction, - middleTezAmount: number - ): Promise { - return await this.tokenToTokenPayment( - tokenAmount, - minTokensOut, - secondDexContract, - middleTezAmount, - await tezos.signer.publicKeyHash() - ); - } - - async investLiquidity( - tokenAmount: number, - tezAmount: number, - minShares: number - ): Promise { - await this.approveToken(tokenAmount, this.contract.address); - const operation = await this.contract.methods - .use("investLiquidity", tokenAmount) - .send({ amount: tezAmount / tezPrecision }); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async divestLiquidity( - tokenAmount: number, - tezAmount: number, - sharesBurned: number - ): Promise { - await this.approveToken(tokenAmount, this.contract.address); - const operation = await this.contract.methods - .use("divestLiquidity", tezAmount, tokenAmount, sharesBurned) - .send(); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async vote( - voter: string, - delegate: string, - value: number - ): Promise { - const operation = await this.contract.methods - .use("vote", delegate, value, voter) - .send(); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async veto(voter: string, value: number): Promise { - const operation = await this.contract.methods - .use("veto", value, voter) - .send(); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async withdrawProfit(receiver: string): Promise { - const operation = await this.contract.methods - .use("withdrawProfit", receiver) - .send(); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async sendReward(amount: number): Promise { - const operation = await tezos.contract.transfer({ - to: this.contract.address, - amount: amount, - mutez: true, - }); - await confirmOperation(tezos, operation.hash); - return operation; - } - - async approveToken( - tokenAmount: number, - address: string - ): Promise { - await this.updateStorage(); - let tokenAddress = this.storage.token_address; - let token = await tezos.contract.at(tokenAddress); - let operation = await token.methods - .update_operators([ - { - [tokenAmount ? "add_operator" : "remove_operator"]: { - owner: await tezos.signer.publicKeyHash(), - operator: address, - token_id: defaultTokenId, - }, - }, - ]) - .send(); - await confirmOperation(tezos, operation.hash); - return operation; - } -} diff --git a/test/helpers/factory.ts b/test/helpers/factory.ts deleted file mode 100644 index 6d41be89..00000000 --- a/test/helpers/factory.ts +++ /dev/null @@ -1,208 +0,0 @@ -import { ContractAbstraction, ContractProvider } from "@taquito/taquito"; -import { TransactionOperation } from "@taquito/taquito/dist/types/operations/transaction-operation"; -import { FactoryStorage } from "./types"; -import { execSync } from "child_process"; -import { getLigo, prepareProviderOptions, tezPrecision } from "./utils"; -import { defaultTokenId } from "./tokenFA2"; -import { confirmOperation } from "./confirmation"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; -export class Factory { - public contract: ContractAbstraction; - public storage: FactoryStorage; - - constructor(contract: ContractAbstraction) { - this.contract = contract; - } - - static async init(factoryAddress: string): Promise { - return new Factory(await tezos.contract.at(factoryAddress)); - } - - async updateProvider(accountName: string): Promise { - let config = await prepareProviderOptions(accountName); - tezos.setProvider(config); - } - - wrapStorageArgument(map: string, key: any): any { - if (map === "token_to_exchange" && standard === "FA2") { - return [key, defaultTokenId]; - } - return key; - } - - async convertTokensList(bigMap: any, counter: number): Promise { - let list = []; - for (let i = 0; i < counter; i++) { - list.push(await bigMap.get(i.toString())); - } - if (standard === "FA2") { - return list.map((value) => { - return value["0"]; - }); - } - return list; - } - - async updateStorage( - maps: { - token_to_exchange?: string[]; - dex_lambdas?: number[]; - token_lambdas?: number[]; - } = {} - ): Promise { - const storage: any = await this.contract.storage(); - this.storage = { - baker_validator: storage.baker_validator, - token_list: await this.convertTokensList( - storage.token_list, - storage.counter - ), - token_to_exchange: {}, - dex_lambdas: {}, - token_lambdas: {}, - }; - for (let key in maps) { - this.storage[key] = await maps[key].reduce(async (prev, current) => { - try { - return { - ...(await prev), - [current]: await storage[key].get( - this.wrapStorageArgument(key, current) - ), - }; - } catch (ex) { - return { - ...(await prev), - }; - } - }, Promise.resolve({})); - } - } - - async launchExchange( - tokenAddress: string, - tokenAmount: number, - tezAmount: number, - approve: boolean = true - ): Promise { - return standard === "FA2" - ? await this.launchExchangeFA2( - tokenAddress, - tokenAmount, - tezAmount, - approve - ) - : await this.launchExchangeFA12( - tokenAddress, - tokenAmount, - tezAmount, - approve - ); - } - - async launchExchangeFA2( - tokenAddress: string, - tokenAmount: number, - tezAmount: number, - approve: boolean = true - ): Promise { - if (approve) - await this.approveToken(tokenAddress, tokenAmount, this.contract.address); - const operation = await this.contract.methods - .launchExchange(tokenAddress, defaultTokenId, tokenAmount) - .send({ amount: tezAmount / tezPrecision }); - await confirmOperation(tezos, operation.hash); - await this.updateStorage({ token_to_exchange: [tokenAddress] }); - return operation; - } - - async launchExchangeFA12( - tokenAddress: string, - tokenAmount: number, - tezAmount: number, - approve: boolean = true - ): Promise { - if (approve) - await this.approveToken(tokenAddress, tokenAmount, this.contract.address); - const operation = await this.contract.methods - .launchExchange(tokenAddress, tokenAmount) - .send({ amount: tezAmount / tezPrecision }); - await confirmOperation(tezos, operation.hash); - await this.updateStorage({ token_to_exchange: [tokenAddress] }); - return operation; - } - - async setDexFunction(index: number, lambdaName: string): Promise { - let ligo = getLigo(true); - const stdout = execSync( - `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TestFactory${standard}.ligo main 'SetDexFunction(record index =${index}n; func = ${lambdaName}; end)'`, - { maxBuffer: 1024 * 500 } - ); - const operation = await tezos.contract.transfer({ - to: this.contract.address, - amount: 0, - parameter: { - entrypoint: "setDexFunction", - value: JSON.parse(stdout.toString()).args[0].args[0], - }, - }); - await confirmOperation(tezos, operation.hash); - } - - async setTokenFunction(index: number, lambdaName: string): Promise { - let ligo = getLigo(true); - const stdout = execSync( - `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TestFactory${standard}.ligo main 'SetTokenFunction(record index =${index}n; func = ${lambdaName}; end)'`, - { maxBuffer: 1024 * 500 } - ); - const operation = await tezos.contract.transfer({ - to: this.contract.address, - amount: 0, - parameter: { - entrypoint: "setTokenFunction", - value: JSON.parse(stdout.toString()).args[0], - }, - }); - await confirmOperation(tezos, operation.hash); - } - - async approveToken( - tokenAddress: string, - tokenAmount: number, - address: string - ): Promise { - return standard === "FA2" - ? await this.approveTokenFA2(tokenAddress, tokenAmount, address) - : await this.approveTokenFA12(tokenAddress, tokenAmount, address); - } - - async approveTokenFA2( - tokenAddress: string, - tokenAmount: number, - address: string - ): Promise { - let token = await tezos.contract.at(tokenAddress); - let operation = await token.methods - .update_operators([ - { - [tokenAmount ? "add_operator" : "remove_operator"]: { - owner: await tezos.signer.publicKeyHash(), - operator: address, - token_id: defaultTokenId, - }, - }, - ]) - .send(); - await confirmOperation(tezos, operation.hash); - } - - async approveTokenFA12( - tokenAddress: string, - tokenAmount: number, - address: string - ): Promise { - let token = await tezos.contract.at(tokenAddress); - let operation = await token.methods.approve(address, tokenAmount).send(); - await confirmOperation(tezos, operation.hash); - } -} diff --git a/test/storage/Factory.ts b/test/storage/Factory.ts deleted file mode 100644 index 694a09d2..00000000 --- a/test/storage/Factory.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { MichelsonMap } from "@taquito/michelson-encoder"; - -export default { - counter: "0", - baker_validator: "tz1ZZZZZZZZZZZZZZZZZZZZZZZZZZZZNkiRg", - token_list: MichelsonMap.fromLiteral({}), - token_to_exchange: MichelsonMap.fromLiteral({}), - dex_lambdas: MichelsonMap.fromLiteral({}), - token_lambdas: MichelsonMap.fromLiteral({}), - voters: MichelsonMap.fromLiteral({}), - vetos: MichelsonMap.fromLiteral({}), - votes: MichelsonMap.fromLiteral({}), - user_rewards: MichelsonMap.fromLiteral({}), - metadata: MichelsonMap.fromLiteral({}), - ledger: MichelsonMap.fromLiteral({}), -}; diff --git a/test/storage/Functions.ts b/test/storage/Functions.ts deleted file mode 100644 index 931fa805..00000000 --- a/test/storage/Functions.ts +++ /dev/null @@ -1,80 +0,0 @@ -export let dexFunctions = [ - { - index: 0, - name: "initialize_exchange", - }, - { - index: 1, - name: "tez_to_token", - }, - { - index: 2, - name: "token_to_tez", - }, - { - index: 3, - name: "withdraw_profit", - }, - { - index: 4, - name: "invest_liquidity", - }, - { - index: 5, - name: "divest_liquidity", - }, - { - index: 6, - name: "vote", - }, - { - index: 7, - name: "veto", - }, - { - index: 8, - name: "receive_reward", - }, -]; - -let tokenFunctionsFA12 = [ - { - index: 0, - name: "transfer", - }, - { - index: 1, - name: "approve", - }, - { - index: 2, - name: "get_balance", - }, - { - index: 3, - name: "get_allowance_to_contract", - }, - { - index: 4, - name: "get_total_supply", - }, -]; - -let tokenFunctionsFA2 = [ - { - index: 0, - name: "transfer", - }, - { - index: 1, - name: "update_operators", - }, - { - index: 2, - name: "get_balance_of", - }, -]; -export let tokenFunctions = { - FA12: tokenFunctionsFA12, - FA2: tokenFunctionsFA2, -}; From a4f0e806c2b91cc9f46e9205940a6d3d529bdc77 Mon Sep 17 00:00:00 2001 From: KStasi Date: Wed, 15 Sep 2021 15:10:13 +0200 Subject: [PATCH 12/22] update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ac9faa9f..42e4eb22 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "migrate-granadanet": "yarn clean && truffle migrate --network granadanet", "migrate-granadanet-reset": "yarn clean && truffle migrate --network granadanet --reset", "compile": "yarn clean && truffle compile", - "start-sandbox": "docker run --rm --name my-sandbox -e flextesa_node_cors_origin='*' -e block_time=1 -p 8732:20000 --detach tqtezos/flextesa:20210602 granabox start --add-bootstrap-account eve,edpku9qEgcyfNNDK6EpMvu5SqXDqWRLuxdMxdyH12ivTUuB1KXfGP4,tz1MnmtP4uAcgMpeZN6JtyziXeFqqwQG6yn6,unencrypted:edsk3Sb16jcx9KrgMDsbZDmKnuN11v4AbTtPBgBSBTqYftd8Cq3i1e@1000000000000 --no-daemons-for eve", + "start-sandbox": "docker run --rm --name my-sandbox -e flextesa_node_cors_origin='*' -e block_time=1 --detach -p 8732:20000 tqtezos/flextesa:20210602 granabox start --add-bootstrap-account eve,edpku9qEgcyfNNDK6EpMvu5SqXDqWRLuxdMxdyH12ivTUuB1KXfGP4,tz1MnmtP4uAcgMpeZN6JtyziXeFqqwQG6yn6,unencrypted:edsk3Sb16jcx9KrgMDsbZDmKnuN11v4AbTtPBgBSBTqYftd8Cq3i1e@1000000000000 --no-daemons-for eve", "test": "yarn clean && yarn compile && truffle test ", "test:quick": "truffle test", "postinstall": "patch-package" From eb3b69c6c04dc4a0ee8e986fcf69a0ac0a21cbe0 Mon Sep 17 00:00:00 2001 From: KStasi Date: Wed, 15 Sep 2021 16:01:40 +0200 Subject: [PATCH 13/22] fixes & update tests --- contracts/partials/TTMethodDex.ligo | 67 +++++++++++------------------ test/SellToken.spec.ts | 9 ++-- 2 files changed, 28 insertions(+), 48 deletions(-) diff --git a/contracts/partials/TTMethodDex.ligo b/contracts/partials/TTMethodDex.ligo index dad388b3..4742b0b0 100644 --- a/contracts/partials/TTMethodDex.ligo +++ b/contracts/partials/TTMethodDex.ligo @@ -415,26 +415,6 @@ function ensured_initialize_exchange( (* update storage *) s.pairs[token_id] := pair; s.tokens[token_id] := params.pair; - - (* prepare operations to get change if any *) - // operations := - // typed_transfer( - // Tezos.sender, - // this, - // params.token_a_in, - // params.pair.token_a_id, - // params.pair.token_a_address, - // params.pair.token_a_type - // ) # operations; - // operations := - // typed_transfer( - // Tezos.sender, - // this, - // params.token_b_in, - // params.pair.token_b_id, - // params.pair.token_b_address, - // params.pair.token_b_type - // ) # operations; } | AddPair(n) -> skip | Swap(n) -> skip @@ -658,7 +638,7 @@ function token_to_token_route( record [ swaps=params.swaps; min_amount_out=params.min_amount_out; - receiver=Tezos.sender; + receiver=params.receiver; ], 0mutez, get_ensured_swap_entrypoint(this) @@ -694,7 +674,7 @@ function token_to_token_route( record [ swaps=params.swaps; min_amount_out=params.min_amount_out; - receiver=Tezos.sender; + receiver=params.receiver; ], 0mutez, get_ensured_swap_entrypoint(this) @@ -962,26 +942,29 @@ function ensured_invest( pair.total_supply := pair.total_supply + params.shares; s.pairs[token_id] := pair; - (* prepare operations to get initial liquidity *) - (* TODO: send change if any *) - // operations := - // typed_transfer( - // Tezos.sender, - // this, - // tokens_a_required, - // params.pair.token_a_id, - // params.pair.token_a_address, - // params.pair.token_a_type - // ) # operations; - // operations := - // typed_transfer( - // Tezos.sender, - // this, - // tokens_b_required, - // params.pair.token_b_id, - // params.pair.token_b_address, - // params.pair.token_b_type - // ) # operations; + (* send cahnge *) + if tokens_a_required < token_a_in then + operations := + typed_transfer( + this, + params.receiver, + abs(tokens_a_required - token_a_in), + params.pair.token_a_id, + params.pair.token_a_address, + params.pair.token_a_type + ) # operations + else skip; + if tokens_b_required < token_b_in then + operations := + typed_transfer( + this, + params.receiver, + abs(tokens_b_required - token_b_in), + params.pair.token_b_id, + params.pair.token_b_address, + params.pair.token_b_type + ) # operations + else skip; } | EnsuredAddPair(n) -> skip | EnsuredSwap(n) -> skip diff --git a/test/SellToken.spec.ts b/test/SellToken.spec.ts index a5edaccd..c174e5dc 100644 --- a/test/SellToken.spec.ts +++ b/test/SellToken.spec.ts @@ -3,6 +3,7 @@ import { strictEqual, ok, notStrictEqual, rejects } from "assert"; import BigNumber from "bignumber.js"; import accounts from "./accounts/accounts"; import { defaultAccountInfo } from "./constants"; +import { isConstructorDeclaration } from "typescript"; const standard = process.env.EXCHANGE_TOKEN_STANDARD; contract("SellToken()", function () { @@ -131,6 +132,8 @@ contract("SellToken()", function () { aliceAddress ), (err: any) => { + console.log(err.message); + console.log(errorMsg); ok(err.message == errorMsg, "Error message mismatch"); return true; } @@ -151,12 +154,6 @@ contract("SellToken()", function () { 300, "Dex/high-out" ); - tokenToTokenFailCase( - "revert in case of 10000% of reserves to be swapped", - 100000000, - 1, - "Dex/high-out" - ); tokenToTokenFailCase( "revert in case of 1% of reserves to be swapped", 1, From 39bdac96a885010a9e309f1827f074bfeb9b0b59 Mon Sep 17 00:00:00 2001 From: KStasi Date: Wed, 15 Sep 2021 16:07:05 +0200 Subject: [PATCH 14/22] update ci --- ci/flextesa.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/flextesa.sh b/ci/flextesa.sh index 8796e8d1..c3ea18a2 100755 --- a/ci/flextesa.sh +++ b/ci/flextesa.sh @@ -1,3 +1,3 @@ #!/bin/sh yarn start-sandbox & -sleep 10 +sleep 20 From d39c61c6c5a67d78bed973ec4ca5e64d7ab419f0 Mon Sep 17 00:00:00 2001 From: KStasi Date: Wed, 15 Sep 2021 16:24:53 +0200 Subject: [PATCH 15/22] fix errors --- test/SellToken.spec.ts | 2 -- test/SellTokenWithRoute.spec.ts | 6 ------ test/helpers/ttContext.ts | 3 --- 3 files changed, 11 deletions(-) diff --git a/test/SellToken.spec.ts b/test/SellToken.spec.ts index c174e5dc..ceb3225a 100644 --- a/test/SellToken.spec.ts +++ b/test/SellToken.spec.ts @@ -132,8 +132,6 @@ contract("SellToken()", function () { aliceAddress ), (err: any) => { - console.log(err.message); - console.log(errorMsg); ok(err.message == errorMsg, "Error message mismatch"); return true; } diff --git a/test/SellTokenWithRoute.spec.ts b/test/SellTokenWithRoute.spec.ts index a49388ee..394efc3e 100644 --- a/test/SellTokenWithRoute.spec.ts +++ b/test/SellTokenWithRoute.spec.ts @@ -272,12 +272,6 @@ contract("SellTokenWithRoute()", function () { 300, "Dex/high-out" ); - tokenToTokenFailCase( - "revert in case of 10000% of reserves to be swapped", - 100000000, - 1, - "Dex/high-out" - ); tokenToTokenFailCase( "revert in case of 1% of reserves to be swapped", 12, diff --git a/test/helpers/ttContext.ts b/test/helpers/ttContext.ts index 9820fe21..5d496016 100644 --- a/test/helpers/ttContext.ts +++ b/test/helpers/ttContext.ts @@ -95,7 +95,6 @@ export class TTContext { async setDexFunctions(): Promise { for (let dexFunction of dexFunctions) { - console.log(dexFunction); await this.dex.setDexFunction(dexFunction.index, dexFunction.name); } await this.dex.updateStorage({ @@ -117,7 +116,6 @@ export class TTContext { async setTokenDexFunctions(): Promise { for (let tokenFunction of tokenFunctions["FA2"]) { - console.log(tokenFunction); await this.dex.setTokenFunction(tokenFunction.index, tokenFunction.name); } await this.dex.updateStorage({ @@ -126,7 +124,6 @@ export class TTContext { } async setBalanceDexFunctions(): Promise { for (let balFunction of balFunctions) { - console.log(balFunction); await this.dex.setBalFunction(balFunction.index, balFunction.name); } await this.dex.updateStorage({ From f8282bac7e6800c3313db82798f0681ddc5dff26 Mon Sep 17 00:00:00 2001 From: KStasi Date: Thu, 16 Sep 2021 15:37:10 +0200 Subject: [PATCH 16/22] pretify code --- contracts/main/MetadataStorage.ligo | 36 ++++++++++++++------- contracts/main/TokenFA12.ligo | 24 +++++++------- contracts/main/TokenFA2.ligo | 24 +++++++------- contracts/partials/IMetadataStorage.ligo | 26 +++++++-------- contracts/partials/ITTDex.ligo | 18 +++++------ contracts/partials/IToken.ligo | 8 ++--- contracts/partials/ITokenFA2.ligo | 6 ++-- contracts/partials/TTDex.ligo | 40 ++++++++++++------------ contracts/partials/TTMethodDex.ligo | 30 +++++++++--------- contracts/partials/TTMethodFA2.ligo | 18 +++++------ contracts/partials/View.ligo | 6 ++-- 11 files changed, 124 insertions(+), 112 deletions(-) diff --git a/contracts/main/MetadataStorage.ligo b/contracts/main/MetadataStorage.ligo index 92e3ef5c..b59d6bc8 100644 --- a/contracts/main/MetadataStorage.ligo +++ b/contracts/main/MetadataStorage.ligo @@ -1,30 +1,42 @@ #include "../partials/IMetadataStorage.ligo" (* Add or remove the admin permissions for address; only called by one of the current owners *) -function update_owner (const params : update_owner_type; const s : storage) : return is +function update_owner( + const params : set_owner_type; + const s : storage_type) + : return_type is block { - if s.owners contains Tezos.sender then - skip + if s.owners contains Tezos.sender + then skip else failwith("MetadataStorage/permision-denied"); - if params.add then - s.owners := Set.add (params.owner, s.owners) - else - s.owners := Set.remove (params.owner, s.owners); + + if params.add + then s.owners := Set.add (params.owner, s.owners) + else s.owners := Set.remove (params.owner, s.owners); } with ((nil : list (operation)), s) (* Update the metadata for the token; only called by one of the current owners *) -function update_metadata (const new_metadata : metadata_type; const s : storage) : return is +function update_metadata( + const new_metadata : metadata_type; + const s : storage_type) + : return_type is block { - if s.owners contains Tezos.sender then - skip + if s.owners contains Tezos.sender + then skip else failwith("MetadataStorage/permision-denied"); s.metadata := new_metadata; } with ((nil : list (operation)), s) (* MetadataStorage - Contract to store and upgrade the shares token metadata *) -function main (const p : storage_action; const s : storage) : return is +function main( + const p : action_type; + const s : storage_type) + : return_type is case p of | Update_owners(params) -> update_owner(params, s) | Update_storage(new_metadata) -> update_metadata(new_metadata, s) - | Get_metadata(receiver) -> (list [transaction(s.metadata, 0tz, receiver)], s) + | Get_metadata(receiver) -> (list [ + transaction(s.metadata, 0tz, receiver) + ], + s) end diff --git a/contracts/main/TokenFA12.ligo b/contracts/main/TokenFA12.ligo index cb5a41b0..d4bde321 100644 --- a/contracts/main/TokenFA12.ligo +++ b/contracts/main/TokenFA12.ligo @@ -1,7 +1,7 @@ #include "../partials/IToken.ligo" (* Helper function to get account *) -function getAccount (const addr : address; const s : storage) : account is +function getAccount (const addr : address; const s : storage_type) : account is case s.ledger[addr] of None -> record [ balance = 0n; @@ -11,21 +11,21 @@ function getAccount (const addr : address; const s : storage) : account is end; (* Helper function to get allowance for an account *) -function getAllowance (const ownerAccount : account; const spender : address; const s : storage) : amt is +function getAllowance (const ownerAccount : account; const spender : address; const s : storage_type) : amt is case ownerAccount.allowances[spender] of Some (amt) -> amt | None -> 0n end; (* Transfer token to another account *) -function transfer (const from_ : address; const to_ : address; const value : amt; var s : storage) : return is +function transfer (const from_ : address; const to_ : address; const value : amt; var s : storage_type) : return_type is block { (* Sending to yourself? *) if from_ = to_ then failwith("InvalidSelfToSelfTransfer") else skip; - (* Retrieve sender account from storage *) + (* Retrieve sender account from storage_type *) const senderAccount : account = getAccount(from_, s); (* Balance check *) @@ -48,7 +48,7 @@ function transfer (const from_ : address; const to_ : address; const value : amt (* Update sender balance *) senderAccount.balance := abs(senderAccount.balance - value); - (* Update storage *) + (* Update storage_type *) s.ledger[from_] := senderAccount; (* Create or get destination account *) @@ -57,13 +57,13 @@ function transfer (const from_ : address; const to_ : address; const value : amt (* Update destination balance *) destAccount.balance := destAccount.balance + value; - (* Update storage *) + (* Update storage_type *) s.ledger[to_] := destAccount; } with (noOperations, s) (* Approve an amt to be spent by another address in the name of the sender *) -function approve (const spender : address; const value : amt; var s : storage) : return is +function approve (const spender : address; const value : amt; var s : storage_type) : return_type is block { if spender = Tezos.sender then failwith("InvalidSelfToSelfApproval") @@ -83,32 +83,32 @@ function approve (const spender : address; const value : amt; var s : storage) : (* Set spender allowance *) senderAccount.allowances[spender] := value; - (* Update storage *) + (* Update storage_type *) s.ledger[Tezos.sender] := senderAccount; } with (noOperations, s) (* View function that forwards the balance of source to a contract *) -function getBalance (const owner : address; const contr : contract(amt); var s : storage) : return is +function getBalance (const owner : address; const contr : contract(amt); var s : storage_type) : return_type is block { const ownerAccount : account = getAccount(owner, s); } with (list [transaction(ownerAccount.balance, 0tz, contr)], s) (* View function that forwards the allowance amt of spender in the name of tokenOwner to a contract *) -function getAllowances (const owner : address; const spender : address; const contr : contract(amt); var s : storage) : return is +function getAllowances (const owner : address; const spender : address; const contr : contract(amt); var s : storage_type) : return_type is block { const ownerAccount : account = getAccount(owner, s); const spenderAllowance : amt = getAllowance(ownerAccount, spender, s); } with (list [transaction(spenderAllowance, 0tz, contr)], s) (* View function that forwards the totalSupply to a contract *) -function getTotalSupply (const contr : contract(amt); var s : storage) : return is +function getTotalSupply (const contr : contract(amt); var s : storage_type) : return_type is block { skip } with (list [transaction(s.total_supply, 0tz, contr)], s) (* TokenFA1.2 - Mock FA1.2 token for tests *) -function main (const action : tokenAction; var s : storage) : return is +function main (const action : tokenAction; var s : storage_type) : return_type is block { skip } with case action of diff --git a/contracts/main/TokenFA2.ligo b/contracts/main/TokenFA2.ligo index cb702e30..fdc64da8 100644 --- a/contracts/main/TokenFA2.ligo +++ b/contracts/main/TokenFA2.ligo @@ -1,7 +1,7 @@ #include "../partials/ITokenFA2.ligo" (* Helper function to get account *) -function get_account (const addr : address; const s : storage) : account is +function get_account (const addr : address; const s : storage_type) : account is case s.ledger[addr] of None -> record [ balance = 0n; @@ -11,9 +11,9 @@ function get_account (const addr : address; const s : storage) : account is end; (* Perform transfers from one owner *) -function iterate_transfer (const s : storage; const user_trx_params : transfer_param) : storage is +function iterate_transfer (const s : storage_type; const user_trx_params : transfer_param) : storage_type is block { - (* Retrieve sender account from storage *) + (* Retrieve sender account from storage_type *) const sender_account : account = get_account(user_trx_params.from_, s); (* Check permissions *) @@ -22,7 +22,7 @@ function iterate_transfer (const s : storage; const user_trx_params : transfer_p else failwith("FA2_NOT_OPERATOR"); (* Perform single transfer *) - function make_transfer(const s : storage; const transfer : transfer_destination) : storage is + function make_transfer(const s : storage_type; const transfer : transfer_destination) : storage_type is block { (* Token id check *) if default_token_id =/= transfer.token_id then @@ -37,7 +37,7 @@ function iterate_transfer (const s : storage; const user_trx_params : transfer_p (* Update sender balance *) sender_account.balance := abs(sender_account.balance - transfer.amount); - (* Update storage *) + (* Update storage_type *) s.ledger[user_trx_params.from_] := sender_account; (* Create or get destination account *) @@ -46,13 +46,13 @@ function iterate_transfer (const s : storage; const user_trx_params : transfer_p (* Update destination balance *) dest_account.balance := dest_account.balance + transfer.amount; - (* Update storage *) + (* Update storage_type *) s.ledger[transfer.to_] := dest_account; } with s; } with (List.fold (make_transfer, user_trx_params.txs, s)) (* Perform single operator update *) -function iterate_update_operator (const s : storage; const params : update_operator_param) : storage is +function iterate_update_operator (const s : storage_type; const params : update_operator_param) : storage_type is block { case params of | Add_operator(param) -> { @@ -72,7 +72,7 @@ function iterate_update_operator (const s : storage; const params : update_opera (* Set operator *) sender_account.allowances := Set.add(param.operator, sender_account.allowances); - (* Update storage *) + (* Update storage_type *) s.ledger[param.owner] := sender_account; } | Remove_operator(param) -> { @@ -92,14 +92,14 @@ function iterate_update_operator (const s : storage; const params : update_opera (* Set operator *) sender_account.allowances := Set.remove(param.operator, sender_account.allowances); - (* Update storage *) + (* Update storage_type *) s.ledger[param.owner] := sender_account; } end } with s (* Perform balance look up *) -function get_balance_of (const balance_params : balance_params; const s : storage) : list(operation) is +function get_balance_of (const balance_params : balance_params; const s : storage_type) : list(operation) is block { (* Perform single balance lookup *) @@ -110,7 +110,7 @@ function get_balance_of (const balance_params : balance_params; const s : storag failwith("FA2_TOKEN_UNDEFINED") else skip; - (* Retrieve the asked account balance from storage *) + (* Retrieve the asked account balance from storage_type *) const sender_account : account = get_account(request.owner, s); (* Form the response *) @@ -125,7 +125,7 @@ function get_balance_of (const balance_params : balance_params; const s : storag } with list [transaction(accumulated_response, 0tz, balance_params.callback)] (* TokenFA2 - Mock FA2 token for tests *) -function main (const action : token_action; var s : storage) : return is +function main (const action : token_action; var s : storage_type) : return_type is block { skip } with case action of diff --git a/contracts/partials/IMetadataStorage.ligo b/contracts/partials/IMetadataStorage.ligo index c6e50327..ded46cfc 100644 --- a/contracts/partials/IMetadataStorage.ligo +++ b/contracts/partials/IMetadataStorage.ligo @@ -1,19 +1,19 @@ -(* contract storage *) -type update_owner_type is record [ - add : bool; (* whether add or remove account from owners *) - owner : address; (* account *) +(* contract storage_type *) +type set_owner_type is record [ + add : bool; (* whe/ther add or remove account from owners *) + owner : address; (* account *) ] -type metadata_type is big_map (string, bytes) +type metadata_type is big_map (string, bytes) -type storage is record [ - metadata : metadata_type; (* metadata accoding to TZIP-16 *) - owners : set(address); (* all owners *) +type storage_type is record [ + metadata : metadata_type; (* metadata accoding to TZIP-16 *) + owners : set(address); (* all owners *) ] -type return is list (operation) * storage +type return_type is list (operation) * storage_type (* Valid entry points *) -type storage_action is -| Update_owners of update_owner_type (* manage owner permissions *) -| Update_storage of metadata_type (* update storage *) -| Get_metadata of contract (metadata_type) (* send the storage data to the account *) \ No newline at end of file +type action_type is +| Update_owners of set_owner_type (* manage owner permissions *) +| Update_storage of metadata_type (* update storage_type *) +| Get_metadata of contract (metadata_type) (* send the storage_type data to the account *) \ No newline at end of file diff --git a/contracts/partials/ITTDex.ligo b/contracts/partials/ITTDex.ligo index 775db6d8..2b3873d2 100644 --- a/contracts/partials/ITTDex.ligo +++ b/contracts/partials/ITTDex.ligo @@ -51,7 +51,7 @@ type balance_info is record [ balance_b : option (nat); ] -(* record for the dex storage *) +(* record for the dex storage_type *) type dex_storage is record [ entered : bool; (* reentrancy protection *) tmp : balance_info; @@ -84,7 +84,7 @@ type swap_data is record [ ] type internal_swap_type is record [ - s : dex_storage; (* storage state *) + s : dex_storage; (* storage_type state *) amount_in : nat; (* amount of tokens to be sold *) token_address_in : address; (* address of sold token *) token_id_in : nat; (* identifier of sold token *) @@ -185,10 +185,10 @@ type token_action is | IBalance_of of balance_params (* returns the balance of the account *) | IUpdate_operators of update_operator_params (* updates the token operators *) -type return is list (operation) * dex_storage -type dex_func is (dex_action * dex_storage * address) -> return -type token_func is (token_action * dex_storage * address) -> return -type bal_func is (balance_action * dex_storage * address) -> return +type return_type is list (operation) * dex_storage +type dex_func is (dex_action * dex_storage * address) -> return_type +type token_func is (token_action * dex_storage * address) -> return_type +type bal_func is (balance_action * dex_storage * address) -> return_type type set_token_function_params is record [ func : token_func; (* code of the function *) @@ -220,10 +220,10 @@ type full_action is | SetTokenFunction of set_token_function_params (* sets the FA function, is used before the whole system is launched *) | SetBalanceFunction of set_bal_function_params (* sets the FA function, is used before the whole system is launched *) -(* real dex storage *) +(* real dex storage_type *) type full_dex_storage is record - storage : dex_storage; (* real dex storage *) - metadata : big_map(string, bytes); (* metadata storage according to TZIP-016 *) + storage_type : dex_storage; (* real dex storage_type *) + metadata : big_map(string, bytes); (* metadata storage_type according to TZIP-016 *) dex_lambdas : big_map(nat, dex_func); (* map with exchange-related functions code *) token_lambdas : big_map(nat, token_func); (* map with token-related functions code *) balance_lambdas : big_map(nat, bal_func); (* map with token-related functions code *) diff --git a/contracts/partials/IToken.ligo b/contracts/partials/IToken.ligo index 3fd5f3ab..c5dcf83b 100644 --- a/contracts/partials/IToken.ligo +++ b/contracts/partials/IToken.ligo @@ -10,15 +10,15 @@ type account is allowances : map (trusted, amt); ] -(* contract storage *) -type storage is +(* contract storage_type *) +type storage_type is record [ total_supply : amt; ledger : big_map (address, account); ] -(* define return for readability *) -type return is list (operation) * storage +(* define return_type for readability *) +type return_type is list (operation) * storage_type (* define noop for readability *) const noOperations : list (operation) = nil; diff --git a/contracts/partials/ITokenFA2.ligo b/contracts/partials/ITokenFA2.ligo index 4fa59602..6f578f72 100644 --- a/contracts/partials/ITokenFA2.ligo +++ b/contracts/partials/ITokenFA2.ligo @@ -13,8 +13,8 @@ type token_metadata_info is ] const default_token_id : token_id = 0n; -(* contract storage *) -type storage is +(* contract storage_type *) +type storage_type is record [ total_supply : nat; ledger : big_map (address, account); @@ -22,7 +22,7 @@ type storage is metadata : big_map(string, bytes); ] -type return is list (operation) * storage +type return_type is list (operation) * storage_type type transfer_destination is [@layout:comb] diff --git a/contracts/partials/TTDex.ligo b/contracts/partials/TTDex.ligo index eca70fc5..04c1fe64 100644 --- a/contracts/partials/TTDex.ligo +++ b/contracts/partials/TTDex.ligo @@ -4,16 +4,16 @@ const idx : nat; const s : full_dex_storage) : full_return is block { - const res : return = case s.balance_lambdas[idx] of - Some(f) -> f(p, s.storage, this) - | None -> (failwith("Dex/function-not-set") : return) + const res : return_type = case s.balance_lambdas[idx] of + Some(f) -> f(p, s.storage_type, this) + | None -> (failwith("Dex/function-not-set") : return_type) end; - s.storage := res.1; + s.storage_type := res.1; } with (res.0, s) (* Route exchange-specific action -Due to the fabulous storage, gas and operation size limits +Due to the fabulous storage_type, gas and operation size limits the only way to have all the nessary functions is to store them in big_map and dispatch the exact function code before the execution. @@ -36,11 +36,11 @@ block { | EnsuredSwap(n) -> 5n | EnsuredInvest(n) -> 6n end; - const res : return = case s.dex_lambdas[idx] of - Some(f) -> f(p, s.storage, this) - | None -> (failwith("Dex/function-not-set") : return) + const res : return_type = case s.dex_lambdas[idx] of + Some(f) -> f(p, s.storage_type, this) + | None -> (failwith("Dex/function-not-set") : return_type) end; - s.storage := res.1; + s.storage_type := res.1; if idx > 2n then res.0 := Tezos.transaction( unit, @@ -51,7 +51,7 @@ block { (* Route token-specific action -Due to the fabulous storage, gas and operation size limits +Due to the fabulous storage_type, gas and operation size limits the only way to have all the nessary functions is to store them in big_map and dispatch the exact function code before the execution. @@ -66,22 +66,22 @@ based on the provided index. const idx : nat; const s : full_dex_storage) : full_return is block { - const res : return = case s.token_lambdas[idx] of - Some(f) -> f(p, s.storage, this) - | None -> (failwith("Dex/function-not-set") : return) + const res : return_type = case s.token_lambdas[idx] of + Some(f) -> f(p, s.storage_type, this) + | None -> (failwith("Dex/function-not-set") : return_type) end; - s.storage := res.1; + s.storage_type := res.1; } with (res.0, s) [@inline] function close (const s : full_dex_storage) : full_dex_storage is block { - if not s.storage.entered then + if not s.storage_type.entered then failwith("Dex/not-entered") else skip; if Tezos.sender =/= Tezos.self_address then failwith("Dex/not-self") else skip; - s.storage.entered := False; + s.storage_type.entered := False; } with s (* Return the reserves to the contracts. *) @@ -89,7 +89,7 @@ block { const params : get_reserves_params; const s : full_dex_storage) : full_return is block { - const pair : pair_info = case s.storage.pairs[params.pair_id] of + const pair : pair_info = case s.storage_type.pairs[params.pair_id] of None -> record [ token_a_pool = 0n; token_b_pool = 0n; @@ -105,7 +105,7 @@ block { params.receiver) ], s) -(* Set the dex function code to factory storage *) +(* Set the dex function code to factory storage_type *) [@inline] function set_dex_function( const idx : nat; const f : dex_func; @@ -117,7 +117,7 @@ block { end; } with s -(* Set the token function code to factory storage *) +(* Set the token function code to factory storage_type *) [@inline] function set_token_function( const idx : nat; const f : token_func; @@ -129,7 +129,7 @@ block { end; } with s -(* Set the token function code to factory storage *) +(* Set the token function code to factory storage_type *) [@inline] function set_balance_function( const idx : nat; const f : bal_func; diff --git a/contracts/partials/TTMethodDex.ligo b/contracts/partials/TTMethodDex.ligo index 4742b0b0..f76a4dc9 100644 --- a/contracts/partials/TTMethodDex.ligo +++ b/contracts/partials/TTMethodDex.ligo @@ -343,7 +343,7 @@ function check_token_id( function ensured_initialize_exchange( const p : dex_action; const s : dex_storage; - const this: address) : return is + const this: address) : return_type is block { var operations: list(operation) := list[]; case p of @@ -412,7 +412,7 @@ function ensured_initialize_exchange( ]; pair.total_supply := init_shares; - (* update storage *) + (* update storage_type *) s.pairs[token_id] := pair; s.tokens[token_id] := params.pair; } @@ -429,7 +429,7 @@ function ensured_initialize_exchange( function initialize_exchange( const p : dex_action; const s : dex_storage; - const this: address) : return is + const this: address) : return_type is block { var operations: list(operation) := list[]; case p of @@ -557,7 +557,7 @@ function internal_token_to_token_swap( tmp.token_address_in := swap.to_.token; tmp.token_id_in := swap.to_.id; - (* update storage *) + (* update storage_type *) const updated_pair : pair_info = form_pools( swap.from_.pool, swap.to_.pool, @@ -579,7 +579,7 @@ note: tokens should be approved before the operation *) function token_to_token_route( const p : dex_action; const s : dex_storage; - const this : address) : return is + const this : address) : return_type is block { var operations: list(operation) := list[]; case p of @@ -696,7 +696,7 @@ note: tokens should be approved before the operation *) function ensured_route( const p : dex_action; const s : dex_storage; - const this : address) : return is + const this : address) : return_type is block { var operations: list(operation) := list[]; case p of @@ -754,7 +754,7 @@ function ensured_route( if tmp.amount_in < params.min_amount_out then failwith ("Dex/wrong-min-out") else skip; - (* update storage*) + (* update storage_type*) s := tmp.s; (* add token transfer to user's account to operations *) @@ -777,7 +777,7 @@ note: tokens should be approved before the operation *) function invest_liquidity( const p : dex_action; const s : dex_storage; - const this: address) : return is + const this: address) : return_type is block { var operations: list(operation) := list[]; case p of @@ -862,7 +862,7 @@ note: tokens should be approved before the operation *) function ensured_invest( const p : dex_action; const s : dex_storage; - const this: address) : return is + const this: address) : return_type is block { var operations: list(operation) := list[]; case p of @@ -977,7 +977,7 @@ function ensured_invest( function divest_liquidity( const p : dex_action; const s : dex_storage; - const this: address) : return is + const this: address) : return_type is block { var operations: list(operation) := list[]; case p of @@ -1045,7 +1045,7 @@ function divest_liquidity( pair.token_a_pool := abs(pair.token_a_pool - token_a_divested); pair.token_b_pool := abs(pair.token_b_pool - token_b_divested); - (* update storage *) + (* update storage_type *) s.pairs[token_id] := pair; (* prepare operations with tokens to user *) @@ -1075,7 +1075,7 @@ function divest_liquidity( function update_balance_fa_12_a( const p : balance_action; const s : dex_storage; - const this: address) : return is + const this: address) : return_type is block { var operations: list(operation) := list[]; case p of @@ -1098,7 +1098,7 @@ function update_balance_fa_12_a( function update_balance_fa_12_b( const p : balance_action; const s : dex_storage; - const this: address) : return is + const this: address) : return_type is block { var operations: list(operation) := list[]; case p of @@ -1121,7 +1121,7 @@ function update_balance_fa_12_b( function update_balance_fa_2_a( const p : balance_action; const s : dex_storage; - const this: address) : return is + const this: address) : return_type is block { var operations: list(operation) := list[]; case p of @@ -1154,7 +1154,7 @@ function update_balance_fa_2_a( function update_balance_fa_2_b( const p : balance_action; const s : dex_storage; - const this: address) : return is + const this: address) : return_type is block { var operations: list(operation) := list[]; case p of diff --git a/contracts/partials/TTMethodFA2.ligo b/contracts/partials/TTMethodFA2.ligo index f497f600..8b5caff1 100644 --- a/contracts/partials/TTMethodFA2.ligo +++ b/contracts/partials/TTMethodFA2.ligo @@ -8,7 +8,7 @@ function get_allowance (const owner_account : account_info; const spender : addr (* Perform single transfer *) function make_transfer(const s : dex_storage; const transfer : transfer_destination) : dex_storage is block { - (* Retrieve sender account from storage *) + (* Retrieve sender account from storage_type *) const user_key : (address * nat) = (user_trx_params.from_, transfer.token_id); const sender_account : account_info = get_account(user_key, s); @@ -25,7 +25,7 @@ function get_allowance (const owner_account : account_info; const spender : addr (* Update sender balance *) sender_account.balance := abs(sender_account.balance - transfer.amount); - (* Update storage *) + (* Update storage_type *) s.ledger[user_key] := sender_account; (* Create or get destination account *) @@ -34,7 +34,7 @@ function get_allowance (const owner_account : account_info; const spender : addr (* Update destination balance *) dest_account.balance := dest_account.balance + transfer.amount; - (* Update storage *) + (* Update storage_type *) s.ledger[(transfer.to_, transfer.token_id)] := dest_account; } with s; } with (List.fold (make_transfer, user_trx_params.txs, s)) @@ -55,7 +55,7 @@ function iterate_update_operator (const s : dex_storage; const params : update_o (* Set operator *) sender_account.allowances := Set.add(param.operator, sender_account.allowances); - (* Update storage *) + (* Update storage_type *) s.ledger[(param.owner, param.token_id)] := sender_account; } | Remove_operator(param) -> { @@ -70,14 +70,14 @@ function iterate_update_operator (const s : dex_storage; const params : update_o (* Set operator *) sender_account.allowances := Set.remove(param.operator, sender_account.allowances); - (* Update storage *) + (* Update storage_type *) s.ledger[(param.owner, param.token_id)] := sender_account; } end } with s -function transfer (const p : token_action; var s : dex_storage; const this : address) : return is +function transfer (const p : token_action; var s : dex_storage; const this : address) : return_type is block { var operations: list(operation) := list[]; case p of @@ -89,7 +89,7 @@ function transfer (const p : token_action; var s : dex_storage; const this : add end } with (operations, s) -function get_balance_of (const p : token_action; const s : dex_storage; const this : address) : return is +function get_balance_of (const p : token_action; const s : dex_storage; const this : address) : return_type is block { var operations: list(operation) := list[]; case p of @@ -98,7 +98,7 @@ function get_balance_of (const p : token_action; const s : dex_storage; const th (* Perform single balance lookup *) function look_up_balance(const l: list (balance_of_response); const request : balance_of_request) : list (balance_of_response) is block { - (* Retrieve the asked account balance from storage *) + (* Retrieve the asked account balance from storage_type *) const sender_account : account_info = get_account((request.owner, request.token_id), s); (* Form the response *) @@ -116,7 +116,7 @@ function get_balance_of (const p : token_action; const s : dex_storage; const th end } with (operations, s) -function update_operators (const p : token_action; const s : dex_storage; const this : address) : return is +function update_operators (const p : token_action; const s : dex_storage; const this : address) : return_type is block { var operations: list(operation) := list[]; case p of diff --git a/contracts/partials/View.ligo b/contracts/partials/View.ligo index 4084b1c1..0bde27c8 100644 --- a/contracts/partials/View.ligo +++ b/contracts/partials/View.ligo @@ -8,7 +8,7 @@ type token_metadata_info is ] type func_type is nat -> token_metadata_info -type storage is big_map(nat, func_type) +type storage_type is big_map(nat, func_type) function get_metadata (const token_id : nat) : token_metadata_info is record [ @@ -23,8 +23,8 @@ function get_metadata (const token_id : nat) : token_metadata_info is ] ] -function main (const f : func_type ; const s : storage) : - (list(operation) * storage) is +function main (const f : func_type ; const s : storage_type) : + (list(operation) * storage_type) is block { s[0n] := f; } with ((nil : list(operation)), s) From ae2f8a5023e562cf8b34af85620bacc4e0e4840b Mon Sep 17 00:00:00 2001 From: KStasi Date: Thu, 16 Sep 2021 16:46:27 +0200 Subject: [PATCH 17/22] refactoring --- .env | 2 +- .github/workflows/master.yml | 2 +- README.md | 4 +- contracts/main/TTDex.ligo | 31 ++- contracts/main/TokenFA2.ligo | 8 +- contracts/partials/Dex.ligo | 165 ++++++++++++ contracts/partials/IDex.ligo | 215 ++++++++++++++++ contracts/partials/IMetadataStorage.ligo | 2 +- contracts/partials/ITTDex.ligo | 235 ------------------ contracts/partials/IToken.ligo | 22 +- contracts/partials/ITokenFA2.ligo | 16 +- .../{TTMethodDex.ligo => MethodDex.ligo} | 152 +++++------ .../{TTMethodFA2.ligo => MethodFA2.ligo} | 20 +- contracts/partials/TTDex.ligo | 142 ----------- contracts/partials/TypesFA2.ligo | 2 +- migrations/2_deploy_token_to_token_dex.js | 16 +- patches/truffle+5.5.0-tezos.4.patch | 6 +- test/helpers/ttContext.ts | 6 +- test/helpers/ttdexFA2.ts | 12 +- truffle.d.ts | 2 +- 20 files changed, 537 insertions(+), 523 deletions(-) create mode 100644 contracts/partials/Dex.ligo create mode 100644 contracts/partials/IDex.ligo delete mode 100644 contracts/partials/ITTDex.ligo rename contracts/partials/{TTMethodDex.ligo => MethodDex.ligo} (91%) rename contracts/partials/{TTMethodFA2.ligo => MethodFA2.ligo} (81%) delete mode 100644 contracts/partials/TTDex.ligo diff --git a/.env b/.env index 5df5c9d5..328e7d80 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ EXCHANGE_TOKEN_STANDARD=FA12 -LIGO_VERSION=0.9.0 \ No newline at end of file +LIGO_VERSION=0.24.0 \ No newline at end of file diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index beea59e8..4c6d2b29 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -30,4 +30,4 @@ jobs: run: yarn compile && yarn test env: EXCHANGE_TOKEN_STANDARD: ${{ matrix.standard }} - LIGO_VERSION: "0.9.0" + LIGO_VERSION: "0.24.0" diff --git a/README.md b/README.md index 9b3c21d7..5a641ec5 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The solution consists of 6 types of contracts: 1. `Factory` - singleton used to deploy new TokenX-XTZ exchange pair; 2. `Dex` - contract for TokenX-XTZ pair exchanges; -3. `TTDex` - contract for TokenX-TokenY pair exchanges; +3. `Dex` - contract for TokenX-TokenY pair exchanges; 4. `Token` - FA token implementation. 5. `BakerRegistry` - bakery registrar. 6. `MetadataStorage` - contract to store and upgrade the shares token metadata. @@ -26,7 +26,7 @@ The solution consists of 6 types of contracts: |──────── main/ # the contracts to be compiled |──────── partial/ # the code parts imported by main contracts ├── test/ # test cases -├── storage/ # initial storage for contract originations +├── storage_type/ # initial storage_type for contract originations ├── scripts/ # cli for dex/factory actions ├── test.md # cases covered by tests ├── README.md # current file diff --git a/contracts/main/TTDex.ligo b/contracts/main/TTDex.ligo index 6251213b..594b843c 100644 --- a/contracts/main/TTDex.ligo +++ b/contracts/main/TTDex.ligo @@ -1,11 +1,12 @@ -#define FA2_STANDARD_ENABLED -#define TOKEN_TO_TOKEN_ENABLED -#include "../partials/ITTDex.ligo" -#include "../partials/TTMethodDex.ligo" -#include "../partials/TTDex.ligo" +#include "../partials/IDex.ligo" +#include "../partials/MethodDex.ligo" +#include "../partials/Dex.ligo" (* DexFA2 - Contract for exchanges for XTZ - FA2 token pair *) -function main (const p : full_action; const s : full_dex_storage) : full_return is +function main( + const p : full_action_type; + const s : full_storage_type) + : full_return_type is block { const this: address = Tezos.self_address; } with case p of @@ -19,7 +20,19 @@ function main (const p : full_action; const s : full_dex_storage) : full_return | BalanceBFA2(params) -> call_balance(IBalanceBFA2(params), this, 3n, s) | Get_reserves(params) -> get_reserves(params, s) | Close -> ((nil:list(operation)), close(s)) - | SetBalanceFunction(params) -> ((nil:list(operation)), if params.index > 3n then (failwith("Dex/wrong-index") : full_dex_storage) else set_balance_function(params.index, params.func, s)) - | SetDexFunction(params) -> ((nil:list(operation)), if params.index > 6n then (failwith("Dex/wrong-index") : full_dex_storage) else set_dex_function(params.index, params.func, s)) - | SetTokenFunction(params) -> ((nil:list(operation)), if params.index > 2n then (failwith("Dex/wrong-index") : full_dex_storage) else set_token_function(params.index, params.func, s)) + | SetBalanceFunction(params) -> + ((nil:list(operation)), + if params.index > bal_func_count + then (failwith("Dex/wrong-index") : full_storage_type) + else set_balance_function(params.index, params.func, s)) + | SetDexFunction(params) -> + ((nil:list(operation)), + if params.index > dex_func_count + then (failwith("Dex/wrong-index") : full_storage_type) + else set_dex_function(params.index, params.func, s)) + | SetTokenFunction(params) -> + ((nil:list(operation)), + if params.index > token_func_count + then (failwith("Dex/wrong-index") : full_storage_type) + else set_token_function(params.index, params.func, s)) end diff --git a/contracts/main/TokenFA2.ligo b/contracts/main/TokenFA2.ligo index fdc64da8..84a0d964 100644 --- a/contracts/main/TokenFA2.ligo +++ b/contracts/main/TokenFA2.ligo @@ -99,7 +99,7 @@ function iterate_update_operator (const s : storage_type; const params : update_ } with s (* Perform balance look up *) -function get_balance_of (const balance_params : balance_params; const s : storage_type) : list(operation) is +function get_balance_of (const bal_fa2_type : bal_fa2_type; const s : storage_type) : list(operation) is block { (* Perform single balance lookup *) @@ -121,11 +121,11 @@ function get_balance_of (const balance_params : balance_params; const s : storag } with response # l; (* Collect balances info *) - const accumulated_response : list (balance_of_response) = List.fold(look_up_balance, balance_params.requests, (nil: list(balance_of_response))); - } with list [transaction(accumulated_response, 0tz, balance_params.callback)] + const accumulated_response : list (balance_of_response) = List.fold(look_up_balance, bal_fa2_type.requests, (nil: list(balance_of_response))); + } with list [transaction(accumulated_response, 0tz, bal_fa2_type.callback)] (* TokenFA2 - Mock FA2 token for tests *) -function main (const action : token_action; var s : storage_type) : return_type is +function main (const action : token_action_type; var s : storage_type) : return_type is block { skip } with case action of diff --git a/contracts/partials/Dex.ligo b/contracts/partials/Dex.ligo new file mode 100644 index 00000000..4133abe1 --- /dev/null +++ b/contracts/partials/Dex.ligo @@ -0,0 +1,165 @@ +[@inline] +function call_balance( + const p : bal_action_type; + const this : address; + const idx : nat; + const s : full_storage_type) + : full_return_type is + block { + const res : return_type = + case s.balance_lambdas[idx] of + Some(f) -> f(p, s.storage, this) + | None -> (failwith("Dex/function-not-set") : return_type) + end; + s.storage := res.1; + } with (res.0, s) + +(* Route exchange-specific action + +Due to the fabulous storage_type, gas and operation size limits +the only way to have all the nessary functions is to store +them in big_map and dispatch the exact function code before +the execution. + +The function is responsible for fiding the appropriate method +based on the argument type. + +*) +[@inline] +function call_dex( + const p : action_type; + const this : address; + const s : full_storage_type) + : full_return_type is + block { + const idx : nat = + case p of + AddPair(n) -> 0n + | Swap(n) -> 1n + | Invest(n) -> 2n + | Divest(n) -> 3n + | EnsuredAddPair(n) -> 4n + | EnsuredSwap(n) -> 5n + | EnsuredInvest(n) -> 6n + end; + + const res : return_type = + case s.dex_lambdas[idx] of + Some(f) -> f(p, s.storage, this) + | None -> (failwith("Dex/function-not-set") : return_type) + end; + s.storage := res.1; + + if idx > 2n + then res.0 := Tezos.transaction( + unit, + 0mutez, + get_close_entrypoint(this)) # res.0 + else skip; + } with (res.0, s) + +(* Route token-specific action + +Due to the fabulous storage_type, gas and operation size limits +the only way to have all the nessary functions is to store +them in big_map and dispatch the exact function code before +the execution. + +The function is responsible for fiding the appropriate method +based on the provided index. + +*) +[@inline] function call_token( + const p : token_action_type; + const this : address; + const idx : nat; + const s : full_storage_type) + : full_return_type is + block { + const res : return_type = + case s.token_lambdas[idx] of + Some(f) -> f(p, s.storage, this) + | None -> (failwith("Dex/function-not-set") : return_type) + end; + s.storage := res.1; + } with (res.0, s) + +[@inline] +function close( + const s : full_storage_type) + : full_storage_type is + block { + if not s.storage.entered + then failwith("Dex/not-entered") + else skip; + if Tezos.sender =/= Tezos.self_address + then failwith("Dex/not-self") + else skip; + s.storage.entered := False; + } with s + +(* Return the reserves to the contracts. *) +[@inline] +function get_reserves( + const params : reserves_type; + const s : full_storage_type) + : full_return_type is + block { + const pair : pair_type = + case s.storage.pairs[params.pair_id] of + None -> record [ + token_a_pool = 0n; + token_b_pool = 0n; + total_supply = 0n; + ] + | Some(instance) -> instance + end; + } with (list [ + Tezos.transaction(( + pair.token_a_pool, + pair.token_b_pool), + 0tez, + params.receiver) + ], s) + +(* Set the dex function code to factory storage_type *) +[@inline] +function set_dex_function( + const idx : nat; + const f : dex_func_type; + const s : full_storage_type) + : full_storage_type is + block { + case s.dex_lambdas[idx] of + Some(n) -> failwith("Dex/function-set") + | None -> s.dex_lambdas[idx] := f + end; + } with s + +(* Set the token function code to factory storage_type *) +[@inline] +function set_token_function( + const idx : nat; + const f : token_func_type; + const s : full_storage_type) + : full_storage_type is + block { + case s.token_lambdas[idx] of + Some(n) -> failwith("Dex/function-set") + | None -> s.token_lambdas[idx] := f + end; + } with s + +(* Set the token function code to factory storage_type *) +[@inline] +function set_balance_function( + const idx : nat; + const f : bal_func_type; + const s : full_storage_type) + : full_storage_type is + block { + case s.balance_lambdas[idx] of + Some(n) -> failwith("Dex/function-set") + | None -> s.balance_lambdas[idx] := f + end; + } with s \ No newline at end of file diff --git a/contracts/partials/IDex.ligo b/contracts/partials/IDex.ligo new file mode 100644 index 00000000..7649b7ab --- /dev/null +++ b/contracts/partials/IDex.ligo @@ -0,0 +1,215 @@ +#include "./TypesFA2.ligo" + +(* Storage types *) + +(* record that represents account shares *) +type account_info is record [ + balance : nat; (* LP tokens *) + allowances : set (address); (* accounts allowed to act on behalf of the user *) +] + +type transfer_fa2_type is list (transfer_param) +type transfer_fa12_type is michelson_pair(address, "from", michelson_pair(address, "to", nat, "value"), "") +type entry_fa12_type is TransferTypeFA12 of transfer_fa12_type +type entry_fa2_type is TransferTypeFA2 of transfer_fa2_type +type bal_fa12_type is address * contract(nat) +type balance_fa12_type is BalanceOfTypeFA12 of bal_fa12_type +type balance_fa2_type is BalanceOfTypeFA2 of bal_fa2_type + +type token_type is +| Fa12 +| Fa2 + +type token_name is +| A +| B + +type pair_type is record [ + token_a_pool : nat; (* token A reserves in the pool *) + token_b_pool : nat; (* token B reserves in the pool *) + total_supply : nat; (* total shares count *) +] + +type tokens_type is record [ + token_a_address : address; (* token A address *) + token_b_address : address; (* token B address *) + token_a_id : nat; (* token A identifier *) + token_b_id : nat; (* token B identifier *) + token_a_type : token_type; (* token A standard *) + token_b_type : token_type; (* token B standard *) +] + +type tmp_type is record [ + balance_a : option (nat); + balance_b : option (nat); +] + +(* record for the dex storage_type *) +type storage_type is record [ + entered : bool; (* reentrancy protection *) + tmp : tmp_type; + pairs_count : nat; (* total shares count *) + tokens : big_map(nat, tokens_type); (* all the tokens list *) + token_to_id : big_map(bytes, nat); (* all the tokens list *) + pairs : big_map(nat, pair_type); (* account info per address *) + ledger : big_map((address * nat), account_info); (* account info per address *) +] + +(* operation type *) +type swap_type is +| Sell (* exchange token A to token B *) +| Buy (* exchange token B to token A *) + +type swap_slice_type is record [ + pair : tokens_type; (* exchange pair info *) + operation : swap_type; (* exchange operation *) +] + +type swap_side_type is record [ + pool : nat; (* pair identifier*) + token : address; (* token address*) + id : nat; (* token aidentifier *) + standard : token_type; (* token standard *) +] + +type swap_data_type is record [ + to_ : swap_side_type; (* info about sold asset *) + from_ : swap_side_type; (* info about bought asset *) +] + +type tmp_swap_type is record [ + s : storage_type; (* storage_type state *) + amount_in : nat; (* amount of tokens to be sold *) + token_address_in : address; (* address of sold token *) + token_id_in : nat; (* identifier of sold token *) + operation : option(operation); (* exchange operation type *) + sender : address; (* address of the sender *) + receiver : address; (* address of the receiver *) +] + +(* Entrypoint arguments *) +type route_type is [@layout:comb] record [ + swaps : list(swap_slice_type); (* swap operations list*) + amount_in : nat; (* amount of tokens to be exchanged *) + min_amount_out : nat; (* min amount of tokens received to accept exchange *) + receiver : address; (* tokens receiver *) +] + +type ensured_route_type is [@layout:comb] record [ + swaps : list(swap_slice_type); (* swap operations list*) + min_amount_out : nat; (* min amount of tokens received to accept exchange *) + receiver : address; (* tokens receiver *) +] + +type initialize_params is [@layout:comb] record [ + pair : tokens_type; (* exchange pair info *) + token_a_in : nat; (* min amount of tokens A invested *) + token_b_in : nat; (* min amount of tokens B invested *) +] + +type invest_type is [@layout:comb] record [ + pair : tokens_type; (* exchange pair info *) + shares : nat; (* the amount of shares to receive *) + token_a_in : nat; (* min amount of tokens A invested *) + token_b_in : nat; (* min amount of tokens B invested *) +] + +type ensured_invest_type is [@layout:comb] record [ + pair : tokens_type; (* exchange pair info *) + receiver : address; (* exchange pair info *) + shares : nat; (* the amount of shares to receive *) +] + +type ensured_add_type is [@layout:comb] record [ + pair : tokens_type; (* exchange pair info *) + receiver : address; (* exchange pair info *) +] + +type divest_type is [@layout:comb] record [ + pair : tokens_type; (* exchange pair info *) + min_token_a_out : nat; (* min amount of tokens A received to accept the divestment *) + min_token_b_out : nat; (* min amount of tokens B received to accept the divestment *) + shares : nat; (* amount of shares to be burnt *) +] + +type action_type is +(* User's entrypoints *) + AddPair of initialize_params (* sets initial liquidity *) +| Swap of route_type (* exchanges token to another token and sends them to receiver *) +| Invest of invest_type (* mints min shares after investing tokens *) +| Divest of divest_type (* burns shares and sends tokens to the owner *) +(* For internal usage*) +| EnsuredAddPair of ensured_add_type (* sets initial liquidity *) +| EnsuredSwap of ensured_route_type (* exchanges token to another token and sends them to receiver *) +| EnsuredInvest of ensured_invest_type (* mints min shares after investing tokens *) + +type bal_action_type is +(* Callback *) + IBalanceAFA12 of nat (* process token balance *) +| IBalanceBFA12 of nat (* process token balance *) +| IBalanceAFA2 of list(balance_of_response) (* process token balance *) +| IBalanceBFA2 of list(balance_of_response) (* process token balance *) + +type reserves_type is record [ + receiver : contract(nat * nat); (* response receiver *) + pair_id : nat; (* pair identifier *) +] + +(* Main function parameter types specific for FA2 standard*) +type transfer_type is list (transfer_param) +type operator_type is list (update_operator_param) + +type token_action_type is + ITransfer of transfer_type (* transfer asset from one account to another *) +| IBalance_of of bal_fa2_type (* returns the balance of the account *) +| IUpdate_operators of operator_type (* updates the token operators *) + +type return_type is list (operation) * storage_type +type dex_func_type is (action_type * storage_type * address) -> return_type +type token_func_type is (token_action_type * storage_type * address) -> return_type +type bal_func_type is (bal_action_type * storage_type * address) -> return_type + +type set_token_func_type is record [ + func : token_func_type; (* code of the function *) + index : nat; (* the key in functions map *) +] +type set_bal_func_type is record [ + func : bal_func_type; (* code of the function *) + index : nat; (* the key in functions map *) +] +type set_dex_func_type is record [ + func : dex_func_type; (* code of the function *) + index : nat; (* the key in functions map *) +] + +(* full list of dex entrypoints *) +type full_action_type is +| Use of action_type +| Transfer of transfer_type (* transfer asset from one account to another *) +| Balance_of of bal_fa2_type (* returns the balance of the account *) +| Update_operators of operator_type (* updates the token operators *) +| Get_reserves of reserves_type (* returns the underlying token reserves *) +| Close of unit (* entrypoint to prevent reentrancy *) +| BalanceAFA12 of nat (* process token balance *) +| BalanceBFA12 of nat (* process token balance *) +| BalanceAFA2 of list(balance_of_response) (* process token balance *) +| BalanceBFA2 of list(balance_of_response) (* process token balance *) +| SetDexFunction of set_dex_func_type (* sets the dex specific function. Is used before the whole system is launched *) +| SetTokenFunction of set_token_func_type (* sets the FA function, is used before the whole system is launched *) +| SetBalanceFunction of set_bal_func_type (* sets the FA function, is used before the whole system is launched *) + +(* real dex storage_type *) +type full_storage_type is record [ + storage : storage_type; (* real dex storage_type *) + metadata : big_map(string, bytes); (* metadata storage_type according to TZIP-016 *) + dex_lambdas : big_map(nat, dex_func_type); (* map with exchange-related functions code *) + token_lambdas : big_map(nat, token_func_type); (* map with token-related functions code *) + balance_lambdas : big_map(nat, bal_func_type); (* map with token-related functions code *) +] + +type full_return_type is list (operation) * full_storage_type + +const fee_rate : nat = 333n; (* exchange fee rate distributed among the liquidity providers *) +const bal_func_count : nat = 3n; +const dex_func_count : nat = 6n; +const token_func_count : nat = 2n; \ No newline at end of file diff --git a/contracts/partials/IMetadataStorage.ligo b/contracts/partials/IMetadataStorage.ligo index ded46cfc..7e8a18c1 100644 --- a/contracts/partials/IMetadataStorage.ligo +++ b/contracts/partials/IMetadataStorage.ligo @@ -16,4 +16,4 @@ type return_type is list (operation) * storage_type type action_type is | Update_owners of set_owner_type (* manage owner permissions *) | Update_storage of metadata_type (* update storage_type *) -| Get_metadata of contract (metadata_type) (* send the storage_type data to the account *) \ No newline at end of file +| Get_metadata of contract (metadata_type) (* send the storage_type data to the account *) diff --git a/contracts/partials/ITTDex.ligo b/contracts/partials/ITTDex.ligo deleted file mode 100644 index 2b3873d2..00000000 --- a/contracts/partials/ITTDex.ligo +++ /dev/null @@ -1,235 +0,0 @@ -#include "./TypesFA2.ligo" - -(* Storage types *) - -(* record that represents account shares *) -type account_info is record [ - balance : nat; (* LP tokens *) - allowances : set (address); (* accounts allowed to act on behalf of the user *) -] - -type token_transfer_params_fa2 is list (transfer_param) -type token_identifier_fa2 is record [ - token_address : address; - token_id : nat; -] -type token_transfer_params_fa12 is michelson_pair(address, "from", michelson_pair(address, "to", nat, "value"), "") -type token_identifier_fa12 is address -type transfer_type_fa12 is TransferTypeFA12 of token_transfer_params_fa12 -type transfer_type_fa2 is TransferTypeFA2 of token_transfer_params_fa2 -type balance_of_fa12_params is address * contract(nat) -type balance_of_fa12_type is BalanceOfTypeFA12 of balance_of_fa12_params -type balance_of_fa2_type is BalanceOfTypeFA2 of balance_params - -type token_type is -| Fa12 -| Fa2 - -type token_name is -| A -| B - -type pair_info is record [ - token_a_pool : nat; (* token A reserves in the pool *) - token_b_pool : nat; (* token B reserves in the pool *) - total_supply : nat; (* total shares count *) -] - -type tokens_info is record [ - token_a_address : address; (* token A address *) - token_b_address : address; (* token B address *) - token_a_id : nat; (* token A identifier *) - token_b_id : nat; (* token B identifier *) - token_a_type : token_type; (* token A standard *) - token_b_type : token_type; (* token B standard *) -] - -type token_pair is bytes - -type balance_info is record [ - balance_a : option (nat); - balance_b : option (nat); -] - -(* record for the dex storage_type *) -type dex_storage is record [ - entered : bool; (* reentrancy protection *) - tmp : balance_info; - pairs_count : nat; (* total shares count *) - tokens : big_map(nat, tokens_info); (* all the tokens list *) - token_to_id : big_map(token_pair, nat); (* all the tokens list *) - pairs : big_map(nat, pair_info); (* account info per address *) - ledger : big_map((address * nat), account_info); (* account info per address *) -] -(* operation type *) -type swap_type is -| Sell (* exchange token A to token B *) -| Buy (* exchange token B to token A *) - -type swap_slice_type is record [ - pair : tokens_info; (* exchange pair info *) - operation : swap_type; (* exchange operation *) -] - -type swap_side is record [ - pool : nat; (* pair identifier*) - token : address; (* token address*) - id : nat; (* token aidentifier *) - standard : token_type; (* token standard *) -] - -type swap_data is record [ - to_ : swap_side; (* info about sold asset *) - from_ : swap_side; (* info about bought asset *) -] - -type internal_swap_type is record [ - s : dex_storage; (* storage_type state *) - amount_in : nat; (* amount of tokens to be sold *) - token_address_in : address; (* address of sold token *) - token_id_in : nat; (* identifier of sold token *) - operation : option(operation); (* exchange operation type *) - sender : address; (* address of the sender *) - receiver : address; (* address of the receiver *) -] - -(* Entrypoint arguments *) -type token_to_token_route_params is - [@layout:comb] - record [ - swaps : list(swap_slice_type); (* swap operations list*) - amount_in : nat; (* amount of tokens to be exchanged *) - min_amount_out : nat; (* min amount of tokens received to accept exchange *) - receiver : address; (* tokens receiver *) - ] - -type ensured_route_params is - [@layout:comb] - record [ - swaps : list(swap_slice_type); (* swap operations list*) - min_amount_out : nat; (* min amount of tokens received to accept exchange *) - receiver : address; (* tokens receiver *) - ] - -type initialize_params is - [@layout:comb] - record [ - pair : tokens_info; (* exchange pair info *) - token_a_in : nat; (* min amount of tokens A invested *) - token_b_in : nat; (* min amount of tokens B invested *) - ] - -type invest_liquidity_params is - [@layout:comb] - record [ - pair : tokens_info; (* exchange pair info *) - shares : nat; (* the amount of shares to receive *) - token_a_in : nat; (* min amount of tokens A invested *) - token_b_in : nat; (* min amount of tokens B invested *) - ] - -type ensured_invest_params is - [@layout:comb] - record [ - pair : tokens_info; (* exchange pair info *) - receiver : address; (* exchange pair info *) - shares : nat; (* the amount of shares to receive *) - ] - -type ensured_add_params is - [@layout:comb] - record [ - pair : tokens_info; (* exchange pair info *) - receiver : address; (* exchange pair info *) - ] - -type divest_liquidity_params is - [@layout:comb] - record [ - pair : tokens_info; (* exchange pair info *) - min_token_a_out : nat; (* min amount of tokens A received to accept the divestment *) - min_token_b_out : nat; (* min amount of tokens B received to accept the divestment *) - shares : nat; (* amount of shares to be burnt *) - ] - -type dex_action is -(* User's entrypoints *) -| AddPair of initialize_params (* sets initial liquidity *) -| Swap of token_to_token_route_params (* exchanges token to another token and sends them to receiver *) -| Invest of invest_liquidity_params (* mints min shares after investing tokens *) -| Divest of divest_liquidity_params (* burns shares and sends tokens to the owner *) -(* For internal usage*) -| EnsuredAddPair of ensured_add_params (* sets initial liquidity *) -| EnsuredSwap of ensured_route_params (* exchanges token to another token and sends them to receiver *) -| EnsuredInvest of ensured_invest_params (* mints min shares after investing tokens *) - -type balance_action is -(* Callback *) -| IBalanceAFA12 of nat (* process token balance *) -| IBalanceBFA12 of nat (* process token balance *) -| IBalanceAFA2 of list(balance_of_response) (* process token balance *) -| IBalanceBFA2 of list(balance_of_response) (* process token balance *) - -type use_params is dex_action -type get_reserves_params is record [ - receiver : contract(nat * nat); (* response receiver *) - pair_id : nat; (* pair identifier *) -] - -(* Main function parameter types specific for FA2 standard*) -type transfer_params is list (transfer_param) -type update_operator_params is list (update_operator_param) - -type token_action is -| ITransfer of transfer_params (* transfer asset from one account to another *) -| IBalance_of of balance_params (* returns the balance of the account *) -| IUpdate_operators of update_operator_params (* updates the token operators *) - -type return_type is list (operation) * dex_storage -type dex_func is (dex_action * dex_storage * address) -> return_type -type token_func is (token_action * dex_storage * address) -> return_type -type bal_func is (balance_action * dex_storage * address) -> return_type - -type set_token_function_params is record [ - func : token_func; (* code of the function *) - index : nat; (* the key in functions map *) -] -type set_bal_function_params is record [ - func : bal_func; (* code of the function *) - index : nat; (* the key in functions map *) -] - -type set_dex_function_params is record [ - func : dex_func; (* code of the function *) - index : nat; (* the key in functions map *) -] - -(* full list of dex entrypoints *) -type full_action is -| Use of use_params -| Transfer of transfer_params (* transfer asset from one account to another *) -| Balance_of of balance_params (* returns the balance of the account *) -| Update_operators of update_operator_params (* updates the token operators *) -| Get_reserves of get_reserves_params (* returns the underlying token reserves *) -| Close of unit (* entrypoint to prevent reentrancy *) -| BalanceAFA12 of nat (* process token balance *) -| BalanceBFA12 of nat (* process token balance *) -| BalanceAFA2 of list(balance_of_response) (* process token balance *) -| BalanceBFA2 of list(balance_of_response) (* process token balance *) -| SetDexFunction of set_dex_function_params (* sets the dex specific function. Is used before the whole system is launched *) -| SetTokenFunction of set_token_function_params (* sets the FA function, is used before the whole system is launched *) -| SetBalanceFunction of set_bal_function_params (* sets the FA function, is used before the whole system is launched *) - -(* real dex storage_type *) -type full_dex_storage is record - storage_type : dex_storage; (* real dex storage_type *) - metadata : big_map(string, bytes); (* metadata storage_type according to TZIP-016 *) - dex_lambdas : big_map(nat, dex_func); (* map with exchange-related functions code *) - token_lambdas : big_map(nat, token_func); (* map with token-related functions code *) - balance_lambdas : big_map(nat, bal_func); (* map with token-related functions code *) -end - -type full_return is list (operation) * full_dex_storage - -const fee_rate : nat = 333n; (* exchange fee rate distributed among the liquidity providers *) - diff --git a/contracts/partials/IToken.ligo b/contracts/partials/IToken.ligo index c5dcf83b..5f73e531 100644 --- a/contracts/partials/IToken.ligo +++ b/contracts/partials/IToken.ligo @@ -1,24 +1,22 @@ (* Implimentation of the FA1.2 specification in PascaLIGO *) (* Define types *) -type trusted is address +type trusted is address type amt is nat -type account is - record [ - balance : amt; - allowances : map (trusted, amt); - ] +type account is record [ + balance : amt; + allowances : map (trusted, amt); +] (* contract storage_type *) -type storage_type is - record [ - total_supply : amt; - ledger : big_map (address, account); - ] +type storage_type is record [ + total_supply : amt; + ledger : big_map (address, account); +] (* define return_type for readability *) -type return_type is list (operation) * storage_type +type return_type is list (operation) * storage_type (* define noop for readability *) const noOperations : list (operation) = nil; diff --git a/contracts/partials/ITokenFA2.ligo b/contracts/partials/ITokenFA2.ligo index 6f578f72..42a09b20 100644 --- a/contracts/partials/ITokenFA2.ligo +++ b/contracts/partials/ITokenFA2.ligo @@ -53,7 +53,7 @@ type balance_of_response is balance : nat; ] -type balance_params is +type bal_fa2_type is [@layout:comb] record [ requests : list (balance_of_request); @@ -72,11 +72,11 @@ type update_operator_param is | Add_operator of operator_param | Remove_operator of operator_param -type transfer_params is list (transfer_param) -// type balance_params is michelson_pair_right_comb(balance_params_r) -type update_operator_params is list (update_operator_param) +type transfer_type is list (transfer_param) +// type bal_fa2_type is michelson_pair_right_comb(balance_params_r) +type operator_type is list (update_operator_param) -type token_action is -| Transfer of transfer_params -| Balance_of of balance_params -| Update_operators of update_operator_params +type token_action_type is +| Transfer of transfer_type +| Balance_of of bal_fa2_type +| Update_operators of operator_type diff --git a/contracts/partials/TTMethodDex.ligo b/contracts/partials/MethodDex.ligo similarity index 91% rename from contracts/partials/TTMethodDex.ligo rename to contracts/partials/MethodDex.ligo index f76a4dc9..713fe279 100644 --- a/contracts/partials/TTMethodDex.ligo +++ b/contracts/partials/MethodDex.ligo @@ -1,7 +1,7 @@ (* Helper function to get account *) function get_account( const key : (address * nat); - const s : dex_storage) : account_info is + const s : storage_type) : account_info is case s.ledger[key] of None -> record [ balance = 0n; @@ -12,15 +12,15 @@ function get_account( (* Helper function to get token pair *) function get_pair( - const key : tokens_info; - const s : dex_storage) : (pair_info * nat) is + const key : tokens_type; + const s : storage_type) : (pair_type * nat) is block { - const token_bytes : token_pair = Bytes.pack(key); + const token_bytes : bytes = Bytes.pack(key); const token_id : nat = case s.token_to_id[token_bytes] of None -> s.pairs_count | Some(instance) -> instance end; - const pair : pair_info = case s.pairs[token_id] of + const pair : pair_type = case s.pairs[token_id] of None -> record [ token_a_pool = 0n; token_b_pool = 0n; @@ -35,7 +35,7 @@ function form_pools( const from_pool: nat; const to_pool: nat; const supply: nat; - const direction: swap_type) : pair_info is + const direction: swap_type) : pair_type is case direction of Buy -> record [ token_a_pool = to_pool; @@ -51,17 +51,17 @@ function form_pools( (* Helper function to unwrap the pair for swap *) function form_swap_data( - const pair: pair_info; - const swap: tokens_info; - const direction: swap_type) : swap_data is + const pair: pair_type; + const swap: tokens_type; + const direction: swap_type) : swap_data_type is block { - const side_a : swap_side = record [ + const side_a : swap_side_type = record [ pool = pair.token_a_pool; token = swap.token_a_address; id = swap.token_a_id; standard = swap.token_a_type; ]; - const side_b : swap_side = record [ + const side_b : swap_side_type = record [ pool = pair.token_b_pool; token = swap.token_b_address; id = swap.token_b_id; @@ -83,7 +83,7 @@ function wrap_fa2_transfer_trx( const owner : address; const receiver : address; const value : nat; - const token_id : nat) : transfer_type_fa2 is + const token_id : nat) : entry_fa2_type is TransferTypeFA2(list[ record[ from_ = owner; @@ -99,47 +99,47 @@ function wrap_fa2_transfer_trx( function wrap_fa12_transfer_trx( const owner : address; const receiver : address; - const value : nat) : transfer_type_fa12 is + const value : nat) : entry_fa12_type is TransferTypeFA12(owner, (receiver, value)) (* Helper function to get fa2 token contract *) function get_fa2_token_contract( - const token_address : address) : contract(transfer_type_fa2) is + const token_address : address) : contract(entry_fa2_type) is case (Tezos.get_entrypoint_opt( "%transfer", - token_address) : option(contract(transfer_type_fa2))) of + token_address) : option(contract(entry_fa2_type))) of Some(contr) -> contr - | None -> (failwith("Dex/not-token") : contract(transfer_type_fa2)) + | None -> (failwith("Dex/not-token") : contract(entry_fa2_type)) end; (* Helper function to get fa1.2 token contract *) function get_fa12_token_contract( - const token_address : address) : contract(transfer_type_fa12) is + const token_address : address) : contract(entry_fa12_type) is case (Tezos.get_entrypoint_opt( "%transfer", - token_address) : option(contract(transfer_type_fa12))) of + token_address) : option(contract(entry_fa12_type))) of Some(contr) -> contr - | None -> (failwith("Dex/not-token") : contract(transfer_type_fa12)) + | None -> (failwith("Dex/not-token") : contract(entry_fa12_type)) end; (* Helper function to get fa2 token contract *) function get_fa2_balance_entrypoint( - const token_address : address) : contract(transfer_type_fa2) is + const token_address : address) : contract(entry_fa2_type) is case (Tezos.get_entrypoint_opt( "%transfer", - token_address) : option(contract(transfer_type_fa2))) of + token_address) : option(contract(entry_fa2_type))) of Some(contr) -> contr - | None -> (failwith("Dex/not-token") : contract(transfer_type_fa2)) + | None -> (failwith("Dex/not-token") : contract(entry_fa2_type)) end; (* Helper function to get fa1.2 token contract *) function get_fa12_balance_entrypoint( - const token_address : address) : contract(transfer_type_fa12) is + const token_address : address) : contract(entry_fa12_type) is case (Tezos.get_entrypoint_opt( "%transfer", - token_address) : option(contract(transfer_type_fa12))) of + token_address) : option(contract(entry_fa12_type))) of Some(contr) -> contr - | None -> (failwith("Dex/not-token") : contract(transfer_type_fa12)) + | None -> (failwith("Dex/not-token") : contract(entry_fa12_type)) end; (* Helper function to get the reentrancy entrypoint of the current contract *) @@ -206,34 +206,34 @@ function get_bal_fa2_b(const self : address) : contract(list(balance_of_response | None -> (failwith("Dex/balanceBFa2") : contract(list(balance_of_response))) end -function get_fa12_balance_entrypoint(const token : address) : contract(balance_of_fa12_params) is - case (Tezos.get_entrypoint_opt("%getBalance", token): option(contract(balance_of_fa12_params))) of +function get_fa12_balance_entrypoint(const token : address) : contract(bal_fa12_type) is + case (Tezos.get_entrypoint_opt("%getBalance", token): option(contract(bal_fa12_type))) of | Some(contr) -> contr - | None -> (failwith("Dex/balance-of-ep") : contract(balance_of_fa12_params)) + | None -> (failwith("Dex/balance-of-ep") : contract(bal_fa12_type)) end -function get_fa2_balance_entrypoint(const token : address): contract(balance_params) is - case (Tezos.get_entrypoint_opt("%balance_of", token): option(contract(balance_params))) of +function get_fa2_balance_entrypoint(const token : address): contract(bal_fa2_type) is + case (Tezos.get_entrypoint_opt("%balance_of", token): option(contract(bal_fa2_type))) of | Some(contr) -> contr - | None -> (failwith("Dex/balance-of-ep") : contract(balance_params)) + | None -> (failwith("Dex/balance-of-ep") : contract(bal_fa2_type)) end -function get_ensured_initialize_entrypoint(const token : address): contract(ensured_add_params) is - case (Tezos.get_entrypoint_opt("%ensuredAddPair", token): option(contract(ensured_add_params))) of +function get_ensured_initialize_entrypoint(const token : address): contract(ensured_add_type) is + case (Tezos.get_entrypoint_opt("%ensuredAddPair", token): option(contract(ensured_add_type))) of | Some(contr) -> contr - | None -> (failwith("Dex/no-entrypoint") : contract(ensured_add_params)) + | None -> (failwith("Dex/no-entrypoint") : contract(ensured_add_type)) end -function get_ensured_invest_entrypoint(const token : address): contract(ensured_invest_params) is - case (Tezos.get_entrypoint_opt("%ensuredInvest", token): option(contract(ensured_invest_params))) of +function get_ensured_invest_entrypoint(const token : address): contract(ensured_invest_type) is + case (Tezos.get_entrypoint_opt("%ensuredInvest", token): option(contract(ensured_invest_type))) of | Some(contr) -> contr - | None -> (failwith("Dex/no-entrypoint") : contract(ensured_invest_params)) + | None -> (failwith("Dex/no-entrypoint") : contract(ensured_invest_type)) end -function get_ensured_swap_entrypoint(const token : address): contract(ensured_route_params) is - case (Tezos.get_entrypoint_opt("%ensuredSwap", token): option(contract(ensured_route_params))) of +function get_ensured_swap_entrypoint(const token : address): contract(ensured_route_type) is + case (Tezos.get_entrypoint_opt("%ensuredSwap", token): option(contract(ensured_route_type))) of | Some(contr) -> contr - | None -> (failwith("Dex/no-entrypoint") : contract(ensured_route_params)) + | None -> (failwith("Dex/no-entrypoint") : contract(ensured_route_type)) end (* Helper function to transfer fa2 tokens *) @@ -337,12 +337,12 @@ function check_token_id( | Fa2 -> unit end; -#include "../partials/TTMethodFA2.ligo" +#include "../partials/MethodFA2.ligo" (* Initialize exchange after the previous liquidity was drained *) function ensured_initialize_exchange( - const p : dex_action; - const s : dex_storage; + const p : action_type; + const s : storage_type; const this: address) : return_type is block { var operations: list(operation) := list[]; @@ -364,8 +364,8 @@ function ensured_initialize_exchange( check_token_id(params.pair.token_b_id, params.pair.token_b_type); (* read pair info*) - const res : (pair_info * nat) = get_pair(params.pair, s); - const pair : pair_info = res.0; + const res : (pair_type * nat) = get_pair(params.pair, s); + const pair : pair_type = res.0; const token_id : nat = res.1; (* update counter if needed *) @@ -427,8 +427,8 @@ function ensured_initialize_exchange( (* Initialize exchange after the previous liquidity was drained *) function initialize_exchange( - const p : dex_action; - const s : dex_storage; + const p : action_type; + const s : storage_type; const this: address) : return_type is block { var operations: list(operation) := list[]; @@ -510,8 +510,8 @@ function initialize_exchange( (* Intrenal functions for swap hops *) function internal_token_to_token_swap( - const tmp : internal_swap_type; - const params : swap_slice_type ) : internal_swap_type is + const tmp : tmp_swap_type; + const params : swap_slice_type ) : tmp_swap_type is block { (* check preconditions *) if params.pair.token_a_address = params.pair.token_b_address @@ -521,10 +521,10 @@ function internal_token_to_token_swap( then failwith("Dex/wrong-pair") else skip; (* get pair info*) - const res : (pair_info * nat) = get_pair(params.pair, tmp.s); - const pair : pair_info = res.0; + const res : (pair_type * nat) = get_pair(params.pair, tmp.s); + const pair : pair_type = res.0; const token_id : nat = res.1; - const swap: swap_data = form_swap_data(pair, params.pair, params.operation); + const swap: swap_data_type = form_swap_data(pair, params.pair, params.operation); (* ensure there is liquidity *) if pair.token_a_pool * pair.token_b_pool = 0n @@ -558,7 +558,7 @@ function internal_token_to_token_swap( tmp.token_id_in := swap.to_.id; (* update storage_type *) - const updated_pair : pair_info = form_pools( + const updated_pair : pair_type = form_pools( swap.from_.pool, swap.to_.pool, pair.total_supply, @@ -577,8 +577,8 @@ function internal_token_to_token_swap( (* Exchange tokens to tokens with multiple hops, note: tokens should be approved before the operation *) function token_to_token_route( - const p : dex_action; - const s : dex_storage; + const p : action_type; + const s : storage_type; const this : address) : return_type is block { var operations: list(operation) := list[]; @@ -694,8 +694,8 @@ function token_to_token_route( (* Exchange tokens to tokens with multiple hops, note: tokens should be approved before the operation *) function ensured_route( - const p : dex_action; - const s : dex_storage; + const p : action_type; + const s : storage_type; const this : address) : return_type is block { var operations: list(operation) := list[]; @@ -736,7 +736,7 @@ function ensured_route( end; (* perform internal swaps *) - const tmp : internal_swap_type = List.fold( + const tmp : tmp_swap_type = List.fold( internal_token_to_token_swap, params.swaps, record [ @@ -775,8 +775,8 @@ function ensured_route( (* Provide liquidity (both tokens) to the pool, note: tokens should be approved before the operation *) function invest_liquidity( - const p : dex_action; - const s : dex_storage; + const p : action_type; + const s : storage_type; const this: address) : return_type is block { var operations: list(operation) := list[]; @@ -860,8 +860,8 @@ function invest_liquidity( (* Provide liquidity (both tokens) to the pool, note: tokens should be approved before the operation *) function ensured_invest( - const p : dex_action; - const s : dex_storage; + const p : action_type; + const s : storage_type; const this: address) : return_type is block { var operations: list(operation) := list[]; @@ -881,8 +881,8 @@ function ensured_invest( then failwith("Dex/wrong-pair") else skip; (* read pair info*) - const res : (pair_info * nat) = get_pair(params.pair, s); - const pair : pair_info = res.0; + const res : (pair_type * nat) = get_pair(params.pair, s); + const pair : pair_type = res.0; const token_id : nat = res.1; (* ensure there is liquidity *) @@ -975,8 +975,8 @@ function ensured_invest( (* Remove liquidity (both tokens) from the pool by burning shares *) function divest_liquidity( - const p : dex_action; - const s : dex_storage; + const p : action_type; + const s : storage_type; const this: address) : return_type is block { var operations: list(operation) := list[]; @@ -1000,8 +1000,8 @@ function divest_liquidity( then failwith("Dex/wrong-pair") else skip; (* read pair info*) - const res : (pair_info * nat) = get_pair(params.pair, s); - const pair : pair_info = res.0; + const res : (pair_type * nat) = get_pair(params.pair, s); + const pair : pair_type = res.0; const token_id : nat = res.1; (* ensure pair exist *) @@ -1073,8 +1073,8 @@ function divest_liquidity( (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_12_a( - const p : balance_action; - const s : dex_storage; + const p : bal_action_type; + const s : storage_type; const this: address) : return_type is block { var operations: list(operation) := list[]; @@ -1096,8 +1096,8 @@ function update_balance_fa_12_a( (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_12_b( - const p : balance_action; - const s : dex_storage; + const p : bal_action_type; + const s : storage_type; const this: address) : return_type is block { var operations: list(operation) := list[]; @@ -1119,8 +1119,8 @@ function update_balance_fa_12_b( (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_2_a( - const p : balance_action; - const s : dex_storage; + const p : bal_action_type; + const s : storage_type; const this: address) : return_type is block { var operations: list(operation) := list[]; @@ -1152,8 +1152,8 @@ function update_balance_fa_2_a( (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_2_b( - const p : balance_action; - const s : dex_storage; + const p : bal_action_type; + const s : storage_type; const this: address) : return_type is block { var operations: list(operation) := list[]; diff --git a/contracts/partials/TTMethodFA2.ligo b/contracts/partials/MethodFA2.ligo similarity index 81% rename from contracts/partials/TTMethodFA2.ligo rename to contracts/partials/MethodFA2.ligo index 8b5caff1..0c426cfd 100644 --- a/contracts/partials/TTMethodFA2.ligo +++ b/contracts/partials/MethodFA2.ligo @@ -1,12 +1,12 @@ (* Helper function to get allowance for an account *) -function get_allowance (const owner_account : account_info; const spender : address; const s : dex_storage) : bool is +function get_allowance (const owner_account : account_info; const spender : address; const s : storage_type) : bool is owner_account.allowances contains spender (* Perform transfers from one owner *) -[@inline] function iterate_transfer (const s : dex_storage; const user_trx_params : transfer_param) : dex_storage is +[@inline] function iterate_transfer (const s : storage_type; const user_trx_params : transfer_param) : storage_type is block { (* Perform single transfer *) - function make_transfer(const s : dex_storage; const transfer : transfer_destination) : dex_storage is + function make_transfer(const s : storage_type; const transfer : transfer_destination) : storage_type is block { (* Retrieve sender account from storage_type *) const user_key : (address * nat) = (user_trx_params.from_, transfer.token_id); @@ -40,7 +40,7 @@ function get_allowance (const owner_account : account_info; const spender : addr } with (List.fold (make_transfer, user_trx_params.txs, s)) (* Perform single operator update *) -function iterate_update_operator (const s : dex_storage; const params : update_operator_param) : dex_storage is +function iterate_update_operator (const s : storage_type; const params : update_operator_param) : storage_type is block { case params of | Add_operator(param) -> { @@ -77,7 +77,7 @@ function iterate_update_operator (const s : dex_storage; const params : update_o } with s -function transfer (const p : token_action; var s : dex_storage; const this : address) : return_type is +function transfer (const p : token_action_type; var s : storage_type; const this : address) : return_type is block { var operations: list(operation) := list[]; case p of @@ -89,12 +89,12 @@ function transfer (const p : token_action; var s : dex_storage; const this : add end } with (operations, s) -function get_balance_of (const p : token_action; const s : dex_storage; const this : address) : return_type is +function get_balance_of (const p : token_action_type; const s : storage_type; const this : address) : return_type is block { var operations: list(operation) := list[]; case p of | ITransfer(params) -> skip - | IBalance_of(balance_params) -> { + | IBalance_of(bal_fa2_type) -> { (* Perform single balance lookup *) function look_up_balance(const l: list (balance_of_response); const request : balance_of_request) : list (balance_of_response) is block { @@ -109,14 +109,14 @@ function get_balance_of (const p : token_action; const s : dex_storage; const th } with response # l; (* Collect balances info *) - const accumulated_response : list (balance_of_response) = List.fold(look_up_balance, balance_params.requests, (nil: list(balance_of_response))); - operations := list[Tezos.transaction(accumulated_response, 0mutez, balance_params.callback)]; + const accumulated_response : list (balance_of_response) = List.fold(look_up_balance, bal_fa2_type.requests, (nil: list(balance_of_response))); + operations := list[Tezos.transaction(accumulated_response, 0mutez, bal_fa2_type.callback)]; } | IUpdate_operators(params) -> skip end } with (operations, s) -function update_operators (const p : token_action; const s : dex_storage; const this : address) : return_type is +function update_operators (const p : token_action_type; const s : storage_type; const this : address) : return_type is block { var operations: list(operation) := list[]; case p of diff --git a/contracts/partials/TTDex.ligo b/contracts/partials/TTDex.ligo deleted file mode 100644 index 04c1fe64..00000000 --- a/contracts/partials/TTDex.ligo +++ /dev/null @@ -1,142 +0,0 @@ -[@inline] function call_balance( - const p : balance_action; - const this : address; - const idx : nat; - const s : full_dex_storage) : full_return is -block { - const res : return_type = case s.balance_lambdas[idx] of - Some(f) -> f(p, s.storage_type, this) - | None -> (failwith("Dex/function-not-set") : return_type) - end; - s.storage_type := res.1; -} with (res.0, s) - -(* Route exchange-specific action - -Due to the fabulous storage_type, gas and operation size limits -the only way to have all the nessary functions is to store -them in big_map and dispatch the exact function code before -the execution. - -The function is responsible for fiding the appropriate method -based on the argument type. - -*) -[@inline] function call_dex( - const p : dex_action; - const this : address; - const s : full_dex_storage) : full_return is -block { - const idx : nat = case p of - | AddPair(n) -> 0n - | Swap(n) -> 1n - | Invest(n) -> 2n - | Divest(n) -> 3n - | EnsuredAddPair(n) -> 4n - | EnsuredSwap(n) -> 5n - | EnsuredInvest(n) -> 6n - end; - const res : return_type = case s.dex_lambdas[idx] of - Some(f) -> f(p, s.storage_type, this) - | None -> (failwith("Dex/function-not-set") : return_type) - end; - s.storage_type := res.1; - if idx > 2n then - res.0 := Tezos.transaction( - unit, - 0mutez, - get_close_entrypoint(this)) # res.0 - else skip; -} with (res.0, s) - -(* Route token-specific action - -Due to the fabulous storage_type, gas and operation size limits -the only way to have all the nessary functions is to store -them in big_map and dispatch the exact function code before -the execution. - -The function is responsible for fiding the appropriate method -based on the provided index. - -*) -[@inline] function call_token( - const p : token_action; - const this : address; - const idx : nat; - const s : full_dex_storage) : full_return is -block { - const res : return_type = case s.token_lambdas[idx] of - Some(f) -> f(p, s.storage_type, this) - | None -> (failwith("Dex/function-not-set") : return_type) - end; - s.storage_type := res.1; -} with (res.0, s) - -[@inline] function close (const s : full_dex_storage) : full_dex_storage is -block { - if not s.storage_type.entered then - failwith("Dex/not-entered") - else skip; - if Tezos.sender =/= Tezos.self_address then - failwith("Dex/not-self") - else skip; - s.storage_type.entered := False; -} with s - -(* Return the reserves to the contracts. *) -[@inline] function get_reserves( - const params : get_reserves_params; - const s : full_dex_storage) : full_return is -block { - const pair : pair_info = case s.storage_type.pairs[params.pair_id] of - None -> record [ - token_a_pool = 0n; - token_b_pool = 0n; - total_supply = 0n; - ] - | Some(instance) -> instance - end; -} with (list [ - Tezos.transaction(( - pair.token_a_pool, - pair.token_b_pool), - 0tez, - params.receiver) - ], s) - -(* Set the dex function code to factory storage_type *) -[@inline] function set_dex_function( - const idx : nat; - const f : dex_func; - const s : full_dex_storage) : full_dex_storage is -block { - case s.dex_lambdas[idx] of - Some(n) -> failwith("Dex/function-set") - | None -> s.dex_lambdas[idx] := f - end; -} with s - -(* Set the token function code to factory storage_type *) -[@inline] function set_token_function( - const idx : nat; - const f : token_func; - const s : full_dex_storage) : full_dex_storage is -block { - case s.token_lambdas[idx] of - Some(n) -> failwith("Dex/function-set") - | None -> s.token_lambdas[idx] := f - end; -} with s - -(* Set the token function code to factory storage_type *) -[@inline] function set_balance_function( - const idx : nat; - const f : bal_func; - const s : full_dex_storage) : full_dex_storage is -block { - case s.balance_lambdas[idx] of - Some(n) -> failwith("Dex/function-set") - | None -> s.balance_lambdas[idx] := f - end; -} with s \ No newline at end of file diff --git a/contracts/partials/TypesFA2.ligo b/contracts/partials/TypesFA2.ligo index 9d1828b6..16d224e7 100644 --- a/contracts/partials/TypesFA2.ligo +++ b/contracts/partials/TypesFA2.ligo @@ -38,7 +38,7 @@ type balance_of_response is balance : nat; ] -type balance_params is +type bal_fa2_type is [@layout:comb] record [ requests : list (balance_of_request); diff --git a/migrations/2_deploy_token_to_token_dex.js b/migrations/2_deploy_token_to_token_dex.js index f86c9c84..b961f38f 100644 --- a/migrations/2_deploy_token_to_token_dex.js +++ b/migrations/2_deploy_token_to_token_dex.js @@ -1,8 +1,8 @@ const standard = process.env.EXCHANGE_TOKEN_STANDARD; const usedStandard = standard == "MIXED" ? "FA2" : standard; -const TTDex = artifacts.require("TTDex"); +const Dex = artifacts.require("Dex"); const MetadataStorage = artifacts.require("MetadataStorage"); -const dexStorage = require("../storage/TTDex"); +const dexStorage = require("../storage/Dex"); const { TezosToolkit } = require("@taquito/taquito"); const { InMemorySigner } = require("@taquito/signer"); const { MichelsonMap } = require("@taquito/michelson-encoder"); @@ -46,15 +46,15 @@ module.exports = async (deployer, network, accounts) => { "ascii" ).toString("hex"), }); - await deployer.deploy(TTDex, dexStorage); - const dexInstance = await TTDex.deployed(); - console.log(`TTDex address: ${dexInstance.address}`); + await deployer.deploy(Dex, dexStorage); + const dexInstance = await Dex.deployed(); + console.log(`Dex address: ${dexInstance.address}`); const ligo = getLigo(true); for (dexFunction of dexFunctions) { const stdout = execSync( - `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TTDex.ligo main 'SetDexFunction(record index =${dexFunction.index}n; func = ${dexFunction.name}; end)'`, + `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/Dex.ligo main 'SetDexFunction(record index =${dexFunction.index}n; func = ${dexFunction.name}; end)'`, { maxBuffer: 1024 * 500 } ); const operation = await tezos.contract.transfer({ @@ -69,7 +69,7 @@ module.exports = async (deployer, network, accounts) => { } for (balFunction of balFunctions) { const stdout = execSync( - `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TTDex.ligo main 'SetBalanceFunction(record index =${balFunction.index}n; func = ${balFunction.name}; end)'`, + `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/Dex.ligo main 'SetBalanceFunction(record index =${balFunction.index}n; func = ${balFunction.name}; end)'`, { maxBuffer: 1024 * 500 } ); const operation = await tezos.contract.transfer({ @@ -84,7 +84,7 @@ module.exports = async (deployer, network, accounts) => { } for (tokenFunction of tokenFunctions[standard]) { const stdout = execSync( - `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TTDex.ligo main 'SetTokenFunction(record index =${tokenFunction.index}n; func = ${tokenFunction.name}; end)'`, + `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/Dex.ligo main 'SetTokenFunction(record index =${tokenFunction.index}n; func = ${tokenFunction.name}; end)'`, { maxBuffer: 1024 * 500 } ); const operation = await tezos.contract.transfer({ diff --git a/patches/truffle+5.5.0-tezos.4.patch b/patches/truffle+5.5.0-tezos.4.patch index f60ef2bd..cbbaf372 100644 --- a/patches/truffle+5.5.0-tezos.4.patch +++ b/patches/truffle+5.5.0-tezos.4.patch @@ -7,7 +7,7 @@ index a84a254..ef05d8b 100755 var compiler = { name: "ligo", - version: "next" -+ version: "0.9.0" ++ version: "0.24.0" }; var LIGO_PATTERN = "**/*.{ligo,mligo,religo}"; var compile = {}; @@ -16,7 +16,7 @@ index a84a254..ef05d8b 100755 // Check that ligo is available function checkLigo(callback) { - child_process_1.exec("docker run --rm -i ligolang/ligo:next --help", function (err, stdout, stderr) { -+ child_process_1.exec("docker run --rm -i ligolang/ligo:0.9.0 --help", function (err, stdout, stderr) { ++ child_process_1.exec("docker run --rm -i ligolang/ligo:0.24.0 --help", function (err, stdout, stderr) { if (err) return callback(colors_1.default.red("Error executing ligo:") + "\n" + stderr); callback(null); @@ -25,7 +25,7 @@ index a84a254..ef05d8b 100755 "--rm", "-i", - "ligolang/ligo:next", -+ "ligolang/ligo:0.9.0", ++ "ligolang/ligo:0.24.0", "compile-contract", "--michelson-format=json", fullInternalSourcePath, diff --git a/test/helpers/ttContext.ts b/test/helpers/ttContext.ts index 5d496016..079756b0 100644 --- a/test/helpers/ttContext.ts +++ b/test/helpers/ttContext.ts @@ -1,10 +1,10 @@ const standard = process.env.EXCHANGE_TOKEN_STANDARD; -import { TTDex as TTDexFA2 } from "./ttdexFA2"; +import { Dex as TTDexFA2 } from "./ttdexFA2"; import { TokenFA12 } from "./tokenFA12"; import { prepareProviderOptions } from "./utils"; -import dexStorage from "../storage/TTDex"; +import dexStorage from "../storage/Dex"; import tokenFA12Storage from "../storage/TokenFA12"; import tokenFA2Storage from "../storage/TokenFA2"; import { @@ -20,7 +20,7 @@ import BigNumber from "bignumber.js"; type Dex = TTDexFA2; const CTokenFA12 = artifacts.require("TokenFA12"); const CTokenFA2 = artifacts.require("TokenFA2"); -const CDex = artifacts.require("TTDex"); +const CDex = artifacts.require("Dex"); export class TTContext { public dex: Dex; diff --git a/test/helpers/ttdexFA2.ts b/test/helpers/ttdexFA2.ts index 54455e59..054ff53a 100644 --- a/test/helpers/ttdexFA2.ts +++ b/test/helpers/ttdexFA2.ts @@ -10,7 +10,7 @@ import { confirmOperation } from "./confirmation"; const standard = process.env.EXCHANGE_TOKEN_STANDARD; -export class TTDex extends TokenFA2 { +export class Dex extends TokenFA2 { public contract: ContractAbstraction; public storage: TTDexStorage; @@ -18,8 +18,8 @@ export class TTDex extends TokenFA2 { super(contract); } - static async init(dexAddress: string): Promise { - return new TTDex(await tezos.contract.at(dexAddress)); + static async init(dexAddress: string): Promise { + return new Dex(await tezos.contract.at(dexAddress)); } async updateStorage( @@ -375,7 +375,7 @@ export class TTDex extends TokenFA2 { async setDexFunction(index: number, lambdaName: string): Promise { let ligo = getLigo(true); const stdout = execSync( - `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TTDex.ligo main 'SetDexFunction(record index =${index}n; func = ${lambdaName}; end)'`, + `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/Dex.ligo main 'SetDexFunction(record index =${index}n; func = ${lambdaName}; end)'`, { maxBuffer: 1024 * 500 } ); const operation = await tezos.contract.transfer({ @@ -392,7 +392,7 @@ export class TTDex extends TokenFA2 { async setTokenFunction(index: number, lambdaName: string): Promise { let ligo = getLigo(true); const stdout = execSync( - `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TTDex.ligo main 'SetTokenFunction(record index =${index}n; func = ${lambdaName}; end)'`, + `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/Dex.ligo main 'SetTokenFunction(record index =${index}n; func = ${lambdaName}; end)'`, { maxBuffer: 1024 * 500 } ); const operation = await tezos.contract.transfer({ @@ -409,7 +409,7 @@ export class TTDex extends TokenFA2 { async setBalFunction(index: number, lambdaName: string): Promise { let ligo = getLigo(true); const stdout = execSync( - `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/TTDex.ligo main 'SetBalanceFunction(record index =${index}n; func = ${lambdaName}; end)'`, + `${ligo} compile-parameter --michelson-format=json $PWD/contracts/main/Dex.ligo main 'SetBalanceFunction(record index =${index}n; func = ${lambdaName}; end)'`, { maxBuffer: 1024 * 500 } ); const operation = await tezos.contract.transfer({ diff --git a/truffle.d.ts b/truffle.d.ts index 11b082ac..f9dc7a64 100644 --- a/truffle.d.ts +++ b/truffle.d.ts @@ -28,7 +28,7 @@ declare interface Artifacts { require(name: "TestFactoryFA2"): Contract; require(name: "DexFA12"): Contract; require(name: "DexFA2"): Contract; - require(name: "TTDex"): Contract; + require(name: "Dex"): Contract; require(name: "TTDexFA12"): Contract; } From a9d3f68b1c80538ab9127b31efc95c74b7cf29ac Mon Sep 17 00:00:00 2001 From: KStasi Date: Fri, 17 Sep 2021 10:29:03 +0200 Subject: [PATCH 18/22] update code style and ligo version --- contracts/main/Dex.ligo | 38 ++ contracts/main/MetadataStorage.ligo | 8 +- contracts/main/TTDex.ligo | 38 -- contracts/main/TokenFA12.ligo | 10 +- contracts/main/TokenFA2.ligo | 20 +- contracts/partials/Dex.ligo | 49 ++- contracts/partials/IDex.ligo | 6 +- contracts/partials/MethodDex.ligo | 521 ++++------------------------ contracts/partials/MethodFA2.ligo | 102 ++++-- contracts/partials/Utils.ligo | 350 +++++++++++++++++++ contracts/partials/View.ligo | 30 -- 11 files changed, 562 insertions(+), 610 deletions(-) create mode 100644 contracts/main/Dex.ligo delete mode 100644 contracts/main/TTDex.ligo create mode 100644 contracts/partials/Utils.ligo delete mode 100644 contracts/partials/View.ligo diff --git a/contracts/main/Dex.ligo b/contracts/main/Dex.ligo new file mode 100644 index 00000000..4048d0a9 --- /dev/null +++ b/contracts/main/Dex.ligo @@ -0,0 +1,38 @@ +#include "../partials/IDex.ligo" +#include "../partials/Utils.ligo" +#include "../partials/MethodFA2.ligo" +#include "../partials/MethodDex.ligo" +#include "../partials/Dex.ligo" + +(* DexFA2 - Contract for exchanges for XTZ - FA2 token pair *) +function main( + const p : full_action_type; + const s : full_storage_type) + : full_return_type is + case p of + Use(params) -> call_dex(params, s) + | Transfer(params) -> call_token(ITransfer(params), 0n, s) + | Balance_of(params) -> call_token(IBalance_of(params), 2n, s) + | Update_operators(params) -> call_token(IUpdate_operators(params), 1n, s) + | BalanceAFA12(params) -> call_balance(IBalanceAFA12(params), 0n, s) + | BalanceBFA12(params) -> call_balance(IBalanceBFA12(params), 1n, s) + | BalanceAFA2(params) -> call_balance(IBalanceAFA2(params), 2n, s) + | BalanceBFA2(params) -> call_balance(IBalanceBFA2(params), 3n, s) + | Get_reserves(params) -> get_reserves(params, s) + | Close -> ((nil:list(operation)), close(s)) + | SetBalanceFunction(params) -> + ((nil:list(operation)), + if params.index > bal_func_count + then (failwith("Dex/wrong-index") : full_storage_type) + else set_balance_function(params.index, params.func, s)) + | SetDexFunction(params) -> + ((nil:list(operation)), + if params.index > dex_func_count + then (failwith("Dex/wrong-index") : full_storage_type) + else set_dex_function(params.index, params.func, s)) + | SetTokenFunction(params) -> + ((nil:list(operation)), + if params.index > token_func_count + then (failwith("Dex/wrong-index") : full_storage_type) + else set_token_function(params.index, params.func, s)) + end diff --git a/contracts/main/MetadataStorage.ligo b/contracts/main/MetadataStorage.ligo index b59d6bc8..c2f2dad2 100644 --- a/contracts/main/MetadataStorage.ligo +++ b/contracts/main/MetadataStorage.ligo @@ -3,7 +3,7 @@ (* Add or remove the admin permissions for address; only called by one of the current owners *) function update_owner( const params : set_owner_type; - const s : storage_type) + var s : storage_type) : return_type is block { if s.owners contains Tezos.sender @@ -18,7 +18,7 @@ function update_owner( (* Update the metadata for the token; only called by one of the current owners *) function update_metadata( const new_metadata : metadata_type; - const s : storage_type) + var s : storage_type) : return_type is block { if s.owners contains Tezos.sender @@ -30,10 +30,10 @@ function update_metadata( (* MetadataStorage - Contract to store and upgrade the shares token metadata *) function main( const p : action_type; - const s : storage_type) + var s : storage_type) : return_type is case p of - | Update_owners(params) -> update_owner(params, s) + Update_owners(params) -> update_owner(params, s) | Update_storage(new_metadata) -> update_metadata(new_metadata, s) | Get_metadata(receiver) -> (list [ transaction(s.metadata, 0tz, receiver) diff --git a/contracts/main/TTDex.ligo b/contracts/main/TTDex.ligo deleted file mode 100644 index 594b843c..00000000 --- a/contracts/main/TTDex.ligo +++ /dev/null @@ -1,38 +0,0 @@ -#include "../partials/IDex.ligo" -#include "../partials/MethodDex.ligo" -#include "../partials/Dex.ligo" - -(* DexFA2 - Contract for exchanges for XTZ - FA2 token pair *) -function main( - const p : full_action_type; - const s : full_storage_type) - : full_return_type is - block { - const this: address = Tezos.self_address; - } with case p of - | Use(params) -> call_dex(params, this, s) - | Transfer(params) -> call_token(ITransfer(params), this, 0n, s) - | Balance_of(params) -> call_token(IBalance_of(params), this, 2n, s) - | Update_operators(params) -> call_token(IUpdate_operators(params), this, 1n, s) - | BalanceAFA12(params) -> call_balance(IBalanceAFA12(params), this, 0n, s) - | BalanceBFA12(params) -> call_balance(IBalanceBFA12(params), this, 1n, s) - | BalanceAFA2(params) -> call_balance(IBalanceAFA2(params), this, 2n, s) - | BalanceBFA2(params) -> call_balance(IBalanceBFA2(params), this, 3n, s) - | Get_reserves(params) -> get_reserves(params, s) - | Close -> ((nil:list(operation)), close(s)) - | SetBalanceFunction(params) -> - ((nil:list(operation)), - if params.index > bal_func_count - then (failwith("Dex/wrong-index") : full_storage_type) - else set_balance_function(params.index, params.func, s)) - | SetDexFunction(params) -> - ((nil:list(operation)), - if params.index > dex_func_count - then (failwith("Dex/wrong-index") : full_storage_type) - else set_dex_function(params.index, params.func, s)) - | SetTokenFunction(params) -> - ((nil:list(operation)), - if params.index > token_func_count - then (failwith("Dex/wrong-index") : full_storage_type) - else set_token_function(params.index, params.func, s)) - end diff --git a/contracts/main/TokenFA12.ligo b/contracts/main/TokenFA12.ligo index d4bde321..cfba7efd 100644 --- a/contracts/main/TokenFA12.ligo +++ b/contracts/main/TokenFA12.ligo @@ -11,7 +11,7 @@ function getAccount (const addr : address; const s : storage_type) : account is end; (* Helper function to get allowance for an account *) -function getAllowance (const ownerAccount : account; const spender : address; const s : storage_type) : amt is +function getAllowance (const ownerAccount : account; const spender : address) : amt is case ownerAccount.allowances[spender] of Some (amt) -> amt | None -> 0n @@ -26,7 +26,7 @@ function transfer (const from_ : address; const to_ : address; const value : amt else skip; (* Retrieve sender account from storage_type *) - const senderAccount : account = getAccount(from_, s); + var senderAccount : account := getAccount(from_, s); (* Balance check *) if senderAccount.balance < value then @@ -35,7 +35,7 @@ function transfer (const from_ : address; const to_ : address; const value : amt (* Check this address can spend the tokens *) if from_ =/= Tezos.sender then block { - const spenderAllowance : amt = getAllowance(senderAccount, Tezos.sender, s); + const spenderAllowance : amt = getAllowance(senderAccount, Tezos.sender); if spenderAllowance < value then failwith("NotEnoughAllowance") @@ -73,7 +73,7 @@ function approve (const spender : address; const value : amt; var s : storage_ty var senderAccount : account := getAccount(Tezos.sender, s); (* Get current spender allowance *) - const spenderAllowance : amt = getAllowance(senderAccount, spender, s); + // const spenderAllowance : amt = getAllowance(senderAccount, spender, s); (* Prevent a corresponding attack vector *) // if spenderAllowance > 0n and value > 0n then @@ -98,7 +98,7 @@ function getBalance (const owner : address; const contr : contract(amt); var s : function getAllowances (const owner : address; const spender : address; const contr : contract(amt); var s : storage_type) : return_type is block { const ownerAccount : account = getAccount(owner, s); - const spenderAllowance : amt = getAllowance(ownerAccount, spender, s); + const spenderAllowance : amt = getAllowance(ownerAccount, spender); } with (list [transaction(spenderAllowance, 0tz, contr)], s) (* View function that forwards the totalSupply to a contract *) diff --git a/contracts/main/TokenFA2.ligo b/contracts/main/TokenFA2.ligo index 84a0d964..81542d94 100644 --- a/contracts/main/TokenFA2.ligo +++ b/contracts/main/TokenFA2.ligo @@ -13,17 +13,17 @@ function get_account (const addr : address; const s : storage_type) : account is (* Perform transfers from one owner *) function iterate_transfer (const s : storage_type; const user_trx_params : transfer_param) : storage_type is block { - (* Retrieve sender account from storage_type *) - const sender_account : account = get_account(user_trx_params.from_, s); - - (* Check permissions *) - if user_trx_params.from_ = Tezos.sender or sender_account.allowances contains Tezos.sender then - skip - else failwith("FA2_NOT_OPERATOR"); - (* Perform single transfer *) - function make_transfer(const s : storage_type; const transfer : transfer_destination) : storage_type is + function make_transfer(var s : storage_type; const transfer : transfer_destination) : storage_type is block { + (* Retrieve sender account from storage_type *) + var sender_account : account := get_account(user_trx_params.from_, s); + + (* Check permissions *) + if user_trx_params.from_ = Tezos.sender or sender_account.allowances contains Tezos.sender then + skip + else failwith("FA2_NOT_OPERATOR"); + (* Token id check *) if default_token_id =/= transfer.token_id then failwith("FA2_TOKEN_UNDEFINED") @@ -52,7 +52,7 @@ function iterate_transfer (const s : storage_type; const user_trx_params : trans } with (List.fold (make_transfer, user_trx_params.txs, s)) (* Perform single operator update *) -function iterate_update_operator (const s : storage_type; const params : update_operator_param) : storage_type is +function iterate_update_operator (var s : storage_type; const params : update_operator_param) : storage_type is block { case params of | Add_operator(param) -> { diff --git a/contracts/partials/Dex.ligo b/contracts/partials/Dex.ligo index 4133abe1..4f584be7 100644 --- a/contracts/partials/Dex.ligo +++ b/contracts/partials/Dex.ligo @@ -1,14 +1,13 @@ [@inline] function call_balance( const p : bal_action_type; - const this : address; const idx : nat; - const s : full_storage_type) + var s : full_storage_type) : full_return_type is block { const res : return_type = case s.balance_lambdas[idx] of - Some(f) -> f(p, s.storage, this) + Some(f) -> f(p, s.storage) | None -> (failwith("Dex/function-not-set") : return_type) end; s.storage := res.1; @@ -28,24 +27,23 @@ based on the argument type. [@inline] function call_dex( const p : action_type; - const this : address; - const s : full_storage_type) + var s : full_storage_type) : full_return_type is block { const idx : nat = case p of - AddPair(n) -> 0n - | Swap(n) -> 1n - | Invest(n) -> 2n - | Divest(n) -> 3n - | EnsuredAddPair(n) -> 4n - | EnsuredSwap(n) -> 5n - | EnsuredInvest(n) -> 6n + AddPair(_) -> 0n + | Swap(_) -> 1n + | Invest(_) -> 2n + | Divest(_) -> 3n + | EnsuredAddPair(_) -> 4n + | EnsuredSwap(_) -> 5n + | EnsuredInvest(_) -> 6n end; - const res : return_type = + var res : return_type := case s.dex_lambdas[idx] of - Some(f) -> f(p, s.storage, this) + Some(f) -> f(p, s.storage) | None -> (failwith("Dex/function-not-set") : return_type) end; s.storage := res.1; @@ -54,7 +52,7 @@ function call_dex( then res.0 := Tezos.transaction( unit, 0mutez, - get_close_entrypoint(this)) # res.0 + get_close_entrypoint(Tezos.self_address)) # res.0 else skip; } with (res.0, s) @@ -71,14 +69,13 @@ based on the provided index. *) [@inline] function call_token( const p : token_action_type; - const this : address; const idx : nat; - const s : full_storage_type) + var s : full_storage_type) : full_return_type is block { const res : return_type = case s.token_lambdas[idx] of - Some(f) -> f(p, s.storage, this) + Some(f) -> f(p, s.storage) | None -> (failwith("Dex/function-not-set") : return_type) end; s.storage := res.1; @@ -86,8 +83,8 @@ based on the provided index. [@inline] function close( - const s : full_storage_type) - : full_storage_type is + var s : full_storage_type) + : full_storage_type is block { if not s.storage.entered then failwith("Dex/not-entered") @@ -127,11 +124,11 @@ function get_reserves( function set_dex_function( const idx : nat; const f : dex_func_type; - const s : full_storage_type) + var s : full_storage_type) : full_storage_type is block { case s.dex_lambdas[idx] of - Some(n) -> failwith("Dex/function-set") + Some(_) -> failwith("Dex/function-set") | None -> s.dex_lambdas[idx] := f end; } with s @@ -141,11 +138,11 @@ function set_dex_function( function set_token_function( const idx : nat; const f : token_func_type; - const s : full_storage_type) + var s : full_storage_type) : full_storage_type is block { case s.token_lambdas[idx] of - Some(n) -> failwith("Dex/function-set") + Some(_) -> failwith("Dex/function-set") | None -> s.token_lambdas[idx] := f end; } with s @@ -155,11 +152,11 @@ function set_token_function( function set_balance_function( const idx : nat; const f : bal_func_type; - const s : full_storage_type) + var s : full_storage_type) : full_storage_type is block { case s.balance_lambdas[idx] of - Some(n) -> failwith("Dex/function-set") + Some(_) -> failwith("Dex/function-set") | None -> s.balance_lambdas[idx] := f end; } with s \ No newline at end of file diff --git a/contracts/partials/IDex.ligo b/contracts/partials/IDex.ligo index 7649b7ab..315cd8c7 100644 --- a/contracts/partials/IDex.ligo +++ b/contracts/partials/IDex.ligo @@ -165,9 +165,9 @@ type token_action_type is | IUpdate_operators of operator_type (* updates the token operators *) type return_type is list (operation) * storage_type -type dex_func_type is (action_type * storage_type * address) -> return_type -type token_func_type is (token_action_type * storage_type * address) -> return_type -type bal_func_type is (bal_action_type * storage_type * address) -> return_type +type dex_func_type is (action_type * storage_type) -> return_type +type token_func_type is (token_action_type * storage_type) -> return_type +type bal_func_type is (bal_action_type * storage_type) -> return_type type set_token_func_type is record [ func : token_func_type; (* code of the function *) diff --git a/contracts/partials/MethodDex.ligo b/contracts/partials/MethodDex.ligo index 713fe279..34722709 100644 --- a/contracts/partials/MethodDex.ligo +++ b/contracts/partials/MethodDex.ligo @@ -1,354 +1,12 @@ -(* Helper function to get account *) -function get_account( - const key : (address * nat); - const s : storage_type) : account_info is - case s.ledger[key] of - None -> record [ - balance = 0n; - allowances = (set [] : set (address)); - ] - | Some(instance) -> instance - end; - -(* Helper function to get token pair *) -function get_pair( - const key : tokens_type; - const s : storage_type) : (pair_type * nat) is - block { - const token_bytes : bytes = Bytes.pack(key); - const token_id : nat = case s.token_to_id[token_bytes] of - None -> s.pairs_count - | Some(instance) -> instance - end; - const pair : pair_type = case s.pairs[token_id] of - None -> record [ - token_a_pool = 0n; - token_b_pool = 0n; - total_supply = 0n; - ] - | Some(instance) -> instance - end; - } with (pair, token_id) - -(* Helper function to wrap the pair for swap *) -function form_pools( - const from_pool: nat; - const to_pool: nat; - const supply: nat; - const direction: swap_type) : pair_type is - case direction of - Buy -> record [ - token_a_pool = to_pool; - token_b_pool = from_pool; - total_supply = supply; - ] - | Sell -> record [ - token_a_pool = from_pool; - token_b_pool = to_pool; - total_supply = supply; - ] - end; - -(* Helper function to unwrap the pair for swap *) -function form_swap_data( - const pair: pair_type; - const swap: tokens_type; - const direction: swap_type) : swap_data_type is - block { - const side_a : swap_side_type = record [ - pool = pair.token_a_pool; - token = swap.token_a_address; - id = swap.token_a_id; - standard = swap.token_a_type; - ]; - const side_b : swap_side_type = record [ - pool = pair.token_b_pool; - token = swap.token_b_address; - id = swap.token_b_id; - standard = swap.token_b_type; - ]; - } with case direction of - Sell -> record [ - from_ = side_a; - to_ = side_b; - ] - | Buy -> record [ - from_ = side_b; - to_ = side_a; - ] - end; - -(* Helper function to prepare the token transfer *) -function wrap_fa2_transfer_trx( - const owner : address; - const receiver : address; - const value : nat; - const token_id : nat) : entry_fa2_type is - TransferTypeFA2(list[ - record[ - from_ = owner; - txs = list [ record [ - to_ = receiver; - token_id = token_id; - amount = value; - ] ] - ] - ]) - -(* Helper function to prepare the token transfer *) -function wrap_fa12_transfer_trx( - const owner : address; - const receiver : address; - const value : nat) : entry_fa12_type is - TransferTypeFA12(owner, (receiver, value)) - -(* Helper function to get fa2 token contract *) -function get_fa2_token_contract( - const token_address : address) : contract(entry_fa2_type) is - case (Tezos.get_entrypoint_opt( - "%transfer", - token_address) : option(contract(entry_fa2_type))) of - Some(contr) -> contr - | None -> (failwith("Dex/not-token") : contract(entry_fa2_type)) - end; - -(* Helper function to get fa1.2 token contract *) -function get_fa12_token_contract( - const token_address : address) : contract(entry_fa12_type) is - case (Tezos.get_entrypoint_opt( - "%transfer", - token_address) : option(contract(entry_fa12_type))) of - Some(contr) -> contr - | None -> (failwith("Dex/not-token") : contract(entry_fa12_type)) - end; - -(* Helper function to get fa2 token contract *) -function get_fa2_balance_entrypoint( - const token_address : address) : contract(entry_fa2_type) is - case (Tezos.get_entrypoint_opt( - "%transfer", - token_address) : option(contract(entry_fa2_type))) of - Some(contr) -> contr - | None -> (failwith("Dex/not-token") : contract(entry_fa2_type)) - end; - -(* Helper function to get fa1.2 token contract *) -function get_fa12_balance_entrypoint( - const token_address : address) : contract(entry_fa12_type) is - case (Tezos.get_entrypoint_opt( - "%transfer", - token_address) : option(contract(entry_fa12_type))) of - Some(contr) -> contr - | None -> (failwith("Dex/not-token") : contract(entry_fa12_type)) - end; - -(* Helper function to get the reentrancy entrypoint of the current contract *) -function get_close_entrypoint( - const contract_address : address) : contract(unit) is - case (Tezos.get_entrypoint_opt( - "%close", contract_address) : option(contract(unit))) of - Some(contr) -> contr - | None -> (failwith("Dex/no-close-entrypoint") : contract(unit)) - end; - -(* Helper function to transfer fa2 tokens *) -function transfer_fa2( - const sender_ : address; - const receiver : address; - const amount_ : nat; - const token_id : nat; - const contract_address : address) : operation is - Tezos.transaction( - wrap_fa2_transfer_trx( - sender_, - receiver, - amount_, - token_id), - 0mutez, - get_fa2_token_contract(contract_address) - ); - -(* Helper function to transfer fa1.2 tokens *) -function transfer_fa12( - const sender_ : address; - const receiver : address; - const amount_ : nat; - const contract_address : address) : operation is - Tezos.transaction( - wrap_fa12_transfer_trx( - sender_, - receiver, - amount_), - 0mutez, - get_fa12_token_contract(contract_address) - ); - -function get_bal_fa12_a(const self : address) : contract(nat) is - case (Tezos.get_entrypoint_opt("%balanceAFA12", self) : option(contract(nat))) of - | Some(contr) -> contr - | None -> (failwith("Dex/balanceAFa12") : contract(nat)) - end -function get_bal_fa12_b(const self : address) : contract(nat) is - case (Tezos.get_entrypoint_opt("%balanceBFA12", self) : option(contract(nat))) of - | Some(contr) -> contr - | None -> (failwith("Dex/balanceBFa12") : contract(nat)) - end - -function get_bal_fa2_a(const self : address) : contract(list(balance_of_response)) is - case (Tezos.get_entrypoint_opt("%balanceAFA2", self) : option(contract(list(balance_of_response)))) of - | Some(contr) -> contr - | None -> (failwith("Dex/balanceAFa2") : contract(list(balance_of_response))) - end - -function get_bal_fa2_b(const self : address) : contract(list(balance_of_response)) is - case (Tezos.get_entrypoint_opt("%balanceBFA2", self) : option(contract(list(balance_of_response)))) of - | Some(contr) -> contr - | None -> (failwith("Dex/balanceBFa2") : contract(list(balance_of_response))) - end - -function get_fa12_balance_entrypoint(const token : address) : contract(bal_fa12_type) is - case (Tezos.get_entrypoint_opt("%getBalance", token): option(contract(bal_fa12_type))) of - | Some(contr) -> contr - | None -> (failwith("Dex/balance-of-ep") : contract(bal_fa12_type)) - end - -function get_fa2_balance_entrypoint(const token : address): contract(bal_fa2_type) is - case (Tezos.get_entrypoint_opt("%balance_of", token): option(contract(bal_fa2_type))) of - | Some(contr) -> contr - | None -> (failwith("Dex/balance-of-ep") : contract(bal_fa2_type)) - end - -function get_ensured_initialize_entrypoint(const token : address): contract(ensured_add_type) is - case (Tezos.get_entrypoint_opt("%ensuredAddPair", token): option(contract(ensured_add_type))) of - | Some(contr) -> contr - | None -> (failwith("Dex/no-entrypoint") : contract(ensured_add_type)) - end - -function get_ensured_invest_entrypoint(const token : address): contract(ensured_invest_type) is - case (Tezos.get_entrypoint_opt("%ensuredInvest", token): option(contract(ensured_invest_type))) of - | Some(contr) -> contr - | None -> (failwith("Dex/no-entrypoint") : contract(ensured_invest_type)) - end - -function get_ensured_swap_entrypoint(const token : address): contract(ensured_route_type) is - case (Tezos.get_entrypoint_opt("%ensuredSwap", token): option(contract(ensured_route_type))) of - | Some(contr) -> contr - | None -> (failwith("Dex/no-entrypoint") : contract(ensured_route_type)) - end - -(* Helper function to transfer fa2 tokens *) -function get_balance_fa2( - const user : address; - const token_id : nat; - const contract_address : address; - const callback : contract(list(balance_of_response))) : operation is - Tezos.transaction( - record [ - requests = list [ - record [ - owner = user; - token_id = token_id; - ] - ]; - callback = callback - ], - 0mutez, - get_fa2_balance_entrypoint(contract_address) - ); - -(* Helper function to transfer fa1.2 tokens *) -function get_balance_fa12( - const user : address; - const contract_address : address; - const callback : contract(nat)) : operation is - Tezos.transaction( - (user, callback), - 0mutez, - get_fa12_balance_entrypoint(contract_address) - ); - -(* Helper function to transfer the asset based on its standard *) -function typed_transfer( - const sender_ : address; - const receiver : address; - const amount_ : nat; - const token_id : nat; - const contract_address : address; - const standard: token_type) : operation is - case standard of - Fa12 -> transfer_fa12( - sender_, - receiver, - amount_, - contract_address) - | Fa2 -> transfer_fa2( - sender_, - receiver, - amount_, - token_id, - contract_address) - end; - -(* Helper function to transfer the asset based on its standard *) -function typed_get_balance( - const account : address; - const token_id : nat; - const contract_address : address; - const standard: token_type; - const name : token_name) : operation is - block { - var op : option(operation) := (None : option(operation)); - case standard of - Fa12 -> { - const callback : contract(nat) = case name of - | A -> get_bal_fa12_a(account) - | B -> get_bal_fa12_b(account) - end; - op := Some(get_balance_fa12( - account, - contract_address, - callback)); - } - | Fa2 -> { - const callback : contract(list(balance_of_response)) = case name of - | A -> get_bal_fa2_a(account) - | B -> get_bal_fa2_b(account) - end; - op := Some(get_balance_fa2( - account, - token_id, - contract_address, - callback)); - } - end; - } with case op of - | Some(o) -> o - | None -> (failwith("Dex/no-balance") : operation) - end - -(* Helper function to transfer the asset based on its standard *) -function check_token_id( - const token_id : nat; - const standard: token_type) : unit is - case standard of - Fa12 -> if token_id = 0n - then unit - else (failwith("Dex/non-zero-token-id") : unit) - | Fa2 -> unit - end; - -#include "../partials/MethodFA2.ligo" - (* Initialize exchange after the previous liquidity was drained *) function ensured_initialize_exchange( const p : action_type; - const s : storage_type; - const this: address) : return_type is + var s : storage_type) : return_type is block { var operations: list(operation) := list[]; case p of EnsuredAddPair(params) -> { - if Tezos.sender =/= this + if Tezos.sender =/= Tezos.self_address then failwith("Dex/not-self") else skip; @@ -365,7 +23,7 @@ function ensured_initialize_exchange( (* read pair info*) const res : (pair_type * nat) = get_pair(params.pair, s); - const pair : pair_type = res.0; + var pair : pair_type := res.0; const token_id : nat = res.1; (* update counter if needed *) @@ -416,20 +74,14 @@ function ensured_initialize_exchange( s.pairs[token_id] := pair; s.tokens[token_id] := params.pair; } - | AddPair(n) -> skip - | Swap(n) -> skip - | EnsuredSwap(n) -> skip - | Invest(n) -> skip - | EnsuredInvest(n) -> skip - | Divest(n) -> skip + | _ -> skip end } with (operations, s) (* Initialize exchange after the previous liquidity was drained *) function initialize_exchange( const p : action_type; - const s : storage_type; - const this: address) : return_type is + var s : storage_type) : return_type is block { var operations: list(operation) := list[]; case p of @@ -446,14 +98,14 @@ function initialize_exchange( (* prepare operations to get initial liquidity *) operations := list [ typed_get_balance( - this, + Tezos.self_address, params.pair.token_a_id, params.pair.token_a_address, params.pair.token_a_type, A(unit) ); typed_get_balance( - this, + Tezos.self_address, params.pair.token_b_id, params.pair.token_b_address, params.pair.token_b_type, @@ -461,7 +113,7 @@ function initialize_exchange( ); typed_transfer( Tezos.sender, - this, + Tezos.self_address, params.token_a_in, params.pair.token_a_id, params.pair.token_a_address, @@ -469,21 +121,21 @@ function initialize_exchange( ); typed_transfer( Tezos.sender, - this, + Tezos.self_address, params.token_b_in, params.pair.token_b_id, params.pair.token_b_address, params.pair.token_b_type ); typed_get_balance( - this, + Tezos.self_address, params.pair.token_a_id, params.pair.token_a_address, params.pair.token_a_type, A(unit) ); typed_get_balance( - this, + Tezos.self_address, params.pair.token_b_id, params.pair.token_b_address, params.pair.token_b_type, @@ -495,22 +147,17 @@ function initialize_exchange( receiver=Tezos.sender; ], 0mutez, - get_ensured_initialize_entrypoint(this) + get_ensured_initialize_entrypoint(Tezos.self_address) ); ]; } - | EnsuredAddPair(n) -> skip - | Swap(n) -> skip - | EnsuredSwap(n) -> skip - | Invest(n) -> skip - | EnsuredInvest(n) -> skip - | Divest(n) -> skip + | _ -> skip end } with (operations, s) (* Intrenal functions for swap hops *) function internal_token_to_token_swap( - const tmp : tmp_swap_type; + var tmp : tmp_swap_type; const params : swap_slice_type ) : tmp_swap_type is block { (* check preconditions *) @@ -524,7 +171,7 @@ function internal_token_to_token_swap( const res : (pair_type * nat) = get_pair(params.pair, tmp.s); const pair : pair_type = res.0; const token_id : nat = res.1; - const swap: swap_data_type = form_swap_data(pair, params.pair, params.operation); + var swap: swap_data_type := form_swap_data(pair, params.pair, params.operation); (* ensure there is liquidity *) if pair.token_a_pool * pair.token_b_pool = 0n @@ -578,12 +225,10 @@ function internal_token_to_token_swap( note: tokens should be approved before the operation *) function token_to_token_route( const p : action_type; - const s : storage_type; - const this : address) : return_type is + var s : storage_type) : return_type is block { var operations: list(operation) := list[]; case p of - | AddPair(n) -> skip | Swap(params) -> { if s.entered then failwith("Dex/reentrancy") @@ -614,21 +259,21 @@ function token_to_token_route( operations := list [ (* from *) typed_get_balance( - this, + Tezos.self_address, first_swap.pair.token_a_id, first_swap.pair.token_a_address, first_swap.pair.token_a_type, A(unit) ); typed_transfer(Tezos.sender, - this, + Tezos.self_address, params.amount_in, first_swap.pair.token_a_id, first_swap.pair.token_a_address, first_swap.pair.token_a_type ) ; typed_get_balance( - this, + Tezos.self_address, first_swap.pair.token_a_id, first_swap.pair.token_a_address, first_swap.pair.token_a_type, @@ -641,7 +286,7 @@ function token_to_token_route( receiver=params.receiver; ], 0mutez, - get_ensured_swap_entrypoint(this) + get_ensured_swap_entrypoint(Tezos.self_address) ); ]; (* TODO : add continue *) @@ -650,21 +295,21 @@ function token_to_token_route( operations := list [ (* from *) typed_get_balance( - this, + Tezos.self_address, first_swap.pair.token_b_id, first_swap.pair.token_b_address, first_swap.pair.token_b_type, B(unit) ); typed_transfer(Tezos.sender, - this, + Tezos.self_address, params.amount_in, first_swap.pair.token_b_id, first_swap.pair.token_b_address, first_swap.pair.token_b_type ); typed_get_balance( - this, + Tezos.self_address, first_swap.pair.token_b_id, first_swap.pair.token_b_address, first_swap.pair.token_b_type, @@ -677,17 +322,13 @@ function token_to_token_route( receiver=params.receiver; ], 0mutez, - get_ensured_swap_entrypoint(this) + get_ensured_swap_entrypoint(Tezos.self_address) ); ]; } end; } - | EnsuredAddPair(n) -> skip - | EnsuredSwap(n) -> skip - | Invest(n) -> skip - | EnsuredInvest(n) -> skip - | Divest(n) -> skip + | _ -> skip end } with (operations, s) @@ -695,14 +336,12 @@ function token_to_token_route( note: tokens should be approved before the operation *) function ensured_route( const p : action_type; - const s : storage_type; - const this : address) : return_type is + var s : storage_type) : return_type is block { var operations: list(operation) := list[]; case p of - | AddPair(n) -> skip | EnsuredSwap(params) -> { - if Tezos.sender =/= this + if Tezos.sender =/= Tezos.self_address then failwith("Dex/not-self") else skip; @@ -743,7 +382,7 @@ function ensured_route( s = s; amount_in = amount_in; operation = (None : option(operation)); - sender = this; + sender = Tezos.self_address; receiver = params.receiver; token_id_in = token_id_in; token_address_in = token_address_in; @@ -764,11 +403,7 @@ function ensured_route( end; operations := last_operation # operations; } - | EnsuredAddPair(n) -> skip - | Swap(n) -> skip - | Invest(n) -> skip - | EnsuredInvest(n) -> skip - | Divest(n) -> skip + | _ -> skip end } with (operations, s) @@ -776,13 +411,10 @@ function ensured_route( note: tokens should be approved before the operation *) function invest_liquidity( const p : action_type; - const s : storage_type; - const this: address) : return_type is + var s : storage_type) : return_type is block { var operations: list(operation) := list[]; case p of - | AddPair(n) -> skip - | Swap(n) -> skip | Invest(params) -> { if s.entered then failwith("Dex/reentrancy") @@ -796,14 +428,14 @@ function invest_liquidity( (* prepare operations to get initial liquidity *) operations := list [ typed_get_balance( - this, + Tezos.self_address, params.pair.token_a_id, params.pair.token_a_address, params.pair.token_a_type, A(unit) ); typed_get_balance( - this, + Tezos.self_address, params.pair.token_b_id, params.pair.token_b_address, params.pair.token_b_type, @@ -811,7 +443,7 @@ function invest_liquidity( ); typed_transfer( Tezos.sender, - this, + Tezos.self_address, params.token_a_in, params.pair.token_a_id, params.pair.token_a_address, @@ -819,21 +451,21 @@ function invest_liquidity( ); typed_transfer( Tezos.sender, - this, + Tezos.self_address, params.token_b_in, params.pair.token_b_id, params.pair.token_b_address, params.pair.token_b_type ); typed_get_balance( - this, + Tezos.self_address, params.pair.token_a_id, params.pair.token_a_address, params.pair.token_a_type, A(unit) ); typed_get_balance( - this, + Tezos.self_address, params.pair.token_b_id, params.pair.token_b_address, params.pair.token_b_type, @@ -846,14 +478,11 @@ function invest_liquidity( receiver=Tezos.sender; ], 0mutez, - get_ensured_invest_entrypoint(this) + get_ensured_invest_entrypoint(Tezos.self_address) ); ]; } - | EnsuredAddPair(n) -> skip - | EnsuredSwap(n) -> skip - | EnsuredInvest(n) -> skip - | Divest(n) -> skip + | _ -> skip end } with (operations, s) @@ -861,15 +490,12 @@ function invest_liquidity( note: tokens should be approved before the operation *) function ensured_invest( const p : action_type; - const s : storage_type; - const this: address) : return_type is + var s : storage_type) : return_type is block { var operations: list(operation) := list[]; case p of - | AddPair(n) -> skip - | Swap(n) -> skip | EnsuredInvest(params) -> { - if Tezos.sender =/= this + if Tezos.sender =/= Tezos.self_address then failwith("Dex/not-self") else skip; @@ -882,7 +508,7 @@ function ensured_invest( (* read pair info*) const res : (pair_type * nat) = get_pair(params.pair, s); - const pair : pair_type = res.0; + var pair : pair_type := res.0; const token_id : nat = res.1; (* ensure there is liquidity *) @@ -894,20 +520,20 @@ function ensured_invest( then failwith("Dex/wrong-params") else skip; (* calculate tokens to be withdrawn *) - const tokens_a_required : nat = + var tokens_a_required : nat := params.shares * pair.token_a_pool / pair.total_supply; if params.shares * pair.token_a_pool > tokens_a_required * pair.total_supply then tokens_a_required := tokens_a_required + 1n else skip; - const tokens_b_required : nat = + var tokens_b_required : nat := params.shares * pair.token_b_pool / pair.total_supply; if params.shares * pair.token_b_pool > tokens_b_required * pair.total_supply then tokens_b_required := tokens_b_required + 1n else skip; (* update pool reserves *) - const token_a_in : nat = 0n; - const token_b_in : nat = 0n; + var token_a_in : nat := 0n; + var token_b_in : nat := 0n; case s.tmp.balance_a of | Some(balance_a) -> token_a_in := balance_a | None -> failwith("Dex/balanca-a-not-updated") @@ -946,7 +572,7 @@ function ensured_invest( if tokens_a_required < token_a_in then operations := typed_transfer( - this, + Tezos.self_address, params.receiver, abs(tokens_a_required - token_a_in), params.pair.token_a_id, @@ -957,7 +583,7 @@ function ensured_invest( if tokens_b_required < token_b_in then operations := typed_transfer( - this, + Tezos.self_address, params.receiver, abs(tokens_b_required - token_b_in), params.pair.token_b_id, @@ -966,27 +592,17 @@ function ensured_invest( ) # operations else skip; } - | EnsuredAddPair(n) -> skip - | EnsuredSwap(n) -> skip - | Invest(n) -> skip - | Divest(n) -> skip + | _ -> skip end } with (operations, s) (* Remove liquidity (both tokens) from the pool by burning shares *) function divest_liquidity( const p : action_type; - const s : storage_type; - const this: address) : return_type is + var s : storage_type) : return_type is block { var operations: list(operation) := list[]; case p of - | AddPair(token_amount) -> skip - | EnsuredAddPair(n) -> skip - | Swap(n) -> skip - | EnsuredSwap(n) -> skip - | Invest(n) -> skip - | EnsuredInvest(n) -> skip | Divest(params) -> { if s.entered then failwith("Dex/reentrancy") @@ -1001,7 +617,7 @@ function divest_liquidity( (* read pair info*) const res : (pair_type * nat) = get_pair(params.pair, s); - const pair : pair_type = res.0; + var pair : pair_type := res.0; const token_id : nat = res.1; (* ensure pair exist *) @@ -1051,7 +667,7 @@ function divest_liquidity( (* prepare operations with tokens to user *) operations := typed_transfer( - this, + Tezos.self_address, Tezos.sender, token_a_divested, params.pair.token_a_id, @@ -1060,7 +676,7 @@ function divest_liquidity( ) # operations; operations := typed_transfer( - this, + Tezos.self_address, Tezos.sender, token_b_divested, params.pair.token_b_id, @@ -1068,14 +684,14 @@ function divest_liquidity( params.pair.token_b_type ) # operations; } + | _ -> skip end } with (operations, s) (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_12_a( const p : bal_action_type; - const s : storage_type; - const this: address) : return_type is + var s : storage_type) : return_type is block { var operations: list(operation) := list[]; case p of @@ -1088,21 +704,17 @@ function update_balance_fa_12_a( | None -> new_balance end); } - | IBalanceBFA12(n) -> skip - | IBalanceAFA2(n) -> skip - | IBalanceBFA2(n) -> skip + | _ -> skip end } with (operations, s) (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_12_b( const p : bal_action_type; - const s : storage_type; - const this: address) : return_type is + var s : storage_type) : return_type is block { var operations: list(operation) := list[]; case p of - | IBalanceAFA12(n) -> skip | IBalanceBFA12(new_balance) -> { s.tmp.balance_b := Some(case s.tmp.balance_b of | Some(prev_balance) -> @@ -1112,21 +724,17 @@ function update_balance_fa_12_b( | None -> new_balance end); } - | IBalanceAFA2(n) -> skip - | IBalanceBFA2(n) -> skip + | _ -> skip end } with (operations, s) (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_2_a( const p : bal_action_type; - const s : storage_type; - const this: address) : return_type is + var s : storage_type) : return_type is block { var operations: list(operation) := list[]; case p of - | IBalanceAFA12(n) -> skip - | IBalanceBFA12(n) -> skip | IBalanceAFA2(responses) -> { const response : balance_of_response = case List.head_opt(responses) of @@ -1134,7 +742,7 @@ function update_balance_fa_2_a( | None -> (failwith("Dex/no-balance-response") : balance_of_response) end; - if response.request.owner =/= this + if response.request.owner =/= Tezos.self_address then failwith("Dex/wrong-balance-owner") else skip; @@ -1146,21 +754,17 @@ function update_balance_fa_2_a( | None -> response.balance end); } - | IBalanceBFA2(n) -> skip + | _ -> skip end } with (operations, s) (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_2_b( const p : bal_action_type; - const s : storage_type; - const this: address) : return_type is + var s : storage_type) : return_type is block { var operations: list(operation) := list[]; case p of - | IBalanceAFA12(n) -> skip - | IBalanceBFA12(n) -> skip - | IBalanceAFA2(n) -> skip | IBalanceBFA2(responses) -> { const response : balance_of_response = case List.head_opt(responses) of @@ -1168,7 +772,7 @@ function update_balance_fa_2_b( | None -> (failwith("Dex/no-balance-response") : balance_of_response) end; - if response.request.owner =/= this + if response.request.owner =/= Tezos.self_address then failwith("Dex/wrong-balance-owner") else skip; @@ -1180,5 +784,6 @@ function update_balance_fa_2_b( | None -> response.balance end); } + | _ -> skip end } with (operations, s) diff --git a/contracts/partials/MethodFA2.ligo b/contracts/partials/MethodFA2.ligo index 0c426cfd..61b14f36 100644 --- a/contracts/partials/MethodFA2.ligo +++ b/contracts/partials/MethodFA2.ligo @@ -1,25 +1,31 @@ -(* Helper function to get allowance for an account *) -function get_allowance (const owner_account : account_info; const spender : address; const s : storage_type) : bool is - owner_account.allowances contains spender - (* Perform transfers from one owner *) -[@inline] function iterate_transfer (const s : storage_type; const user_trx_params : transfer_param) : storage_type is +[@inline] +function iterate_transfer( + var s : storage_type; + const user_trx_params : transfer_param) + : storage_type is block { (* Perform single transfer *) - function make_transfer(const s : storage_type; const transfer : transfer_destination) : storage_type is + function make_transfer( + var s : storage_type; + const transfer : transfer_destination) + : storage_type is block { (* Retrieve sender account from storage_type *) - const user_key : (address * nat) = (user_trx_params.from_, transfer.token_id); - const sender_account : account_info = get_account(user_key, s); + const user_key : (address * nat) = + (user_trx_params.from_, + transfer.token_id); + var sender_account : account_info := get_account(user_key, s); (* Check permissions *) - if user_trx_params.from_ = Tezos.sender or sender_account.allowances contains Tezos.sender then - skip + if user_trx_params.from_ = Tezos.sender + or sender_account.allowances contains Tezos.sender + then skip else failwith("FA2_NOT_OPERATOR"); (* Balance check *) - if sender_account.balance < transfer.amount then - failwith("FA2_INSUFFICIENT_BALANCE") + if sender_account.balance < transfer.amount + then failwith("FA2_INSUFFICIENT_BALANCE") else skip; (* Update sender balance *) @@ -29,7 +35,8 @@ function get_allowance (const owner_account : account_info; const spender : addr s.ledger[user_key] := sender_account; (* Create or get destination account *) - var dest_account : account_info := get_account((transfer.to_, transfer.token_id), s); + var dest_account : account_info := + get_account((transfer.to_, transfer.token_id), s); (* Update destination balance *) dest_account.balance := dest_account.balance + transfer.amount; @@ -40,35 +47,42 @@ function get_allowance (const owner_account : account_info; const spender : addr } with (List.fold (make_transfer, user_trx_params.txs, s)) (* Perform single operator update *) -function iterate_update_operator (const s : storage_type; const params : update_operator_param) : storage_type is +function iterate_update_operator( + var s : storage_type; + const params : update_operator_param) + : storage_type is block { case params of - | Add_operator(param) -> { + Add_operator(param) -> { (* Check an owner *) - if Tezos.sender =/= param.owner then - failwith("FA2_NOT_OWNER") + if Tezos.sender =/= param.owner + then failwith("FA2_NOT_OWNER") else skip; (* Create or get sender account *) - var sender_account : account_info := get_account((param.owner, param.token_id), s); + var sender_account : account_info := + get_account((param.owner, param.token_id), s); (* Set operator *) - sender_account.allowances := Set.add(param.operator, sender_account.allowances); + sender_account.allowances := + Set.add(param.operator, sender_account.allowances); (* Update storage_type *) s.ledger[(param.owner, param.token_id)] := sender_account; } | Remove_operator(param) -> { (* Check an owner *) - if Tezos.sender =/= param.owner then - failwith("FA2_NOT_OWNER") + if Tezos.sender =/= param.owner + then failwith("FA2_NOT_OWNER") else skip; (* Create or get sender account *) - var sender_account : account_info := get_account((param.owner, param.token_id), s); + var sender_account : account_info := + get_account((param.owner, param.token_id), s); (* Set operator *) - sender_account.allowances := Set.remove(param.operator, sender_account.allowances); + sender_account.allowances := + Set.remove(param.operator, sender_account.allowances); (* Update storage_type *) s.ledger[(param.owner, param.token_id)] := sender_account; @@ -77,29 +91,37 @@ function iterate_update_operator (const s : storage_type; const params : update_ } with s -function transfer (const p : token_action_type; var s : storage_type; const this : address) : return_type is +function transfer( + const p : token_action_type; + var s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of | ITransfer(params) -> { s := List.fold(iterate_transfer, params, s); } - | IBalance_of(params) -> skip - | IUpdate_operators(params) -> skip + | _ -> skip end } with (operations, s) -function get_balance_of (const p : token_action_type; const s : storage_type; const this : address) : return_type is +function get_balance_of( + const p : token_action_type; + const s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of - | ITransfer(params) -> skip | IBalance_of(bal_fa2_type) -> { (* Perform single balance lookup *) - function look_up_balance(const l: list (balance_of_response); const request : balance_of_request) : list (balance_of_response) is + function look_up_balance( + const l : list (balance_of_response); + const request : balance_of_request) + : list (balance_of_response) is block { (* Retrieve the asked account balance from storage_type *) - const sender_account : account_info = get_account((request.owner, request.token_id), s); + const sender_account : account_info = + get_account((request.owner, request.token_id), s); (* Form the response *) const response : balance_of_response = record [ @@ -109,21 +131,29 @@ function get_balance_of (const p : token_action_type; const s : storage_type; co } with response # l; (* Collect balances info *) - const accumulated_response : list (balance_of_response) = List.fold(look_up_balance, bal_fa2_type.requests, (nil: list(balance_of_response))); - operations := list[Tezos.transaction(accumulated_response, 0mutez, bal_fa2_type.callback)]; + const accumulated_response : list (balance_of_response) = + List.fold(look_up_balance, + bal_fa2_type.requests, + (nil: list(balance_of_response))); + operations := list[Tezos.transaction( + accumulated_response, + 0mutez, + bal_fa2_type.callback)]; } - | IUpdate_operators(params) -> skip + | _ -> skip end } with (operations, s) -function update_operators (const p : token_action_type; const s : storage_type; const this : address) : return_type is +function update_operators( + const p : token_action_type; + var s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of - | ITransfer(params) -> skip - | IBalance_of(params) -> skip | IUpdate_operators(params) -> { s := List.fold(iterate_update_operator, params, s); } + | _ -> skip end } with (operations, s) \ No newline at end of file diff --git a/contracts/partials/Utils.ligo b/contracts/partials/Utils.ligo new file mode 100644 index 00000000..074a55d9 --- /dev/null +++ b/contracts/partials/Utils.ligo @@ -0,0 +1,350 @@ +(* Helper function to get account *) +function get_account( + const key : (address * nat); + const s : storage_type) + : account_info is + case s.ledger[key] of + None -> record [ + balance = 0n; + allowances = (set [] : set (address)); + ] + | Some(instance) -> instance + end; + +(* Helper function to get token pair *) +function get_pair( + const key : tokens_type; + const s : storage_type) + : (pair_type * nat) is + block { + const token_bytes : bytes = Bytes.pack(key); + const token_id : nat = + case s.token_to_id[token_bytes] of + None -> s.pairs_count + | Some(instance) -> instance + end; + const pair : pair_type = + case s.pairs[token_id] of + None -> record [ + token_a_pool = 0n; + token_b_pool = 0n; + total_supply = 0n; + ] + | Some(instance) -> instance + end; + } with (pair, token_id) + +(* Helper function to wrap the pair for swap *) +function form_pools( + const from_pool : nat; + const to_pool : nat; + const supply : nat; + const direction : swap_type) + : pair_type is + case direction of + Buy -> record [ + token_a_pool = to_pool; + token_b_pool = from_pool; + total_supply = supply; + ] + | Sell -> record [ + token_a_pool = from_pool; + token_b_pool = to_pool; + total_supply = supply; + ] + end; + +(* Helper function to unwrap the pair for swap *) +function form_swap_data( + const pair : pair_type; + const swap : tokens_type; + const direction : swap_type) + : swap_data_type is + block { + const side_a : swap_side_type = record [ + pool = pair.token_a_pool; + token = swap.token_a_address; + id = swap.token_a_id; + standard = swap.token_a_type; + ]; + const side_b : swap_side_type = record [ + pool = pair.token_b_pool; + token = swap.token_b_address; + id = swap.token_b_id; + standard = swap.token_b_type; + ]; + } with case direction of + Sell -> record [ + from_ = side_a; + to_ = side_b; + ] + | Buy -> record [ + from_ = side_b; + to_ = side_a; + ] + end; + +(* Helper function to prepare the token transfer *) +function wrap_fa2_transfer_trx( + const owner : address; + const receiver : address; + const value : nat; + const token_id : nat) + : entry_fa2_type is + TransferTypeFA2(list[ + record[ + from_ = owner; + txs = list [ record [ + to_ = receiver; + token_id = token_id; + amount = value; + ] ] + ] + ]) + +(* Helper function to get fa2 token contract *) +function get_fa2_token_contract( + const token_address : address) + : contract(entry_fa2_type) is + case (Tezos.get_entrypoint_opt("%transfer", token_address) + : option(contract(entry_fa2_type))) of + Some(contr) -> contr + | None -> (failwith("Dex/not-token") : contract(entry_fa2_type)) + end; + +(* Helper function to get fa1.2 token contract *) +function get_fa12_token_contract( + const token_address : address) + : contract(entry_fa12_type) is + case (Tezos.get_entrypoint_opt("%transfer", token_address) + : option(contract(entry_fa12_type))) of + Some(contr) -> contr + | None -> (failwith("Dex/not-token") : contract(entry_fa12_type)) + end; + +(* Helper function to get fa2 token contract *) +function get_fa2_balance_entrypoint( + const token_address : address) + : contract(entry_fa2_type) is + case (Tezos.get_entrypoint_opt("%transfer", token_address) + : option(contract(entry_fa2_type))) of + Some(contr) -> contr + | None -> (failwith("Dex/not-token") : contract(entry_fa2_type)) + end; + +(* Helper function to get fa1.2 token contract *) +function get_fa12_balance_entrypoint( + const token_address : address) + : contract(entry_fa12_type) is + case (Tezos.get_entrypoint_opt("%transfer", token_address) + : option(contract(entry_fa12_type))) of + Some(contr) -> contr + | None -> (failwith("Dex/not-token") : contract(entry_fa12_type)) + end; + +(* Helper function to get the reentrancy entrypoint of the current contract *) +function get_close_entrypoint( + const self : address) + : contract(unit) is + case (Tezos.get_entrypoint_opt("%close", self) + : option(contract(unit))) of + Some(contr) -> contr + | None -> (failwith("Dex/no-close-entrypoint") : contract(unit)) + end; + +function get_bal_fa12_a( + const self : address) + : contract(nat) is + case (Tezos.get_entrypoint_opt("%balanceAFA12", self) + : option(contract(nat))) of + Some(contr) -> contr + | None -> (failwith("Dex/balanceAFa12") : contract(nat)) + end + +function get_bal_fa12_b( + const self : address) + : contract(nat) is + case (Tezos.get_entrypoint_opt("%balanceBFA12", self) + : option(contract(nat))) of + Some(contr) -> contr + | None -> (failwith("Dex/balanceBFa12") : contract(nat)) + end + +function get_bal_fa2_a( + const self : address) + : contract(list(balance_of_response)) is + case (Tezos.get_entrypoint_opt("%balanceAFA2", self) + : option(contract(list(balance_of_response)))) of + Some(contr) -> contr + | None -> (failwith("Dex/balanceAFa2") : contract(list(balance_of_response))) + end + +function get_bal_fa2_b( + const self : address) + : contract(list(balance_of_response)) is + case (Tezos.get_entrypoint_opt("%balanceBFA2", self) + : option(contract(list(balance_of_response)))) of + Some(contr) -> contr + | None -> (failwith("Dex/balanceBFa2") : contract(list(balance_of_response))) + end + +function get_fa12_balance_entrypoint( + const token : address) + : contract(bal_fa12_type) is + case (Tezos.get_entrypoint_opt("%getBalance", token) + : option(contract(bal_fa12_type))) of + Some(contr) -> contr + | None -> (failwith("Dex/balance-of-ep") : contract(bal_fa12_type)) + end + +function get_fa2_balance_entrypoint( + const token : address) + : contract(bal_fa2_type) is + case (Tezos.get_entrypoint_opt("%balance_of", token) + : option(contract(bal_fa2_type))) of + Some(contr) -> contr + | None -> (failwith("Dex/balance-of-ep") : contract(bal_fa2_type)) + end + +function get_ensured_initialize_entrypoint( + const token : address) + : contract(ensured_add_type) is + case (Tezos.get_entrypoint_opt("%ensuredAddPair", token) + : option(contract(ensured_add_type))) of + Some(contr) -> contr + | None -> (failwith("Dex/no-entrypoint") : contract(ensured_add_type)) + end + +function get_ensured_invest_entrypoint( + const token : address) + : contract(ensured_invest_type) is + case (Tezos.get_entrypoint_opt("%ensuredInvest", token) + : option(contract(ensured_invest_type))) of + Some(contr) -> contr + | None -> (failwith("Dex/no-entrypoint") : contract(ensured_invest_type)) + end + +function get_ensured_swap_entrypoint( + const token : address) + : contract(ensured_route_type) is + case (Tezos.get_entrypoint_opt("%ensuredSwap", token) + : option(contract(ensured_route_type))) of + Some(contr) -> contr + | None -> (failwith("Dex/no-entrypoint") : contract(ensured_route_type)) + end + +(* Helper function to transfer fa2 tokens *) +function get_balance_fa2( + const user : address; + const token_id : nat; + const token : address; + const callback : contract(list(balance_of_response))) + : operation is + Tezos.transaction( + record [ + requests = list [ + record [ + owner = user; + token_id = token_id; + ] + ]; + callback = callback + ], + 0mutez, + get_fa2_balance_entrypoint(token) + ); + +(* Helper function to transfer fa1.2 tokens *) +function get_balance_fa12( + const user : address; + const token : address; + const callback : contract(nat)) + : operation is + Tezos.transaction( + (user, callback), + 0mutez, + get_fa12_balance_entrypoint(token) + ); + +(* Helper function to transfer the asset based on its standard *) +function typed_transfer( + const owner : address; + const receiver : address; + const amount_ : nat; + const token_id : nat; + const token : address; + const standard : token_type) + : operation is + case standard of + Fa12 -> Tezos.transaction( + TransferTypeFA12(owner, (receiver, amount_)), + 0mutez, + get_fa12_token_contract(token) + ) + | Fa2 -> Tezos.transaction( + TransferTypeFA2(list[ + record[ + from_ = owner; + txs = list [ record [ + to_ = receiver; + token_id = token_id; + amount = amount_; + ] ] + ] + ]), + 0mutez, + get_fa2_token_contract(token) + ) + end; + +(* Helper function to transfer the asset based on its standard *) +function typed_get_balance( + const account : address; + const token_id : nat; + const token : address; + const standard : token_type; + const name : token_name) + : operation is + block { + var op : option(operation) := (None : option(operation)); + case standard of + Fa12 -> { + const callback : contract(nat) = + case name of + A -> get_bal_fa12_a(account) + | B -> get_bal_fa12_b(account) + end; + op := Some(get_balance_fa12( + account, + token, + callback)); + } + | Fa2 -> { + const callback : contract(list(balance_of_response)) = + case name of + A -> get_bal_fa2_a(account) + | B -> get_bal_fa2_b(account) + end; + op := Some(get_balance_fa2( + account, + token_id, + token, + callback)); + } + end; + } with case op of + Some(o) -> o + | None -> (failwith("Dex/no-balance") : operation) + end + +(* Helper function to transfer the asset based on its standard *) +function check_token_id( + const token_id : nat; + const standard : token_type) + : unit is + case standard of + Fa12 -> if token_id = 0n + then unit + else (failwith("Dex/non-zero-token-id") : unit) + | Fa2 -> unit + end; diff --git a/contracts/partials/View.ligo b/contracts/partials/View.ligo deleted file mode 100644 index 0bde27c8..00000000 --- a/contracts/partials/View.ligo +++ /dev/null @@ -1,30 +0,0 @@ -type token_id is nat - -type token_metadata_info is - [@layout:comb] - record [ - token_id : token_id; - token_info : map (string, bytes); - ] - -type func_type is nat -> token_metadata_info -type storage_type is big_map(nat, func_type) - -function get_metadata (const token_id : nat) : token_metadata_info is - record [ - token_id = 0n; - token_info = map[ - "symbol" -> 0x515054; - "name" -> 0x5175697075204c5020546f6b656e; - "decimals" -> 0x36; - "shouldPreferSymbol" -> 0x74727565; - "description" -> 0x51756970757377617020536861726520506f6f6c20546f6b656e; - "thumbnailUri" -> 0x68747470733a2f2f7175697075737761702e636f6d2f51504c502e706e67; - ] - ] - -function main (const f : func_type ; const s : storage_type) : - (list(operation) * storage_type) is - block { - s[0n] := f; - } with ((nil : list(operation)), s) From 56f4e6182b55f52ed9e96fb40c60755037ead325 Mon Sep 17 00:00:00 2001 From: KStasi Date: Fri, 17 Sep 2021 10:42:09 +0200 Subject: [PATCH 19/22] refactoring --- contracts/partials/MethodDex.ligo | 295 +++++++++++++++++------------- 1 file changed, 172 insertions(+), 123 deletions(-) diff --git a/contracts/partials/MethodDex.ligo b/contracts/partials/MethodDex.ligo index 34722709..09f663c6 100644 --- a/contracts/partials/MethodDex.ligo +++ b/contracts/partials/MethodDex.ligo @@ -1,7 +1,8 @@ (* Initialize exchange after the previous liquidity was drained *) function ensured_initialize_exchange( - const p : action_type; - var s : storage_type) : return_type is + const p : action_type; + var s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of @@ -13,9 +14,11 @@ function ensured_initialize_exchange( (* check preconditions *) if params.pair.token_a_address = params.pair.token_b_address and params.pair.token_a_id >= params.pair.token_b_id - then failwith("Dex/wrong-token-id") else skip; + then failwith("Dex/wrong-token-id") + else skip; if params.pair.token_a_address > params.pair.token_b_address - then failwith("Dex/wrong-pair") else skip; + then failwith("Dex/wrong-pair") + else skip; (* check fa1.2 token ids *) check_token_id(params.pair.token_a_id, params.pair.token_a_type); @@ -27,31 +30,37 @@ function ensured_initialize_exchange( const token_id : nat = res.1; (* update counter if needed *) - if s.pairs_count = token_id then { + if s.pairs_count = token_id + then { s.token_to_id[Bytes.pack(params.pair)] := token_id; s.pairs_count := s.pairs_count + 1n; - } else skip; + } + else skip; var token_a_in : nat := 0n; var token_b_in : nat := 0n; case s.tmp.balance_a of - | Some(balance_a) -> token_a_in := balance_a + Some(balance_a) -> token_a_in := balance_a | None -> failwith("Dex/balanca-a-not-updated") end; case s.tmp.balance_b of - | Some(balance_b) -> token_b_in := balance_b + Some(balance_b) -> token_b_in := balance_b | None -> failwith("Dex/balanca-b-not-updated") end; (* check preconditions *) if pair.token_a_pool * pair.token_b_pool =/= 0n (* no reserves *) - then failwith("Dex/non-zero-reserves") else skip; + then failwith("Dex/non-zero-reserves") + else skip; if pair.total_supply =/= 0n (* no shares owned *) - then failwith("Dex/non-zero-shares") else skip; + then failwith("Dex/non-zero-shares") + else skip; if token_a_in < 1n (* no token A invested *) - then failwith("Dex/no-token-a") else skip; + then failwith("Dex/no-token-a") + else skip; if token_b_in < 1n (* no token B invested *) - then failwith("Dex/no-token-b") else skip; + then failwith("Dex/no-token-b") + else skip; (* update pool reserves *) pair.token_a_pool := token_a_in; @@ -59,8 +68,8 @@ function ensured_initialize_exchange( (* calculate initial shares *) const init_shares : nat = - if token_a_in < token_b_in then - token_a_in + if token_a_in < token_b_in + then token_a_in else token_b_in; (* distribute initial shares *) @@ -80,8 +89,9 @@ function ensured_initialize_exchange( (* Initialize exchange after the previous liquidity was drained *) function initialize_exchange( - const p : action_type; - var s : storage_type) : return_type is + const p : action_type; + var s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of @@ -157,31 +167,38 @@ function initialize_exchange( (* Intrenal functions for swap hops *) function internal_token_to_token_swap( - var tmp : tmp_swap_type; - const params : swap_slice_type ) : tmp_swap_type is + var tmp : tmp_swap_type; + const params : swap_slice_type) + : tmp_swap_type is block { (* check preconditions *) if params.pair.token_a_address = params.pair.token_b_address - and params.pair.token_a_id >= params.pair.token_b_id - then failwith("Dex/wrong-token-id") else skip; + and params.pair.token_a_id >= params.pair.token_b_id + then failwith("Dex/wrong-token-id") + else skip; if params.pair.token_a_address > params.pair.token_b_address - then failwith("Dex/wrong-pair") else skip; + then failwith("Dex/wrong-pair") + else skip; (* get pair info*) const res : (pair_type * nat) = get_pair(params.pair, tmp.s); const pair : pair_type = res.0; const token_id : nat = res.1; - var swap: swap_data_type := form_swap_data(pair, params.pair, params.operation); + var swap: swap_data_type := + form_swap_data(pair, params.pair, params.operation); (* ensure there is liquidity *) if pair.token_a_pool * pair.token_b_pool = 0n - then failwith("Dex/not-launched") else skip; + then failwith("Dex/not-launched") + else skip; if tmp.amount_in = 0n (* non-zero amount of tokens exchanged *) - then failwith ("Dex/zero-amount-in") else skip; + then failwith ("Dex/zero-amount-in") + else skip; (* ensure the route is corresponding *) if swap.from_.token =/= tmp.token_address_in - or swap.from_.id =/= tmp.token_id_in - then failwith("Dex/wrong-route") else skip; + or swap.from_.id =/= tmp.token_id_in + then failwith("Dex/wrong-route") + else skip; (* calculate amount out *) const from_in_with_fee : nat = tmp.amount_in * 997n; @@ -191,10 +208,6 @@ function internal_token_to_token_swap( (* calculate swapped token amount *) const out : nat = numerator / denominator; - (* ensure the price impact isn't too high *) - if out > swap.to_.pool / 3n - then failwith("Dex/high-out") else skip; - (* update pools amounts *) swap.to_.pool := abs(swap.to_.pool - out); swap.from_.pool := swap.from_.pool + tmp.amount_in; @@ -224,8 +237,9 @@ function internal_token_to_token_swap( (* Exchange tokens to tokens with multiple hops, note: tokens should be approved before the operation *) function token_to_token_route( - const p : action_type; - var s : storage_type) : return_type is + const p : action_type; + var s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of @@ -236,11 +250,14 @@ function token_to_token_route( (* validate input params *) if List.size(params.swaps) < 1n (* the route is empty *) - then failwith ("Dex/too-few-swaps") else skip; + then failwith ("Dex/too-few-swaps") + else skip; if params.amount_in = 0n (* non-zero amount of tokens exchanged *) - then failwith ("Dex/zero-amount-in") else skip; + then failwith ("Dex/zero-amount-in") + else skip; if params.min_amount_out = 0n (* non-zero amount of tokens to receive *) - then failwith ("Dex/zero-min-amount-out") else skip; + then failwith ("Dex/zero-min-amount-out") + else skip; s.tmp := record [ balance_a = (None : option(nat)); @@ -248,14 +265,15 @@ function token_to_token_route( ]; (* get the first exchange info *) - const first_swap : swap_slice_type = case List.head_opt(params.swaps) of - Some(swap) -> swap - | None -> (failwith("Dex/zero-swaps") : swap_slice_type) - end; + const first_swap : swap_slice_type = + case List.head_opt(params.swaps) of + Some(swap) -> swap + | None -> (failwith("Dex/zero-swaps") : swap_slice_type) + end; (* prepare operation to withdraw user's tokens *) case first_swap.operation of - | Sell -> { + Sell -> { operations := list [ (* from *) typed_get_balance( @@ -335,21 +353,23 @@ function token_to_token_route( (* Exchange tokens to tokens with multiple hops, note: tokens should be approved before the operation *) function ensured_route( - const p : action_type; - var s : storage_type) : return_type is + const p : action_type; + var s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of - | EnsuredSwap(params) -> { + EnsuredSwap(params) -> { if Tezos.sender =/= Tezos.self_address then failwith("Dex/not-self") else skip; (* get the first exchange info *) - const first_swap : swap_slice_type = case List.head_opt(params.swaps) of - Some(swap) -> swap - | None -> (failwith("Dex/zero-swaps") : swap_slice_type) - end; + const first_swap : swap_slice_type = + case List.head_opt(params.swaps) of + Some(swap) -> swap + | None -> (failwith("Dex/zero-swaps") : swap_slice_type) + end; (* declare helper variables *) var token_id_in : nat := first_swap.pair.token_a_id; @@ -358,20 +378,19 @@ function ensured_route( (* prepare operation to withdraw user's tokens *) case first_swap.operation of - | Sell -> { - case s.tmp.balance_a of - | Some(balance_a) -> amount_in := balance_a - | None -> failwith("Dex/balanca-a-not-updated") - end; - } + Sell -> + case s.tmp.balance_a of + Some(balance_a) -> amount_in := balance_a + | None -> failwith("Dex/balanca-a-not-updated") + end | Buy -> { token_id_in := first_swap.pair.token_b_id; token_address_in := first_swap.pair.token_b_address; case s.tmp.balance_b of - | Some(balance_b) -> amount_in := balance_b + Some(balance_b) -> amount_in := balance_b | None -> failwith("Dex/balanca-b-not-updated") end; - } + } end; (* perform internal swaps *) @@ -391,16 +410,18 @@ function ensured_route( (* check the amount of tokens is sufficient *) if tmp.amount_in < params.min_amount_out - then failwith ("Dex/wrong-min-out") else skip; + then failwith ("Dex/wrong-min-out") + else skip; (* update storage_type*) s := tmp.s; (* add token transfer to user's account to operations *) - const last_operation : operation = case tmp.operation of - Some(o) -> o - | None -> (failwith("Dex/too-few-swaps") : operation) - end; + const last_operation : operation = + case tmp.operation of + Some(o) -> o + | None -> (failwith("Dex/too-few-swaps") : operation) + end; operations := last_operation # operations; } | _ -> skip @@ -410,12 +431,13 @@ function ensured_route( (* Provide liquidity (both tokens) to the pool, note: tokens should be approved before the operation *) function invest_liquidity( - const p : action_type; - var s : storage_type) : return_type is + const p : action_type; + var s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of - | Invest(params) -> { + Invest(params) -> { if s.entered then failwith("Dex/reentrancy") else s.entered := True; @@ -489,12 +511,13 @@ function invest_liquidity( (* Provide liquidity (both tokens) to the pool, note: tokens should be approved before the operation *) function ensured_invest( - const p : action_type; - var s : storage_type) : return_type is + const p : action_type; + var s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of - | EnsuredInvest(params) -> { + EnsuredInvest(params) -> { if Tezos.sender =/= Tezos.self_address then failwith("Dex/not-self") else skip; @@ -502,9 +525,11 @@ function ensured_invest( (* check preconditions *) if params.pair.token_a_address = params.pair.token_b_address and params.pair.token_a_id >= params.pair.token_b_id - then failwith("Dex/wrong-token-id") else skip; + then failwith("Dex/wrong-token-id") + else skip; if params.pair.token_a_address > params.pair.token_b_address - then failwith("Dex/wrong-pair") else skip; + then failwith("Dex/wrong-pair") + else skip; (* read pair info*) const res : (pair_type * nat) = get_pair(params.pair, s); @@ -513,45 +538,53 @@ function ensured_invest( (* ensure there is liquidity *) if pair.token_a_pool * pair.token_b_pool = 0n - then failwith("Dex/not-launched") else skip; + then failwith("Dex/not-launched") + else skip; (* ensure purchsed shares satisfy required minimum *) if params.shares = 0n - then failwith("Dex/wrong-params") else skip; + then failwith("Dex/wrong-params") + else skip; (* calculate tokens to be withdrawn *) var tokens_a_required : nat := params.shares * pair.token_a_pool / pair.total_supply; if params.shares * pair.token_a_pool > tokens_a_required * pair.total_supply - then tokens_a_required := tokens_a_required + 1n else skip; + then tokens_a_required := tokens_a_required + 1n + else skip; var tokens_b_required : nat := params.shares * pair.token_b_pool / pair.total_supply; if params.shares * pair.token_b_pool > tokens_b_required * pair.total_supply - then tokens_b_required := tokens_b_required + 1n else skip; + then tokens_b_required := tokens_b_required + 1n + else skip; (* update pool reserves *) var token_a_in : nat := 0n; var token_b_in : nat := 0n; case s.tmp.balance_a of - | Some(balance_a) -> token_a_in := balance_a + Some(balance_a) -> token_a_in := balance_a | None -> failwith("Dex/balanca-a-not-updated") end; case s.tmp.balance_b of - | Some(balance_b) -> token_b_in := balance_b + Some(balance_b) -> token_b_in := balance_b | None -> failwith("Dex/balanca-b-not-updated") end; (* ensure *) if tokens_a_required = 0n (* providing liquidity won't impact on price *) - then failwith("Dex/zero-token-a-in") else skip; + then failwith("Dex/zero-token-a-in") + else skip; if tokens_b_required = 0n (* providing liquidity won't impact on price *) - then failwith("Dex/zero-token-b-in") else skip; + then failwith("Dex/zero-token-b-in") + else skip; if tokens_a_required > token_a_in (* required tokens doesn't exceed max allowed by user *) - then failwith("Dex/low-max-token-a-in") else skip; + then failwith("Dex/low-max-token-a-in") + else skip; if tokens_b_required > token_b_in (* required tez doesn't exceed max allowed by user *) - then failwith("Dex/low-max-token-b-in") else skip; + then failwith("Dex/low-max-token-b-in") + else skip; var account : account_info := get_account((params.receiver, token_id), s); const share : nat = account.balance; @@ -569,7 +602,8 @@ function ensured_invest( s.pairs[token_id] := pair; (* send cahnge *) - if tokens_a_required < token_a_in then + if tokens_a_required < token_a_in + then operations := typed_transfer( Tezos.self_address, @@ -598,22 +632,25 @@ function ensured_invest( (* Remove liquidity (both tokens) from the pool by burning shares *) function divest_liquidity( - const p : action_type; - var s : storage_type) : return_type is + const p : action_type; + var s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of - | Divest(params) -> { + Divest(params) -> { if s.entered then failwith("Dex/reentrancy") else s.entered := True; (* check preconditions *) if params.pair.token_a_address = params.pair.token_b_address - and params.pair.token_a_id >= params.pair.token_b_id - then failwith("Dex/wrong-token-id") else skip; + and params.pair.token_a_id >= params.pair.token_b_id + then failwith("Dex/wrong-token-id") + else skip; if params.pair.token_a_address > params.pair.token_b_address - then failwith("Dex/wrong-pair") else skip; + then failwith("Dex/wrong-pair") + else skip; (* read pair info*) const res : (pair_type * nat) = get_pair(params.pair, s); @@ -622,18 +659,22 @@ function divest_liquidity( (* ensure pair exist *) if s.pairs_count = token_id - then failwith("Dex/pair-not-exist") else skip; + then failwith("Dex/pair-not-exist") + else skip; if pair.token_a_pool * pair.token_b_pool = 0n - then failwith("Dex/not-launched") else skip; + then failwith("Dex/not-launched") + else skip; var account : account_info := get_account((Tezos.sender, token_id), s); const share : nat = account.balance; (* ensure *) if params.shares = 0n (* minimal burn's shares are non-zero *) - then failwith("Dex/zero-burn-shares") else skip; + then failwith("Dex/zero-burn-shares") + else skip; if params.shares > share (* burnt shares are lower than balance *) - then failwith("Dex/insufficient-shares") else skip; + then failwith("Dex/insufficient-shares") + else skip; (* update users shares *) account.balance := abs(share - params.shares); @@ -647,12 +688,14 @@ function divest_liquidity( (* ensure minimal amounts out are non-zero *) if params.min_token_a_out = 0n or params.min_token_b_out = 0n - then failwith("Dex/dust-output") else skip; + then failwith("Dex/dust-output") + else skip; (* ensure minimal amounts are satisfied *) if token_a_divested < params.min_token_a_out or token_b_divested < params.min_token_b_out - then failwith("Dex/high-expectation") else skip; + then failwith("Dex/high-expectation") + else skip; (* update total shares *) pair.total_supply := abs(pair.total_supply - params.shares); @@ -690,12 +733,13 @@ function divest_liquidity( (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_12_a( - const p : bal_action_type; - var s : storage_type) : return_type is + const p : bal_action_type; + var s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of - | IBalanceAFA12(new_balance) -> { + IBalanceAFA12(new_balance) -> { s.tmp.balance_a := Some(case s.tmp.balance_a of | Some(prev_balance) -> if prev_balance > new_balance @@ -710,19 +754,21 @@ function update_balance_fa_12_a( (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_12_b( - const p : bal_action_type; - var s : storage_type) : return_type is + const p : bal_action_type; + var s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of - | IBalanceBFA12(new_balance) -> { - s.tmp.balance_b := Some(case s.tmp.balance_b of - | Some(prev_balance) -> - if prev_balance > new_balance - then (failwith("Dex/balance-decremented") : nat) - else abs(new_balance - prev_balance) - | None -> new_balance - end); + IBalanceBFA12(new_balance) -> { + s.tmp.balance_b := Some( + case s.tmp.balance_b of + Some(prev_balance) -> + if prev_balance > new_balance + then (failwith("Dex/balance-decremented") : nat) + else abs(new_balance - prev_balance) + | None -> new_balance + end); } | _ -> skip end @@ -738,7 +784,7 @@ function update_balance_fa_2_a( | IBalanceAFA2(responses) -> { const response : balance_of_response = case List.head_opt(responses) of - | Some(head) -> head + Some(head) -> head | None -> (failwith("Dex/no-balance-response") : balance_of_response) end; @@ -746,13 +792,14 @@ function update_balance_fa_2_a( then failwith("Dex/wrong-balance-owner") else skip; - s.tmp.balance_a := Some(case s.tmp.balance_a of - | Some(prev_balance) -> - if prev_balance > response.balance - then (failwith("Dex/balance-decremented") : nat) - else abs(response.balance - prev_balance) - | None -> response.balance - end); + s.tmp.balance_a := Some( + case s.tmp.balance_a of + Some(prev_balance) -> + if prev_balance > response.balance + then (failwith("Dex/balance-decremented") : nat) + else abs(response.balance - prev_balance) + | None -> response.balance + end); } | _ -> skip end @@ -760,15 +807,16 @@ function update_balance_fa_2_a( (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_2_b( - const p : bal_action_type; - var s : storage_type) : return_type is + const p : bal_action_type; + var s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of - | IBalanceBFA2(responses) -> { + IBalanceBFA2(responses) -> { const response : balance_of_response = case List.head_opt(responses) of - | Some(head) -> head + Some(head) -> head | None -> (failwith("Dex/no-balance-response") : balance_of_response) end; @@ -776,13 +824,14 @@ function update_balance_fa_2_b( then failwith("Dex/wrong-balance-owner") else skip; - s.tmp.balance_b := Some(case s.tmp.balance_b of - | Some(prev_balance) -> - if prev_balance > response.balance - then (failwith("Dex/balance-decremented") : nat) - else abs(response.balance - prev_balance) - | None -> response.balance - end); + s.tmp.balance_b := Some( + case s.tmp.balance_b of + Some(prev_balance) -> + if prev_balance > response.balance + then (failwith("Dex/balance-decremented") : nat) + else abs(response.balance - prev_balance) + | None -> response.balance + end); } | _ -> skip end From 417e6d65e78101ed67aea722dbf8e12b698c0aa8 Mon Sep 17 00:00:00 2001 From: KStasi Date: Fri, 17 Sep 2021 16:00:22 +0200 Subject: [PATCH 20/22] optimizations --- contracts/partials/Dex.ligo | 2 +- contracts/partials/IDex.ligo | 26 +-- contracts/partials/MethodDex.ligo | 278 +++++++++++------------------- contracts/partials/Utils.ligo | 129 ++++---------- 4 files changed, 148 insertions(+), 287 deletions(-) diff --git a/contracts/partials/Dex.ligo b/contracts/partials/Dex.ligo index 4f584be7..63b57407 100644 --- a/contracts/partials/Dex.ligo +++ b/contracts/partials/Dex.ligo @@ -52,7 +52,7 @@ function call_dex( then res.0 := Tezos.transaction( unit, 0mutez, - get_close_entrypoint(Tezos.self_address)) # res.0 + get_close_entrypoint(unit)) # res.0 else skip; } with (res.0, s) diff --git a/contracts/partials/IDex.ligo b/contracts/partials/IDex.ligo index 315cd8c7..59a5b4ed 100644 --- a/contracts/partials/IDex.ligo +++ b/contracts/partials/IDex.ligo @@ -16,9 +16,14 @@ type bal_fa12_type is address * contract(nat) type balance_fa12_type is BalanceOfTypeFA12 of bal_fa12_type type balance_fa2_type is BalanceOfTypeFA2 of bal_fa2_type -type token_type is -| Fa12 -| Fa2 +type fa2_token_type is record [ + token_address : address; (* token A address *) + token_id : nat; (* token A identifier *) +] + +type token_type is +| Fa12 of address +| Fa2 of fa2_token_type type token_name is | A @@ -31,10 +36,6 @@ type pair_type is record [ ] type tokens_type is record [ - token_a_address : address; (* token A address *) - token_b_address : address; (* token B address *) - token_a_id : nat; (* token A identifier *) - token_b_id : nat; (* token B identifier *) token_a_type : token_type; (* token A standard *) token_b_type : token_type; (* token B standard *) ] @@ -67,9 +68,7 @@ type swap_slice_type is record [ type swap_side_type is record [ pool : nat; (* pair identifier*) - token : address; (* token address*) - id : nat; (* token aidentifier *) - standard : token_type; (* token standard *) + token : token_type; (* token standard *) ] type swap_data_type is record [ @@ -80,8 +79,7 @@ type swap_data_type is record [ type tmp_swap_type is record [ s : storage_type; (* storage_type state *) amount_in : nat; (* amount of tokens to be sold *) - token_address_in : address; (* address of sold token *) - token_id_in : nat; (* identifier of sold token *) + token_in : token_type; (* address of sold token *) operation : option(operation); (* exchange operation type *) sender : address; (* address of the sender *) receiver : address; (* address of the receiver *) @@ -212,4 +210,6 @@ type full_return_type is list (operation) * full_storage_type const fee_rate : nat = 333n; (* exchange fee rate distributed among the liquidity providers *) const bal_func_count : nat = 3n; const dex_func_count : nat = 6n; -const token_func_count : nat = 2n; \ No newline at end of file +const token_func_count : nat = 2n; +const fee_denom : nat = 1000n; +const fee_num : nat = 997n; \ No newline at end of file diff --git a/contracts/partials/MethodDex.ligo b/contracts/partials/MethodDex.ligo index 09f663c6..3d0ddbf2 100644 --- a/contracts/partials/MethodDex.ligo +++ b/contracts/partials/MethodDex.ligo @@ -1,8 +1,71 @@ + +(* Initialize exchange after the previous liquidity was drained *) +function initialize_exchange( + const p : action_type; + var s : storage_type) + : return_type is + block { + var operations: list(operation) := list[]; + case p of + AddPair(params) -> { + if s.entered + then failwith("Dex/reentrancy") + else s.entered := True; + + s.tmp := record [ + balance_a = (None : option(nat)); + balance_b = (None : option(nat)); + ]; + + (* prepare operations to get initial liquidity *) + operations := list [ + typed_get_balance( + params.pair.token_a_type, + A(unit) + ); + typed_get_balance( + params.pair.token_b_type, + B(unit) + ); + typed_transfer( + Tezos.sender, + Tezos.self_address, + params.token_a_in, + params.pair.token_a_type + ); + typed_transfer( + Tezos.sender, + Tezos.self_address, + params.token_b_in, + params.pair.token_b_type + ); + typed_get_balance( + params.pair.token_a_type, + A(unit) + ); + typed_get_balance( + params.pair.token_b_type, + B(unit) + ); + Tezos.transaction( + record [ + pair=params.pair; + receiver=Tezos.sender; + ], + 0mutez, + get_ensured_initialize_entrypoint(Tezos.self_address) + ); + ]; + } + | _ -> skip + end +} with (operations, s) + (* Initialize exchange after the previous liquidity was drained *) function ensured_initialize_exchange( const p : action_type; var s : storage_type) - : return_type is + : return_type is block { var operations: list(operation) := list[]; case p of @@ -12,17 +75,9 @@ function ensured_initialize_exchange( else skip; (* check preconditions *) - if params.pair.token_a_address = params.pair.token_b_address - and params.pair.token_a_id >= params.pair.token_b_id + if params.pair.token_a_type > params.pair.token_b_type then failwith("Dex/wrong-token-id") else skip; - if params.pair.token_a_address > params.pair.token_b_address - then failwith("Dex/wrong-pair") - else skip; - - (* check fa1.2 token ids *) - check_token_id(params.pair.token_a_id, params.pair.token_a_type); - check_token_id(params.pair.token_b_id, params.pair.token_b_type); (* read pair info*) const res : (pair_type * nat) = get_pair(params.pair, s); @@ -47,6 +102,12 @@ function ensured_initialize_exchange( Some(balance_b) -> token_b_in := balance_b | None -> failwith("Dex/balanca-b-not-updated") end; + if token_a_in < 1n (* no token A invested *) + then failwith("Dex/no-token-a") + else skip; + if token_b_in < 1n (* no token B invested *) + then failwith("Dex/no-token-b") + else skip; (* check preconditions *) if pair.token_a_pool * pair.token_b_pool =/= 0n (* no reserves *) @@ -55,12 +116,6 @@ function ensured_initialize_exchange( if pair.total_supply =/= 0n (* no shares owned *) then failwith("Dex/non-zero-shares") else skip; - if token_a_in < 1n (* no token A invested *) - then failwith("Dex/no-token-a") - else skip; - if token_b_in < 1n (* no token B invested *) - then failwith("Dex/no-token-b") - else skip; (* update pool reserves *) pair.token_a_pool := token_a_in; @@ -83,87 +138,10 @@ function ensured_initialize_exchange( s.pairs[token_id] := pair; s.tokens[token_id] := params.pair; } - | _ -> skip + | _ -> skip end } with (operations, s) -(* Initialize exchange after the previous liquidity was drained *) -function initialize_exchange( - const p : action_type; - var s : storage_type) - : return_type is - block { - var operations: list(operation) := list[]; - case p of - AddPair(params) -> { - if s.entered - then failwith("Dex/reentrancy") - else s.entered := True; - - s.tmp := record [ - balance_a = (None : option(nat)); - balance_b = (None : option(nat)); - ]; - - (* prepare operations to get initial liquidity *) - operations := list [ - typed_get_balance( - Tezos.self_address, - params.pair.token_a_id, - params.pair.token_a_address, - params.pair.token_a_type, - A(unit) - ); - typed_get_balance( - Tezos.self_address, - params.pair.token_b_id, - params.pair.token_b_address, - params.pair.token_b_type, - B(unit) - ); - typed_transfer( - Tezos.sender, - Tezos.self_address, - params.token_a_in, - params.pair.token_a_id, - params.pair.token_a_address, - params.pair.token_a_type - ); - typed_transfer( - Tezos.sender, - Tezos.self_address, - params.token_b_in, - params.pair.token_b_id, - params.pair.token_b_address, - params.pair.token_b_type - ); - typed_get_balance( - Tezos.self_address, - params.pair.token_a_id, - params.pair.token_a_address, - params.pair.token_a_type, - A(unit) - ); - typed_get_balance( - Tezos.self_address, - params.pair.token_b_id, - params.pair.token_b_address, - params.pair.token_b_type, - B(unit) - ); - Tezos.transaction( - record [ - pair=params.pair; - receiver=Tezos.sender; - ], - 0mutez, - get_ensured_initialize_entrypoint(Tezos.self_address) - ); - ]; - } - | _ -> skip - end -} with (operations, s) (* Intrenal functions for swap hops *) function internal_token_to_token_swap( @@ -172,11 +150,7 @@ function internal_token_to_token_swap( : tmp_swap_type is block { (* check preconditions *) - if params.pair.token_a_address = params.pair.token_b_address - and params.pair.token_a_id >= params.pair.token_b_id - then failwith("Dex/wrong-token-id") - else skip; - if params.pair.token_a_address > params.pair.token_b_address + if params.pair.token_a_type > params.pair.token_b_type then failwith("Dex/wrong-pair") else skip; @@ -195,15 +169,14 @@ function internal_token_to_token_swap( then failwith ("Dex/zero-amount-in") else skip; (* ensure the route is corresponding *) - if swap.from_.token =/= tmp.token_address_in - or swap.from_.id =/= tmp.token_id_in + if swap.from_.token =/= tmp.token_in then failwith("Dex/wrong-route") else skip; (* calculate amount out *) - const from_in_with_fee : nat = tmp.amount_in * 997n; + const from_in_with_fee : nat = tmp.amount_in * fee_num; const numerator : nat = from_in_with_fee * swap.to_.pool; - const denominator : nat = swap.from_.pool * 1000n + from_in_with_fee; + const denominator : nat = swap.from_.pool * fee_denom + from_in_with_fee; (* calculate swapped token amount *) const out : nat = numerator / denominator; @@ -214,8 +187,7 @@ function internal_token_to_token_swap( (* update info for the next hop *) tmp.amount_in := out; - tmp.token_address_in := swap.to_.token; - tmp.token_id_in := swap.to_.id; + tmp.token_in := swap.to_.token; (* update storage_type *) const updated_pair : pair_type = form_pools( @@ -227,10 +199,11 @@ function internal_token_to_token_swap( (* prepare operations to withdraw user's tokens *) tmp.operation := Some( - typed_transfer(tmp.sender, tmp.receiver, out, - swap.to_.id, - swap.to_.token, - swap.to_.standard + typed_transfer( + tmp.sender, + tmp.receiver, + out, + swap.to_.token )); } with tmp @@ -243,7 +216,7 @@ function token_to_token_route( block { var operations: list(operation) := list[]; case p of - | Swap(params) -> { + Swap(params) -> { if s.entered then failwith("Dex/reentrancy") else s.entered := True; @@ -277,23 +250,16 @@ function token_to_token_route( operations := list [ (* from *) typed_get_balance( - Tezos.self_address, - first_swap.pair.token_a_id, - first_swap.pair.token_a_address, first_swap.pair.token_a_type, A(unit) ); - typed_transfer(Tezos.sender, + typed_transfer( + Tezos.sender, Tezos.self_address, params.amount_in, - first_swap.pair.token_a_id, - first_swap.pair.token_a_address, first_swap.pair.token_a_type ) ; typed_get_balance( - Tezos.self_address, - first_swap.pair.token_a_id, - first_swap.pair.token_a_address, first_swap.pair.token_a_type, A(unit) ); @@ -307,29 +273,20 @@ function token_to_token_route( get_ensured_swap_entrypoint(Tezos.self_address) ); ]; - (* TODO : add continue *) } | Buy -> { operations := list [ (* from *) typed_get_balance( - Tezos.self_address, - first_swap.pair.token_b_id, - first_swap.pair.token_b_address, first_swap.pair.token_b_type, B(unit) ); typed_transfer(Tezos.sender, Tezos.self_address, params.amount_in, - first_swap.pair.token_b_id, - first_swap.pair.token_b_address, first_swap.pair.token_b_type ); typed_get_balance( - Tezos.self_address, - first_swap.pair.token_b_id, - first_swap.pair.token_b_address, first_swap.pair.token_b_type, B(unit) ); @@ -372,8 +329,7 @@ function ensured_route( end; (* declare helper variables *) - var token_id_in : nat := first_swap.pair.token_a_id; - var token_address_in : address := first_swap.pair.token_a_address; + var token : token_type := first_swap.pair.token_a_type; var amount_in : nat := 0n; (* prepare operation to withdraw user's tokens *) @@ -384,8 +340,7 @@ function ensured_route( | None -> failwith("Dex/balanca-a-not-updated") end | Buy -> { - token_id_in := first_swap.pair.token_b_id; - token_address_in := first_swap.pair.token_b_address; + token := first_swap.pair.token_b_type; case s.tmp.balance_b of Some(balance_b) -> amount_in := balance_b | None -> failwith("Dex/balanca-b-not-updated") @@ -403,8 +358,7 @@ function ensured_route( operation = (None : option(operation)); sender = Tezos.self_address; receiver = params.receiver; - token_id_in = token_id_in; - token_address_in = token_address_in; + token_in = token; ] ); @@ -450,16 +404,10 @@ function invest_liquidity( (* prepare operations to get initial liquidity *) operations := list [ typed_get_balance( - Tezos.self_address, - params.pair.token_a_id, - params.pair.token_a_address, params.pair.token_a_type, A(unit) ); typed_get_balance( - Tezos.self_address, - params.pair.token_b_id, - params.pair.token_b_address, params.pair.token_b_type, B(unit) ); @@ -467,29 +415,19 @@ function invest_liquidity( Tezos.sender, Tezos.self_address, params.token_a_in, - params.pair.token_a_id, - params.pair.token_a_address, params.pair.token_a_type ); typed_transfer( Tezos.sender, Tezos.self_address, params.token_b_in, - params.pair.token_b_id, - params.pair.token_b_address, params.pair.token_b_type ); typed_get_balance( - Tezos.self_address, - params.pair.token_a_id, - params.pair.token_a_address, params.pair.token_a_type, A(unit) ); typed_get_balance( - Tezos.self_address, - params.pair.token_b_id, - params.pair.token_b_address, params.pair.token_b_type, B(unit) ); @@ -523,11 +461,7 @@ function ensured_invest( else skip; (* check preconditions *) - if params.pair.token_a_address = params.pair.token_b_address - and params.pair.token_a_id >= params.pair.token_b_id - then failwith("Dex/wrong-token-id") - else skip; - if params.pair.token_a_address > params.pair.token_b_address + if params.pair.token_a_type > params.pair.token_b_type then failwith("Dex/wrong-pair") else skip; @@ -609,8 +543,6 @@ function ensured_invest( Tezos.self_address, params.receiver, abs(tokens_a_required - token_a_in), - params.pair.token_a_id, - params.pair.token_a_address, params.pair.token_a_type ) # operations else skip; @@ -620,8 +552,6 @@ function ensured_invest( Tezos.self_address, params.receiver, abs(tokens_b_required - token_b_in), - params.pair.token_b_id, - params.pair.token_b_address, params.pair.token_b_type ) # operations else skip; @@ -644,11 +574,7 @@ function divest_liquidity( else s.entered := True; (* check preconditions *) - if params.pair.token_a_address = params.pair.token_b_address - and params.pair.token_a_id >= params.pair.token_b_id - then failwith("Dex/wrong-token-id") - else skip; - if params.pair.token_a_address > params.pair.token_b_address + if params.pair.token_a_type > params.pair.token_b_type then failwith("Dex/wrong-pair") else skip; @@ -713,8 +639,6 @@ function divest_liquidity( Tezos.self_address, Tezos.sender, token_a_divested, - params.pair.token_a_id, - params.pair.token_a_address, params.pair.token_a_type ) # operations; operations := @@ -722,8 +646,6 @@ function divest_liquidity( Tezos.self_address, Tezos.sender, token_b_divested, - params.pair.token_b_id, - params.pair.token_b_address, params.pair.token_b_type ) # operations; } @@ -740,12 +662,13 @@ function update_balance_fa_12_a( var operations: list(operation) := list[]; case p of IBalanceAFA12(new_balance) -> { - s.tmp.balance_a := Some(case s.tmp.balance_a of - | Some(prev_balance) -> - if prev_balance > new_balance - then (failwith("Dex/balance-decremented") : nat) - else abs(new_balance - prev_balance) - | None -> new_balance + s.tmp.balance_a := Some( + case s.tmp.balance_a of + Some(prev_balance) -> + if prev_balance > new_balance + then (failwith("Dex/balance-decremented") : nat) + else abs(new_balance - prev_balance) + | None -> new_balance end); } | _ -> skip @@ -776,12 +699,13 @@ function update_balance_fa_12_b( (* Remove liquidity (both tokens) from the pool by burning shares *) function update_balance_fa_2_a( - const p : bal_action_type; - var s : storage_type) : return_type is + const p : bal_action_type; + var s : storage_type) + : return_type is block { var operations: list(operation) := list[]; case p of - | IBalanceAFA2(responses) -> { + IBalanceAFA2(responses) -> { const response : balance_of_response = case List.head_opt(responses) of Some(head) -> head diff --git a/contracts/partials/Utils.ligo b/contracts/partials/Utils.ligo index 074a55d9..7f05d2da 100644 --- a/contracts/partials/Utils.ligo +++ b/contracts/partials/Utils.ligo @@ -63,15 +63,11 @@ function form_swap_data( block { const side_a : swap_side_type = record [ pool = pair.token_a_pool; - token = swap.token_a_address; - id = swap.token_a_id; - standard = swap.token_a_type; + token = swap.token_a_type; ]; const side_b : swap_side_type = record [ pool = pair.token_b_pool; - token = swap.token_b_address; - id = swap.token_b_id; - standard = swap.token_b_type; + token = swap.token_b_type; ]; } with case direction of Sell -> record [ @@ -84,24 +80,6 @@ function form_swap_data( ] end; -(* Helper function to prepare the token transfer *) -function wrap_fa2_transfer_trx( - const owner : address; - const receiver : address; - const value : nat; - const token_id : nat) - : entry_fa2_type is - TransferTypeFA2(list[ - record[ - from_ = owner; - txs = list [ record [ - to_ = receiver; - token_id = token_id; - amount = value; - ] ] - ] - ]) - (* Helper function to get fa2 token contract *) function get_fa2_token_contract( const token_address : address) @@ -122,67 +100,47 @@ function get_fa12_token_contract( | None -> (failwith("Dex/not-token") : contract(entry_fa12_type)) end; -(* Helper function to get fa2 token contract *) -function get_fa2_balance_entrypoint( - const token_address : address) - : contract(entry_fa2_type) is - case (Tezos.get_entrypoint_opt("%transfer", token_address) - : option(contract(entry_fa2_type))) of - Some(contr) -> contr - | None -> (failwith("Dex/not-token") : contract(entry_fa2_type)) - end; - -(* Helper function to get fa1.2 token contract *) -function get_fa12_balance_entrypoint( - const token_address : address) - : contract(entry_fa12_type) is - case (Tezos.get_entrypoint_opt("%transfer", token_address) - : option(contract(entry_fa12_type))) of - Some(contr) -> contr - | None -> (failwith("Dex/not-token") : contract(entry_fa12_type)) - end; - (* Helper function to get the reentrancy entrypoint of the current contract *) function get_close_entrypoint( - const self : address) + const _ : unit) : contract(unit) is - case (Tezos.get_entrypoint_opt("%close", self) + case (Tezos.get_entrypoint_opt("%close", Tezos.self_address) : option(contract(unit))) of Some(contr) -> contr | None -> (failwith("Dex/no-close-entrypoint") : contract(unit)) end; function get_bal_fa12_a( - const self : address) + const _ : unit) : contract(nat) is - case (Tezos.get_entrypoint_opt("%balanceAFA12", self) + case (Tezos.get_entrypoint_opt("%balanceAFA12", Tezos.self_address) : option(contract(nat))) of Some(contr) -> contr | None -> (failwith("Dex/balanceAFa12") : contract(nat)) end function get_bal_fa12_b( - const self : address) + const _ : unit) : contract(nat) is - case (Tezos.get_entrypoint_opt("%balanceBFA12", self) + case (Tezos.get_entrypoint_opt("%balanceBFA12", Tezos.self_address) : option(contract(nat))) of Some(contr) -> contr | None -> (failwith("Dex/balanceBFa12") : contract(nat)) end function get_bal_fa2_a( - const self : address) + const _ : unit) : contract(list(balance_of_response)) is - case (Tezos.get_entrypoint_opt("%balanceAFA2", self) + case (Tezos.get_entrypoint_opt("%balanceAFA2", Tezos.self_address) : option(contract(list(balance_of_response)))) of Some(contr) -> contr | None -> (failwith("Dex/balanceAFa2") : contract(list(balance_of_response))) end function get_bal_fa2_b( - const self : address) + const _ : unit) : contract(list(balance_of_response)) is - case (Tezos.get_entrypoint_opt("%balanceBFA2", self) + case (Tezos.get_entrypoint_opt("%balanceBFA2", Tezos.self_address) : option(contract(list(balance_of_response)))) of Some(contr) -> contr | None -> (failwith("Dex/balanceBFa2") : contract(list(balance_of_response))) @@ -235,7 +193,6 @@ function get_ensured_swap_entrypoint( (* Helper function to transfer fa2 tokens *) function get_balance_fa2( - const user : address; const token_id : nat; const token : address; const callback : contract(list(balance_of_response))) @@ -244,7 +201,7 @@ function get_balance_fa2( record [ requests = list [ record [ - owner = user; + owner = Tezos.self_address; token_id = token_id; ] ]; @@ -256,95 +213,75 @@ function get_balance_fa2( (* Helper function to transfer fa1.2 tokens *) function get_balance_fa12( - const user : address; const token : address; const callback : contract(nat)) : operation is Tezos.transaction( - (user, callback), + (Tezos.self_address, callback), 0mutez, get_fa12_balance_entrypoint(token) ); (* Helper function to transfer the asset based on its standard *) function typed_transfer( - const owner : address; + const owner : address; const receiver : address; const amount_ : nat; - const token_id : nat; - const token : address; - const standard : token_type) + const token : token_type) : operation is - case standard of - Fa12 -> Tezos.transaction( + case token of + Fa12(token_address) -> Tezos.transaction( TransferTypeFA12(owner, (receiver, amount_)), 0mutez, - get_fa12_token_contract(token) + get_fa12_token_contract(token_address) ) - | Fa2 -> Tezos.transaction( + | Fa2(token_info) -> Tezos.transaction( TransferTypeFA2(list[ record[ from_ = owner; txs = list [ record [ to_ = receiver; - token_id = token_id; + token_id = token_info.token_id; amount = amount_; ] ] ] ]), 0mutez, - get_fa2_token_contract(token) + get_fa2_token_contract(token_info.token_address) ) end; (* Helper function to transfer the asset based on its standard *) function typed_get_balance( - const account : address; - const token_id : nat; - const token : address; - const standard : token_type; + const token : token_type; const name : token_name) : operation is block { var op : option(operation) := (None : option(operation)); - case standard of - Fa12 -> { + case token of + Fa12(token) -> { const callback : contract(nat) = case name of - A -> get_bal_fa12_a(account) - | B -> get_bal_fa12_b(account) + A -> get_bal_fa12_a(unit) + | B -> get_bal_fa12_b(unit) end; op := Some(get_balance_fa12( - account, token, callback)); } - | Fa2 -> { + | Fa2(token_info) -> { const callback : contract(list(balance_of_response)) = case name of - A -> get_bal_fa2_a(account) - | B -> get_bal_fa2_b(account) + A -> get_bal_fa2_a(unit) + | B -> get_bal_fa2_b(unit) end; op := Some(get_balance_fa2( - account, - token_id, - token, + token_info.token_id, + token_info.token_address, callback)); } end; } with case op of Some(o) -> o | None -> (failwith("Dex/no-balance") : operation) - end - -(* Helper function to transfer the asset based on its standard *) -function check_token_id( - const token_id : nat; - const standard : token_type) - : unit is - case standard of - Fa12 -> if token_id = 0n - then unit - else (failwith("Dex/non-zero-token-id") : unit) - | Fa2 -> unit - end; + end \ No newline at end of file From 4941eaff88087b3be20c42518bb6577ac1f0a2c8 Mon Sep 17 00:00:00 2001 From: KStasi Date: Mon, 20 Sep 2021 07:47:14 +0200 Subject: [PATCH 21/22] update migrations --- contracts/partials/Dex.ligo | 3 +- contracts/partials/MethodDex.ligo | 18 +-- contracts/partials/MethodFA2.ligo | 14 +-- migrations/2_deploy_token_to_token_dex.js | 135 ++++++++++++++-------- storage/{TTDex.js => Dex.js} | 0 storage/Factory.js | 16 --- storage/Functions.js | 41 +++---- storage/TTFunctions.js | 69 ----------- 8 files changed, 121 insertions(+), 175 deletions(-) rename storage/{TTDex.js => Dex.js} (100%) delete mode 100644 storage/Factory.js delete mode 100644 storage/TTFunctions.js diff --git a/contracts/partials/Dex.ligo b/contracts/partials/Dex.ligo index 63b57407..7c55c33e 100644 --- a/contracts/partials/Dex.ligo +++ b/contracts/partials/Dex.ligo @@ -67,7 +67,8 @@ The function is responsible for fiding the appropriate method based on the provided index. *) -[@inline] function call_token( +[@inline] +function call_token( const p : token_action_type; const idx : nat; var s : full_storage_type) diff --git a/contracts/partials/MethodDex.ligo b/contracts/partials/MethodDex.ligo index 3d0ddbf2..b5eef642 100644 --- a/contracts/partials/MethodDex.ligo +++ b/contracts/partials/MethodDex.ligo @@ -303,7 +303,7 @@ function token_to_token_route( } end; } - | _ -> skip + | _ -> skip end } with (operations, s) @@ -378,7 +378,7 @@ function ensured_route( end; operations := last_operation # operations; } - | _ -> skip + | _ -> skip end } with (operations, s) @@ -442,7 +442,7 @@ function invest_liquidity( ); ]; } - | _ -> skip + | _ -> skip end } with (operations, s) @@ -556,7 +556,7 @@ function ensured_invest( ) # operations else skip; } - | _ -> skip + | _ -> skip end } with (operations, s) @@ -649,7 +649,7 @@ function divest_liquidity( params.pair.token_b_type ) # operations; } - | _ -> skip + | _ -> skip end } with (operations, s) @@ -671,7 +671,7 @@ function update_balance_fa_12_a( | None -> new_balance end); } - | _ -> skip + | _ -> skip end } with (operations, s) @@ -693,7 +693,7 @@ function update_balance_fa_12_b( | None -> new_balance end); } - | _ -> skip + | _ -> skip end } with (operations, s) @@ -725,7 +725,7 @@ function update_balance_fa_2_a( | None -> response.balance end); } - | _ -> skip + | _ -> skip end } with (operations, s) @@ -757,6 +757,6 @@ function update_balance_fa_2_b( | None -> response.balance end); } - | _ -> skip + | _ -> skip end } with (operations, s) diff --git a/contracts/partials/MethodFA2.ligo b/contracts/partials/MethodFA2.ligo index 61b14f36..a662c63a 100644 --- a/contracts/partials/MethodFA2.ligo +++ b/contracts/partials/MethodFA2.ligo @@ -101,7 +101,7 @@ function transfer( | ITransfer(params) -> { s := List.fold(iterate_transfer, params, s); } - | _ -> skip + | _ -> skip end } with (operations, s) @@ -133,14 +133,14 @@ function get_balance_of( (* Collect balances info *) const accumulated_response : list (balance_of_response) = List.fold(look_up_balance, - bal_fa2_type.requests, - (nil: list(balance_of_response))); + bal_fa2_type.requests, + (nil: list(balance_of_response))); operations := list[Tezos.transaction( accumulated_response, 0mutez, bal_fa2_type.callback)]; } - | _ -> skip + | _ -> skip end } with (operations, s) @@ -151,9 +151,9 @@ function update_operators( block { var operations: list(operation) := list[]; case p of - | IUpdate_operators(params) -> { - s := List.fold(iterate_update_operator, params, s); + IUpdate_operators(params) -> { + s := List.fold(iterate_update_operator, params, s); } - | _ -> skip + | _ -> skip end } with (operations, s) \ No newline at end of file diff --git a/migrations/2_deploy_token_to_token_dex.js b/migrations/2_deploy_token_to_token_dex.js index b961f38f..c7b8f9fd 100644 --- a/migrations/2_deploy_token_to_token_dex.js +++ b/migrations/2_deploy_token_to_token_dex.js @@ -10,7 +10,7 @@ const { dexFunctions, tokenFunctions, balFunctions, -} = require("../storage/TTFunctions"); +} = require("../storage/Functions"); const { execSync } = require("child_process"); const Token = artifacts.require("Token" + usedStandard); const TokenFA12 = artifacts.require("TokenFA12"); @@ -28,7 +28,7 @@ const defaultTokenId = 0; module.exports = async (deployer, network, accounts) => { tezos = new TezosToolkit(tezos.rpc.url); - if (network === "development") return; + // if (network === "development") return; const secretKey = accountsStored.alice.sk.trim(); tezos.setProvider({ config: { @@ -115,33 +115,46 @@ module.exports = async (deployer, network, accounts) => { const dex = await tezos.contract.at(dexInstance.address.toString()); const ordered = token0Instance.address.toString() < token1Instance.address.toString(); - if (standard === "FA12") { - let operation = await token0Instance.methods - .approve(dexInstance.address.toString(), initialTokenAmount) - .send(); - await confirmOperation(tezos, operation.hash); - operation = await token1Instance.methods - .approve(dexInstance.address.toString(), initialTokenAmount) - .send(); - await operation.confirmation(); - } else { - let operation = await token0Instance.methods - .update_operators([ - { - add_operator: { - owner: accounts[0], - operator: dexInstance.address.toString(), - token_id: defaultTokenId, - }, - }, - ]) - .send(); - await confirmOperation(tezos, operation.hash); - if (standard == "MIXED") { + let operation; + switch (standard.toLocaleLowerCase()) { + case "fa12": + operation = await token0Instance.methods + .approve(dexInstance.address.toString(), initialTokenAmount) + .send(); + await confirmOperation(tezos, operation.hash); operation = await token1Instance.methods .approve(dexInstance.address.toString(), initialTokenAmount) .send(); - } else { + await operation.confirmation(); + operation = await dex.methods + .use( + "addPair", + "fa12", + ordered + ? token0Instance.address.toString() + : token1Instance.address.toString(), + "fa12", + ordered + ? token1Instance.address.toString() + : token0Instance.address.toString(), + initialTokenAmount, + initialTokenAmount + ) + .send(); + break; + case "fa2": + operation = await token0Instance.methods + .update_operators([ + { + add_operator: { + owner: accounts[0], + operator: dexInstance.address.toString(), + token_id: defaultTokenId, + }, + }, + ]) + .send(); + await confirmOperation(tezos, operation.hash); operation = await token1Instance.methods .update_operators([ { @@ -153,28 +166,56 @@ module.exports = async (deployer, network, accounts) => { }, ]) .send(); - } - await confirmOperation(tezos, operation.hash); + await confirmOperation(tezos, operation.hash); + operation = await dex.methods + .use( + "addPair", + "fa2", + ordered + ? token0Instance.address.toString() + : token1Instance.address.toString(), + defaultTokenId, + "fa2", + ordered + ? token1Instance.address.toString() + : token0Instance.address.toString(), + defaultTokenId, + initialTokenAmount, + initialTokenAmount + ) + .send(); + break; + case "mixed": + operation = await token0Instance.methods + .update_operators([ + { + add_operator: { + owner: accounts[0], + operator: dexInstance.address.toString(), + token_id: defaultTokenId, + }, + }, + ]) + .send(); + await confirmOperation(tezos, operation.hash); + operation = await token1Instance.methods + .approve(dexInstance.address.toString(), initialTokenAmount) + .send(); + await confirmOperation(tezos, operation.hash); + operation = await dex.methods + .use( + "addPair", + "fa12", + token1Instance.address.toString(), + "fa2", + token0Instance.address.toString(), + defaultTokenId, + initialTokenAmount, + initialTokenAmount + ) + .send(); + break; } - operation = await dex.methods - .use( - "addPair", - ordered - ? token0Instance.address.toString() - : token1Instance.address.toString(), - 0, - standard == "MIXED" ? "fa2" : standard.toLocaleLowerCase(), - null, - ordered - ? token1Instance.address.toString() - : token0Instance.address.toString(), - 0, - standard == "MIXED" ? "fa12" : standard.toLocaleLowerCase(), - null, - initialTokenAmount, - initialTokenAmount - ) - .send(); await confirmOperation(tezos, operation.hash); } diff --git a/storage/TTDex.js b/storage/Dex.js similarity index 100% rename from storage/TTDex.js rename to storage/Dex.js diff --git a/storage/Factory.js b/storage/Factory.js deleted file mode 100644 index 45d5c0b8..00000000 --- a/storage/Factory.js +++ /dev/null @@ -1,16 +0,0 @@ -const { MichelsonMap } = require("@taquito/michelson-encoder"); - -module.exports = { - counter: "0", - baker_validator: "tz1ZZZZZZZZZZZZZZZZZZZZZZZZZZZZNkiRg", - token_list: MichelsonMap.fromLiteral({}), - token_to_exchange: MichelsonMap.fromLiteral({}), - dex_lambdas: MichelsonMap.fromLiteral({}), - token_lambdas: MichelsonMap.fromLiteral({}), - voters: MichelsonMap.fromLiteral({}), - vetos: MichelsonMap.fromLiteral({}), - votes: MichelsonMap.fromLiteral({}), - user_rewards: MichelsonMap.fromLiteral({}), - metadata: MichelsonMap.fromLiteral({}), - ledger: MichelsonMap.fromLiteral({}), -}; diff --git a/storage/Functions.js b/storage/Functions.js index 83a5bd45..6ebcf6d0 100644 --- a/storage/Functions.js +++ b/storage/Functions.js @@ -5,62 +5,50 @@ module.exports.dexFunctions = [ }, { index: 1, - name: "tez_to_token", + name: "token_to_token_route", }, { index: 2, - name: "token_to_tez", + name: "invest_liquidity", }, { index: 3, - name: "withdraw_profit", + name: "divest_liquidity", }, { index: 4, - name: "invest_liquidity", + name: "ensured_initialize_exchange", }, { index: 5, - name: "divest_liquidity", + name: "ensured_route", }, { index: 6, - name: "vote", - }, - { - index: 7, - name: "veto", - }, - { - index: 8, - name: "receive_reward", + name: "ensured_invest", }, ]; -let tokenFunctionsFA12 = [ +module.exports.balFunctions = [ { index: 0, - name: "transfer", + name: "update_balance_fa_12_a", }, { index: 1, - name: "approve", + name: "update_balance_fa_12_b", }, { index: 2, - name: "get_balance", + name: "update_balance_fa_2_a", }, { index: 3, - name: "get_allowance_to_contract", - }, - { - index: 4, - name: "get_total_supply", + name: "update_balance_fa_2_b", }, ]; -let tokenFunctionsFA2 = [ +let tokenFunctions = [ { index: 0, name: "transfer", @@ -75,6 +63,7 @@ let tokenFunctionsFA2 = [ }, ]; module.exports.tokenFunctions = { - FA12: tokenFunctionsFA12, - FA2: tokenFunctionsFA2, + FA12: tokenFunctions, + MIXED: tokenFunctions, + FA2: tokenFunctions, }; diff --git a/storage/TTFunctions.js b/storage/TTFunctions.js deleted file mode 100644 index 6ebcf6d0..00000000 --- a/storage/TTFunctions.js +++ /dev/null @@ -1,69 +0,0 @@ -module.exports.dexFunctions = [ - { - index: 0, - name: "initialize_exchange", - }, - { - index: 1, - name: "token_to_token_route", - }, - { - index: 2, - name: "invest_liquidity", - }, - { - index: 3, - name: "divest_liquidity", - }, - { - index: 4, - name: "ensured_initialize_exchange", - }, - { - index: 5, - name: "ensured_route", - }, - { - index: 6, - name: "ensured_invest", - }, -]; - -module.exports.balFunctions = [ - { - index: 0, - name: "update_balance_fa_12_a", - }, - { - index: 1, - name: "update_balance_fa_12_b", - }, - { - index: 2, - name: "update_balance_fa_2_a", - }, - { - index: 3, - name: "update_balance_fa_2_b", - }, -]; - -let tokenFunctions = [ - { - index: 0, - name: "transfer", - }, - { - index: 1, - name: "update_operators", - }, - { - index: 2, - name: "get_balance_of", - }, -]; -module.exports.tokenFunctions = { - FA12: tokenFunctions, - MIXED: tokenFunctions, - FA2: tokenFunctions, -}; From 7a79ff38809e7c6e40bb74625a508fd77cabdddc Mon Sep 17 00:00:00 2001 From: KStasi Date: Mon, 20 Sep 2021 15:14:26 +0200 Subject: [PATCH 22/22] update tests --- migrations/2_deploy_token_to_token_dex.js | 2 +- test/BuyToken.spec.ts | 6 +- test/BuyTokenWithRouter.spec.ts | 634 +++++++++--------- ...uidity.spec.ts => DivestLiquidity.spec.ts} | 6 +- ...spec.ts => InitializeExchangeTest.spec.ts} | 88 ++- ...uidity.spec.ts => InvestLiquidity.spec.ts} | 6 +- test/SellToken.spec.ts | 6 +- test/SellTokenWithRoute.spec.ts | 618 ++++++++--------- test/TokenAToTokenB.spec.ts | 6 +- test/TokenBToTokenA.spec.ts | 6 +- test/helpers/{ttContext.ts => context.ts} | 13 +- test/helpers/{ttdexFA2.ts => dexFA2.ts} | 362 ++++++---- test/helpers/types.ts | 30 +- test/storage/{TTDex.ts => Dex.ts} | 0 test/storage/{TTFunctions.ts => Functions.ts} | 0 truffle.d.ts | 2 +- 16 files changed, 963 insertions(+), 822 deletions(-) rename test/{DivestTTLiquidity.spec.ts => DivestLiquidity.spec.ts} (99%) rename test/{InitializeTTExchangeTest.spec.ts => InitializeExchangeTest.spec.ts} (82%) rename test/{InvestTTLiquidity.spec.ts => InvestLiquidity.spec.ts} (99%) rename test/helpers/{ttContext.ts => context.ts} (96%) rename test/helpers/{ttdexFA2.ts => dexFA2.ts} (60%) rename test/storage/{TTDex.ts => Dex.ts} (100%) rename test/storage/{TTFunctions.ts => Functions.ts} (100%) diff --git a/migrations/2_deploy_token_to_token_dex.js b/migrations/2_deploy_token_to_token_dex.js index c7b8f9fd..dee88f45 100644 --- a/migrations/2_deploy_token_to_token_dex.js +++ b/migrations/2_deploy_token_to_token_dex.js @@ -28,7 +28,7 @@ const defaultTokenId = 0; module.exports = async (deployer, network, accounts) => { tezos = new TezosToolkit(tezos.rpc.url); - // if (network === "development") return; + if (network === "development") return; const secretKey = accountsStored.alice.sk.trim(); tezos.setProvider({ config: { diff --git a/test/BuyToken.spec.ts b/test/BuyToken.spec.ts index ae5da24e..70ef6a7d 100644 --- a/test/BuyToken.spec.ts +++ b/test/BuyToken.spec.ts @@ -1,4 +1,4 @@ -import { TTContext } from "./helpers/ttContext"; +import { Context } from "./helpers/context"; import { strictEqual, ok, notStrictEqual, rejects } from "assert"; import BigNumber from "bignumber.js"; import accounts from "./accounts/accounts"; @@ -6,7 +6,7 @@ import { defaultAccountInfo } from "./constants"; const standard = process.env.EXCHANGE_TOKEN_STANDARD; contract("BuyToken()", function () { - let context: TTContext; + let context: Context; const tokenAAmount: number = 100000; const tokenBAmount: number = 1000; const aliceAddress: string = accounts.alice.pkh; @@ -14,7 +14,7 @@ contract("BuyToken()", function () { let tokenBAddress; before(async () => { - context = await TTContext.init([], false, "alice", false); + context = await Context.init([], false, "alice", false); await context.setAllDexFunctions(); await context.createPair({ tokenAAmount, diff --git a/test/BuyTokenWithRouter.spec.ts b/test/BuyTokenWithRouter.spec.ts index b9ab952a..bfe34db6 100644 --- a/test/BuyTokenWithRouter.spec.ts +++ b/test/BuyTokenWithRouter.spec.ts @@ -1,325 +1,325 @@ -import { TTContext } from "./helpers/ttContext"; -import { strictEqual, ok, notStrictEqual, rejects } from "assert"; -import BigNumber from "bignumber.js"; -import accounts from "./accounts/accounts"; -import { defaultAccountInfo } from "./constants"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; -import { Parser } from "@taquito/michel-codec"; +// import { Context } from "./helpers/context"; +// import { strictEqual, ok, notStrictEqual, rejects } from "assert"; +// import BigNumber from "bignumber.js"; +// import accounts from "./accounts/accounts"; +// import { defaultAccountInfo } from "./constants"; +// const standard = process.env.EXCHANGE_TOKEN_STANDARD; +// import { Parser } from "@taquito/michel-codec"; -export const michelParser = new Parser(); +// export const michelParser = new Parser(); -contract("BuyTokenWithRoute()", function () { - let context: TTContext; - const tokenAAmount: number = 100000; - const tokenBAmount: number = 10000; - const tokenCAmount: number = 10000; - const aliceAddress: string = accounts.alice.pkh; - let tokenAAddress; - let tokenBAddress; - let tokenCAddress; - let reverseOrder; +// contract("BuyTokenWithRoute()", function () { +// let context: Context; +// const tokenAAmount: number = 100000; +// const tokenBAmount: number = 10000; +// const tokenCAmount: number = 10000; +// const aliceAddress: string = accounts.alice.pkh; +// let tokenAAddress; +// let tokenBAddress; +// let tokenCAddress; +// let reverseOrder; - before(async () => { - context = await TTContext.init([], false, "alice", false); - await context.setAllDexFunctions(); - await context.createPair({ - tokenAAmount, - tokenBAmount, - }); - tokenAAddress = context.tokens[0].contract.address; - tokenBAddress = context.tokens[1].contract.address; - await context.createPair( - { - tokenAAmount: tokenAAmount, - tokenAAddress, - tokenBAmount: tokenCAmount, - }, - false - ); - tokenCAddress = context.tokens[2].contract.address; - reverseOrder = standard != "MIXED" && tokenAAddress > tokenCAddress; - }); +// before(async () => { +// context = await Context.init([], false, "alice", false); +// await context.setAllDexFunctions(); +// await context.createPair({ +// tokenAAmount, +// tokenBAmount, +// }); +// tokenAAddress = context.tokens[0].contract.address; +// tokenBAddress = context.tokens[1].contract.address; +// await context.createPair( +// { +// tokenAAmount: tokenAAmount, +// tokenAAddress, +// tokenBAmount: tokenCAmount, +// }, +// false +// ); +// tokenCAddress = context.tokens[2].contract.address; +// reverseOrder = standard != "MIXED" && tokenAAddress > tokenCAddress; +// }); - function tokenToTokenSuccessCase( - decription, - amountIn, - amountOut, - tokensLeftover - ) { - it(decription, async function () { - const pairAddress = context.dex.contract.address; - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.tokens[1].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.tokens[2].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.dex.updateStorage({ - ledger: [[aliceAddress, 0]], - tokens: ["0"], - pairs: ["0", "1"], - }); - const aliceInitTokenABalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - const aliceInitTokenBBalance = ( - (await context.tokens[1].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - const aliceInitTokenСBalance = ( - (await context.tokens[2].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - const pairInitTokenABalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairInitTokenBBalance = await context.tokens[1].storage.ledger[ - pairAddress - ].balance; - const pairInitTokenСBalance = await context.tokens[2].storage.ledger[ - pairAddress - ].balance; - const initDexPair0 = context.dex.storage.pairs[0]; - const initDexPair1 = context.dex.storage.pairs[1]; - await context.dex.tokenToTokenRoutePayment( - [ - { - pair: { - token_a_address: tokenAAddress, - token_b_address: tokenBAddress, - token_a_id: new BigNumber(0), - token_b_id: new BigNumber(0), - token_a_type: { - [standard.toLowerCase() == "mixed" - ? "fa2" - : standard.toLowerCase()]: null, - }, - token_b_type: { - [standard.toLowerCase() == "mixed" - ? "fa12" - : standard.toLowerCase()]: null, - }, - }, - operation: { buy: null }, - }, - { - pair: { - token_a_address: reverseOrder ? tokenCAddress : tokenAAddress, - token_b_address: reverseOrder ? tokenAAddress : tokenCAddress, - token_a_id: new BigNumber(0), - token_b_id: new BigNumber(0), - token_a_type: { - [standard.toLowerCase() == "mixed" - ? "fa2" - : standard.toLowerCase()]: null, - }, - token_b_type: { - [standard.toLowerCase() == "mixed" - ? "fa12" - : standard.toLowerCase()]: null, - }, - }, - operation: { sell: null }, - }, - ], - amountIn, - amountOut, - aliceAddress - ); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.tokens[1].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.tokens[2].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.dex.updateStorage({ - ledger: [[aliceAddress, 0]], - tokens: ["0"], - pairs: ["0", "1"], - }); - const finalDexPair0 = context.dex.storage.pairs[0]; - const finalDexPair1 = context.dex.storage.pairs[1]; - const aliceFinalTokenABalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const aliceFinalTokenBBalance = await context.tokens[1].storage.ledger[ - aliceAddress - ].balance; - const aliceFinalTokenСBalance = await context.tokens[2].storage.ledger[ - aliceAddress - ].balance; - const pairTokenABalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTokenBBalance = await context.tokens[1].storage.ledger[ - pairAddress - ].balance; - const pairTokenСBalance = await context.tokens[2].storage.ledger[ - pairAddress - ].balance; - const internalBalanceChange0 = - initDexPair0.token_a_pool.toNumber() - - finalDexPair0.token_a_pool.toNumber(); - const internalBalanceChange1 = - finalDexPair1.token_a_pool.toNumber() - - initDexPair1.token_a_pool.toNumber(); - strictEqual( - aliceInitTokenABalance.toNumber(), - aliceFinalTokenABalance.toNumber() - ); - strictEqual( - aliceInitTokenBBalance.toNumber() - amountIn, - aliceFinalTokenBBalance.toNumber() - ); - strictEqual( - aliceInitTokenСBalance.toNumber() + amountOut + tokensLeftover, - aliceFinalTokenСBalance.toNumber() - ); - strictEqual( - pairInitTokenABalance.toNumber(), - pairTokenABalance.toNumber() - ); - strictEqual( - pairInitTokenСBalance.toNumber() - amountOut - tokensLeftover, - pairTokenСBalance.toNumber() - ); - strictEqual( - pairInitTokenBBalance.toNumber() + amountIn, - pairTokenBBalance.toNumber() - ); - strictEqual( - finalDexPair0.token_b_pool.toNumber(), - initDexPair0.token_b_pool.toNumber() + amountIn - ); - strictEqual( - finalDexPair1.token_b_pool.toNumber(), - initDexPair1.token_b_pool.toNumber() - amountOut - tokensLeftover - ); - strictEqual(internalBalanceChange0, internalBalanceChange1); - }); - } +// function tokenToTokenSuccessCase( +// decription, +// amountIn, +// amountOut, +// tokensLeftover +// ) { +// it(decription, async function () { +// const pairAddress = context.dex.contract.address; +// await context.tokens[0].updateStorage({ +// ledger: [aliceAddress, pairAddress], +// }); +// await context.tokens[1].updateStorage({ +// ledger: [aliceAddress, pairAddress], +// }); +// await context.tokens[2].updateStorage({ +// ledger: [aliceAddress, pairAddress], +// }); +// await context.dex.updateStorage({ +// ledger: [[aliceAddress, 0]], +// tokens: ["0"], +// pairs: ["0", "1"], +// }); +// const aliceInitTokenABalance = ( +// (await context.tokens[0].storage.ledger[aliceAddress]) || +// defaultAccountInfo +// ).balance; +// const aliceInitTokenBBalance = ( +// (await context.tokens[1].storage.ledger[aliceAddress]) || +// defaultAccountInfo +// ).balance; +// const aliceInitTokenСBalance = ( +// (await context.tokens[2].storage.ledger[aliceAddress]) || +// defaultAccountInfo +// ).balance; +// const pairInitTokenABalance = await context.tokens[0].storage.ledger[ +// pairAddress +// ].balance; +// const pairInitTokenBBalance = await context.tokens[1].storage.ledger[ +// pairAddress +// ].balance; +// const pairInitTokenСBalance = await context.tokens[2].storage.ledger[ +// pairAddress +// ].balance; +// const initDexPair0 = context.dex.storage.pairs[0]; +// const initDexPair1 = context.dex.storage.pairs[1]; +// await context.dex.tokenToTokenRoutePayment( +// [ +// { +// pair: { +// token_a_address: tokenAAddress, +// token_b_address: tokenBAddress, +// token_a_id: new BigNumber(0), +// token_b_id: new BigNumber(0), +// token_a_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa2" +// : standard.toLowerCase()]: null, +// }, +// token_b_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa12" +// : standard.toLowerCase()]: null, +// }, +// }, +// operation: { buy: null }, +// }, +// { +// pair: { +// token_a_address: reverseOrder ? tokenCAddress : tokenAAddress, +// token_b_address: reverseOrder ? tokenAAddress : tokenCAddress, +// token_a_id: new BigNumber(0), +// token_b_id: new BigNumber(0), +// token_a_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa2" +// : standard.toLowerCase()]: null, +// }, +// token_b_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa12" +// : standard.toLowerCase()]: null, +// }, +// }, +// operation: { sell: null }, +// }, +// ], +// amountIn, +// amountOut, +// aliceAddress +// ); +// await context.tokens[0].updateStorage({ +// ledger: [aliceAddress, pairAddress], +// }); +// await context.tokens[1].updateStorage({ +// ledger: [aliceAddress, pairAddress], +// }); +// await context.tokens[2].updateStorage({ +// ledger: [aliceAddress, pairAddress], +// }); +// await context.dex.updateStorage({ +// ledger: [[aliceAddress, 0]], +// tokens: ["0"], +// pairs: ["0", "1"], +// }); +// const finalDexPair0 = context.dex.storage.pairs[0]; +// const finalDexPair1 = context.dex.storage.pairs[1]; +// const aliceFinalTokenABalance = await context.tokens[0].storage.ledger[ +// aliceAddress +// ].balance; +// const aliceFinalTokenBBalance = await context.tokens[1].storage.ledger[ +// aliceAddress +// ].balance; +// const aliceFinalTokenСBalance = await context.tokens[2].storage.ledger[ +// aliceAddress +// ].balance; +// const pairTokenABalance = await context.tokens[0].storage.ledger[ +// pairAddress +// ].balance; +// const pairTokenBBalance = await context.tokens[1].storage.ledger[ +// pairAddress +// ].balance; +// const pairTokenСBalance = await context.tokens[2].storage.ledger[ +// pairAddress +// ].balance; +// const internalBalanceChange0 = +// initDexPair0.token_a_pool.toNumber() - +// finalDexPair0.token_a_pool.toNumber(); +// const internalBalanceChange1 = +// finalDexPair1.token_a_pool.toNumber() - +// initDexPair1.token_a_pool.toNumber(); +// strictEqual( +// aliceInitTokenABalance.toNumber(), +// aliceFinalTokenABalance.toNumber() +// ); +// strictEqual( +// aliceInitTokenBBalance.toNumber() - amountIn, +// aliceFinalTokenBBalance.toNumber() +// ); +// strictEqual( +// aliceInitTokenСBalance.toNumber() + amountOut + tokensLeftover, +// aliceFinalTokenСBalance.toNumber() +// ); +// strictEqual( +// pairInitTokenABalance.toNumber(), +// pairTokenABalance.toNumber() +// ); +// strictEqual( +// pairInitTokenСBalance.toNumber() - amountOut - tokensLeftover, +// pairTokenСBalance.toNumber() +// ); +// strictEqual( +// pairInitTokenBBalance.toNumber() + amountIn, +// pairTokenBBalance.toNumber() +// ); +// strictEqual( +// finalDexPair0.token_b_pool.toNumber(), +// initDexPair0.token_b_pool.toNumber() + amountIn +// ); +// strictEqual( +// finalDexPair1.token_b_pool.toNumber(), +// initDexPair1.token_b_pool.toNumber() - amountOut - tokensLeftover +// ); +// strictEqual(internalBalanceChange0, internalBalanceChange1); +// }); +// } - function tokenToTokenFailCase(decription, amountIn, amountOut, errorMsg) { - it(decription, async function () { - await rejects( - context.dex.tokenToTokenRoutePayment( - [ - { - pair: { - token_a_address: tokenAAddress, - token_b_address: tokenBAddress, - token_a_id: new BigNumber(0), - token_b_id: new BigNumber(0), - token_a_type: { - [standard.toLowerCase() == "mixed" - ? "fa2" - : standard.toLowerCase()]: null, - }, - token_b_type: { - [standard.toLowerCase() == "mixed" - ? "fa12" - : standard.toLowerCase()]: null, - }, - }, - operation: { buy: null }, - }, - { - pair: { - token_a_address: reverseOrder ? tokenCAddress : tokenAAddress, - token_b_address: reverseOrder ? tokenAAddress : tokenCAddress, - token_a_id: new BigNumber(0), - token_b_id: new BigNumber(0), - token_a_type: { - [standard.toLowerCase() == "mixed" - ? "fa2" - : standard.toLowerCase()]: null, - }, - token_b_type: { - [standard.toLowerCase() == "mixed" - ? "fa12" - : standard.toLowerCase()]: null, - }, - }, - operation: { sell: null }, - }, - ], - amountIn, - amountOut, - aliceAddress - ), - (err: any) => { - ok(err.message == errorMsg, "Error message mismatch"); - return true; - } - ); - }); - } +// function tokenToTokenFailCase(decription, amountIn, amountOut, errorMsg) { +// it(decription, async function () { +// await rejects( +// context.dex.tokenToTokenRoutePayment( +// [ +// { +// pair: { +// token_a_address: tokenAAddress, +// token_b_address: tokenBAddress, +// token_a_id: new BigNumber(0), +// token_b_id: new BigNumber(0), +// token_a_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa2" +// : standard.toLowerCase()]: null, +// }, +// token_b_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa12" +// : standard.toLowerCase()]: null, +// }, +// }, +// operation: { buy: null }, +// }, +// { +// pair: { +// token_a_address: reverseOrder ? tokenCAddress : tokenAAddress, +// token_b_address: reverseOrder ? tokenAAddress : tokenCAddress, +// token_a_id: new BigNumber(0), +// token_b_id: new BigNumber(0), +// token_a_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa2" +// : standard.toLowerCase()]: null, +// }, +// token_b_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa12" +// : standard.toLowerCase()]: null, +// }, +// }, +// operation: { sell: null }, +// }, +// ], +// amountIn, +// amountOut, +// aliceAddress +// ), +// (err: any) => { +// ok(err.message == errorMsg, "Error message mismatch"); +// return true; +// } +// ); +// }); +// } - describe("Test different amount of tokens to be swapped", () => { - tokenToTokenFailCase( - "revert in case of 0 tokens to be swapped", - 0, - 1, - "Dex/zero-amount-in" - ); - tokenToTokenFailCase( - "revert in case of 100% of reserves to be swapped", - 10000, - 1, - "Dex/high-out" - ); - tokenToTokenFailCase( - "revert in case of 10000% of reserves to be swapped", - 100000, - 1, - "Dex/high-out" - ); +// describe("Test different amount of tokens to be swapped", () => { +// tokenToTokenFailCase( +// "revert in case of 0 tokens to be swapped", +// 0, +// 1, +// "Dex/zero-amount-in" +// ); +// tokenToTokenFailCase( +// "revert in case of 100% of reserves to be swapped", +// 10000, +// 1, +// "Dex/high-out" +// ); +// tokenToTokenFailCase( +// "revert in case of 10000% of reserves to be swapped", +// 100000, +// 1, +// "Dex/high-out" +// ); - tokenToTokenSuccessCase( - "success in case of 1% of reserves to be swapped", - 11, - 10, - 0 - ); - tokenToTokenSuccessCase( - "success in case of ~30% of reserves to be swapped", - 300, - 280, - 0 - ); - }); +// tokenToTokenSuccessCase( +// "success in case of 1% of reserves to be swapped", +// 11, +// 10, +// 0 +// ); +// tokenToTokenSuccessCase( +// "success in case of ~30% of reserves to be swapped", +// 300, +// 280, +// 0 +// ); +// }); - describe("Test different minimal desirable output amount", () => { - tokenToTokenFailCase( - "reevert in case of 0 tokens expected", - 10, - 0, - "Dex/zero-min-amount-out" - ); - tokenToTokenFailCase( - "revert in case of too many tokens expected", - 10, - 70000, - "Dex/wrong-min-out" - ); - tokenToTokenSuccessCase( - "success in case of exact amount of tokens expected", - 5, - 4, - 0 - ); - tokenToTokenSuccessCase( - "success in case of smaller amount of tokens expected", - 10, - 7, - 1 - ); - }); -}); +// describe("Test different minimal desirable output amount", () => { +// tokenToTokenFailCase( +// "reevert in case of 0 tokens expected", +// 10, +// 0, +// "Dex/zero-min-amount-out" +// ); +// tokenToTokenFailCase( +// "revert in case of too many tokens expected", +// 10, +// 70000, +// "Dex/wrong-min-out" +// ); +// tokenToTokenSuccessCase( +// "success in case of exact amount of tokens expected", +// 5, +// 4, +// 0 +// ); +// tokenToTokenSuccessCase( +// "success in case of smaller amount of tokens expected", +// 10, +// 7, +// 1 +// ); +// }); +// }); diff --git a/test/DivestTTLiquidity.spec.ts b/test/DivestLiquidity.spec.ts similarity index 99% rename from test/DivestTTLiquidity.spec.ts rename to test/DivestLiquidity.spec.ts index 6d5cc7fd..d31beeae 100644 --- a/test/DivestTTLiquidity.spec.ts +++ b/test/DivestLiquidity.spec.ts @@ -1,4 +1,4 @@ -import { TTContext } from "./helpers/ttContext"; +import { Context } from "./helpers/context"; import { strictEqual, ok, notStrictEqual, rejects } from "assert"; import BigNumber from "bignumber.js"; import accounts from "./accounts/accounts"; @@ -6,7 +6,7 @@ import { defaultAccountInfo } from "./constants"; const standard = process.env.EXCHANGE_TOKEN_STANDARD; contract("DivestTTLiquidity()", function () { - let context: TTContext; + let context: Context; const tokenAAmount: number = 1000; const tokenBAmount: number = 100000; const aliceAddress: string = accounts.alice.pkh; @@ -18,7 +18,7 @@ contract("DivestTTLiquidity()", function () { const burntShares: number = 200; before(async () => { - context = await TTContext.init([], false, "alice", false); + context = await Context.init([], false, "alice", false); await context.setAllDexFunctions(); await context.createPair({ tokenAAmount, diff --git a/test/InitializeTTExchangeTest.spec.ts b/test/InitializeExchangeTest.spec.ts similarity index 82% rename from test/InitializeTTExchangeTest.spec.ts rename to test/InitializeExchangeTest.spec.ts index 14796ac7..67584d0e 100644 --- a/test/InitializeTTExchangeTest.spec.ts +++ b/test/InitializeExchangeTest.spec.ts @@ -1,4 +1,4 @@ -import { TTContext } from "./helpers/ttContext"; +import { Context } from "./helpers/context"; import { strictEqual, ok, notStrictEqual, rejects } from "assert"; import accounts from "./accounts/accounts"; import { defaultAccountInfo } from "./constants"; @@ -6,14 +6,14 @@ import { TokenFA2 } from "./helpers/tokenFA2"; import { TokenFA12 } from "./helpers/tokenFA12"; const standard = process.env.EXCHANGE_TOKEN_STANDARD; -contract("InitializeTTExchange()", function () { - let context: TTContext; +contract.only("InitializeExchange()", function () { + let context: Context; let aliceAddress: string = accounts.alice.pkh; const tokenAAmount: number = 10000; const tokenBAmount: number = 1000; before(async () => { - context = await TTContext.init([], false, "alice", false); + context = await Context.init([], false, "alice", false); await context.setAllDexFunctions(); }); @@ -155,14 +155,38 @@ contract("InitializeTTExchange()", function () { context.dex.storage.pairs[0].token_b_pool.toNumber(), tokenBAmount ); - strictEqual( - context.dex.storage.tokens["0"].token_a_address, - tokenAAddress - ); - strictEqual( - context.dex.storage.tokens["0"].token_b_address, - tokenBAddress - ); + switch (standard.toLocaleLowerCase()) { + case "fa12": + strictEqual( + context.dex.storage.tokens["0"].token_a_type.fa12, + tokenAAddress + ); + strictEqual( + context.dex.storage.tokens["0"].token_b_type.fa12, + tokenBAddress + ); + break; + case "fa2": + strictEqual( + context.dex.storage.tokens["0"].token_a_type.fa2.token_address, + tokenAAddress + ); + strictEqual( + context.dex.storage.tokens["0"].token_b_type.fa2.token_address, + tokenBAddress + ); + break; + case "mixed": + strictEqual( + context.dex.storage.tokens["0"].token_a_type.fa12, + tokenAAddress + ); + strictEqual( + context.dex.storage.tokens["0"].token_b_type.fa2.token_address, + tokenBAddress + ); + break; + } }); it("revert in case the pair exists", async function () { @@ -282,14 +306,38 @@ contract("InitializeTTExchange()", function () { context.dex.storage.pairs[0].token_b_pool.toNumber(), tokenBAmount ); - strictEqual( - context.dex.storage.tokens["0"].token_a_address, - tokenAAddress - ); - strictEqual( - context.dex.storage.tokens["0"].token_b_address, - tokenBAddress - ); + switch (standard.toLocaleLowerCase()) { + case "fa12": + strictEqual( + context.dex.storage.tokens["0"].token_a_type.fa12, + tokenAAddress + ); + strictEqual( + context.dex.storage.tokens["0"].token_b_type.fa12, + tokenBAddress + ); + break; + case "fa2": + strictEqual( + context.dex.storage.tokens["0"].token_a_type.fa2.token_address, + tokenAAddress + ); + strictEqual( + context.dex.storage.tokens["0"].token_b_type.fa2.token_address, + tokenBAddress + ); + break; + case "mixed": + strictEqual( + context.dex.storage.tokens["0"].token_a_type.fa12, + tokenAAddress + ); + strictEqual( + context.dex.storage.tokens["0"].token_b_type.fa2.token_address, + tokenBAddress + ); + break; + } }); it("revert in case the amount of token A is zero", async function () { diff --git a/test/InvestTTLiquidity.spec.ts b/test/InvestLiquidity.spec.ts similarity index 99% rename from test/InvestTTLiquidity.spec.ts rename to test/InvestLiquidity.spec.ts index e32fa585..fb748463 100644 --- a/test/InvestTTLiquidity.spec.ts +++ b/test/InvestLiquidity.spec.ts @@ -1,11 +1,11 @@ -import { TTContext } from "./helpers/ttContext"; +import { Context } from "./helpers/context"; import { strictEqual, ok, notStrictEqual, rejects } from "assert"; import accounts from "./accounts/accounts"; import { defaultAccountInfo } from "./constants"; const standard = process.env.EXCHANGE_TOKEN_STANDARD; contract("InvestTTLiquidity()", function () { - let context: TTContext; + let context: Context; const tokenAAmount: number = 1000; const tokenBAmount: number = 100000; const aliceAddress: string = accounts.alice.pkh; @@ -15,7 +15,7 @@ contract("InvestTTLiquidity()", function () { let tokenBAddress; before(async () => { - context = await TTContext.init([], false, "alice", false); + context = await Context.init([], false, "alice", false); await context.setAllDexFunctions(); await context.createPair({ tokenAAmount, diff --git a/test/SellToken.spec.ts b/test/SellToken.spec.ts index ceb3225a..8d48b137 100644 --- a/test/SellToken.spec.ts +++ b/test/SellToken.spec.ts @@ -1,4 +1,4 @@ -import { TTContext } from "./helpers/ttContext"; +import { Context } from "./helpers/context"; import { strictEqual, ok, notStrictEqual, rejects } from "assert"; import BigNumber from "bignumber.js"; import accounts from "./accounts/accounts"; @@ -7,7 +7,7 @@ import { isConstructorDeclaration } from "typescript"; const standard = process.env.EXCHANGE_TOKEN_STANDARD; contract("SellToken()", function () { - let context: TTContext; + let context: Context; const tokenAAmount: number = 100000; const tokenBAmount: number = 1000; const aliceAddress: string = accounts.alice.pkh; @@ -15,7 +15,7 @@ contract("SellToken()", function () { let tokenBAddress; before(async () => { - context = await TTContext.init([], false, "alice", false); + context = await Context.init([], false, "alice", false); await context.setAllDexFunctions(); await context.createPair({ tokenAAmount, diff --git a/test/SellTokenWithRoute.spec.ts b/test/SellTokenWithRoute.spec.ts index 394efc3e..93ea006a 100644 --- a/test/SellTokenWithRoute.spec.ts +++ b/test/SellTokenWithRoute.spec.ts @@ -1,315 +1,315 @@ -import { TTContext } from "./helpers/ttContext"; -import { strictEqual, ok, notStrictEqual, rejects } from "assert"; -import BigNumber from "bignumber.js"; -import accounts from "./accounts/accounts"; -import { defaultAccountInfo } from "./constants"; -const standard = process.env.EXCHANGE_TOKEN_STANDARD; +// import { Context } from "./helpers/context"; +// import { strictEqual, ok, notStrictEqual, rejects } from "assert"; +// import BigNumber from "bignumber.js"; +// import accounts from "./accounts/accounts"; +// import { defaultAccountInfo } from "./constants"; +// const standard = process.env.EXCHANGE_TOKEN_STANDARD; -contract("SellTokenWithRoute()", function () { - let context: TTContext; - const tokenAAmount: number = 100000; - const tokenBAmount: number = 10000; - const tokenCAmount: number = 10000; - const aliceAddress: string = accounts.alice.pkh; - let tokenAAddress; - let tokenBAddress; - let tokenCAddress; - let reverseOrder; +// contract("SellTokenWithRoute()", function () { +// let context: Context; +// const tokenAAmount: number = 100000; +// const tokenBAmount: number = 10000; +// const tokenCAmount: number = 10000; +// const aliceAddress: string = accounts.alice.pkh; +// let tokenAAddress; +// let tokenBAddress; +// let tokenCAddress; +// let reverseOrder; - before(async () => { - context = await TTContext.init([], false, "alice", false); - await context.setAllDexFunctions(); - await context.createPair({ - tokenAAmount, - tokenBAmount, - }); - tokenAAddress = context.tokens[0].contract.address; - tokenBAddress = context.tokens[1].contract.address; - await context.createPair( - { - tokenAAmount: tokenCAmount, - tokenBAddress, - tokenBAmount: tokenBAmount, - }, - false - ); - tokenCAddress = context.tokens[2].contract.address; - reverseOrder = standard != "MIXED" && tokenCAddress > tokenBAddress; - }); +// before(async () => { +// context = await Context.init([], false, "alice", false); +// await context.setAllDexFunctions(); +// await context.createPair({ +// tokenAAmount, +// tokenBAmount, +// }); +// tokenAAddress = context.tokens[0].contract.address; +// tokenBAddress = context.tokens[1].contract.address; +// await context.createPair( +// { +// tokenAAmount: tokenCAmount, +// tokenBAddress, +// tokenBAmount: tokenBAmount, +// }, +// false +// ); +// tokenCAddress = context.tokens[2].contract.address; +// reverseOrder = standard != "MIXED" && tokenCAddress > tokenBAddress; +// }); - function tokenToTokenSuccessCase( - decription, - amountIn, - amountOut, - tokensLeftover - ) { - it(decription, async function () { - const pairAddress = context.dex.contract.address; - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.tokens[1].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.tokens[2].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.dex.updateStorage({ - ledger: [[aliceAddress, 0]], - tokens: ["0"], - pairs: ["0", "1"], - }); - const aliceInitTokenABalance = ( - (await context.tokens[0].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - const aliceInitTokenBBalance = ( - (await context.tokens[1].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - const aliceInitTokenСBalance = ( - (await context.tokens[2].storage.ledger[aliceAddress]) || - defaultAccountInfo - ).balance; - const pairInitTokenABalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairInitTokenBBalance = await context.tokens[1].storage.ledger[ - pairAddress - ].balance; - const pairInitTokenСBalance = await context.tokens[2].storage.ledger[ - pairAddress - ].balance; - const initDexPair0 = context.dex.storage.pairs[0]; - const initDexPair1 = context.dex.storage.pairs[1]; - await context.dex.tokenToTokenRoutePayment( - [ - { - pair: { - token_a_address: tokenAAddress, - token_b_address: tokenBAddress, - token_a_id: new BigNumber(0), - token_b_id: new BigNumber(0), - token_a_type: { - [standard.toLowerCase() == "mixed" - ? "fa2" - : standard.toLowerCase()]: null, - }, - token_b_type: { - [standard.toLowerCase() == "mixed" - ? "fa12" - : standard.toLowerCase()]: null, - }, - }, - operation: { sell: null }, - }, - { - pair: { - token_a_address: reverseOrder ? tokenBAddress : tokenCAddress, - token_b_address: reverseOrder ? tokenCAddress : tokenBAddress, - token_a_id: new BigNumber(0), - token_b_id: new BigNumber(0), - token_a_type: { - [standard.toLowerCase() == "mixed" - ? "fa2" - : standard.toLowerCase()]: null, - }, - token_b_type: { - [standard.toLowerCase() == "mixed" - ? "fa12" - : standard.toLowerCase()]: null, - }, - }, - operation: { buy: null }, - }, - ], - amountIn, - amountOut, - aliceAddress - ); - await context.tokens[0].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.tokens[1].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.tokens[2].updateStorage({ - ledger: [aliceAddress, pairAddress], - }); - await context.dex.updateStorage({ - ledger: [[aliceAddress, 0]], - tokens: ["0"], - pairs: ["0", "1"], - }); - const finalDexPair0 = context.dex.storage.pairs[0]; - const finalDexPair1 = context.dex.storage.pairs[1]; - const aliceFinalTokenABalance = await context.tokens[0].storage.ledger[ - aliceAddress - ].balance; - const aliceFinalTokenBBalance = await context.tokens[1].storage.ledger[ - aliceAddress - ].balance; - const aliceFinalTokenСBalance = await context.tokens[2].storage.ledger[ - aliceAddress - ].balance; - const pairTokenABalance = await context.tokens[0].storage.ledger[ - pairAddress - ].balance; - const pairTokenBBalance = await context.tokens[1].storage.ledger[ - pairAddress - ].balance; - const pairTokenСBalance = await context.tokens[2].storage.ledger[ - pairAddress - ].balance; - const internalBalanceChange0 = - initDexPair0.token_b_pool.toNumber() - - finalDexPair0.token_b_pool.toNumber(); - const internalBalanceChange1 = - finalDexPair1.token_b_pool.toNumber() - - initDexPair1.token_b_pool.toNumber(); - strictEqual( - aliceInitTokenBBalance.toNumber(), - aliceFinalTokenBBalance.toNumber() - ); - strictEqual( - aliceInitTokenABalance.toNumber() - amountIn, - aliceFinalTokenABalance.toNumber() - ); - strictEqual( - aliceInitTokenСBalance.toNumber() + amountOut + tokensLeftover, - aliceFinalTokenСBalance.toNumber() - ); - strictEqual( - pairInitTokenBBalance.toNumber(), - pairTokenBBalance.toNumber() - ); - strictEqual( - pairInitTokenСBalance.toNumber() - amountOut - tokensLeftover, - pairTokenСBalance.toNumber() - ); - strictEqual( - pairInitTokenABalance.toNumber() + amountIn, - pairTokenABalance.toNumber() - ); - strictEqual( - finalDexPair0.token_a_pool.toNumber(), - initDexPair0.token_a_pool.toNumber() + amountIn - ); - strictEqual( - finalDexPair1.token_a_pool.toNumber(), - initDexPair1.token_a_pool.toNumber() - amountOut - tokensLeftover - ); - strictEqual(internalBalanceChange0, internalBalanceChange1); - }); - } +// function tokenToTokenSuccessCase( +// decription, +// amountIn, +// amountOut, +// tokensLeftover +// ) { +// it(decription, async function () { +// const pairAddress = context.dex.contract.address; +// await context.tokens[0].updateStorage({ +// ledger: [aliceAddress, pairAddress], +// }); +// await context.tokens[1].updateStorage({ +// ledger: [aliceAddress, pairAddress], +// }); +// await context.tokens[2].updateStorage({ +// ledger: [aliceAddress, pairAddress], +// }); +// await context.dex.updateStorage({ +// ledger: [[aliceAddress, 0]], +// tokens: ["0"], +// pairs: ["0", "1"], +// }); +// const aliceInitTokenABalance = ( +// (await context.tokens[0].storage.ledger[aliceAddress]) || +// defaultAccountInfo +// ).balance; +// const aliceInitTokenBBalance = ( +// (await context.tokens[1].storage.ledger[aliceAddress]) || +// defaultAccountInfo +// ).balance; +// const aliceInitTokenСBalance = ( +// (await context.tokens[2].storage.ledger[aliceAddress]) || +// defaultAccountInfo +// ).balance; +// const pairInitTokenABalance = await context.tokens[0].storage.ledger[ +// pairAddress +// ].balance; +// const pairInitTokenBBalance = await context.tokens[1].storage.ledger[ +// pairAddress +// ].balance; +// const pairInitTokenСBalance = await context.tokens[2].storage.ledger[ +// pairAddress +// ].balance; +// const initDexPair0 = context.dex.storage.pairs[0]; +// const initDexPair1 = context.dex.storage.pairs[1]; +// await context.dex.tokenToTokenRoutePayment( +// [ +// { +// pair: { +// token_a_address: tokenAAddress, +// token_b_address: tokenBAddress, +// token_a_id: new BigNumber(0), +// token_b_id: new BigNumber(0), +// token_a_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa2" +// : standard.toLowerCase()]: null, +// }, +// token_b_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa12" +// : standard.toLowerCase()]: null, +// }, +// }, +// operation: { sell: null }, +// }, +// { +// pair: { +// token_a_address: reverseOrder ? tokenBAddress : tokenCAddress, +// token_b_address: reverseOrder ? tokenCAddress : tokenBAddress, +// token_a_id: new BigNumber(0), +// token_b_id: new BigNumber(0), +// token_a_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa2" +// : standard.toLowerCase()]: null, +// }, +// token_b_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa12" +// : standard.toLowerCase()]: null, +// }, +// }, +// operation: { buy: null }, +// }, +// ], +// amountIn, +// amountOut, +// aliceAddress +// ); +// await context.tokens[0].updateStorage({ +// ledger: [aliceAddress, pairAddress], +// }); +// await context.tokens[1].updateStorage({ +// ledger: [aliceAddress, pairAddress], +// }); +// await context.tokens[2].updateStorage({ +// ledger: [aliceAddress, pairAddress], +// }); +// await context.dex.updateStorage({ +// ledger: [[aliceAddress, 0]], +// tokens: ["0"], +// pairs: ["0", "1"], +// }); +// const finalDexPair0 = context.dex.storage.pairs[0]; +// const finalDexPair1 = context.dex.storage.pairs[1]; +// const aliceFinalTokenABalance = await context.tokens[0].storage.ledger[ +// aliceAddress +// ].balance; +// const aliceFinalTokenBBalance = await context.tokens[1].storage.ledger[ +// aliceAddress +// ].balance; +// const aliceFinalTokenСBalance = await context.tokens[2].storage.ledger[ +// aliceAddress +// ].balance; +// const pairTokenABalance = await context.tokens[0].storage.ledger[ +// pairAddress +// ].balance; +// const pairTokenBBalance = await context.tokens[1].storage.ledger[ +// pairAddress +// ].balance; +// const pairTokenСBalance = await context.tokens[2].storage.ledger[ +// pairAddress +// ].balance; +// const internalBalanceChange0 = +// initDexPair0.token_b_pool.toNumber() - +// finalDexPair0.token_b_pool.toNumber(); +// const internalBalanceChange1 = +// finalDexPair1.token_b_pool.toNumber() - +// initDexPair1.token_b_pool.toNumber(); +// strictEqual( +// aliceInitTokenBBalance.toNumber(), +// aliceFinalTokenBBalance.toNumber() +// ); +// strictEqual( +// aliceInitTokenABalance.toNumber() - amountIn, +// aliceFinalTokenABalance.toNumber() +// ); +// strictEqual( +// aliceInitTokenСBalance.toNumber() + amountOut + tokensLeftover, +// aliceFinalTokenСBalance.toNumber() +// ); +// strictEqual( +// pairInitTokenBBalance.toNumber(), +// pairTokenBBalance.toNumber() +// ); +// strictEqual( +// pairInitTokenСBalance.toNumber() - amountOut - tokensLeftover, +// pairTokenСBalance.toNumber() +// ); +// strictEqual( +// pairInitTokenABalance.toNumber() + amountIn, +// pairTokenABalance.toNumber() +// ); +// strictEqual( +// finalDexPair0.token_a_pool.toNumber(), +// initDexPair0.token_a_pool.toNumber() + amountIn +// ); +// strictEqual( +// finalDexPair1.token_a_pool.toNumber(), +// initDexPair1.token_a_pool.toNumber() - amountOut - tokensLeftover +// ); +// strictEqual(internalBalanceChange0, internalBalanceChange1); +// }); +// } - function tokenToTokenFailCase(decription, amountIn, amountOut, errorMsg) { - it(decription, async function () { - await rejects( - context.dex.tokenToTokenRoutePayment( - [ - { - pair: { - token_a_address: tokenAAddress, - token_b_address: tokenBAddress, - token_a_id: new BigNumber(0), - token_b_id: new BigNumber(0), - token_a_type: { - [standard.toLowerCase() == "mixed" - ? "fa2" - : standard.toLowerCase()]: null, - }, - token_b_type: { - [standard.toLowerCase() == "mixed" - ? "fa12" - : standard.toLowerCase()]: null, - }, - }, - operation: { sell: null }, - }, - { - pair: { - token_a_address: reverseOrder ? tokenBAddress : tokenCAddress, - token_b_address: reverseOrder ? tokenCAddress : tokenBAddress, - token_a_id: new BigNumber(0), - token_b_id: new BigNumber(0), - token_a_type: { - [standard.toLowerCase() == "mixed" - ? "fa2" - : standard.toLowerCase()]: null, - }, - token_b_type: { - [standard.toLowerCase() == "mixed" - ? "fa12" - : standard.toLowerCase()]: null, - }, - }, - operation: { buy: null }, - }, - ], - amountIn, - amountOut, - aliceAddress - ), - (err: any) => { - ok(err.message == errorMsg, "Error message mismatch"); - return true; - } - ); - }); - } +// function tokenToTokenFailCase(decription, amountIn, amountOut, errorMsg) { +// it(decription, async function () { +// await rejects( +// context.dex.tokenToTokenRoutePayment( +// [ +// { +// pair: { +// token_a_address: tokenAAddress, +// token_b_address: tokenBAddress, +// token_a_id: new BigNumber(0), +// token_b_id: new BigNumber(0), +// token_a_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa2" +// : standard.toLowerCase()]: null, +// }, +// token_b_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa12" +// : standard.toLowerCase()]: null, +// }, +// }, +// operation: { sell: null }, +// }, +// { +// pair: { +// token_a_address: reverseOrder ? tokenBAddress : tokenCAddress, +// token_b_address: reverseOrder ? tokenCAddress : tokenBAddress, +// token_a_id: new BigNumber(0), +// token_b_id: new BigNumber(0), +// token_a_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa2" +// : standard.toLowerCase()]: null, +// }, +// token_b_type: { +// [standard.toLowerCase() == "mixed" +// ? "fa12" +// : standard.toLowerCase()]: null, +// }, +// }, +// operation: { buy: null }, +// }, +// ], +// amountIn, +// amountOut, +// aliceAddress +// ), +// (err: any) => { +// ok(err.message == errorMsg, "Error message mismatch"); +// return true; +// } +// ); +// }); +// } - describe("Test different amount of tokens to be swapped", () => { - tokenToTokenFailCase( - "revert in case of 0 tokens to be swapped", - 0, - 1, - "Dex/zero-amount-in" - ); - tokenToTokenFailCase( - "revert in case of 100% of reserves to be swapped", - 100000, - 300, - "Dex/high-out" - ); - tokenToTokenFailCase( - "revert in case of 1% of reserves to be swapped", - 12, - 1, - "Dex/wrong-min-out" - ); - tokenToTokenSuccessCase( - "success in case of ~30% of reserves to be swapped", - 30000, - 1866, - 0 - ); - }); +// describe("Test different amount of tokens to be swapped", () => { +// tokenToTokenFailCase( +// "revert in case of 0 tokens to be swapped", +// 0, +// 1, +// "Dex/zero-amount-in" +// ); +// tokenToTokenFailCase( +// "revert in case of 100% of reserves to be swapped", +// 100000, +// 300, +// "Dex/high-out" +// ); +// tokenToTokenFailCase( +// "revert in case of 1% of reserves to be swapped", +// 12, +// 1, +// "Dex/wrong-min-out" +// ); +// tokenToTokenSuccessCase( +// "success in case of ~30% of reserves to be swapped", +// 30000, +// 1866, +// 0 +// ); +// }); - describe("Test different minimal desirable output amount", () => { - tokenToTokenFailCase( - "reevert in case of 0 tokens expected", - 10, - 0, - "Dex/zero-min-amount-out" - ); - tokenToTokenFailCase( - "revert in case of too many tokens expected", - 20, - 7, - "Dex/wrong-min-out" - ); - tokenToTokenSuccessCase( - "success in case of exact amount of tokens expected", - 1000, - 38, - 0 - ); - tokenToTokenSuccessCase( - "success in case of smaller amount of tokens expected", - 1000, - 33, - 4 - ); - }); -}); +// describe("Test different minimal desirable output amount", () => { +// tokenToTokenFailCase( +// "reevert in case of 0 tokens expected", +// 10, +// 0, +// "Dex/zero-min-amount-out" +// ); +// tokenToTokenFailCase( +// "revert in case of too many tokens expected", +// 20, +// 7, +// "Dex/wrong-min-out" +// ); +// tokenToTokenSuccessCase( +// "success in case of exact amount of tokens expected", +// 1000, +// 38, +// 0 +// ); +// tokenToTokenSuccessCase( +// "success in case of smaller amount of tokens expected", +// 1000, +// 33, +// 4 +// ); +// }); +// }); diff --git a/test/TokenAToTokenB.spec.ts b/test/TokenAToTokenB.spec.ts index 44666cd3..fe65519d 100644 --- a/test/TokenAToTokenB.spec.ts +++ b/test/TokenAToTokenB.spec.ts @@ -1,4 +1,4 @@ -import { TTContext } from "./helpers/ttContext"; +import { Context } from "./helpers/context"; import { strictEqual, ok, notStrictEqual, rejects } from "assert"; import BigNumber from "bignumber.js"; import accounts from "./accounts/accounts"; @@ -6,7 +6,7 @@ import { defaultAccountInfo } from "./constants"; const standard = process.env.EXCHANGE_TOKEN_STANDARD; contract("TokenAToTokenB()", function () { - let context: TTContext; + let context: Context; const tokenAAmount: number = 100; const tokenBAmount: number = 100; const aliceAddress: string = accounts.alice.pkh; @@ -15,7 +15,7 @@ contract("TokenAToTokenB()", function () { let tokenBAddress; before(async () => { - context = await TTContext.init([], false, "alice", false); + context = await Context.init([], false, "alice", false); await context.setAllDexFunctions(); await context.createPair({ tokenAAmount, diff --git a/test/TokenBToTokenA.spec.ts b/test/TokenBToTokenA.spec.ts index 3abb55b3..91f0e08a 100644 --- a/test/TokenBToTokenA.spec.ts +++ b/test/TokenBToTokenA.spec.ts @@ -1,4 +1,4 @@ -import { TTContext } from "./helpers/ttContext"; +import { Context } from "./helpers/context"; import { strictEqual, ok, notStrictEqual, rejects } from "assert"; import BigNumber from "bignumber.js"; import accounts from "./accounts/accounts"; @@ -6,7 +6,7 @@ import { defaultAccountInfo } from "./constants"; const standard = process.env.EXCHANGE_TOKEN_STANDARD; contract("TokenBToTokenA()", function () { - let context: TTContext; + let context: Context; const tokenAAmount: number = 100; const tokenBAmount: number = 100; const aliceAddress: string = accounts.alice.pkh; @@ -15,7 +15,7 @@ contract("TokenBToTokenA()", function () { let tokenBAddress; before(async () => { - context = await TTContext.init([], false, "alice", false); + context = await Context.init([], false, "alice", false); await context.setAllDexFunctions(); await context.createPair({ tokenAAmount, diff --git a/test/helpers/ttContext.ts b/test/helpers/context.ts similarity index 96% rename from test/helpers/ttContext.ts rename to test/helpers/context.ts index 079756b0..0aa949d5 100644 --- a/test/helpers/ttContext.ts +++ b/test/helpers/context.ts @@ -1,6 +1,6 @@ const standard = process.env.EXCHANGE_TOKEN_STANDARD; -import { Dex as TTDexFA2 } from "./ttdexFA2"; +import { Dex } from "./dexFA2"; import { TokenFA12 } from "./tokenFA12"; import { prepareProviderOptions } from "./utils"; @@ -11,18 +11,17 @@ import { dexFunctions, tokenFunctions, balFunctions, -} from "../storage/TTFunctions"; +} from "../storage/Functions"; import { TokenFA2 } from "./tokenFA2"; import { Token } from "./token"; import { TezosToolkit } from "@taquito/taquito"; import BigNumber from "bignumber.js"; -type Dex = TTDexFA2; const CTokenFA12 = artifacts.require("TokenFA12"); const CTokenFA2 = artifacts.require("TokenFA2"); const CDex = artifacts.require("Dex"); -export class TTContext { +export class Context { public dex: Dex; public tokens: Token[]; @@ -48,7 +47,7 @@ export class TTContext { setDexFunctions: boolean = false, accountName: string = "alice", useDeployedDex: boolean = true - ): Promise { + ): Promise { let config = await prepareProviderOptions(accountName); tezos = new TezosToolkit(tezos.rpc.url); tezos.setProvider(config); @@ -56,9 +55,9 @@ export class TTContext { let dexInstance = useDeployedDex ? await CDex.deployed() : await CDex.new(dexStorage); - const dex = await TTDexFA2.init(dexInstance.address.toString()); + const dex = await Dex.init(dexInstance.address.toString()); - let context = new TTContext(dex, []); + let context = new Context(dex, []); if (setDexFunctions) { await context.setAllDexFunctions(); } diff --git a/test/helpers/ttdexFA2.ts b/test/helpers/dexFA2.ts similarity index 60% rename from test/helpers/ttdexFA2.ts rename to test/helpers/dexFA2.ts index 054ff53a..88071f2f 100644 --- a/test/helpers/ttdexFA2.ts +++ b/test/helpers/dexFA2.ts @@ -3,7 +3,7 @@ import { BatchOperation } from "@taquito/taquito/dist/types/operations/batch-ope import { TransactionOperation } from "@taquito/taquito/dist/types/operations/transaction-operation"; import { BigNumber } from "bignumber.js"; import { TokenFA2 } from "./tokenFA2"; -import { TTDexStorage, SwapSliceType } from "./types"; +import { DexStorage, SwapSliceType } from "./types"; import { getLigo } from "./utils"; import { execSync } from "child_process"; import { confirmOperation } from "./confirmation"; @@ -12,7 +12,7 @@ const standard = process.env.EXCHANGE_TOKEN_STANDARD; export class Dex extends TokenFA2 { public contract: ContractAbstraction; - public storage: TTDexStorage; + public storage: DexStorage; constructor(contract: ContractAbstraction) { super(contract); @@ -43,7 +43,8 @@ export class Dex extends TokenFA2 { token_lambdas: {}, }; for (let key in maps) { - if (["dex_lambdas", "token_lambdas"].includes(key)) continue; + if (["dex_lambdas", "token_lambdas", "bal_lambdas"].includes(key)) + continue; this.storage[key] = await maps[key].reduce(async (prev, current) => { try { return { @@ -61,7 +62,8 @@ export class Dex extends TokenFA2 { }, Promise.resolve({})); } for (let key in maps) { - if (!["dex_lambdas", "token_lambdas"].includes(key)) continue; + if (!["dex_lambdas", "token_lambdas", "bal_lambdas"].includes(key)) + continue; this[key] = await maps[key].reduce(async (prev, current) => { try { return { @@ -86,52 +88,84 @@ export class Dex extends TokenFA2 { tokenBid: BigNumber = new BigNumber(0), approve: boolean = true ): Promise { - if (approve) { - if (["FA2", "MIXED"].includes(standard)) { - await this.approveFA2Token( + var operation; + switch (standard.toLocaleLowerCase()) { + case "fa12": + await this.approveFA12Token( tokenAAddress, - tokenAid, tokenAAmount, this.contract.address ); - } else { await this.approveFA12Token( + tokenBAddress, + tokenBAmount, + this.contract.address + ); + operation = await this.contract.methods + .use( + "addPair", + "fa12", + tokenAAddress, + "fa12", + tokenBAddress, + tokenAAmount, + tokenBAmount + ) + .send(); + break; + case "fa2": + await this.approveFA2Token( tokenAAddress, - tokenAAmount, + tokenAid, + tokenAAmount || 1, this.contract.address ); - } - if ("FA2" == standard) { await this.approveFA2Token( tokenBAddress, tokenBid, - tokenBAmount, + tokenBAmount || 1, this.contract.address ); - } else { + operation = await this.contract.methods + .use( + "addPair", + "fa2", + tokenAAddress, + tokenAid, + "fa2", + tokenBAddress, + tokenBid, + tokenAAmount, + tokenBAmount + ) + .send(); + break; + case "mixed": await this.approveFA12Token( + tokenAAddress, + tokenAAmount, + this.contract.address + ); + await this.approveFA2Token( tokenBAddress, + tokenBid, tokenBAmount, this.contract.address ); - } + operation = await this.contract.methods + .use( + "addPair", + "fa12", + tokenAAddress, + "fa2", + tokenBAddress, + tokenBid, + tokenAAmount, + tokenBAmount + ) + .send(); + break; } - - const operation = await this.contract.methods - .use( - "addPair", - tokenAAddress, - tokenAid, - standard.toLowerCase() == "mixed" ? "fa2" : standard.toLowerCase(), - null, - tokenBAddress, - tokenBid, - standard.toLowerCase() == "mixed" ? "fa12" : standard.toLowerCase(), - null, - tokenAAmount, - tokenBAmount - ) - .send(); await confirmOperation(tezos, operation.hash); return operation; } @@ -140,40 +174,59 @@ export class Dex extends TokenFA2 { swaps: SwapSliceType[], amountIn: number, minAmountOut: number, - receiver: string, - tokenAid: BigNumber = new BigNumber(0), - tokenBid: BigNumber = new BigNumber(0) + receiver: string ): Promise { let firstSwap = swaps[0]; if (Object.keys(firstSwap.operation)[0] == "buy") { - if (["FA2"].includes(standard)) { - await this.approveFA2Token( - firstSwap.pair.token_b_address, - tokenBid, - amountIn, - this.contract.address - ); - } else { - await this.approveFA12Token( - firstSwap.pair.token_b_address, - amountIn, - this.contract.address - ); + switch (standard.toLocaleLowerCase()) { + case "fa12": + await this.approveFA12Token( + firstSwap.pair.token_b_type.fa12, + amountIn, + this.contract.address + ); + break; + case "fa2": + await this.approveFA2Token( + firstSwap.pair.token_b_type.fa2.token_address, + firstSwap.pair.token_b_type.fa2.token_id, + amountIn, + this.contract.address + ); + break; + case "mixed": + await this.approveFA2Token( + firstSwap.pair.token_b_type.fa2.token_address, + firstSwap.pair.token_b_type.fa2.token_id, + amountIn, + this.contract.address + ); + break; } } else { - if (["FA2", "MIXED"].includes(standard)) { - await this.approveFA2Token( - firstSwap.pair.token_a_address, - tokenAid, - amountIn, - this.contract.address - ); - } else { - await this.approveFA12Token( - firstSwap.pair.token_a_address, - amountIn, - this.contract.address - ); + switch (standard.toLocaleLowerCase()) { + case "fa12": + await this.approveFA12Token( + firstSwap.pair.token_a_type.fa12, + amountIn, + this.contract.address + ); + break; + case "fa2": + await this.approveFA2Token( + firstSwap.pair.token_a_type.fa2.token_address, + firstSwap.pair.token_a_type.fa2.token_id, + amountIn, + this.contract.address + ); + break; + case "mixed": + await this.approveFA12Token( + firstSwap.pair.token_a_type.fa12, + amountIn, + this.contract.address + ); + break; } } const operation = await this.contract.methods @@ -260,51 +313,87 @@ export class Dex extends TokenFA2 { ): Promise { await this.updateStorage({ tokens: [pairId] }); let pair = this.storage.tokens[pairId]; - if (["FA2", "MIXED"].includes(standard)) { - await this.approveFA2Token( - pair.token_a_address, - pair.token_a_id, - - tokenAAmount, - this.contract.address - ); - } else { - await this.approveFA12Token( - pair.token_a_address, - tokenAAmount, - this.contract.address - ); - } - if ("FA2" == standard) { - await this.approveFA2Token( - pair.token_b_address, - pair.token_b_id, - tokenBAmount, - this.contract.address - ); - } else { - await this.approveFA12Token( - pair.token_b_address, - tokenBAmount, - this.contract.address - ); + let operation; + switch (standard.toLocaleLowerCase()) { + case "fa12": + await this.approveFA12Token( + pair.token_a_type.fa12, + tokenAAmount, + this.contract.address + ); + await this.approveFA12Token( + pair.token_b_type.fa12, + tokenBAmount, + this.contract.address + ); + operation = await this.contract.methods + .use( + "invest", + "fa12", + pair.token_a_type.fa12, + "fa12", + pair.token_b_type.fa12, + minShares, + tokenAAmount, + tokenBAmount + ) + .send(); + break; + case "fa2": + await this.approveFA2Token( + pair.token_a_type.fa2.token_address, + pair.token_a_type.fa2.token_id, + tokenAAmount, + this.contract.address + ); + await this.approveFA2Token( + pair.token_b_type.fa2.token_address, + pair.token_b_type.fa2.token_id, + tokenBAmount, + this.contract.address + ); + operation = await this.contract.methods + .use( + "invest", + "fa2", + pair.token_a_type.fa2.token_address, + pair.token_a_type.fa2.token_id, + "fa2", + pair.token_b_type.fa2.token_address, + pair.token_b_type.fa2.token_id, + minShares, + tokenAAmount, + tokenBAmount + ) + .send(); + break; + case "mixed": + await this.approveFA12Token( + pair.token_a_type.fa12, + tokenAAmount, + this.contract.address + ); + await this.approveFA2Token( + pair.token_b_type.fa2.token_address, + pair.token_b_type.fa2.token_id, + tokenBAmount, + this.contract.address + ); + operation = await this.contract.methods + .use( + "invest", + "fa12", + pair.token_a_type.fa12, + "fa2", + pair.token_b_type.fa2.token_address, + pair.token_b_type.fa2.token_id, + minShares, + tokenAAmount, + tokenBAmount + ) + .send(); + break; } - const operation = await this.contract.methods - .use( - "invest", - pair.token_a_address, - pair.token_a_id, - standard.toLowerCase() == "mixed" ? "fa2" : standard.toLowerCase(), - null, - pair.token_b_address, - pair.token_b_id, - standard.toLowerCase() == "mixed" ? "fa12" : standard.toLowerCase(), - null, - minShares, - tokenAAmount, - tokenBAmount - ) - .send(); await confirmOperation(tezos, operation.hash); return operation; } @@ -317,22 +406,55 @@ export class Dex extends TokenFA2 { ): Promise { await this.updateStorage({ tokens: [pairId] }); let pair = this.storage.tokens[pairId]; - const operation = await this.contract.methods - .use( - "divest", - pair.token_a_address, - pair.token_a_id, - standard.toLowerCase() == "mixed" ? "fa2" : standard.toLowerCase(), - null, - pair.token_b_address, - pair.token_b_id, - standard.toLowerCase() == "mixed" ? "fa12" : standard.toLowerCase(), - null, - tokenAAmount, - tokenBAmount, - sharesBurned - ) - .send(); + console.log(pair); + let operation; + switch (standard.toLocaleLowerCase()) { + case "fa12": + operation = await this.contract.methods + .use( + "divest", + "fa12", + pair.token_a_type.fa12, + "fa12", + pair.token_b_type.fa12, + tokenAAmount, + tokenBAmount, + sharesBurned + ) + .send(); + break; + case "fa2": + operation = await this.contract.methods + .use( + "divest", + "fa2", + pair.token_a_type.fa2.token_address, + pair.token_a_type.fa2.token_id, + "fa2", + pair.token_b_type.fa2.token_address, + pair.token_b_type.fa2.token_id, + tokenAAmount, + tokenBAmount, + sharesBurned + ) + .send(); + break; + case "mixed": + operation = await this.contract.methods + .use( + "divest", + "fa12", + pair.token_a_type.fa12, + "fa2", + pair.token_b_type.fa2.token_address, + pair.token_b_type.fa2.token_id, + tokenAAmount, + tokenBAmount, + sharesBurned + ) + .send(); + break; + } await confirmOperation(tezos, operation.hash); return operation; } diff --git a/test/helpers/types.ts b/test/helpers/types.ts index c8ea857c..d5e8e581 100644 --- a/test/helpers/types.ts +++ b/test/helpers/types.ts @@ -1,10 +1,6 @@ import BigNumber from "bignumber.js"; export declare type TokenInfo = { - token_a_address: string; - token_b_address: string; - token_a_id?: BigNumber; - token_b_id?: BigNumber; token_a_type: { [key: string]: any }; token_b_type: { [key: string]: any }; }; @@ -20,7 +16,7 @@ export declare type SwapSliceType = { operation: { [key: string]: any }; }; -export declare type TTDexStorage = { +export declare type DexStorage = { dex_lambdas: { [key: string]: any }; token_lambdas: { [key: string]: any }; pairs_count: BigNumber; @@ -30,30 +26,6 @@ export declare type TTDexStorage = { ledger: { [key: string]: AccountInfo }; }; -export declare type DexStorage = { - tez_pool: BigNumber; - token_pool: BigNumber; - baker_validator: string; - token_address: string; - total_supply: BigNumber; - ledger: { [key: string]: AccountInfo }; - voters: { [key: string]: VoteInfo }; - vetos: { [key: string]: string }; - votes: { [key: string]: BigNumber }; - veto: BigNumber; - current_delegated: string | null | undefined; - current_candidate: string | null | undefined; - total_votes: BigNumber; - reward: BigNumber; - total_reward: BigNumber; - reward_per_share: BigNumber; - reward_per_sec: BigNumber; - last_update_time: string; - period_finish: string; - user_rewards: { [key: string]: UserRewardInfo }; - last_veto: number; -}; - export declare type MetadataStorage = { metadata: { [key: string]: Buffer }; owners: string[]; diff --git a/test/storage/TTDex.ts b/test/storage/Dex.ts similarity index 100% rename from test/storage/TTDex.ts rename to test/storage/Dex.ts diff --git a/test/storage/TTFunctions.ts b/test/storage/Functions.ts similarity index 100% rename from test/storage/TTFunctions.ts rename to test/storage/Functions.ts diff --git a/truffle.d.ts b/truffle.d.ts index f9dc7a64..694816ad 100644 --- a/truffle.d.ts +++ b/truffle.d.ts @@ -29,7 +29,7 @@ declare interface Artifacts { require(name: "DexFA12"): Contract; require(name: "DexFA2"): Contract; require(name: "Dex"): Contract; - require(name: "TTDexFA12"): Contract; + require(name: "DexFA12"): Contract; } declare interface TokenContractInstance {