diff --git a/contract/.github/workflows/ci.yaml b/.github/workflows/ci.yaml similarity index 86% rename from contract/.github/workflows/ci.yaml rename to .github/workflows/ci.yaml index 2fd0e84..ac3a491 100644 --- a/contract/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,11 +51,3 @@ jobs: forge build --sizes id: build continue-on-error: true - - - name: Run scripts - run: | - ls -lsa - ls script/ - for file in script/*; do - forge script $file -vvvv - done \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2cd7dff..48b67bd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ contract/cache output.log __TEMP__* run-*.json +*.cfmms-checkpoint.json diff --git a/.gitmodules b/.gitmodules index b75216e..0280f0e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,24 +1,9 @@ [submodule "contract/lib/forge-std"] path = contract/lib/forge-std url = https://github.com/foundry-rs/forge-std -[submodule "SandwichV4/lib/v3-core"] - path = SandwichV4/lib/v3-core - url = https://github.com/Uniswap/v3-core -[submodule "lib/v3-core"] - branch = v1.0.0 -[submodule "SandwichV4/lib/v2-core"] - path = SandwichV4/lib/v2-core - url = https://github.com/Uniswap/v2-core -[submodule "lib/v2-core"] - branch = v1.0.1 -[submodule "SandwichV4/lib/v2-periphery"] - path = SandwichV4/lib/v2-periphery - url = https://github.com/Uniswap/v2-periphery [submodule "contract/lib/foundry-huff"] path = contract/lib/foundry-huff url = https://github.com/huff-language/foundry-huff -[submodule "lib/forge-std"] - branch = v1.5.2 [submodule "contract/lib/v3-core"] path = contract/lib/v3-core url = https://github.com/Uniswap/v3-core @@ -28,3 +13,9 @@ [submodule "contract/lib/v2-periphery"] path = contract/lib/v2-periphery url = https://github.com/Uniswap/v2-periphery +[submodule "contract/lib/solmate"] + path = contract/lib/solmate + url = https://github.com/transmissions11/solmate +[submodule "contract/lib/v3-periphery"] + path = contract/lib/v3-periphery + url = https://github.com/Uniswap/v3-periphery diff --git a/README.md b/README.md index 1d81a2e..dd9c0cb 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,28 @@ -# Rusty-Sando ![license](https://img.shields.io/badge/License-MIT-green.svg?label=license) ![twitter](https://img.shields.io/twitter/follow/0xMouseless?style=social) +# Rusty-Sando (re-write) ![license](https://img.shields.io/badge/License-MIT-green.svg?label=license) ![twitter](https://img.shields.io/twitter/follow/0xMouseless?style=social) A practical example on how to perform V2/V3 and multi-meat sandwich attacks written using Rust and Huff. -The goal of this repo is to act as reference material for searchers looking to implement their strategies using Rust and Huff. +The goal of this repo is to act as reference material for aspiring searchers. + +> **This codebase has been cleaned up and rewritten to make use of the [`Artemis`](https://github.com/paradigmxyz/artemis) framework.** ## Demo https://user-images.githubusercontent.com/97399882/226269539-afedced0-e070-4d12-9853-dfbafbcefa49.mp4 ## Brief Explanation -Anytime that a transaction interacts with a Uniswap V2/V3 pool and their forks, there is some slippage introduced (router swaps, aggregator swaps, other mev bots). Sandwich bots are a toxic form of MEV as they profit off this slippage by frontrunning the transaction pushing the price of the asset up to the slippage limit and then immediately selling the asset through a backrun transaction. +Anytime that a transaction interacts with a Uniswap V2/V3 pool and its forks, there is some slippage introduced (routers, aggregators, other MEV bots). Sandwich bots, like this one, are a toxic form of MEV as they profit off this slippage by frontrunning the transaction pushing the price of an asset up to the slippage limit, and then immediately selling the asset through a backrun transaction. + +**Bot Logic Breakdown** can be found under [bot/README.md](https://github.com/mouseless-eth/rusty-sando/tree/master/bot) + +**Contract Logic Breakdown** can be found under [contract/README.md](https://github.com/mouseless-eth/rusty-sando/tree/master/contract) ## Features -- **Fully Generalized**: Sandwich any tx that introduces slippage (routers, aggregators, mev bots, ...). +- **Fully Generalized**: Sandwich any tx that introduces slippage. - **V2 and V3 Logic**: Logic to handle Uniswap V2/V3 pools. - **Multi-Meat**: Build and send multi-meat sandwiches. - **Gas Optimized**: Contract written in Huff using unconventional gas optimizations. - **Local Simulations**: Fast concurrent EVM simulations to find sandwich opportunities. -- **Token Dust**: Stores dust at the end of every bundle for lower gas usage next time token is traded. -- **Salmonella Checks**: Detect if tx uses unusual opcodes that may produce different mainnet results. -- **Discord Logging**: Send notifications via discord webhooks. - -**Bot Logic Breakdown** can be found under [bot/README.md](https://github.com/mouseless-eth/rusty-sando/tree/master/bot) - -**Contract Logic Breakdown** can be found under [contract/README.md](https://github.com/mouseless-eth/rusty-sando/tree/master/contract) +- **Token Dust**: Stores dust at the end of every bundle for lower gas usage the next time the token is traded. +- **Salmonella Checks**: Detect if erc20's transfer function uses any unusual opcodes that may produce different mainnet results. ## Notice If any bugs or optimizations are found, feel free to create a pull request. **All pull requests are welcome!** @@ -35,8 +36,10 @@ If any bugs or optimizations are found, feel free to create a pull request. **Al - [subway-rs](https://github.com/refcell/subway-rs) - [cfmms-rs](https://github.com/0xKitsune/cfmms-rs) - [revm](https://github.com/bluealloy/revm) +- [artemis](https://github.com/paradigmxyz/artemis) - [huff-language](https://github.com/huff-language/huff-rs) - [foundry](https://github.com/foundry-rs/foundry) - [reth](https://github.com/paradigmxyz/reth) - [ethers-rs](https://github.com/gakonst/ethers-rs) +- [ethers-flashbots](https://github.com/onbjerg/ethers-flashbots) - [mev-template-rs](https://github.com/degatchi/mev-template-rs) diff --git a/bot/.env.example b/bot/.env.example index 82acd88..539393e 100644 --- a/bot/.env.example +++ b/bot/.env.example @@ -1,9 +1,5 @@ -RPC_URL_WSS=ws://localhost:8545 +WSS_RPC=ws://localhost:8545 SEARCHER_PRIVATE_KEY=0000000000000000000000000000000000000000000000000000000000000001 FLASHBOTS_AUTH_KEY=0000000000000000000000000000000000000000000000000000000000000002 SANDWICH_CONTRACT=0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa -INTERVAL_BLOCK_NEW_POOL=50 -V2_ALERT_DISCORD_WEBHOOK=... -V3_ALERT_DISCORD_WEBHOOK=... -POISON_ALERT_DISCORD_WEBHOOK=... SANDWICH_INCEPTION_BLOCK=... diff --git a/bot/Cargo.toml b/bot/Cargo.toml index e9354fa..8577321 100644 --- a/bot/Cargo.toml +++ b/bot/Cargo.toml @@ -1,41 +1,6 @@ -[package] -name = "rusty-sando" -version = "0.1.0" -edition = "2021" -license = "MIT" -description = "Optimized sandwich bot written using Rust and Huff" -readme = "README.md" -homepage = "https://github.com/mouseless-eth/rusty-sando" -repository = "https://github.com/mouseless-eth/rusty-sando" -keywords = ["Ethereum", "Mev", "Dex", "Sandwich"] -authors = ["0xmouseless "] - -[dependencies] -ethers-flashbots = { git = "https://github.com/onbjerg/ethers-flashbots" } -ethers = {version = "2.0.0", features = ["abigen", "ws"]} -revm = {version = "3.0.0", features = ["ethersdb", "serde", "std"]} -dotenv = "0.15.0" -hashbrown = "0.14.0" -tokio = { version = "1", features = ["full"] } -log = "0.4.17" -url = "2.3.1" -dashmap = "5.4.0" -async-recursion = "1.0.2" -hex = "0.4.3" -serde = "1.0.145" -eyre = "0.6.8" -reqwest = "0.11.12" -time = "*" -indoc = "2" -indicatif = "0.17.1" -thiserror = "1.0.37" -fern = {version = "0.6", features = ["colored"]} -chrono = "0.4.23" -futures = "0.3.5" -colored = "2.0.0" - -[profile.release] -debug = true - -[dev-dependencies] -tokio-test = "*" +[workspace] +members = [ + "crates/artemis-core", + "crates/strategy", + "sando-bin" +] diff --git a/bot/README.md b/bot/README.md index ace0c72..51c70e2 100644 --- a/bot/README.md +++ b/bot/README.md @@ -1,29 +1,27 @@ # Rusty-Sando/Bot ![license](https://img.shields.io/badge/License-MIT-green.svg?label=license) -Bot logic relies heavily on REVM simulations to detect sandwichable transactions. The simulations are done by injecting a modified router contract called [`BrainDance.sol`](https://github.com/mouseless-eth/rusty-sando/blob/master/contract/src/BrainDance.sol) into a new EVM instance. Once injected, a concurrent binary search is performed to find a optimal input amount that results in the highest revenue. After sandwich calculations, the bot performs a [salmonella](https://github.com/Defi-Cartel/salmonella) check. If the sandwich is salmonella free, the bot then calculates gas bribes and sends bundle. +Bot logic relies heavily on REVM simulations to detect sandwichable transactions. The simulations are done by injecting a modified router contract called [`LilRouter.sol`](https://github.com/mouseless-eth/rusty-sando/blob/master/contract/src/LilRouter.sol) into a new EVM instance. Once injected, a concurrent binary search is performed to find an optimal input amount that results in the highest revenue. After sandwich calculations, the bot performs a [salmonella](https://github.com/Defi-Cartel/salmonella) check. If the sandwich is salmonella free, the bot then calculates gas bribes and sends the bundle to the fb relay. Performing EVM simulations in this way allows the bot to detect sandwichable opportunities against any tx that introduces slippage. ## Logic Breakdown - At startup, index all pools from a specific factory by parsing the `PairCreated` event. And fetch all token dust stored on sando addy. - Read and decode tx from mempool. -- Send tx to [`trace_CallMany`](https://openethereum.github.io/JSONRPC-trace-module#trace_callmany) to obtain `stateDiff`. (could modify to use any other rpc that returns stateDiff) -- Check if `statediff` contains keys that correspond to indexed pool addresses. -- Construct a new EVM database instance from `stateDiff`, used for local simulations. +- Send tx to [`trace_call`](https://openethereum.github.io/JSONRPC-trace-module#trace_call) to obtain `stateDiff`. +- Check if `statediff` contains keys that equal to indexed pool addresses. - For each pool that tx touches: - Find the optimal amount in for a sandwich attack by performing a concurrent binary search. - Check for salmonella by checking if tx uses unconventional opcodes. -- If profitable after gas calculations, send bundle to relays. -- Store sandwich opportunity in backlog for multi meat sandwich calculations. +- If profitable after gas calculations, send the sando bundle to relays. ## Usage -1. This repo requires you to run an [Erigon](https://github.com/ledgerwatch/erigon) archive node. The bot relies on the `newPendingTransactionsWithBody` subscription endpoint and `trace_callMany` rpc which are Erigon specific methods. Node needs to be synced in archive mode to index all pools. +1. This repo requires you to run an [Erigon](https://github.com/ledgerwatch/erigon) archive node. The bot relies on the `newPendingTransactionsWithBody` subscription rpc endpoint which is a Erigon specific method. The node needs to be synced in archive mode to index all pools. 2. [Install Rust](https://www.rust-lang.org/tools/install) if you haven't already. -3. Fill in searcher address in Huff contract and deploy either straight onchain or via create2 using a [metamorphic](https://github.com/0age/metamorphic) like factory. -> If you are using create2, you can easily mine for an address containing 7 zero bytes, saving 84 gas of calldata everytime the contract address is used as an argument. [read more](https://medium.com/coinmonks/deploy-an-efficient-address-contract-a-walkthrough-cb4be4ffbc70). +3. Fill in the searcher address in Huff contract and deploy either straight onchain or via create2 using a [metamorphic](https://github.com/0age/metamorphic) like factory. +> If you are using create2, you can easily mine for an address containing 7 zero bytes, saving 84 gas of calldata every time the contract address is used as an argument. [read more](https://medium.com/coinmonks/deploy-an-efficient-address-contract-a-walkthrough-cb4be4ffbc70). 4. Copy `.env.example` into `.env` and fill out values. @@ -32,89 +30,43 @@ cp .env.example .env ``` ``` -RPC_URL_WSS=ws://localhost:8545 +WSS_RPC=ws://localhost:8545 SEARCHER_PRIVATE_KEY=0000000000000000000000000000000000000000000000000000000000000001 FLASHBOTS_AUTH_KEY=0000000000000000000000000000000000000000000000000000000000000002 SANDWICH_CONTRACT=0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa -V2_ALERT_DISCORD_WEBHOOK=... -V3_ALERT_DISCORD_WEBHOOK=... -POISON_ALERT_DISCORD_WEBHOOK=... -SANDWICH_INCEPTION_BLOCK=... // block that sandwich contract was deployed in +SANDWICH_INCEPTION_BLOCK=... ``` -5. Before running backtests get the runtime bytecode of the contract and set it to [`get_test_sandwich_code`](https://github.com/mouseless-eth/rusty-sando/blob/5ddeb4bbf703420de3cd5bc2b0d6885fce4cb0a4/bot/src/utils/constants.rs#L26) in constants.rs. +5. Run the integration tests ```console -huffc --bin-runtime contract/src/sandwich.huff +cargo test -p strategy --release --features debug ``` -5. Run the tests +6. Run the bot in `debug mode` +Test bot's sandwich finding functionality without a deployed or funded Sando contract (no bundles will be sent) ``` -cargo test --release -- --nocapture +cargo run --release --features debug ``` -6. Create a binary executable +7. Running the bot +```console +cargo run --release ``` -cargo run --bin rusty-sando --release -``` -> **Note** -> with the `--release` flag, the rust compiler will compile with optimizations. These optimizations are important because they speed up REVM simulations 10x. -> > **Warning** > -> **By taking this codebase into production, you are doing so at your own risk under the MIT license.** Although heavily tested, I cannot gurantee that it is bug free. I prefer this codebase to be used as a case study of what MEV could look like using Rust and Huff. - -### Blueprint - -``` -src -├── lib.rs -├── main.rs -├── abi - Holds contract abis -│   └── ... -├── cfmm - Holds logic to index pools -│   └── ... -├── forked_db -│   ├── ... -│   ├── fork_db.rs - Local EVM instance for simulations -│   ├── fork_factory.rs - Creates `fork_db` instances and maintains connection with `global_backend` -│   └── global_backend.rs - Makes and caches rpc calls for missing state -├── runner -│   ├── mod.rs - Main runtime logic lives here -│   ├── bundle_sender.rs - Wrapper to submit bundles -│   ├── oracles.rs - Create execution environments for oracles -│   └── state.rs - Holds information about bot state -├── simulate -│   ... -│   ├── inspectors -│   │   ├── access_list.rs - Locally create access list for sandwich txs -│   │   └── is_sando_safu.rs - Salmonella checker -│   └── make_sandwich.rs - Optimal sandwich calculations and sanity checks -├── types - Common types used throughout codebase -└── utils - ├── ... - └── tx_builder - Logic to encode transactions - └── ... -``` - -### Oracles -There are three important oracles running on their own thread: - -- **NextBlockOracle**: Every new block, update `latestBlock` and `nextBlock` block number, timestamp, and basefee. -- **UpdatePoolOracle**: Every 50 blocks, add any new pools created. -- **MegaSandwichOracle**: Every 10.5 seconds after the latest block, search sandwich backlog to detect for multi meat sandwiches. - +> **By taking this codebase into production, you are doing so at your own risk under the MIT license.** I prefer this codebase to be used as a case study of what MEV could look like using Rust and Huff. ## Improvements -This repo explores only basic and simple multi V2 and V3 sandwiches, however sandwiches come in many flavours and require some modifications to the codebase to capture them: +This repo explores only basic and simple multi V2 and V3 sandwiches, however, sandwiches come in many flavors and require some modifications to the codebase to capture them: - Stable coin pair sandwiches. -- Sandwiches involving pairs that have a transfer limit, an [example](https://eigenphi.io/mev/ethereum/tx/0xe7c1e7d96e63d31f937af48b61d534e32ed9cfdbef066f45d49b967caeea8eed). Transfer limit can be found using a method similiar to [Fej:Leuros's implementation](https://twitter.com/FejLeuros/status/1633379306750767106). -- Multi meat sandwiches that target more than one pool. example: [frontrun](https://etherscan.io/tx/0xa39d28624f6d18a3bd5f5289a70fdc2779782f9a2e2c36dddd95cf882a15da45), [meat1](https://etherscan.io/tx/0xd027b771da68544279262439fd3f1cdef6a438ab6219b510c73c033b4e377296), [meat2](https://etherscan.io/tx/0x288da393cb7c937b8fe29ce0013992063d252372da869e31c6aad689f8b1aaf3), [backrun](https://etherscan.io/tx/0xcf22f2a3c9c67d56282e77e60c09929e0451336a9ed38f037fd484ea29e3cd41). +- Sandwiches involving pairs that have a transfer limit, an [example](https://eigenphi.io/mev/ethereum/tx/0xe7c1e7d96e63d31f937af48b61d534e32ed9cfdbef066f45d49b967caeea8eed). Transfer limit can be found using a method similar to [Fej:Leuros's implementation](https://twitter.com/FejLeuros/status/1633379306750767106). +- Multi-meat sandwiches that target more than one pool. example: [frontrun](https://etherscan.io/tx/0xa39d28624f6d18a3bd5f5289a70fdc2779782f9a2e2c36dddd95cf882a15da45), [meat1](https://etherscan.io/tx/0xd027b771da68544279262439fd3f1cdef6a438ab6219b510c73c033b4e377296), [meat2](https://etherscan.io/tx/0x288da393cb7c937b8fe29ce0013992063d252372da869e31c6aad689f8b1aaf3), [backrun](https://etherscan.io/tx/0xcf22f2a3c9c67d56282e77e60c09929e0451336a9ed38f037fd484ea29e3cd41). - Token -> Weth sandwiches by using a 'flashswap' between two pools. Normally we can only sandwich Weth -> Token swaps as the bot has Weth inventory, however you can use another pool's reserves as inventory to sandwich swaps in the other direction. [example](https://eigenphi.io/mev/ethereum/tx/0x502b66ce1a8b71098decc3585c651745c1af55de19e8f29ec6fff4ed2fcd1589). -- Flashloan sandwiches for larger value swaps. -- Sandwiches that include a users token approval tx + swap tx in one bundle. -- Sandwiches that include a users pending tx/s + swap tx in one bundle if swap tx nonce is higher than pending txs. +- Longtail sandwiches to target TOKEN->(WETH or STABLE) swaps. +- Sandwiches that include a user's token approval tx + swap tx in one bundle. +- Sandwiches that include a user's pending tx/s + swap tx in one bundle if swap tx nonce is higher than pending tx. diff --git a/bot/crates/artemis-core/Cargo.toml b/bot/crates/artemis-core/Cargo.toml new file mode 100644 index 0000000..d1569f5 --- /dev/null +++ b/bot/crates/artemis-core/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "artemis-core" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] + +## eth +ethers = { version = "2", features = ["ws", "rustls"]} +ethers-flashbots = { git = "https://github.com/onbjerg/ethers-flashbots", features = ["rustls"] } + +## async +async-trait = "0.1.64" +reqwest = { version = "0.11.14", default-features = false, features = ["rustls-tls"] } +tokio = { version = "1.18", features = ["full"] } +tokio-stream = { version = "0.1", features = ['sync'] } + +## misc +anyhow = "1.0.70" +thiserror = "1.0.40" +tracing = "0.1.37" diff --git a/bot/crates/artemis-core/src/collectors/block_collector.rs b/bot/crates/artemis-core/src/collectors/block_collector.rs new file mode 100644 index 0000000..883c874 --- /dev/null +++ b/bot/crates/artemis-core/src/collectors/block_collector.rs @@ -0,0 +1,57 @@ +use crate::types::{Collector, CollectorStream}; +use anyhow::Result; +use async_trait::async_trait; +use ethers::{ + prelude::Middleware, + providers::PubsubClient, + types::{U256, U64}, +}; +use std::sync::Arc; +use tokio_stream::StreamExt; + +/// A collector that listens for new blocks, and generates a stream of +/// [events](NewBlock) which contain the block number and hash. +pub struct BlockCollector { + provider: Arc, +} + +/// A new block event, containing the block number and hash. +#[derive(Debug, Clone)] +pub struct NewBlock { + pub number: U64, + pub gas_used: U256, + pub gas_limit: U256, + pub base_fee_per_gas: U256, + pub timestamp: U256, +} + +impl BlockCollector { + pub fn new(provider: Arc) -> Self { + Self { provider } + } +} + +/// Implementation of the [Collector](Collector) trait for the [BlockCollector](BlockCollector). +/// This implementation uses the [PubsubClient](PubsubClient) to subscribe to new blocks. +#[async_trait] +impl Collector for BlockCollector +where + M: Middleware, + M::Provider: PubsubClient, + M::Error: 'static, +{ + async fn get_event_stream(&self) -> Result> { + let stream = self.provider.subscribe_blocks().await?; + let stream = stream.filter_map(|block| match block.number { + Some(number) => Some(NewBlock { + number, + gas_limit: block.gas_used, + gas_used: block.gas_limit, + base_fee_per_gas: block.base_fee_per_gas.unwrap_or_default(), + timestamp: block.timestamp, + }), + None => None, + }); + Ok(Box::pin(stream)) + } +} diff --git a/bot/crates/artemis-core/src/collectors/mempool_collector.rs b/bot/crates/artemis-core/src/collectors/mempool_collector.rs new file mode 100644 index 0000000..e69847b --- /dev/null +++ b/bot/crates/artemis-core/src/collectors/mempool_collector.rs @@ -0,0 +1,38 @@ +use async_trait::async_trait; + +use ethers::{prelude::Middleware, providers::PubsubClient, types::Transaction}; +use std::sync::Arc; + +use crate::types::{Collector, CollectorStream}; +use anyhow::Result; + +/// A collector that listens for new transactions in the mempool, and generates a stream of +/// [events](Transaction) which contain the transaction. +pub struct MempoolCollector { + provider: Arc, +} + +impl MempoolCollector { + pub fn new(provider: Arc) -> Self { + Self { provider } + } +} + +/// Implementation of the [Collector](Collector) trait for the [MempoolCollector](MempoolCollector). +/// This implementation uses the [PubsubClient](PubsubClient) to subscribe to new transactions. +#[async_trait] +impl Collector for MempoolCollector +where + M: Middleware, + M::Provider: PubsubClient, + M::Error: 'static, +{ + async fn get_event_stream(&self) -> Result> { + let stream = self + .provider + .subscribe(["newPendingTransactionsWithBody"]) + .await + .map_err(|_| anyhow::anyhow!("Failed to create mempool stream"))?; + Ok(Box::pin(stream)) + } +} diff --git a/bot/crates/artemis-core/src/collectors/mod.rs b/bot/crates/artemis-core/src/collectors/mod.rs new file mode 100644 index 0000000..5662373 --- /dev/null +++ b/bot/crates/artemis-core/src/collectors/mod.rs @@ -0,0 +1,9 @@ +//! Collectors are responsible for collecting data from external sources and +//! turning them into internal events. For example, a collector might listen to +//! a stream of new blocks, and turn them into a stream of `NewBlock` events. + +/// This collector listens to a stream of new blocks. +pub mod block_collector; + +/// This collector listens to a stream of new pending transactions. +pub mod mempool_collector; diff --git a/bot/crates/artemis-core/src/engine.rs b/bot/crates/artemis-core/src/engine.rs new file mode 100644 index 0000000..349120d --- /dev/null +++ b/bot/crates/artemis-core/src/engine.rs @@ -0,0 +1,124 @@ +use tokio::sync::broadcast::{self, Sender}; +use tokio::task::JoinSet; +use tokio_stream::StreamExt; +use tracing::{error, info}; + +use crate::types::{Collector, Executor, Strategy}; + +/// The main engine of Artemis. This struct is responsible for orchestrating the +/// data flow between collectors, strategies, and executors. +pub struct Engine { + /// The set of collectors that the engine will use to collect events. + collectors: Vec>>, + + /// The set of strategies that the engine will use to process events. + strategies: Vec>>, + + /// The set of executors that the engine will use to execute actions. + executors: Vec>>, +} + +impl Engine { + pub fn new() -> Self { + Self { + collectors: vec![], + strategies: vec![], + executors: vec![], + } + } +} + +impl Default for Engine { + fn default() -> Self { + Self::new() + } +} + +impl Engine +where + E: Send + Clone + 'static + std::fmt::Debug, + A: Send + Clone + 'static + std::fmt::Debug, +{ + /// Adds a collector to be used by the engine. + pub fn add_collector(&mut self, collector: Box>) { + self.collectors.push(collector); + } + + /// Adds a strategy to be used by the engine. + pub fn add_strategy(&mut self, strategy: Box>) { + self.strategies.push(strategy); + } + + /// Adds an executor to be used by the engine. + pub fn add_executor(&mut self, executor: Box>) { + self.executors.push(executor); + } + + /// The core run loop of the engine. This function will spawn a thread for + /// each collector, strategy, and executor. It will then orchestrate the + /// data flow between them. + pub async fn run(self) -> Result, Box> { + let (event_sender, _): (Sender, _) = broadcast::channel(512); + let (action_sender, _): (Sender, _) = broadcast::channel(512); + + let mut set = JoinSet::new(); + + // Spawn executors in separate threads. + for executor in self.executors { + let mut receiver = action_sender.subscribe(); + set.spawn(async move { + info!("starting executor... "); + loop { + match receiver.recv().await { + Ok(action) => match executor.execute(action).await { + Ok(_) => {} + Err(e) => error!("error executing action: {}", e), + }, + Err(e) => error!("error receiving action: {}", e), + } + } + }); + } + + // Spawn strategies in separate threads. + for mut strategy in self.strategies { + let mut event_receiver = event_sender.subscribe(); + let action_sender = action_sender.clone(); + strategy.sync_state().await?; + + set.spawn(async move { + info!("starting strategy... "); + loop { + match event_receiver.recv().await { + Ok(event) => { + if let Some(action) = strategy.process_event(event).await { + match action_sender.send(action) { + Ok(_) => {} + Err(e) => error!("error sending action: {}", e), + } + } + } + Err(e) => error!("error receiving event: {}", e), + } + } + }); + } + + // Spawn collectors in separate threads. + for collector in self.collectors { + let event_sender = event_sender.clone(); + set.spawn(async move { + info!("starting collector... "); + let mut event_stream = collector.get_event_stream().await.unwrap(); + while let Some(event) = event_stream.next().await { + match event_sender.send(event) { + Ok(_) => {} + Err(e) => error!("error sending event: {}", e), + } + } + }); + } + + Ok(set) + } +} diff --git a/bot/crates/artemis-core/src/executors/flashbots_executor.rs b/bot/crates/artemis-core/src/executors/flashbots_executor.rs new file mode 100644 index 0000000..44ed31e --- /dev/null +++ b/bot/crates/artemis-core/src/executors/flashbots_executor.rs @@ -0,0 +1,59 @@ +use std::sync::Arc; + +use anyhow::Result; +use async_trait::async_trait; +use ethers::{providers::Middleware, signers::Signer}; +use ethers_flashbots::{BundleRequest, FlashbotsMiddleware}; +use reqwest::Url; +use tracing::{error, info}; + +use crate::types::Executor; + +/// A Flashbots executor that sends transactions to the Flashbots relay. +pub struct FlashbotsExecutor { + /// The Flashbots middleware. + fb_client: FlashbotsMiddleware, S>, +} + +/// A bundle of transactions to send to the Flashbots relay. +/// Sending vec of bundle request because multiple actions per event not supported +/// See issue: https://github.com/paradigmxyz/artemis/issues/34 +pub type FlashbotsBundle = Vec; + +impl FlashbotsExecutor { + pub fn new(client: Arc, relay_signer: S, relay_url: impl Into) -> Self { + let fb_client = FlashbotsMiddleware::new(client, relay_url, relay_signer); + Self { fb_client } + } +} + +#[async_trait] +impl Executor for FlashbotsExecutor +where + M: Middleware + 'static, + M::Error: 'static, + S: Signer + 'static, +{ + /// Send a bundle to transactions to the Flashbots relay. + async fn execute(&self, action: FlashbotsBundle) -> Result<()> { + for bundle in action { + //// Simulate bundle. + //let simulated_bundle = self.fb_client.simulate_bundle(&bundle).await; + + //match simulated_bundle { + // Ok(res) => info!("Simulation Result: {:?}", res), + // Err(simulate_error) => error!("Error simulating bundle: {:?}", simulate_error), + //} + + // Send bundle. + let pending_bundle = self.fb_client.send_bundle(&bundle).await; + + match pending_bundle { + Ok(res) => info!("Simulation Result: {:?}", res.await), + Err(send_error) => error!("Error sending bundle: {:?}", send_error), + } + } + + Ok(()) + } +} diff --git a/bot/crates/artemis-core/src/executors/mod.rs b/bot/crates/artemis-core/src/executors/mod.rs new file mode 100644 index 0000000..f9f3d9e --- /dev/null +++ b/bot/crates/artemis-core/src/executors/mod.rs @@ -0,0 +1,6 @@ +//! Executors are responsible for taking actions produced by strategies and +//! executing them in different domains. For example, an executor might take a +//! `SubmitTx` action and submit it to the mempool. + +/// This executor submits transactions to the flashbots relay. +pub mod flashbots_executor; diff --git a/bot/crates/artemis-core/src/lib.rs b/bot/crates/artemis-core/src/lib.rs new file mode 100644 index 0000000..c17c504 --- /dev/null +++ b/bot/crates/artemis-core/src/lib.rs @@ -0,0 +1,39 @@ +#![warn(unused_crate_dependencies)] +#![deny(unused_must_use, rust_2018_idioms)] +#![doc(test( + no_crate_inject, + attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables)) +))] + +//! A library for writing MEV bots, designed to be simple, modular, and fast. +//! +//! At its core, Artemis is architected as an event processing pipeline. The +//! library is made up of three main components: +//! +//! 1. [Collectors](types::Collector): *Collectors* take in external events (such as pending txs, +//! new blocks, marketplace orders, etc. ) and turn them into an internal +//! *event* representation. +//! +//! 2. [Strategies](types::Strategy): *Strategies* contain the core logic required for each MEV +//! opportunity. They take in *events* as inputs, and compute whether any +//! opportunities are available (for example, a strategy might listen to a stream +//! of marketplace orders to see if there are any cross-exchange arbs). *Strategies* +//! produce *actions*. +//! +//! 3. [Executors](types::Executor): *Executors* process *actions*, and are responsible for executing +//! them in different domains (for example, submitting txs, posting off-chain orders, etc.). +//! +//! These components are tied together by the [Engine](engine::Engine), which is responsible for +//! orchestrating the flow of data between them. + +/// This module contains [collector](types::Collector) implementations. +pub mod collectors; +/// This module contains the [Engine](engine::Engine) struct, which is responsible +/// for orchestrating data flows between components +pub mod engine; +/// This module contains [executor](types::Executor) implementations. +pub mod executors; +/// This module contains the core type definitions for Artemis. +pub mod types; +/// This module contains utilities for working with Artemis. +pub mod utilities; diff --git a/bot/crates/artemis-core/src/types.rs b/bot/crates/artemis-core/src/types.rs new file mode 100644 index 0000000..41b8151 --- /dev/null +++ b/bot/crates/artemis-core/src/types.rs @@ -0,0 +1,104 @@ +use anyhow::Result; +use async_trait::async_trait; +use ethers::types::Transaction; +use std::pin::Pin; +use tokio_stream::Stream; +use tokio_stream::StreamExt; + +use crate::collectors::block_collector::NewBlock; +use crate::executors::flashbots_executor::FlashbotsBundle; + +/// A stream of events emitted by a [Collector](Collector). +pub type CollectorStream<'a, E> = Pin + Send + 'a>>; + +/// Collector trait, which defines a source of events. +#[async_trait] +pub trait Collector: Send + Sync { + /// Returns the core event stream for the collector. + async fn get_event_stream(&self) -> Result>; +} + +/// Strategy trait, which defines the core logic for each opportunity. +#[async_trait] +pub trait Strategy: Send + Sync { + /// Sync the initial state of the strategy if needed, usually by fetching + /// onchain data. + async fn sync_state(&mut self) -> Result<()>; + + /// Process an event, and return an action if needed. + async fn process_event(&mut self, event: E) -> Option; +} + +/// Executor trait, responsible for executing actions returned by strategies. +#[async_trait] +pub trait Executor: Send + Sync { + /// Execute an action. + async fn execute(&self, action: A) -> Result<()>; +} + +/// CollectorMap is a wrapper around a [Collector](Collector) that maps outgoing +/// events to a different type. +pub struct CollectorMap { + collector: Box>, + f: F, +} +impl CollectorMap { + pub fn new(collector: Box>, f: F) -> Self { + Self { collector, f } + } +} + +#[async_trait] +impl Collector for CollectorMap +where + E1: Send + Sync + 'static, + E2: Send + Sync + 'static, + F: Fn(E1) -> E2 + Send + Sync + Clone + 'static, +{ + async fn get_event_stream(&self) -> Result> { + let stream = self.collector.get_event_stream().await?; + let f = self.f.clone(); + let stream = stream.map(f); + Ok(Box::pin(stream)) + } +} + +/// ExecutorMap is a wrapper around an [Executor](Executor) that maps incoming +/// actions to a different type. +pub struct ExecutorMap { + executor: Box>, + f: F, +} + +impl ExecutorMap { + pub fn new(executor: Box>, f: F) -> Self { + Self { executor, f } + } +} + +#[async_trait] +impl Executor for ExecutorMap +where + A1: Send + Sync + 'static, + A2: Send + Sync + 'static, + F: Fn(A1) -> Option + Send + Sync + Clone + 'static, +{ + async fn execute(&self, action: A1) -> Result<()> { + let action = (self.f)(action); + match action { + Some(action) => self.executor.execute(action).await, + None => Ok(()), + } + } +} + +/// Convenience enum containing all the events that can be emitted by collectors. +pub enum Events { + NewBlock(NewBlock), + Transaction(Transaction), +} + +/// Convenience enum containing all the actions that can be executed by executors. +pub enum Actions { + FlashbotsBundle(FlashbotsBundle), +} diff --git a/bot/crates/artemis-core/src/utilities/mod.rs b/bot/crates/artemis-core/src/utilities/mod.rs new file mode 100644 index 0000000..4ce3226 --- /dev/null +++ b/bot/crates/artemis-core/src/utilities/mod.rs @@ -0,0 +1,4 @@ +//! Utilities for working with Artemis. + +/// This module implements state overriding middleware. +pub mod state_override_middleware; diff --git a/bot/crates/artemis-core/src/utilities/state_override_middleware.rs b/bot/crates/artemis-core/src/utilities/state_override_middleware.rs new file mode 100644 index 0000000..eb35c2b --- /dev/null +++ b/bot/crates/artemis-core/src/utilities/state_override_middleware.rs @@ -0,0 +1,96 @@ +use async_trait::async_trait; +use ethers::{ + core::types::{transaction::eip2718::TypedTransaction, BlockId}, + providers::{spoof, CallBuilder, Middleware, MiddlewareError, RawCall}, + types::{Address, Bytes}, +}; +use thiserror::Error; + +/// This custom middleware performs an ephemeral state override prior to executoring calls. +#[derive(Debug)] +pub struct StateOverrideMiddleware { + /// The inner middleware + inner: M, + /// The state override set we use for calls + state: spoof::State, +} + +impl StateOverrideMiddleware +where + M: Middleware, +{ + /// Creates an instance of StateOverrideMiddleware + /// `ìnner` the inner Middleware + pub fn new(inner: M) -> StateOverrideMiddleware { + Self { + inner, + state: spoof::state(), + } + } +} + +#[async_trait] +impl Middleware for StateOverrideMiddleware +where + M: Middleware, +{ + type Error = StateOverrideMiddlewareError; + type Provider = M::Provider; + type Inner = M; + + fn inner(&self) -> &M { + &self.inner + } + + /// Performs a call with the state override. + async fn call( + &self, + tx: &TypedTransaction, + block: Option, + ) -> Result { + let call_builder = CallBuilder::new(self.inner.provider(), tx); + let call_builder = match block { + Some(block) => call_builder.block(block), + None => call_builder, + }; + let call_builder = call_builder.state(&self.state); + call_builder + .await + .map_err(StateOverrideMiddlewareError::from_provider_err) + } +} + +impl StateOverrideMiddleware { + /// Adds a code override at a given address. + pub fn add_code_to_address(&mut self, address: Address, code: Bytes) { + self.state.account(address).code(code); + } + + /// Adds a code override at a random address, returning the address. + pub fn add_code(&mut self, code: Bytes) -> Address { + let address = Address::random(); + self.state.account(address).code(code); + address + } +} + +#[derive(Error, Debug)] +pub enum StateOverrideMiddlewareError { + /// Thrown when the internal middleware errors + #[error("{0}")] + MiddlewareError(M::Error), +} + +impl MiddlewareError for StateOverrideMiddlewareError { + type Inner = M::Error; + + fn from_err(src: M::Error) -> Self { + StateOverrideMiddlewareError::MiddlewareError(src) + } + + fn as_inner(&self) -> Option<&Self::Inner> { + match self { + StateOverrideMiddlewareError::MiddlewareError(e) => Some(e), + } + } +} diff --git a/bot/crates/artemis-core/tests/main.rs b/bot/crates/artemis-core/tests/main.rs new file mode 100644 index 0000000..9a89386 --- /dev/null +++ b/bot/crates/artemis-core/tests/main.rs @@ -0,0 +1,59 @@ +use artemis_core::{ + collectors::{block_collector::BlockCollector, mempool_collector::MempoolCollector}, + types::Collector, +}; +use ethers::providers::StreamExt; +use ethers::{ + providers::{Middleware, Provider, Ws}, + types::{BlockNumber, TransactionRequest, U256}, + utils::{Anvil, AnvilInstance}, +}; +use std::{sync::Arc, time::Duration}; + +/// Spawns Anvil and instantiates an Http provider. +pub async fn spawn_anvil() -> (Provider, AnvilInstance) { + let anvil = Anvil::new().block_time(1u64).spawn(); + let provider = Provider::::connect(anvil.ws_endpoint()) + .await + .unwrap() + .interval(Duration::from_millis(50u64)); + (provider, anvil) +} + +/// Test that block collector correctly emits blocks. +#[tokio::test] +async fn test_block_collector_sends_blocks() { + let (provider, _anvil) = spawn_anvil().await; + let provider = Arc::new(provider); + let block_collector = BlockCollector::new(provider.clone()); + let block_stream = block_collector.get_event_stream().await.unwrap(); + let block_a = block_stream.into_future().await.0.unwrap(); + let block_b = provider + .get_block(BlockNumber::Latest) + .await + .unwrap() + .unwrap(); + assert_eq!(block_a.number, block_b.number.unwrap()); +} + +/// Test that mempool collector correctly emits blocks. +#[tokio::test] +async fn test_mempool_collector_sends_txs() { + let (provider, _anvil) = spawn_anvil().await; + let provider = Arc::new(provider); + let mempool_collector = MempoolCollector::new(provider.clone()); + let mempool_stream = mempool_collector.get_event_stream().await.unwrap(); + + let account = provider.get_accounts().await.unwrap()[0]; + let value: u64 = 42; + let gas_price = U256::from_dec_str("100000000000000000").unwrap(); + let tx = TransactionRequest::new() + .to(account) + .from(account) + .value(value) + .gas_price(gas_price); + + provider.send_transaction(tx, None).await.unwrap(); + let tx = mempool_stream.into_future().await.0.unwrap(); + assert_eq!(tx.value, value.into()); +} diff --git a/bot/crates/strategy/Cargo.toml b/bot/crates/strategy/Cargo.toml new file mode 100644 index 0000000..056a58f --- /dev/null +++ b/bot/crates/strategy/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "strategy" +version = "0.1.0" +edition = "2021" + +[dependencies] +# Misc +hashbrown = "0.14.0" +tokio = { version = "1.29.0", features = ["full"] } +dashmap = "5.4.0" +thiserror = "1.0.37" +futures = "0.3.5" +async-trait = "0.1.64" +anyhow = "1.0.70" +serde = "1.0.145" + +# EVM based crates +cfmms = { git = "https://github.com/mouseless-eth/cfmms-rs.git", branch = "fix-serialize-dex-fee"} +ethers-flashbots = { git = "https://github.com/onbjerg/ethers-flashbots"} +ethers = {version = "2.0.7", features = ["abigen", "ws"]} +foundry-evm = { git = "https://github.com/mouseless-eth/foundry.git", branch = "ethers-version-change" } +anvil = { git = "https://github.com/mouseless-eth/foundry.git", branch = "ethers-version-change" } +eth-encode-packed = "0.1.0" + +# Logging +colored = "2.0.0" +log = "0.4.17" +indicatif = "0.17.5" + +# Artemis +artemis-core = { path = "../artemis-core" } + +[dev-dependencies] +fern = {version = "0.6.2", features = ["colored"]} + +[features] +debug = [] diff --git a/bot/src/abi/IERC20.abi b/bot/crates/strategy/src/abi/IERC20.abi similarity index 100% rename from bot/src/abi/IERC20.abi rename to bot/crates/strategy/src/abi/IERC20.abi diff --git a/bot/src/abi/IUniswapV2Factory.abi b/bot/crates/strategy/src/abi/IUniswapV2Factory.abi similarity index 100% rename from bot/src/abi/IUniswapV2Factory.abi rename to bot/crates/strategy/src/abi/IUniswapV2Factory.abi diff --git a/bot/src/abi/IUniswapV2Pair.abi b/bot/crates/strategy/src/abi/IUniswapV2Pair.abi similarity index 100% rename from bot/src/abi/IUniswapV2Pair.abi rename to bot/crates/strategy/src/abi/IUniswapV2Pair.abi diff --git a/bot/src/abi/IUniswapV2Router.abi b/bot/crates/strategy/src/abi/IUniswapV2Router.abi similarity index 100% rename from bot/src/abi/IUniswapV2Router.abi rename to bot/crates/strategy/src/abi/IUniswapV2Router.abi diff --git a/bot/src/abi/IUniswapV3Factory.abi b/bot/crates/strategy/src/abi/IUniswapV3Factory.abi similarity index 100% rename from bot/src/abi/IUniswapV3Factory.abi rename to bot/crates/strategy/src/abi/IUniswapV3Factory.abi diff --git a/bot/src/abi/IUniswapV3Pool.abi b/bot/crates/strategy/src/abi/IUniswapV3Pool.abi similarity index 100% rename from bot/src/abi/IUniswapV3Pool.abi rename to bot/crates/strategy/src/abi/IUniswapV3Pool.abi diff --git a/bot/src/abi/mod.rs b/bot/crates/strategy/src/abi/mod.rs similarity index 50% rename from bot/src/abi/mod.rs rename to bot/crates/strategy/src/abi/mod.rs index 9b21d1d..a5481d8 100644 --- a/bot/src/abi/mod.rs +++ b/bot/crates/strategy/src/abi/mod.rs @@ -1,10 +1,4 @@ -use std::{fs, str::FromStr}; - -use ethers::{ - abi::{encode, Token}, - prelude::*, -}; -use eyre::Result; +use ethers::prelude::abigen; abigen!( UniswapV2Factory, @@ -36,22 +30,3 @@ abigen!( "src/abi/IERC20.abi", event_derives(serde::Deserialize, serde::Serialize) ); -abigen!( - BrainDance, - "src/abi/IBrainDance.abi", - event_derives(serde::Deserialize, serde::Serialize) -); - -pub fn get_self_destruct_byte_code(target: Address) -> Result { - let mut raw_byte_code: String = - fs::read_to_string("src/abi/SelfDestruct.byte").expect("unable to read file"); - - // Remove new line - raw_byte_code.pop(); - - let target_as_string = encode(&[Token::Address(target)]); - let target_as_string = hex::encode(target_as_string); - let raw_byte_code = raw_byte_code + &target_as_string; - - Bytes::from_str(&raw_byte_code) -} diff --git a/bot/crates/strategy/src/bot/mod.rs b/bot/crates/strategy/src/bot/mod.rs new file mode 100644 index 0000000..78591af --- /dev/null +++ b/bot/crates/strategy/src/bot/mod.rs @@ -0,0 +1,235 @@ +use anyhow::Result; +use artemis_core::{collectors::block_collector::NewBlock, types::Strategy}; +use async_trait::async_trait; +use cfmms::pool::Pool::{UniswapV2, UniswapV3}; +use colored::Colorize; +use ethers::{providers::Middleware, types::Transaction}; +use foundry_evm::executor::fork::{BlockchainDb, BlockchainDbMeta, SharedBackend}; +use log::{error, info}; +use std::{collections::BTreeSet, sync::Arc}; + +use crate::{ + constants::WETH_ADDRESS, + log_error, log_info_cyan, log_new_block_info, log_not_sandwichable, log_opportunity, + managers::{ + block_manager::BlockManager, pool_manager::PoolManager, + sando_state_manager::SandoStateManager, + }, + simulator::{huff_sando::create_recipe, lil_router::find_optimal_input}, + types::{Action, BlockInfo, Event, RawIngredients, SandoRecipe, StratConfig}, +}; + +pub struct SandoBot { + /// Ethers client + provider: Arc, + /// Keeps track of onchain pools + pool_manager: PoolManager, + /// Block manager + block_manager: BlockManager, + /// Keeps track of weth inventory & token dust + sando_state_manager: SandoStateManager, +} + +impl SandoBot { + /// Create a new instance + pub fn new(client: Arc, config: StratConfig) -> Self { + Self { + pool_manager: PoolManager::new(client.clone()), + provider: client, + block_manager: BlockManager::new(), + sando_state_manager: SandoStateManager::new( + config.sando_address, + config.searcher_signer, + config.sando_inception_block, + ), + } + } + + /// Main logic for the strategy + /// Checks if the passed `RawIngredients` is sandwichable + #[allow(unused_mut)] + pub async fn is_sandwichable( + &self, + ingredients: RawIngredients, + target_block: BlockInfo, + ) -> Result { + // setup shared backend + let shared_backend = SharedBackend::spawn_backend_thread( + self.provider.clone(), + BlockchainDb::new( + BlockchainDbMeta { + cfg_env: Default::default(), + block_env: Default::default(), + hosts: BTreeSet::from(["".to_string()]), + }, + None, + ), /* default because not accounting for this atm */ + Some((target_block.number - 1).into()), + ); + + let mut weth_inventory = self.sando_state_manager.get_weth_inventory(); + + #[cfg(feature = "debug")] + { + // Set a new value only when the debug feature is active + weth_inventory = (*crate::constants::WETH_FUND_AMT).into(); + } + + let optimal_input = find_optimal_input( + &ingredients, + &target_block, + weth_inventory, + shared_backend.clone(), + ) + .await?; + + let recipe = create_recipe( + &ingredients, + &target_block, + optimal_input, + weth_inventory, + self.sando_state_manager.get_searcher_address(), + self.sando_state_manager.get_sando_address(), + shared_backend, + )?; + + log_opportunity!( + ingredients.print_meats(), + optimal_input.as_u128() as f64 / 1e18, + recipe.get_revenue().as_u128() as f64 / 1e18 + ); + + Ok(recipe) + } +} + +#[async_trait] +impl Strategy for SandoBot { + /// Setup by getting all pools to monitor for swaps + async fn sync_state(&mut self) -> Result<()> { + self.pool_manager.setup().await?; + self.sando_state_manager + .setup(self.provider.clone()) + .await?; + self.block_manager.setup(self.provider.clone()).await?; + Ok(()) + } + + /// Process incoming events + async fn process_event(&mut self, event: Event) -> Option { + match event { + Event::NewBlock(block) => match self.process_new_block(block).await { + Ok(_) => None, + Err(e) => { + panic!("strategy is out of sync {}", e); + } + }, + Event::NewTransaction(tx) => self.process_new_tx(tx).await, + } + } +} + +impl SandoBot { + /// Process new blocks as they come in + async fn process_new_block(&mut self, event: NewBlock) -> Result<()> { + log_new_block_info!(event); + self.block_manager.update_block_info(event); + Ok(()) + } + + /// Process new txs as they come in + async fn process_new_tx(&mut self, victim_tx: Transaction) -> Option { + // setup variables for processing tx + let next_block = self.block_manager.get_next_block(); + let latest_block = self.block_manager.get_latest_block(); + + // ignore txs that we can't include in next block + // enhancement: simulate all txs regardless, store result, and use result when tx can included + if victim_tx.max_fee_per_gas.unwrap_or_default() < next_block.base_fee_per_gas { + log_info_cyan!("{:?} mf (p.token_a, p.token_b), + UniswapV3(p) => (p.token_a, p.token_b), + }; + + if token_a != *WETH_ADDRESS && token_b != *WETH_ADDRESS { + // contract can only sandwich weth pools + continue; + } + + // token that we use as frontrun input and backrun output + let start_end_token = *WETH_ADDRESS; + + // token that we use as frontrun output and backrun input + let intermediary_token = if token_a == start_end_token { + token_b + } else { + token_a + }; + + let ingredients = RawIngredients::new( + vec![victim_tx.clone()], + start_end_token, + intermediary_token, + pool, + ); + + match self.is_sandwichable(ingredients, next_block.clone()).await { + Ok(s) => { + let _bundle = match s + .to_fb_bundle( + self.sando_state_manager.get_sando_address(), + self.sando_state_manager.get_searcher_signer(), + false, + self.provider.clone(), + ) + .await + { + Ok(b) => b, + Err(e) => { + log_not_sandwichable!("{:?}", e); + continue; + } + }; + + #[cfg(not(feature = "debug"))] + { + sando_bundles.push(_bundle); + } + } + Err(e) => { + log_not_sandwichable!("{:?} {:?}", victim_tx.hash, e) + } + }; + } + + Some(Action::SubmitToFlashbots(sando_bundles)) + } +} diff --git a/bot/crates/strategy/src/constants.rs b/bot/crates/strategy/src/constants.rs new file mode 100644 index 0000000..0d87f34 --- /dev/null +++ b/bot/crates/strategy/src/constants.rs @@ -0,0 +1,60 @@ +use ethers::{ + prelude::Lazy, + types::{Address, Bytes, H256, U256}, +}; +use foundry_evm::revm::primitives::{B160 as rAddress, U256 as rU256}; + +pub static ONE_ETHER_IN_WEI: Lazy = Lazy::new(|| rU256::from(1000000000000000000_u128)); +pub static WETH_FUND_AMT: Lazy = Lazy::new(|| rU256::from(69) * *ONE_ETHER_IN_WEI); + +// could generate random address to use at runtime +pub static LIL_ROUTER_CONTROLLER: Lazy = Lazy::new(|| { + "0xC0ff33C0ffeeC0ff33C0ffeeC0ff33C0ff33C0ff" + .parse() + .unwrap() +}); + +// could generate random address to use at runtime +pub static LIL_ROUTER_ADDRESS: Lazy = Lazy::new(|| { + "0xDecafC0ffee15BadDecafC0ffee15BadDecafC0f" + .parse() + .unwrap() +}); + +// could compile from `../contract` at runtime instead of parsing from string +pub static LIL_ROUTER_CODE: Lazy = Lazy::new(|| { + "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80634b588d401461004657806381eeb93c14610072578063fa461e3314610085575b600080fd5b610059610054366004610743565b61009a565b6040805192835260208301919091520160405180910390f35b610059610080366004610743565b61021f565b610098610093366004610796565b6104e3565b005b600080846001600160a01b038085169086161082816100cd5773fffd8963efd1fc6a506488495d951d5263988d256100d4565b6401000276ad5b9050600082886040516020016100ff92919091151582526001600160a01b0316602082015260400190565b6040516020818303038152906040529050600080856001600160a01b031663128acb0830878f88886040518663ffffffff1660e01b8152600401610147959493929190610863565b60408051808303816000875af1158015610165573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610189919061089e565b9150915084610198578161019a565b805b6101a3906108d8565b6040516370a0823160e01b81523060048201529098506001600160a01b038a16906370a0823190602401602060405180830381865afa1580156101ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061020e91906108f4565b965050505050505094509492505050565b60405163a9059cbb60e01b81526001600160a01b03848116600483015260248201869052600091829185169063a9059cbb906044016020604051808303816000875af1158015610273573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610297919061091b565b50600080600080886001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156102dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610300919061095b565b506001600160701b031691506001600160701b03169150866001600160a01b0316886001600160a01b0316101561033c57819350809250610343565b8093508192505b50506040516370a0823160e01b81526001600160a01b03888116600483015260009184918916906370a0823190602401602060405180830381865afa158015610390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b491906108f4565b6103be91906109ab565b90506103cb818484610606565b9450600080876001600160a01b0316896001600160a01b0316106103f1578660006103f5565b6000875b6040805160008152602081019182905263022c0d9f60e01b90915291935091506001600160a01b038b169063022c0d9f9061043990859085903090602481016109c2565b600060405180830381600087803b15801561045357600080fd5b505af1158015610467573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201526001600160a01b038b1692506370a082319150602401602060405180830381865afa1580156104af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d391906108f4565b9550505050505094509492505050565b60008413806104f25750600083135b6104fb57600080fd5b60008061050a838501856109f9565b91509150811561058b5760405163a9059cbb60e01b8152336004820152602481018790526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610561573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610585919061091b565b506105fe565b60405163a9059cbb60e01b8152336004820152602481018690526001600160a01b0382169063a9059cbb906044016020604051808303816000875af11580156105d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fc919061091b565b505b505050505050565b60008084116106705760405162461bcd60e51b815260206004820152602b60248201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4960448201526a1394155517d05353d5539560aa1b60648201526084015b60405180910390fd5b6000831180156106805750600082115b6106dd5760405162461bcd60e51b815260206004820152602860248201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4c604482015267495155494449545960c01b6064820152608401610667565b60006106eb856103e5610a32565b905060006106f98483610a32565b905060008261070a876103e8610a32565b6107149190610a51565b90506107208183610a69565b979650505050505050565b6001600160a01b038116811461074057600080fd5b50565b6000806000806080858703121561075957600080fd5b84359350602085013561076b8161072b565b9250604085013561077b8161072b565b9150606085013561078b8161072b565b939692955090935050565b600080600080606085870312156107ac57600080fd5b8435935060208501359250604085013567ffffffffffffffff808211156107d257600080fd5b818701915087601f8301126107e657600080fd5b8135818111156107f557600080fd5b88602082850101111561080757600080fd5b95989497505060200194505050565b6000815180845260005b8181101561083c57602081850181015186830182015201610820565b8181111561084e576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0386811682528515156020830152604082018590528316606082015260a06080820181905260009061072090830184610816565b600080604083850312156108b157600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b6000600160ff1b82016108ed576108ed6108c2565b5060000390565b60006020828403121561090657600080fd5b5051919050565b801515811461074057600080fd5b60006020828403121561092d57600080fd5b81516109388161090d565b9392505050565b80516001600160701b038116811461095657600080fd5b919050565b60008060006060848603121561097057600080fd5b6109798461093f565b92506109876020850161093f565b9150604084015163ffffffff811681146109a057600080fd5b809150509250925092565b6000828210156109bd576109bd6108c2565b500390565b84815283602082015260018060a01b03831660408201526080606082015260006109ef6080830184610816565b9695505050505050565b60008060408385031215610a0c57600080fd5b8235610a178161090d565b91506020830135610a278161072b565b809150509250929050565b6000816000190483118215151615610a4c57610a4c6108c2565b500290565b60008219821115610a6457610a646108c2565b500190565b600082610a8657634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220a3830fddb415d84a0f9225a1e9bbeef724e1b5a2dc0efc456635debefba7af2c64736f6c634300080f0033" + .parse() + .unwrap() +}); + +// funciton signature for getting reserves +pub static GET_RESERVES_SIG: Lazy = Lazy::new(|| "0x0902f1ac".parse().unwrap()); + +pub static ERC20_TRANSFER_EVENT_SIG: Lazy = Lazy::new(|| { + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + .parse() + .unwrap() +}); + +pub static WETH_ADDRESS: Lazy
= Lazy::new(|| { + "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" + .parse() + .unwrap() +}); + +// when we need an address with a lot of eth +pub static SUGAR_DADDY: Lazy
= Lazy::new(|| { + "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" + .parse() + .unwrap() +}); + +// could generate random address to use at runtime +pub static COINBASE: Lazy = Lazy::new(|| { + "0x690B9A9E9aa1C9dB991C7721a92d351Db4FaC990" + .parse() + .unwrap() +}); + +pub static DUST_OVERPAY: Lazy = Lazy::new(|| ethers::utils::parse_ether("0.00015").unwrap()); diff --git a/bot/crates/strategy/src/helpers.rs b/bot/crates/strategy/src/helpers.rs new file mode 100644 index 0000000..4784409 --- /dev/null +++ b/bot/crates/strategy/src/helpers.rs @@ -0,0 +1,135 @@ +use anyhow::{anyhow, Result}; +use ethers::{ + signers::{LocalWallet, Signer}, + types::{ + transaction::{ + eip2718::TypedTransaction, + eip2930::{AccessList, AccessListItem}, + }, + BigEndianHash, Bytes, Eip1559TransactionRequest, H256, + }, +}; +use foundry_evm::{ + executor::{rU256, B160}, + utils::{b160_to_h160, h160_to_b160, ru256_to_u256, u256_to_ru256}, +}; + +/// Sign eip1559 transactions +pub async fn sign_eip1559( + tx: Eip1559TransactionRequest, + signer_wallet: &LocalWallet, +) -> Result { + let tx_typed = TypedTransaction::Eip1559(tx); + let signed_frontrun_tx_sig = signer_wallet + .sign_transaction(&tx_typed) + .await + .map_err(|e| anyhow!("Failed to sign eip1559 request: {:?}", e))?; + + Ok(tx_typed.rlp_signed(&signed_frontrun_tx_sig)) +} + +/// convert revm access list to ethers access list +pub fn access_list_to_ethers(access_list: Vec<(B160, Vec)>) -> AccessList { + AccessList::from( + access_list + .into_iter() + .map(|(address, slots)| AccessListItem { + address: b160_to_h160(address), + storage_keys: slots + .into_iter() + .map(|y| H256::from_uint(&ru256_to_u256(y))) + .collect(), + }) + .collect::>(), + ) +} + +/// convert ethers access list to revm access list +pub fn access_list_to_revm(access_list: AccessList) -> Vec<(B160, Vec)> { + access_list + .0 + .into_iter() + .map(|x| { + ( + h160_to_b160(x.address), + x.storage_keys + .into_iter() + .map(|y| u256_to_ru256(y.0.into())) + .collect(), + ) + }) + .collect() +} + +// +// -- Logging Macros -- +// +#[macro_export] +macro_rules! log_info_cyan { + ($($arg:tt)*) => { + info!("{}", format_args!($($arg)*).to_string().cyan()); + }; +} + +#[macro_export] +macro_rules! log_not_sandwichable { + ($($arg:tt)*) => { + info!("{}", format_args!($($arg)*).to_string().yellow()) + }; +} + +#[macro_export] +macro_rules! log_opportunity { + ($meats:expr, $optimal_input:expr, $revenue:expr) => {{ + info!("\n{}", "[OPPORTUNITY DETECTED]".green().on_black().bold()); + info!( + "{}", + format!("meats: {}", $meats.to_string().green().on_black()).bold() + ); + info!( + "{}", + format!( + "optimal_input: {} wETH", + $optimal_input.to_string().green().on_black() + ) + .bold() + ); + info!( + "{}", + format!( + "revenue : {} wETH", + $revenue.to_string().green().on_black() + ) + .bold() + ); + }}; +} + +#[macro_export] +macro_rules! startup_info_log { + ($($arg:tt)*) => { + info!("{}", format_args!($($arg)*).to_string().on_black().yellow().bold()); + }; +} + +#[macro_export] +macro_rules! log_error { + ($($arg:tt)*) => { + error!("{}", format_args!($($arg)*).to_string().red()); + }; +} + +#[macro_export] +macro_rules! log_new_block_info { + ($new_block:expr) => { + log::info!( + "{}", + format!( + "\nFound New Block\nLatest Block: (number:{:?}, timestamp:{:?}, basefee:{:?})", + $new_block.number, $new_block.timestamp, $new_block.base_fee_per_gas, + ) + .bright_purple() + .on_black() + ); + }; +} diff --git a/bot/crates/strategy/src/lib.rs b/bot/crates/strategy/src/lib.rs new file mode 100644 index 0000000..7de6c42 --- /dev/null +++ b/bot/crates/strategy/src/lib.rs @@ -0,0 +1,16 @@ +mod abi; +mod constants; +mod helpers; +mod simulator; + +/// Module contains logic to manage info on onchain pools +mod managers; + +/// Module contains logic related to transaction building +mod tx_utils; + +/// Module contains core strategy implementation +pub mod bot; + +/// Module contains the core type defenitions for sandwiching +pub mod types; diff --git a/bot/crates/strategy/src/managers/block_manager.rs b/bot/crates/strategy/src/managers/block_manager.rs new file mode 100644 index 0000000..d676b1a --- /dev/null +++ b/bot/crates/strategy/src/managers/block_manager.rs @@ -0,0 +1,53 @@ +use anyhow::{anyhow, Result}; +use ethers::{providers::Middleware, types::BlockNumber}; +use log::info; +use std::sync::Arc; + +use colored::Colorize; + +use crate::{startup_info_log, types::BlockInfo}; + +pub struct BlockManager { + latest_block: BlockInfo, + next_block: BlockInfo, +} + +impl BlockManager { + pub fn new() -> Self { + Self { + latest_block: BlockInfo::default(), + next_block: BlockInfo::default(), + } + } + + pub async fn setup(&mut self, provider: Arc) -> Result<()> { + let latest_block = provider + .get_block(BlockNumber::Latest) + .await + .map_err(|_| anyhow!("Failed to get current block"))? + .ok_or(anyhow!("Failed to get current block"))?; + + let latest_block: BlockInfo = latest_block.try_into()?; + self.update_block_info(latest_block); + + startup_info_log!("latest block synced: {}", latest_block.number); + Ok(()) + } + + /// Return info for the next block + pub fn get_next_block(&self) -> BlockInfo { + self.next_block + } + + /// Return info for the next block + pub fn get_latest_block(&self) -> BlockInfo { + self.latest_block + } + + /// Updates internal state with the latest mined block and next block + pub fn update_block_info>(&mut self, latest_block: T) { + let latest_block: BlockInfo = latest_block.into(); + self.latest_block = latest_block; + self.next_block = latest_block.get_next_block(); + } +} diff --git a/bot/crates/strategy/src/managers/mod.rs b/bot/crates/strategy/src/managers/mod.rs new file mode 100644 index 0000000..f67d57f --- /dev/null +++ b/bot/crates/strategy/src/managers/mod.rs @@ -0,0 +1,3 @@ +pub(crate) mod block_manager; +pub(crate) mod pool_manager; +pub(crate) mod sando_state_manager; diff --git a/bot/crates/strategy/src/managers/pool_manager.rs b/bot/crates/strategy/src/managers/pool_manager.rs new file mode 100644 index 0000000..e5bc7fc --- /dev/null +++ b/bot/crates/strategy/src/managers/pool_manager.rs @@ -0,0 +1,185 @@ +use anyhow::{anyhow, Result}; +use cfmms::{ + checkpoint::sync_pools_from_checkpoint, + dex::{Dex, DexVariant}, + pool::Pool, + sync::sync_pairs, +}; +use colored::Colorize; +use dashmap::DashMap; +use ethers::{ + abi, + providers::Middleware, + types::{Address, BlockNumber, Diff, TraceType, Transaction, H160, H256, U256}, +}; +use log::info; +use std::{path::Path, str::FromStr, sync::Arc}; + +use crate::{constants::WETH_ADDRESS, startup_info_log}; + +pub(crate) struct PoolManager { + /// Provider + provider: Arc, + /// Sandwichable pools + pools: DashMap, + /// Which dexes to monitor + dexes: Vec, +} + +impl PoolManager { + /// Gets state of all pools + pub async fn setup(&mut self) -> Result<()> { + let checkpoint_path = ".cfmms-checkpoint.json"; + + let checkpoint_exists = Path::new(checkpoint_path).exists(); + + let pools = if checkpoint_exists { + let (_, pools) = + sync_pools_from_checkpoint(checkpoint_path, 100000, self.provider.clone()).await?; + pools + } else { + sync_pairs( + self.dexes.clone(), + self.provider.clone(), + Some(checkpoint_path), + ) + .await? + }; + + for pool in pools { + self.pools.insert(pool.address(), pool); + } + + startup_info_log!("pools synced: {}", self.pools.len()); + + Ok(()) + } + + /// Return a tx's touched pools + // enhancement: record stable coin pairs to sandwich as well here + pub async fn get_touched_sandwichable_pools( + &self, + victim_tx: &Transaction, + latest_block: BlockNumber, + provider: Arc, + ) -> Result> { + // get victim tx state diffs + let state_diffs = provider + .trace_call(victim_tx, vec![TraceType::StateDiff], Some(latest_block)) + .await? + .state_diff + .ok_or(anyhow!("not sandwichable, no state diffs produced"))? + .0; + + // capture all addresses that have a state change and are also a `WETH` pool + let touched_pools: Vec = state_diffs + .keys() + .filter_map(|e| self.pools.get(e).map(|p| (*p.value()).clone())) + .filter(|e| match e { + Pool::UniswapV2(p) => vec![p.token_a, p.token_b].contains(&WETH_ADDRESS), + Pool::UniswapV3(p) => vec![p.token_a, p.token_b].contains(&WETH_ADDRESS), + }) + .collect(); + + // nothing to sandwich + if touched_pools.is_empty() { + return Ok(vec![]); + } + + // find trade direction + let weth_state_diff = &state_diffs + .get(&WETH_ADDRESS) + .ok_or(anyhow!("Missing WETH state diffs"))? + .storage; + + let mut sandwichable_pools = vec![]; + + for pool in touched_pools { + // find pool mapping location on WETH contract + let storage_key = H256::from(ethers::utils::keccak256(abi::encode(&[ + abi::Token::Address(pool.address()), + abi::Token::Uint(U256::from(3)), // WETH balanceOf mapping is at index 3 + ]))); + + // in reality we also want to check stable coin pools + if let Some(Diff::Changed(c)) = weth_state_diff.get(&storage_key) { + let from = U256::from(c.from.to_fixed_bytes()); + let to = U256::from(c.to.to_fixed_bytes()); + + // right now bot can only sandwich `weth->token` trades + // enhancement: add support for `token->weth` trades (using longtail or flashswaps sandos) + if to > from { + sandwichable_pools.push(pool); + } + } + } + + Ok(sandwichable_pools) + } + + pub fn new(provider: Arc) -> Self { + let dexes_data = [ + ( + // Uniswap v2 + "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", + DexVariant::UniswapV2, + 10000835u64, + ), + ( + // Sushiswap + "0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac", + DexVariant::UniswapV2, + 10794229u64, + ), + ( + // Crypto.com swap + "0x9DEB29c9a4c7A88a3C0257393b7f3335338D9A9D", + DexVariant::UniswapV2, + 10828414u64, + ), + ( + // Convergence swap + "0x4eef5746ED22A2fD368629C1852365bf5dcb79f1", + DexVariant::UniswapV2, + 12385067u64, + ), + ( + // Pancakeswap + "0x1097053Fd2ea711dad45caCcc45EfF7548fCB362", + DexVariant::UniswapV2, + 15614590u64, + ), + ( + // ShibaSwap + "0x115934131916C8b277DD010Ee02de363c09d037c", + DexVariant::UniswapV2, + 12771526u64, + ), + ( + // Saitaswap + "0x35113a300ca0D7621374890ABFEAC30E88f214b1", + DexVariant::UniswapV2, + 15210780u64, + ), + ( + // Uniswap v3 + "0x1F98431c8aD98523631AE4a59f267346ea31F984", + DexVariant::UniswapV3, + 12369621u64, + ), + ]; + + let dexes = dexes_data + .into_iter() + .map(|(address, variant, number)| { + Dex::new(H160::from_str(address).unwrap(), variant, number, Some(300)) + }) + .collect(); + + Self { + pools: DashMap::new(), + provider, + dexes, + } + } +} diff --git a/bot/crates/strategy/src/managers/sando_state_manager.rs b/bot/crates/strategy/src/managers/sando_state_manager.rs new file mode 100644 index 0000000..0403281 --- /dev/null +++ b/bot/crates/strategy/src/managers/sando_state_manager.rs @@ -0,0 +1,104 @@ +use anyhow::{anyhow, Result}; +use colored::Colorize; +use ethers::{ + providers::Middleware, + signers::{LocalWallet, Signer}, + types::{Address, BlockNumber, Filter, U256, U64}, +}; +use log::info; +use std::sync::Arc; + +use crate::{ + abi::Erc20, + constants::{ERC20_TRANSFER_EVENT_SIG, WETH_ADDRESS}, + startup_info_log, +}; + +pub struct SandoStateManager { + sando_contract: Address, + sando_inception_block: U64, + searcher_signer: LocalWallet, + weth_inventory: U256, + token_dust: Vec
, +} + +impl SandoStateManager { + pub fn new( + sando_contract: Address, + searcher_signer: LocalWallet, + sando_inception_block: U64, + ) -> Self { + Self { + sando_contract, + sando_inception_block, + searcher_signer, + weth_inventory: Default::default(), + token_dust: Default::default(), + } + } + + pub async fn setup(&mut self, provider: Arc) -> Result<()> { + // find weth inventory + let weth = Erc20::new(*WETH_ADDRESS, provider.clone()); + let weth_balance = weth.balance_of(self.sando_contract).call().await?; + startup_info_log!("weth inventory : {}", weth_balance); + self.weth_inventory = weth_balance; + + // find weth dust + let step = 10000; + + let latest_block = provider + .get_block(BlockNumber::Latest) + .await + .map_err(|_| anyhow!("Failed to get latest block"))? + .ok_or(anyhow!("Failed to get latest block"))? + .number + .ok_or(anyhow!("Field block number does not exist on latest block"))? + .as_u64(); + + let mut token_dust = vec![]; + + let start_block = self.sando_inception_block.as_u64(); + + // for each block within the range, get all transfer events asynchronously + for from_block in (start_block..=latest_block).step_by(step) { + let to_block = from_block + step as u64; + + // check for all incoming and outgoing txs within step range + let transfer_logs = provider + .get_logs( + &Filter::new() + .topic0(*ERC20_TRANSFER_EVENT_SIG) + .topic1(self.sando_contract) + .from_block(BlockNumber::Number(U64([from_block]))) + .to_block(BlockNumber::Number(U64([to_block]))), + ) + .await?; + + for log in transfer_logs { + token_dust.push(log.address); + } + } + + startup_info_log!("token dust found : {}", token_dust.len()); + self.token_dust = token_dust; + + Ok(()) + } + + pub fn get_sando_address(&self) -> Address { + self.sando_contract + } + + pub fn get_searcher_address(&self) -> Address { + self.searcher_signer.address() + } + + pub fn get_searcher_signer(&self) -> &LocalWallet { + &self.searcher_signer + } + + pub fn get_weth_inventory(&self) -> U256 { + self.weth_inventory + } +} diff --git a/bot/crates/strategy/src/simulator/huff_sando.rs b/bot/crates/strategy/src/simulator/huff_sando.rs new file mode 100644 index 0000000..5a6cf17 --- /dev/null +++ b/bot/crates/strategy/src/simulator/huff_sando.rs @@ -0,0 +1,500 @@ +use anvil::eth::util::get_precompiles_for; +use anyhow::{anyhow, Result}; +use cfmms::pool::Pool::{UniswapV2, UniswapV3}; +use cfmms::pool::UniswapV2Pool; +use ethers::abi::{self, parse_abi, Address, ParamType}; +use ethers::prelude::BaseContract; +use ethers::types::{Bytes, U256}; +use foundry_evm::executor::TxEnv; +use foundry_evm::executor::{ + fork::SharedBackend, inspector::AccessListTracer, ExecutionResult, Output, TransactTo, +}; +use foundry_evm::revm::{ + db::CacheDB, + primitives::{Address as rAddress, U256 as rU256}, + EVM, +}; + +use crate::constants::{GET_RESERVES_SIG, SUGAR_DADDY, WETH_ADDRESS}; +use crate::helpers::access_list_to_revm; +use crate::simulator::setup_block_state; +use crate::tx_utils::huff_sando_interface::common::five_byte_encoder::FiveByteMetaData; +use crate::tx_utils::huff_sando_interface::{ + common::weth_encoder::WethEncoder, + v2::{v2_create_backrun_payload, v2_create_frontrun_payload}, + v3::{v3_create_backrun_payload, v3_create_frontrun_payload}, +}; +use crate::types::{BlockInfo, RawIngredients, SandoRecipe}; + +use super::salmonella_inspector::{IsSandoSafu, SalmonellaInspectoooor}; + +/// finds if sandwich is profitable + salmonella free +pub fn create_recipe( + ingredients: &RawIngredients, + next_block: &BlockInfo, + optimal_in: U256, + sando_start_bal: U256, + searcher: Address, + sando_address: Address, + shared_backend: SharedBackend, +) -> Result { + #[allow(unused_mut)] + let mut fork_db = CacheDB::new(shared_backend); + + #[cfg(feature = "debug")] + { + inject_huff_sando( + &mut fork_db, + sando_address.0.into(), + searcher.0.into(), + sando_start_bal, + ); + } + let mut evm = EVM::new(); + evm.database(fork_db); + setup_block_state(&mut evm, &next_block); + + // *´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ + // * FRONTRUN TRANSACTION */ + // *.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ + // encode frontrun_in before passing to sandwich contract + let frontrun_in = WethEncoder::decode(WethEncoder::encode(optimal_in)); + + // caluclate frontrun_out using encoded frontrun_in + let frontrun_out = match ingredients.get_target_pool() { + UniswapV2(p) => { + evm.env.tx.gas_price = next_block.base_fee_per_gas.into(); + evm.env.tx.gas_limit = 700000; + evm.env.tx.value = rU256::ZERO; + v2_get_amount_out(frontrun_in, p, true, &mut evm)? + } + UniswapV3(_) => U256::zero(), + }; + + // create tx.data and tx.value for frontrun_in + let (frontrun_data, frontrun_value) = match ingredients.get_target_pool() { + UniswapV2(p) => v2_create_frontrun_payload( + p, + ingredients.get_intermediary_token(), + frontrun_in, + frontrun_out, + ), + UniswapV3(p) => v3_create_frontrun_payload( + p, + ingredients.get_intermediary_token(), + frontrun_in.as_u128().into(), + ), + }; + + // setup evm for frontrun transaction + let mut frontrun_tx_env = TxEnv { + caller: searcher.0.into(), + gas_limit: 700000, + gas_price: next_block.base_fee_per_gas.into(), + gas_priority_fee: None, + transact_to: TransactTo::Call(sando_address.0.into()), + value: frontrun_value.into(), + data: frontrun_data.clone().into(), + chain_id: None, + nonce: None, + access_list: Default::default(), + }; + evm.env.tx = frontrun_tx_env.clone(); + + // get access list + let mut access_list_inspector = AccessListTracer::new( + Default::default(), + searcher, + sando_address, + get_precompiles_for(evm.env.cfg.spec_id), + ); + evm.inspect_ref(&mut access_list_inspector) + .map_err(|e| anyhow!("[EVM ERROR] frontrun: {:?}", (e)))?; + let frontrun_access_list = access_list_inspector.access_list(); + + frontrun_tx_env.access_list = access_list_to_revm(frontrun_access_list); + evm.env.tx = frontrun_tx_env.clone(); + + // run again but now with access list (so that we get accurate gas used) + // run with a salmonella inspector to flag `suspicious` opcodes + let mut salmonella_inspector = SalmonellaInspectoooor::new(); + let frontrun_result = match evm.inspect_commit(&mut salmonella_inspector) { + Ok(result) => result, + Err(e) => return Err(anyhow!("[huffsando: EVM ERROR] frontrun: {:?}", e)), + }; + match frontrun_result { + ExecutionResult::Success { .. } => { /* continue operation */ } + ExecutionResult::Revert { output, .. } => { + return Err(anyhow!("[huffsando: REVERT] frontrun: {:?}", output)); + } + ExecutionResult::Halt { reason, .. } => { + return Err(anyhow!("[huffsando: HALT] frontrun: {:?}", reason)); + } + }; + match salmonella_inspector.is_sando_safu() { + IsSandoSafu::Safu => { /* continue operation */ } + IsSandoSafu::NotSafu(not_safu_opcodes) => { + return Err(anyhow!( + "[huffsando: FrontrunNotSafu] {:?}", + not_safu_opcodes + )) + } + } + + let frontrun_gas_used = frontrun_result.gas_used(); + + // *´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ + // * MEAT TRANSACTION/s */ + // *.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ + let mut is_meat_good = Vec::new(); + for meat in ingredients.get_meats_ref().iter() { + evm.env.tx.caller = rAddress::from_slice(&meat.from.0); + evm.env.tx.transact_to = + TransactTo::Call(rAddress::from_slice(&meat.to.unwrap_or_default().0)); + evm.env.tx.data = meat.input.0.clone(); + evm.env.tx.value = meat.value.into(); + evm.env.tx.chain_id = meat.chain_id.map(|id| id.as_u64()); + //evm.env.tx.nonce = Some(meat.nonce.as_u64()); + evm.env.tx.gas_limit = meat.gas.as_u64(); + match meat.transaction_type { + Some(ethers::types::U64([0])) => { + // legacy tx + evm.env.tx.gas_price = meat.gas_price.unwrap_or_default().into(); + } + Some(_) => { + // type 2 tx + evm.env.tx.gas_priority_fee = meat.max_priority_fee_per_gas.map(|mpf| mpf.into()); + evm.env.tx.gas_price = meat.max_fee_per_gas.unwrap_or_default().into(); + } + None => { + // legacy tx + evm.env.tx.gas_price = meat.gas_price.unwrap().into(); + } + } + + // keep track of which meat transactions are successful to filter reverted meats at end + // remove reverted meats because mempool tx/s gas costs are accounted for by fb + let res = match evm.transact_commit() { + Ok(result) => result, + Err(e) => return Err(anyhow!("[huffsando: EVM ERROR] meat: {:?}", e)), + }; + match res.is_success() { + true => is_meat_good.push(true), + false => is_meat_good.push(false), + } + } + + // *´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ + // * BACKRUN TRANSACTION */ + // *.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ + // encode backrun_in before passing to sandwich contract + let backrun_token_in = ingredients.get_intermediary_token(); + let backrun_token_out = ingredients.get_start_end_token(); + + // keep some dust + let backrun_in = get_erc20_balance(backrun_token_in, sando_address, next_block, &mut evm)?; + let backrun_in = match ingredients.get_target_pool() { + UniswapV2(_) => { + let mut backrun_in_encoded = FiveByteMetaData::encode(backrun_in, 1); + backrun_in_encoded.decrement_four_bytes(); + backrun_in_encoded.decode() + } + UniswapV3(_) => { + let backrun_in_encoded = FiveByteMetaData::encode(backrun_in, 1); + backrun_in_encoded.decode() + } + }; + + // caluclate backrun_out using encoded backrun_in + let backrun_out = match ingredients.get_target_pool() { + UniswapV2(p) => { + let out = v2_get_amount_out(backrun_in, p, false, &mut evm)?; + out + } + UniswapV3(_p) => U256::zero(), // we don't need to know backrun out for v3 + }; + + // create tx.data and tx.value for backrun_in + let (backrun_data, backrun_value) = match ingredients.get_target_pool() { + UniswapV2(p) => v2_create_backrun_payload(p, backrun_token_in, backrun_in, backrun_out), + UniswapV3(p) => ( + v3_create_backrun_payload(p, backrun_token_in, backrun_in), + U256::zero(), + ), + }; + + // setup evm for backrun transaction + let mut backrun_tx_env = TxEnv { + caller: searcher.0.into(), + gas_limit: 700000, + gas_price: next_block.base_fee_per_gas.into(), + gas_priority_fee: None, + transact_to: TransactTo::Call(sando_address.0.into()), + value: backrun_value.into(), + data: backrun_data.clone().into(), + chain_id: None, + nonce: None, + access_list: Default::default(), + }; + evm.env.tx = backrun_tx_env.clone(); + + // create access list + let mut access_list_inspector = AccessListTracer::new( + Default::default(), + searcher, + sando_address, + get_precompiles_for(evm.env.cfg.spec_id), + ); + evm.inspect_ref(&mut access_list_inspector) + .map_err(|e| anyhow!("[huffsando: EVM ERROR] frontrun: {:?}", e)) + .unwrap(); + let backrun_access_list = access_list_inspector.access_list(); + backrun_tx_env.access_list = access_list_to_revm(backrun_access_list); + evm.env.tx = backrun_tx_env.clone(); + + // run again but now with access list (so that we get accurate gas used) + // run with a salmonella inspector to flag `suspicious` opcodes + let mut salmonella_inspector = SalmonellaInspectoooor::new(); + let backrun_result = match evm.inspect_commit(&mut salmonella_inspector) { + Ok(result) => result, + Err(e) => return Err(anyhow!("[huffsando: EVM ERROR] backrun: {:?}", e)), + }; + match backrun_result { + ExecutionResult::Success { .. } => { /* continue */ } + ExecutionResult::Revert { output, .. } => { + return Err(anyhow!("[huffsando: REVERT] backrun: {:?}", output)); + } + ExecutionResult::Halt { reason, .. } => { + return Err(anyhow!("[huffsando: HALT] backrun: {:?}", reason)) + } + }; + match salmonella_inspector.is_sando_safu() { + IsSandoSafu::Safu => { /* continue operation */ } + IsSandoSafu::NotSafu(not_safu_opcodes) => { + return Err(anyhow!( + "[huffsando: BACKRUN_NOT_SAFU] bad_opcodes->{:?}", + not_safu_opcodes + )) + } + } + + let backrun_gas_used = backrun_result.gas_used(); + + // *´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ + // * GENERATE REPORTS */ + // *.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ + // caluclate revenue from balance change + let post_sando_bal = get_erc20_balance(backrun_token_out, sando_address, next_block, &mut evm)?; + + let revenue = post_sando_bal + .checked_sub(sando_start_bal) + .unwrap_or_default(); + + // filter only passing meat txs + let good_meats_only = ingredients + .get_meats_ref() + .iter() + .zip(is_meat_good.iter()) + .filter(|&(_, &b)| b) + .map(|(s, _)| s.to_owned()) + .collect(); + + Ok(SandoRecipe::new( + frontrun_tx_env, + frontrun_gas_used, + good_meats_only, + backrun_tx_env, + backrun_gas_used, + revenue, + *next_block, + )) +} + +/// Get the balance of a token in an evm (account for tax) +pub fn get_erc20_balance( + token: Address, + owner: Address, + block: &BlockInfo, + evm: &mut EVM>, +) -> Result { + let erc20 = BaseContract::from( + parse_abi(&["function balanceOf(address) external returns (uint)"]).unwrap(), + ); + + evm.env.tx.transact_to = TransactTo::Call(token.0.into()); + evm.env.tx.data = erc20.encode("balanceOf", owner).unwrap().0; + evm.env.tx.caller = (*SUGAR_DADDY).into(); // spoof addy with a lot of eth + evm.env.tx.nonce = None; + evm.env.tx.gas_price = block.base_fee_per_gas.into(); + evm.env.tx.gas_limit = 700000; + evm.env.tx.value = rU256::ZERO; + + let result = match evm.transact_ref() { + Ok(result) => result.result, + Err(e) => { + return Err(anyhow!("[get_erc20_balance: EVMError] {:?}", e)); + } + }; + + let output: Bytes = match result { + ExecutionResult::Success { output, .. } => match output { + Output::Call(o) => o.into(), + Output::Create(o, _) => o.into(), + }, + ExecutionResult::Revert { output, .. } => { + return Err(anyhow!("[get_erc20_balance: Revert] {:?}", output)) + } + ExecutionResult::Halt { reason, .. } => { + return Err(anyhow!("[get_erc20_balance: Halt] {:?}", reason)) + } + }; + + match erc20.decode_output("balanceOf", &output) { + Ok(tokens) => return Ok(tokens), + Err(e) => return Err(anyhow!("[get_erc20_balance: ABI Error] {:?}", e)), + } +} + +// Find amount out from an amount in using the k=xy formula +// note: reserve values taken from evm +// note: assuming fee is set to 3% for all pools (not case irl) +// +// Arguments: +// * `amount_in`: amount of token in +// * `target_pool`: address of pool +// * `token_in`: address of token in +// * `token_out`: address of token out +// * `evm`: mutable reference to evm used for query +// +// Returns: +// Ok(U256): amount out +// Err(SimulationError): if error during caluclation +pub fn v2_get_amount_out( + amount_in: U256, + target_pool: UniswapV2Pool, + is_frontrun: bool, + evm: &mut EVM>, +) -> Result { + // get reserves + evm.env.tx.transact_to = TransactTo::Call(target_pool.address().0.into()); + evm.env.tx.caller = (*SUGAR_DADDY).0.into(); // spoof weth address for its ether + evm.env.tx.value = rU256::ZERO; + evm.env.tx.data = (*GET_RESERVES_SIG).0.clone(); // getReserves() + evm.env.tx.nonce = None; + let result = match evm.transact_ref() { + Ok(result) => result.result, + Err(e) => return Err(anyhow!("[get_amount_out_evm: EVM ERROR] {:?}", e)), + }; + let output: Bytes = match result { + ExecutionResult::Success { output, .. } => match output { + Output::Call(o) => o.into(), + Output::Create(o, _) => o.into(), + }, + ExecutionResult::Revert { output, .. } => { + return Err(anyhow!("[get_amount_out_evm: EVM REVERTED] {:?}", output)) + } + ExecutionResult::Halt { reason, .. } => { + return Err(anyhow!("[get_amount_out_evm: EVM HALT] {:?}", reason)) + } + }; + + let tokens = abi::decode( + &vec![ + ParamType::Uint(128), + ParamType::Uint(128), + ParamType::Uint(32), + ], + &output, + ) + .unwrap(); + + let reserves_0 = tokens[0].clone().into_uint().unwrap(); + let reserves_1 = tokens[1].clone().into_uint().unwrap(); + + let other_token = [target_pool.token_a, target_pool.token_b] + .into_iter() + .find(|&t| t != *WETH_ADDRESS) + .unwrap(); + + let (input_token, output_token) = if is_frontrun { + // if frontrun we trade WETH -> TOKEN + (*WETH_ADDRESS, other_token) + } else { + // if backrun we trade TOKEN -> WETH + (other_token, *WETH_ADDRESS) + }; + + let (reserve_in, reserve_out) = match input_token < output_token { + true => (reserves_0, reserves_1), + false => (reserves_1, reserves_0), + }; + + let a_in_with_fee: U256 = amount_in * 997; + let numerator: U256 = a_in_with_fee * reserve_out; + let denominator: U256 = reserve_in * 1000 + a_in_with_fee; + let amount_out: U256 = numerator.checked_div(denominator).unwrap_or(U256::zero()); + + Ok(amount_out) +} + +#[cfg(feature = "debug")] +fn inject_huff_sando( + db: &mut CacheDB, + huff_sando_addy: foundry_evm::executor::B160, + searcher: foundry_evm::executor::B160, + sando_start_bal: U256, +) { + // compile huff contract + let git_root = std::str::from_utf8( + &std::process::Command::new("git") + .arg("rev-parse") + .arg("--show-toplevel") + .output() + .expect("Failed to execute git command") + .stdout, + ) + .unwrap() + .trim() + .to_string(); + + let mut contract_dir = std::path::PathBuf::from(git_root); + contract_dir.push("contract/src"); + + let output = std::process::Command::new("huffc") + .arg("--bin-runtime") + .arg("sando.huff") + .current_dir(contract_dir) + .output() + .expect("Failed to compile huff sando contract"); + + assert!(output.status.success(), "Command execution failed"); + + let huff_sando_code = std::str::from_utf8(&output.stdout).unwrap(); + let huff_sando_code = ::from_str(huff_sando_code).unwrap(); + + //// insert huff sando bytecode + let huff_sando_info = foundry_evm::revm::primitives::AccountInfo::new( + rU256::ZERO, + 0, + foundry_evm::executor::Bytecode::new_raw(huff_sando_code.0), + ); + + db.insert_account_info(huff_sando_addy, huff_sando_info); + + // insert and fund lilRouter controller (so we can spoof) + let searcher_info = foundry_evm::revm::primitives::AccountInfo::new( + crate::simulator::eth_to_wei(200), + 0, + foundry_evm::executor::Bytecode::default(), + ); + db.insert_account_info(searcher, searcher_info); + + // fund huff sando with 200 weth + let slot = foundry_evm::revm::primitives::keccak256(&abi::encode(&[ + abi::Token::Address(huff_sando_addy.0.into()), + abi::Token::Uint(U256::from(3)), + ])); + + db.insert_account_storage((*WETH_ADDRESS).into(), slot.into(), sando_start_bal.into()) + .unwrap(); +} diff --git a/bot/crates/strategy/src/simulator/lil_router.rs b/bot/crates/strategy/src/simulator/lil_router.rs new file mode 100644 index 0000000..724aea3 --- /dev/null +++ b/bot/crates/strategy/src/simulator/lil_router.rs @@ -0,0 +1,329 @@ +use anyhow::{anyhow, Result}; +use cfmms::pool::Pool::{UniswapV2, UniswapV3}; +use ethers::{abi, types::U256}; +use foundry_evm::{ + executor::{fork::SharedBackend, Bytecode, ExecutionResult, Output, TransactTo}, + revm::{ + db::CacheDB, + primitives::{keccak256, AccountInfo, Address as rAddress, U256 as rU256}, + EVM, + }, +}; + +use crate::{ + constants::{ + LIL_ROUTER_ADDRESS, LIL_ROUTER_CODE, LIL_ROUTER_CONTROLLER, WETH_ADDRESS, WETH_FUND_AMT, + }, + tx_utils::lil_router_interface::{ + build_swap_v2_data, build_swap_v3_data, decode_swap_v2_result, decode_swap_v3_result, + }, + types::{BlockInfo, RawIngredients}, +}; + +use super::{eth_to_wei, setup_block_state}; + +// Juiced implementation of https://research.ijcaonline.org/volume65/number14/pxc3886165.pdf +// splits range in more intervals, search intervals concurrently, compare, repeat till termination +pub async fn find_optimal_input( + ingredients: &RawIngredients, + target_block: &BlockInfo, + weth_inventory: U256, + shared_backend: SharedBackend, +) -> Result { + // + // [EXAMPLE WITH 10 BOUND INTERVALS] + // + // (first) (mid) (last) + // ▼ ▼ ▼ + // +---+---+---+---+---+---+---+---+---+---+ + // | | | | | | | | | | | + // +---+---+---+---+---+---+---+---+---+---+ + // ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ + // 0 1 2 3 4 5 6 7 8 9 X + // + // * [0, X] = search range + // * Find revenue at each interval + // * Find index of interval with highest revenue + // * Search again with bounds set to adjacent index of highest + + // setup values for search termination + let base = U256::from(1000000u64); + let tolerance = U256::from(1u64); + + let mut lower_bound = U256::zero(); + let mut upper_bound = weth_inventory; + + let tolerance = (tolerance * ((upper_bound + lower_bound) / rU256::from(2))) / base; + + // initialize variables for search + let l_interval_lower = |i: usize, intervals: &Vec| intervals[i - 1].clone() + 1; + let r_interval_upper = |i: usize, intervals: &Vec| { + intervals[i + 1] + .clone() + .checked_sub(1.into()) + .ok_or(anyhow!("r_interval - 1 underflowed")) + }; + let should_loop_terminate = |lower_bound: U256, upper_bound: U256| -> bool { + let search_range = match upper_bound.checked_sub(lower_bound) { + Some(range) => range, + None => return true, + }; + // produces negative result + if lower_bound > upper_bound { + return true; + } + // tolerance condition not met + if search_range < tolerance { + return true; + } + false + }; + let mut highest_sando_input = U256::zero(); + let number_of_intervals = 15; + let mut counter = 0; + + // continue search until termination condition is met (no point seraching down to closest wei) + loop { + counter += 1; + if should_loop_terminate(lower_bound, upper_bound) { + break; + } + + // split search range into intervals + let mut intervals = Vec::new(); + for i in 0..=number_of_intervals { + let diff = upper_bound + .checked_sub(lower_bound) + .ok_or(anyhow!("upper_bound - lower_bound resulted in underflow"))?; + + let fraction = diff * i; + let divisor = U256::from(number_of_intervals); + let interval = lower_bound + (fraction / divisor); + + intervals.push(interval); + } + + // calculate revenue at each interval concurrently + let mut revenues = Vec::new(); + for bound in &intervals { + let sim = tokio::task::spawn(evaluate_sandwich_revenue( + *bound, + target_block.clone(), + shared_backend.clone(), + ingredients.clone(), + )); + revenues.push(sim); + } + + let revenues = futures::future::join_all(revenues).await; + + let revenues = revenues + .into_iter() + .map(|r| r.unwrap().unwrap_or_default()) + .collect::>(); + + // find interval that produces highest revenue + let (highest_revenue_index, _highest_revenue) = revenues + .iter() + .enumerate() + .max_by(|(_, a), (_, b)| a.cmp(&b)) + .unwrap(); + + highest_sando_input = intervals[highest_revenue_index]; + + // enhancement: find better way to increase finding opps incase of all rev=0 + if revenues[highest_revenue_index] == U256::zero() { + // most likely there is no sandwich possibility + if counter == 10 { + return Ok(U256::zero()); + } + // no revenue found, most likely small optimal so decrease range + upper_bound = intervals[intervals.len() / 3] + .checked_sub(1.into()) + .ok_or(anyhow!("intervals[intervals.len()/3] - 1 underflowed"))?; + continue; + } + + // if highest revenue is produced at last interval (upper bound stays fixed) + if highest_revenue_index == intervals.len() - 1 { + lower_bound = l_interval_lower(highest_revenue_index, &intervals); + continue; + } + + // if highest revenue is produced at first interval (lower bound stays fixed) + if highest_revenue_index == 0 { + upper_bound = r_interval_upper(highest_revenue_index, &intervals)?; + continue; + } + + // set bounds to intervals adjacent to highest revenue index and search again + lower_bound = l_interval_lower(highest_revenue_index, &intervals); + upper_bound = r_interval_upper(highest_revenue_index, &intervals)?; + } + + Ok(highest_sando_input) +} + +async fn evaluate_sandwich_revenue( + frontrun_in: U256, + next_block: BlockInfo, + shared_backend: SharedBackend, + ingredients: RawIngredients, +) -> Result { + let mut fork_db = CacheDB::new(shared_backend); + inject_lil_router_code(&mut fork_db); + + let mut evm = EVM::new(); + evm.database(fork_db); + setup_block_state(&mut evm, &next_block); + + /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ + /* FRONTRUN TRANSACTION */ + /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ + let frontrun_data = match ingredients.get_target_pool() { + UniswapV2(pool) => build_swap_v2_data(frontrun_in, pool, true), + UniswapV3(pool) => build_swap_v3_data(frontrun_in.as_u128().into(), pool, true), + }; + + evm.env.tx.caller = *LIL_ROUTER_CONTROLLER; + evm.env.tx.transact_to = TransactTo::Call(*LIL_ROUTER_ADDRESS); + evm.env.tx.data = frontrun_data.0; + evm.env.tx.gas_limit = 700000; + evm.env.tx.gas_price = next_block.base_fee_per_gas.into(); + evm.env.tx.value = rU256::ZERO; + + let result = match evm.transact_commit() { + Ok(result) => result, + Err(e) => return Err(anyhow!("[lilRouter: EVM ERROR] frontrun: {:?}", e)), + }; + let output = match result { + ExecutionResult::Success { output, .. } => match output { + Output::Call(o) => o, + Output::Create(o, _) => o, + }, + ExecutionResult::Revert { output, .. } => { + return Err(anyhow!("[lilRouter: REVERT] frontrun: {:?}", output)) + } + ExecutionResult::Halt { reason, .. } => { + return Err(anyhow!("[lilRouter: HALT] frontrun: {:?}", reason)) + } + }; + let (_frontrun_out, backrun_in) = match ingredients.get_target_pool() { + UniswapV2(_) => match decode_swap_v2_result(output.into()) { + Ok(output) => output, + Err(e) => { + return Err(anyhow!( + "[lilRouter: FailedToDecodeOutput] frontrun: {:?}", + e + )) + } + }, + UniswapV3(_) => match decode_swap_v3_result(output.into()) { + Ok(output) => output, + Err(e) => return Err(anyhow!("lilRouter: FailedToDecodeOutput: {:?}", e)), + }, + }; + + /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ + /* MEAT TRANSACTION/s */ + /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ + for meat in ingredients.get_meats_ref().iter() { + evm.env.tx.caller = rAddress::from_slice(&meat.from.0); + evm.env.tx.transact_to = + TransactTo::Call(rAddress::from_slice(&meat.to.unwrap_or_default().0)); + evm.env.tx.data = meat.input.0.clone(); + evm.env.tx.value = meat.value.into(); + evm.env.tx.chain_id = meat.chain_id.map(|id| id.as_u64()); + // evm.env.tx.nonce = Some(meat.nonce.as_u64()); /** ignore nonce check for now **/ + evm.env.tx.gas_limit = meat.gas.as_u64(); + match meat.transaction_type { + Some(ethers::types::U64([0])) => { + // legacy tx + evm.env.tx.gas_price = meat.gas_price.unwrap_or_default().into(); + } + Some(_) => { + // type 2 tx + evm.env.tx.gas_priority_fee = meat.max_priority_fee_per_gas.map(|mpf| mpf.into()); + evm.env.tx.gas_price = meat.max_fee_per_gas.unwrap_or_default().into(); + } + None => { + // legacy tx + evm.env.tx.gas_price = meat.gas_price.unwrap_or_default().into(); + } + } + + let _res = evm.transact_commit(); + } + + /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ + /* BACKRUN TRANSACTION */ + /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ + let backrun_data = match ingredients.get_target_pool() { + UniswapV2(pool) => build_swap_v2_data(backrun_in, pool, false), + UniswapV3(pool) => build_swap_v3_data(backrun_in.as_u128().into(), pool, false), + }; + + evm.env.tx.caller = *LIL_ROUTER_CONTROLLER; + evm.env.tx.transact_to = TransactTo::Call(*LIL_ROUTER_ADDRESS); + evm.env.tx.data = backrun_data.0; + evm.env.tx.gas_limit = 700000; + evm.env.tx.gas_price = next_block.base_fee_per_gas.into(); + evm.env.tx.value = rU256::ZERO; + + let result = match evm.transact_commit() { + Ok(result) => result, + Err(e) => return Err(anyhow!("[lilRouter: EVM ERROR] backrun: {:?}", e)), + }; + let output = match result { + ExecutionResult::Success { output, .. } => match output { + Output::Call(o) => o, + Output::Create(o, _) => o, + }, + ExecutionResult::Revert { output, .. } => { + return Err(anyhow!("[lilRouter: REVERT] backrun: {:?}", output)) + } + ExecutionResult::Halt { reason, .. } => { + return Err(anyhow!("[lilRouter: HALT] backrun: {:?}", reason)) + } + }; + let (_backrun_out, post_sandwich_balance) = match ingredients.get_target_pool() { + UniswapV2(_) => match decode_swap_v2_result(output.into()) { + Ok(output) => output, + Err(e) => return Err(anyhow!("[lilRouter: FailedToDecodeOutput] {:?}", e)), + }, + UniswapV3(_) => match decode_swap_v3_result(output.into()) { + Ok(output) => output, + Err(e) => return Err(anyhow!("[lilRouter: FailedToDecodeOutput] {:?}", e)), + }, + }; + + let revenue = post_sandwich_balance + .checked_sub((*WETH_FUND_AMT).into()) + .unwrap_or_default(); + + Ok(revenue) +} + +/// Inserts custom minimal router contract into evm instance for simulations +fn inject_lil_router_code(db: &mut CacheDB) { + // insert lilRouter bytecode + let lil_router_info = AccountInfo::new( + rU256::ZERO, + 0, + Bytecode::new_raw((*LIL_ROUTER_CODE.0).into()), + ); + db.insert_account_info(*LIL_ROUTER_ADDRESS, lil_router_info); + + // insert and fund lilRouter controller (so we can spoof) + let controller_info = AccountInfo::new(*WETH_FUND_AMT, 0, Bytecode::default()); + db.insert_account_info(*LIL_ROUTER_CONTROLLER, controller_info); + + // fund lilRouter with 200 weth + let slot = keccak256(&abi::encode(&[ + abi::Token::Address((*LIL_ROUTER_ADDRESS).into()), + abi::Token::Uint(U256::from(3)), + ])); + + db.insert_account_storage((*WETH_ADDRESS).into(), slot.into(), eth_to_wei(200)) + .unwrap(); +} diff --git a/bot/crates/strategy/src/simulator/mod.rs b/bot/crates/strategy/src/simulator/mod.rs new file mode 100644 index 0000000..f2931b0 --- /dev/null +++ b/bot/crates/strategy/src/simulator/mod.rs @@ -0,0 +1,25 @@ +pub mod huff_sando; +pub(crate) mod lil_router; +pub(crate) mod salmonella_inspector; + +use foundry_evm::{ + executor::fork::SharedBackend, + revm::{db::CacheDB, primitives::U256 as rU256, EVM}, +}; + +use crate::{ + constants::{COINBASE, ONE_ETHER_IN_WEI}, + types::BlockInfo, +}; + +fn setup_block_state(evm: &mut EVM>, next_block: &BlockInfo) { + evm.env.block.number = rU256::from(next_block.number.as_u64()); + evm.env.block.timestamp = next_block.timestamp.into(); + evm.env.block.basefee = next_block.base_fee_per_gas.into(); + // use something other than default + evm.env.block.coinbase = *COINBASE; +} + +pub fn eth_to_wei(amt: u128) -> rU256 { + rU256::from(amt).checked_mul(*ONE_ETHER_IN_WEI).unwrap() +} diff --git a/bot/src/simulate/inspectors/is_sando_safu.rs b/bot/crates/strategy/src/simulator/salmonella_inspector.rs similarity index 72% rename from bot/src/simulate/inspectors/is_sando_safu.rs rename to bot/crates/strategy/src/simulator/salmonella_inspector.rs index bb12324..5067549 100644 --- a/bot/src/simulate/inspectors/is_sando_safu.rs +++ b/bot/crates/strategy/src/simulator/salmonella_inspector.rs @@ -1,9 +1,11 @@ -use revm::interpreter::{opcode, Interpreter}; -use revm::interpreter::{CallInputs, CreateInputs, Gas, InstructionResult}; -use revm::primitives::{Bytes, B160}; -use revm::{Database, EVMData, Inspector}; +use foundry_evm::{ + executor::InstructionResult, + revm::{ + interpreter::{opcode, Interpreter}, + Database, EVMData, Inspector, + }, +}; -#[derive(Debug)] pub enum IsSandoSafu { Safu, NotSafu(Vec), @@ -72,15 +74,6 @@ impl SalmonellaInspectoooor { } impl Inspector for SalmonellaInspectoooor { - fn initialize_interp( - &mut self, - _interp: &mut Interpreter, - _data: &mut EVMData<'_, DB>, - _is_static: bool, - ) -> InstructionResult { - InstructionResult::Continue - } - // get opcode by calling `interp.contract.opcode(interp.program_counter())`. // all other information can be obtained from interp. fn step( @@ -126,47 +119,4 @@ impl Inspector for SalmonellaInspectoooor { InstructionResult::Continue } - - fn step_end( - &mut self, - _interp: &mut Interpreter, - _data: &mut EVMData<'_, DB>, - _is_static: bool, - _eval: InstructionResult, - ) -> InstructionResult { - InstructionResult::Continue - } - - fn call( - &mut self, - _data: &mut EVMData<'_, DB>, - _inputs: &mut CallInputs, - _is_static: bool, - ) -> (InstructionResult, Gas, Bytes) { - (InstructionResult::Continue, Gas::new(0), Bytes::new()) - } - - fn call_end( - &mut self, - _data: &mut EVMData<'_, DB>, - _inputs: &CallInputs, - remaining_gas: Gas, - ret: InstructionResult, - out: Bytes, - _is_static: bool, - ) -> (InstructionResult, Gas, Bytes) { - (ret, remaining_gas, out) - } - - fn create_end( - &mut self, - _data: &mut EVMData<'_, DB>, - _inputs: &CreateInputs, - ret: InstructionResult, - address: Option, - remaining_gas: Gas, - out: Bytes, - ) -> (InstructionResult, Option, Gas, Bytes) { - (ret, address, remaining_gas, out) - } } diff --git a/bot/crates/strategy/src/tx_utils/huff_sando_interface/common/five_byte_encoder.rs b/bot/crates/strategy/src/tx_utils/huff_sando_interface/common/five_byte_encoder.rs new file mode 100644 index 0000000..c699fcc --- /dev/null +++ b/bot/crates/strategy/src/tx_utils/huff_sando_interface/common/five_byte_encoder.rs @@ -0,0 +1,65 @@ +use eth_encode_packed::{SolidityDataType, TakeLastXBytes}; +use ethers::types::U256; + +/// A struct that contains the metadata for the five byte encoding +pub struct FiveByteMetaData { + /// TargetValue squashed down to four bytes + four_bytes: u32, + /// How many byte shifts to apply on our four bytes + byte_shift: u8, + /// Where should the value be stored (which param index in abi schema during func call) + param_index: u8, +} + +impl FiveByteMetaData { + // Encodes a value to 5 bytes of calldata (used to represent other token value) + pub fn encode(amount: U256, param_index: u8) -> Self { + let mut byte_shift: u8 = 0; + let mut four_bytes: u32 = 0; + + while byte_shift < 32 { + // lossy encoding as we lose bits due to division + let encoded_amount = amount / 2u128.pow(8 * byte_shift as u32); + + // if we can fit the value in 4 bytes, we can encode it + if encoded_amount <= U256::from(2).pow((4 * 8).into()) - 1 { + four_bytes = encoded_amount.as_u32(); + break; + } + + byte_shift += 1; + } + + Self { + byte_shift, + four_bytes, + param_index, + } + } + + /// Decrement the four bytes by one (used for when we want to keep dust on contract) + pub fn decrement_four_bytes(&mut self) { + self.four_bytes -= 1; + } + + /// Decodes the 5 bytes back to a 32 byte value (lossy) + pub fn decode(&self) -> U256 { + let value: u128 = (self.four_bytes as u128) << (self.byte_shift as u32 * 8); + return U256::from(value); + } + + /// Finalize by encoding into five bytes for a specific param index + /// Find memoffset for param index such that when stored it is shifted by `self.byte_shifts` + pub fn finalize_to_bytes(self) -> Vec { + // first +4 value is used for function selector, -4 because we account for the 4 bytes used + // for encoding the value to be shifted + let mem_offset = 4 + 32 + (self.param_index * 32) - 4 - self.byte_shift; + + let (encoded, _) = eth_encode_packed::abi::encode_packed(&vec![ + SolidityDataType::NumberWithShift(mem_offset.into(), TakeLastXBytes(8)), + SolidityDataType::NumberWithShift(self.four_bytes.into(), TakeLastXBytes(32)), + ]); + + encoded + } +} diff --git a/bot/crates/strategy/src/tx_utils/huff_sando_interface/common/mod.rs b/bot/crates/strategy/src/tx_utils/huff_sando_interface/common/mod.rs new file mode 100644 index 0000000..9eb0cdf --- /dev/null +++ b/bot/crates/strategy/src/tx_utils/huff_sando_interface/common/mod.rs @@ -0,0 +1,33 @@ +/// This Module file holds common methods used for both v2 and v3 methods + +/// Utils to encode (and decode) 32 bytes to 5 bytes of calldata +pub mod five_byte_encoder; + +/// Utils to encode (and decode) weth to `tx.value` +pub mod weth_encoder; + +// Declare the array as static +static FUNCTION_NAMES: [&str; 8] = [ + "v2_backrun0", + "v2_frontrun0", + "v2_backrun1", + "v2_frontrun1", + "v3_backrun0", + "v3_frontrun0", + "v3_backrun1", + "v3_frontrun1", +]; + +pub fn get_jump_dest_from_sig(function_name: &str) -> u8 { + let starting_index = 0x05; + + // find index of associated JUMPDEST (sig) + for (i, &name) in FUNCTION_NAMES.iter().enumerate() { + if name == function_name { + return (i as u8 * 5) + starting_index; + } + } + + // not found (force jump to invalid JUMPDEST) + 0x00 +} diff --git a/bot/crates/strategy/src/tx_utils/huff_sando_interface/common/weth_encoder.rs b/bot/crates/strategy/src/tx_utils/huff_sando_interface/common/weth_encoder.rs new file mode 100644 index 0000000..de1aa42 --- /dev/null +++ b/bot/crates/strategy/src/tx_utils/huff_sando_interface/common/weth_encoder.rs @@ -0,0 +1,18 @@ +use ethers::{prelude::Lazy, types::U256}; + +/// Constant used for encoding WETH amount +pub static WETH_ENCODING_MULTIPLE: Lazy = Lazy::new(|| U256::from(100000)); + +pub struct WethEncoder {} + +impl WethEncoder { + /// Encodes a weth value to be passed to the contract through `tx.value` + pub fn encode(value: U256) -> U256 { + value / *WETH_ENCODING_MULTIPLE + } + + /// Decodes by multiplying amount by weth constant + pub fn decode(value: U256) -> U256 { + value * *WETH_ENCODING_MULTIPLE + } +} diff --git a/bot/crates/strategy/src/tx_utils/huff_sando_interface/mod.rs b/bot/crates/strategy/src/tx_utils/huff_sando_interface/mod.rs new file mode 100644 index 0000000..9ef5866 --- /dev/null +++ b/bot/crates/strategy/src/tx_utils/huff_sando_interface/mod.rs @@ -0,0 +1,3 @@ +pub mod common; +pub mod v2; +pub mod v3; diff --git a/bot/crates/strategy/src/tx_utils/huff_sando_interface/v2.rs b/bot/crates/strategy/src/tx_utils/huff_sando_interface/v2.rs new file mode 100644 index 0000000..bdb8778 --- /dev/null +++ b/bot/crates/strategy/src/tx_utils/huff_sando_interface/v2.rs @@ -0,0 +1,62 @@ +use cfmms::pool::UniswapV2Pool; +use eth_encode_packed::{SolidityDataType, TakeLastXBytes}; +use ethers::types::{Address, U256}; + +use crate::constants::WETH_ADDRESS; + +use super::common::{ + five_byte_encoder::FiveByteMetaData, get_jump_dest_from_sig, weth_encoder::WethEncoder, +}; + +pub fn v2_create_frontrun_payload( + pool: UniswapV2Pool, + output_token: Address, + amount_in: U256, + amount_out: U256, // amount_out is needed to be passed due to taxed tokens +) -> (Vec, U256) { + let jump_dest = get_jump_dest_from_sig(if *WETH_ADDRESS < output_token { + "v2_frontrun0" + } else { + "v2_frontrun1" + }); + + let five_bytes = + FiveByteMetaData::encode(amount_out, if *WETH_ADDRESS < output_token { 1 } else { 0 }); + + let (payload, _) = eth_encode_packed::abi::encode_packed(&[ + SolidityDataType::NumberWithShift(jump_dest.into(), TakeLastXBytes(8)), + SolidityDataType::Address(pool.address().0.into()), + SolidityDataType::Bytes(&five_bytes.finalize_to_bytes()), + ]); + + let encoded_call_value = WethEncoder::encode(amount_in); + + (payload, encoded_call_value) +} + +/// dev: amount_out is needed to be passed due to taxed tokens +pub fn v2_create_backrun_payload( + pool: UniswapV2Pool, + input_token: Address, + amount_in: U256, + amount_out: U256, // amount_out is needed to be passed due to taxed tokens +) -> (Vec, U256) { + let jump_dest = get_jump_dest_from_sig(if *WETH_ADDRESS < input_token { + "v2_backrun0" + } else { + "v2_backrun1" + }); + + let five_bytes = FiveByteMetaData::encode(amount_in, 1); + + let (payload, _) = eth_encode_packed::abi::encode_packed(&[ + SolidityDataType::NumberWithShift(jump_dest.into(), TakeLastXBytes(8)), + SolidityDataType::Address(pool.address().0.into()), + SolidityDataType::Address(input_token.0.into()), + SolidityDataType::Bytes(&five_bytes.finalize_to_bytes()), + ]); + + let encoded_call_value = WethEncoder::encode(amount_out); + + (payload, encoded_call_value) +} diff --git a/bot/crates/strategy/src/tx_utils/huff_sando_interface/v3.rs b/bot/crates/strategy/src/tx_utils/huff_sando_interface/v3.rs new file mode 100644 index 0000000..6b41f8b --- /dev/null +++ b/bot/crates/strategy/src/tx_utils/huff_sando_interface/v3.rs @@ -0,0 +1,71 @@ +use cfmms::pool::UniswapV3Pool; +use eth_encode_packed::{SolidityDataType, TakeLastXBytes}; +use ethers::{ + abi::{encode, Token}, + types::{Address, U256}, +}; + +use crate::constants::WETH_ADDRESS; + +use super::common::{ + five_byte_encoder::FiveByteMetaData, get_jump_dest_from_sig, weth_encoder::WethEncoder, +}; + +pub fn v3_create_frontrun_payload( + pool: UniswapV3Pool, + output_token: Address, + amount_in: U256, +) -> (Vec, U256) { + let (payload, _) = eth_encode_packed::abi::encode_packed(&[ + SolidityDataType::NumberWithShift( + get_jump_dest_from_sig(if *WETH_ADDRESS < output_token { + "v3_frontrun0" + } else { + "v3_frontrun1" + }) + .into(), + TakeLastXBytes(8), + ), + SolidityDataType::Address(pool.address().0.into()), + SolidityDataType::Bytes(&get_pool_key_hash(pool).to_vec()), + ]); + + let encoded_value = WethEncoder::encode(amount_in); + + (payload, encoded_value) +} + +pub fn v3_create_backrun_payload( + pool: UniswapV3Pool, + input_token: Address, + amount_in: U256, +) -> Vec { + let five_bytes = FiveByteMetaData::encode(U256::from(amount_in), 2); + + let (payload, _) = eth_encode_packed::abi::encode_packed(&[ + SolidityDataType::NumberWithShift( + get_jump_dest_from_sig(if *WETH_ADDRESS < input_token { + "v3_backrun0" + } else { + "v3_backrun1" + }) + .into(), + TakeLastXBytes(8), + ), + SolidityDataType::Address(pool.address().0.into()), + SolidityDataType::Address(input_token.0.into()), + SolidityDataType::Bytes(&get_pool_key_hash(pool).to_vec()), + SolidityDataType::Bytes(&five_bytes.finalize_to_bytes()), + ]); + + payload +} + +/// https://github.com/Uniswap/v3-periphery/blob/6cce88e63e176af1ddb6cc56e029110289622317/contracts/libraries/PoolAddress.sol#L41C80-L41C80 +fn get_pool_key_hash(pool: UniswapV3Pool) -> [u8; 32] { + ethers::utils::keccak256(encode(&[ + Token::Address(pool.token_a), + Token::Address(pool.token_b), + Token::Uint(pool.fee.into()), + ])) +} diff --git a/bot/crates/strategy/src/tx_utils/lil_router_interface.rs b/bot/crates/strategy/src/tx_utils/lil_router_interface.rs new file mode 100644 index 0000000..69ec78c --- /dev/null +++ b/bot/crates/strategy/src/tx_utils/lil_router_interface.rs @@ -0,0 +1,76 @@ +use cfmms::pool::{UniswapV2Pool, UniswapV3Pool}; +use ethers::{abi::parse_abi, prelude::*}; + +use crate::constants::WETH_ADDRESS; + +// Build the data for the lil_router contract's calculateSwapV2 function +pub fn build_swap_v2_data(amount_in: U256, pool: UniswapV2Pool, is_frontrun: bool) -> Bytes { + let lil_router_contract = BaseContract::from(parse_abi(&[ + "function calculateSwapV2(uint amountIn, address targetPair, address inputToken, address outputToken) external returns (uint amountOut, uint realAfterBalance)", + ]).unwrap()); + + let other_token = [pool.token_a, pool.token_b] + .into_iter() + .find(|&t| t != *WETH_ADDRESS) + .unwrap(); + + let (input_token, output_token) = if is_frontrun { + // if frontrun we trade WETH -> TOKEN + (*WETH_ADDRESS, other_token) + } else { + // if backrun we trade TOKEN -> WETH + (other_token, *WETH_ADDRESS) + }; + + lil_router_contract + .encode( + "calculateSwapV2", + (amount_in, pool.address, input_token, output_token), + ) + .unwrap() +} + +// Build the data for the lil_router contract's calculateSwapV3 function +pub fn build_swap_v3_data(amount_in: I256, pool: UniswapV3Pool, is_frontrun: bool) -> Bytes { + let lil_router_contract = BaseContract::from(parse_abi(&[ + "function calculateSwapV3(int amountIn, address targetPoolAddress, address inputToken, address outputToken) public returns (uint amountOut, uint realAfterBalance)", + ]).unwrap()); + + let other_token = [pool.token_a, pool.token_b] + .into_iter() + .find(|&t| t != *WETH_ADDRESS) + .unwrap(); + + let (input_token, output_token) = if is_frontrun { + // if frontrun we trade WETH -> TOKEN + (*WETH_ADDRESS, other_token) + } else { + // if backrun we trade TOKEN -> WETH + (other_token, *WETH_ADDRESS) + }; + + lil_router_contract + .encode( + "calculateSwapV3", + (amount_in, pool.address, input_token, output_token), + ) + .unwrap() +} + +// Decode the result of the lil_router contract's calculateSwapV2 function +pub fn decode_swap_v2_result(output: Bytes) -> Result<(U256, U256), AbiError> { + let lil_router_contract = BaseContract::from(parse_abi(&[ + "function calculateSwapV2(uint amountIn, address targetPair, address inputToken, address outputToken) external returns (uint amountOut, uint realAfterBalance)", + ]).unwrap()); + + lil_router_contract.decode_output("calculateSwapV2", output) +} + +// Decode the result of the lil_router contract's calculateSwapV3 function +pub fn decode_swap_v3_result(output: Bytes) -> Result<(U256, U256), AbiError> { + let lil_router_contract = BaseContract::from(parse_abi(&[ + "function calculateSwapV3(int amountIn, address targetPoolAddress, address inputToken, address outputToken) public returns (uint amountOut, uint realAfterBalance)", + ]).unwrap()); + + lil_router_contract.decode_output("calculateSwapV3", output) +} diff --git a/bot/crates/strategy/src/tx_utils/mod.rs b/bot/crates/strategy/src/tx_utils/mod.rs new file mode 100644 index 0000000..aa1b4b1 --- /dev/null +++ b/bot/crates/strategy/src/tx_utils/mod.rs @@ -0,0 +1,2 @@ +pub(crate) mod huff_sando_interface; +pub(crate) mod lil_router_interface; diff --git a/bot/crates/strategy/src/types.rs b/bot/crates/strategy/src/types.rs new file mode 100644 index 0000000..bedd612 --- /dev/null +++ b/bot/crates/strategy/src/types.rs @@ -0,0 +1,310 @@ +use std::sync::Arc; + +use anyhow::ensure; +use anyhow::{anyhow, Result}; +use artemis_core::{ + collectors::block_collector::NewBlock, executors::flashbots_executor::FlashbotsBundle, +}; +use cfmms::pool::Pool; +use ethers::providers::Middleware; +use ethers::signers::LocalWallet; +use ethers::signers::Signer; +use ethers::types::{ + Address, Block, Bytes, Eip1559TransactionRequest, Transaction, H256, U256, U64, +}; +use ethers_flashbots::BundleRequest; +use foundry_evm::executor::TxEnv; + +use crate::constants::DUST_OVERPAY; +use crate::helpers::access_list_to_ethers; +use crate::helpers::sign_eip1559; + +/// Core Event enum for current strategy +#[derive(Debug, Clone)] +pub enum Event { + NewBlock(NewBlock), + NewTransaction(Transaction), +} + +/// Core Action enum for current strategy +#[derive(Debug, Clone)] +pub enum Action { + SubmitToFlashbots(FlashbotsBundle), +} + +/// Configuration for variables needed for sandwiches +#[derive(Debug, Clone)] +pub struct StratConfig { + pub sando_address: Address, + pub sando_inception_block: U64, + pub searcher_signer: LocalWallet, +} + +/// Information on potential sandwichable opportunity +#[derive(Clone)] +pub struct RawIngredients { + /// Victim tx/s to be used in sandwich + meats: Vec, + /// Which token do start and end sandwich with + start_end_token: Address, + /// Which token do we hold for duration of sandwich + intermediary_token: Address, + /// Which pool are we targetting + target_pool: Pool, +} + +impl RawIngredients { + pub fn new( + meats: Vec, + start_end_token: Address, + intermediary_token: Address, + target_pool: Pool, + ) -> Self { + Self { + meats, + start_end_token, + intermediary_token, + target_pool, + } + } + + pub fn get_start_end_token(&self) -> Address { + self.start_end_token + } + + pub fn get_intermediary_token(&self) -> Address { + self.intermediary_token + } + + pub fn get_meats_ref(&self) -> &Vec { + &self.meats + } + + pub fn get_target_pool(&self) -> Pool { + self.target_pool + } + + // Used for logging + pub fn print_meats(&self) -> String { + let mut s = String::new(); + s.push('['); + for (i, x) in self.meats.iter().enumerate() { + s.push_str(&format!("{:?}", x.hash)); + if i != self.meats.len() - 1 { + s.push_str(","); + } + } + s.push(']'); + s + } +} + +#[derive(Default, Clone, Copy)] +pub struct BlockInfo { + pub number: U64, + pub base_fee_per_gas: U256, + pub timestamp: U256, + // These are optional because we don't know these values for `next_block` + pub gas_used: Option, + pub gas_limit: Option, +} + +impl BlockInfo { + /// Returns block info for next block + pub fn get_next_block(&self) -> BlockInfo { + BlockInfo { + number: self.number + 1, + base_fee_per_gas: calculate_next_block_base_fee(&self), + timestamp: self.timestamp + 12, + gas_used: None, + gas_limit: None, + } + } +} + +impl TryFrom> for BlockInfo { + type Error = anyhow::Error; + + fn try_from(value: Block) -> std::result::Result { + Ok(BlockInfo { + number: value.number.ok_or(anyhow!( + "could not parse block.number when setting up `block_manager`" + ))?, + gas_used: Some(value.gas_used), + gas_limit: Some(value.gas_limit), + base_fee_per_gas: value.base_fee_per_gas.ok_or(anyhow!( + "could not parse base fee when setting up `block_manager`" + ))?, + timestamp: value.timestamp, + }) + } +} + +impl From for BlockInfo { + fn from(value: NewBlock) -> Self { + Self { + number: value.number, + base_fee_per_gas: value.base_fee_per_gas, + timestamp: value.timestamp, + gas_used: Some(value.gas_used), + gas_limit: Some(value.gas_limit), + } + } +} + +/// Calculate the next block base fee +// based on math provided here: https://ethereum.stackexchange.com/questions/107173/how-is-the-base-fee-per-gas-computed-for-a-new-block +fn calculate_next_block_base_fee(block: &BlockInfo) -> U256 { + // Get the block base fee per gas + let current_base_fee_per_gas = block.base_fee_per_gas; + + let current_gas_used = block + .gas_used + .expect("can't calculate base fee from unmined block \"next_block\""); + + let current_gas_target = block + .gas_limit + .expect("can't calculate base fee from unmined block \"next_block\"") + / 2; + + if current_gas_used == current_gas_target { + current_base_fee_per_gas + } else if current_gas_used > current_gas_target { + let gas_used_delta = current_gas_used - current_gas_target; + let base_fee_per_gas_delta = + current_base_fee_per_gas * gas_used_delta / current_gas_target / 8; + + return current_base_fee_per_gas + base_fee_per_gas_delta; + } else { + let gas_used_delta = current_gas_target - current_gas_used; + let base_fee_per_gas_delta = + current_base_fee_per_gas * gas_used_delta / current_gas_target / 8; + + return current_base_fee_per_gas - base_fee_per_gas_delta; + } +} + +/// All details for capturing a sando opp +pub struct SandoRecipe { + frontrun: TxEnv, + frontrun_gas_used: u64, + meats: Vec, + backrun: TxEnv, + backrun_gas_used: u64, + revenue: U256, + target_block: BlockInfo, +} + +impl SandoRecipe { + pub fn new( + frontrun: TxEnv, + frontrun_gas_used: u64, + meats: Vec, + backrun: TxEnv, + backrun_gas_used: u64, + revenue: U256, + target_block: BlockInfo, + ) -> Self { + Self { + frontrun, + frontrun_gas_used, + meats, + backrun, + backrun_gas_used, + revenue, + target_block, + } + } + + pub fn get_revenue(&self) -> U256 { + self.revenue + } + + /// turn recipe into a signed bundle that can be sumbitted to flashbots + pub async fn to_fb_bundle( + self, + sando_address: Address, + searcher: &LocalWallet, + has_dust: bool, + provider: Arc, + ) -> Result { + let nonce = provider + .get_transaction_count(searcher.address(), Some(self.target_block.number.into())) + .await + .map_err(|e| anyhow!("FAILED TO CREATE BUNDLE: Failed to get nonce {:?}", e))?; + + let frontrun_tx = Eip1559TransactionRequest { + to: Some(sando_address.into()), + gas: Some((U256::from(self.frontrun_gas_used) * 10) / 7), + value: Some(self.frontrun.value.into()), + data: Some(self.frontrun.data.into()), + nonce: Some(nonce), + access_list: access_list_to_ethers(self.frontrun.access_list), + max_fee_per_gas: Some(self.target_block.base_fee_per_gas.into()), + ..Default::default() + }; + let signed_frontrun = sign_eip1559(frontrun_tx, &searcher).await?; + + let signed_meat_txs: Vec = self.meats.into_iter().map(|meat| meat.rlp()).collect(); + + // calc bribe (bribes paid in backrun) + let revenue_minus_frontrun_tx_fee = self + .revenue + .checked_sub(U256::from(self.frontrun_gas_used) * self.target_block.base_fee_per_gas) + .ok_or_else(|| { + anyhow!("[FAILED TO CREATE BUNDLE] revenue doesn't cover frontrun basefee") + })?; + + // eat a loss (overpay) to get dust onto the sando contract (more: https://twitter.com/libevm/status/1474870661373779969) + let bribe_amount = if !has_dust { + revenue_minus_frontrun_tx_fee + *DUST_OVERPAY + } else { + // bribe away 99.9999999% of revenue lmeow + revenue_minus_frontrun_tx_fee * 999999999 / 1000000000 + }; + + let max_fee = bribe_amount / self.backrun_gas_used; + + ensure!( + max_fee >= self.target_block.base_fee_per_gas, + "[FAILED TO CREATE BUNDLE] backrun maxfee less than basefee" + ); + + let effective_miner_tip = max_fee.checked_sub(self.target_block.base_fee_per_gas); + + ensure!( + effective_miner_tip.is_none(), + "[FAILED TO CREATE BUNDLE] negative miner tip" + ); + + let backrun_tx = Eip1559TransactionRequest { + to: Some(sando_address.into()), + gas: Some((U256::from(self.backrun_gas_used) * 10) / 7), + value: Some(self.backrun.value.into()), + data: Some(self.backrun.data.into()), + nonce: Some(nonce), + access_list: access_list_to_ethers(self.backrun.access_list), + max_priority_fee_per_gas: Some(max_fee), + max_fee_per_gas: Some(max_fee), + ..Default::default() + }; + let signed_backrun = sign_eip1559(backrun_tx, &searcher).await?; + + // construct bundle + let mut bundled_transactions: Vec = vec![signed_frontrun]; + bundled_transactions.append(&mut signed_meat_txs.clone()); + bundled_transactions.push(signed_backrun); + + let mut bundle_request = BundleRequest::new(); + for tx in bundled_transactions { + bundle_request = bundle_request.push_transaction(tx); + } + + bundle_request = bundle_request + .set_block(self.target_block.number) + .set_simulation_block(self.target_block.number - 1) + .set_simulation_timestamp(self.target_block.timestamp.as_u64()); + + Ok(bundle_request) + } +} diff --git a/bot/crates/strategy/tests/main.rs b/bot/crates/strategy/tests/main.rs new file mode 100644 index 0000000..43a48b8 --- /dev/null +++ b/bot/crates/strategy/tests/main.rs @@ -0,0 +1,192 @@ +use std::{str::FromStr, sync::Arc}; + +use cfmms::pool::{Pool, UniswapV2Pool, UniswapV3Pool}; +use ethers::{ + prelude::Lazy, + providers::{Middleware, Provider, Ws}, + types::{Address, Transaction, TxHash, U64}, +}; +use strategy::{ + bot::SandoBot, + types::{BlockInfo, RawIngredients, StratConfig}, +}; + +// -- consts -- +static WSS_RPC: &str = "ws://localhost:8545"; +pub static WETH_ADDRESS: Lazy
= Lazy::new(|| { + "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" + .parse() + .unwrap() +}); + +// -- utils -- +fn setup_logger() { + let _ = fern::Dispatch::new() + .level(log::LevelFilter::Error) + .level_for("strategy", log::LevelFilter::Info) + .chain(std::io::stdout()) + .apply(); +} + +async fn setup_bot(provider: Arc>) -> SandoBot> { + setup_logger(); + + let strat_config = StratConfig { + sando_address: "0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa" + .parse() + .unwrap(), + sando_inception_block: U64::from(17700000), + searcher_signer: "0x0000000000000000000000000000000000000000000000000000000000000001" + .parse() + .unwrap(), + }; + + SandoBot::new(provider, strat_config) +} + +async fn block_num_to_info(block_num: u64, provider: Arc>) -> BlockInfo { + let block = provider.get_block(block_num).await.unwrap().unwrap(); + block.try_into().unwrap() +} + +fn hex_to_address(hex: &str) -> Address { + hex.parse().unwrap() +} + +async fn hex_to_univ2_pool(hex: &str, provider: Arc>) -> Pool { + let pair_address = hex_to_address(hex); + let pool = UniswapV2Pool::new_from_address(pair_address, provider) + .await + .unwrap(); + Pool::UniswapV2(pool) +} + +async fn hex_to_univ3_pool(hex: &str, provider: Arc>) -> Pool { + let pair_address = hex_to_address(hex); + let pool = UniswapV3Pool::new_from_address(pair_address, provider) + .await + .unwrap(); + Pool::UniswapV3(pool) +} + +async fn victim_tx_hash(tx: &str, provider: Arc>) -> Transaction { + let tx_hash: TxHash = TxHash::from_str(tx).unwrap(); + provider.get_transaction(tx_hash).await.unwrap().unwrap() +} + +/// testing against: https://eigenphi.io/mev/ethereum/tx/0x292156c07794bc50952673bf948b90ab71148b81938b6ab4904096adb654d99a +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn can_sandwich_uni_v2() { + let client = Arc::new(Provider::new(Ws::connect(WSS_RPC).await.unwrap())); + + let bot = setup_bot(client.clone()).await; + + let ingredients = RawIngredients::new( + vec![ + victim_tx_hash( + "0xfecf2c78d1418e6905c18a6a6301c9d39b14e5320e345adce52baaecf805580d", + client.clone(), + ) + .await, + ], + *WETH_ADDRESS, + hex_to_address("0x3642Cf76c5894B4aB51c1080B2c4F5B9eA734106"), + hex_to_univ2_pool("0x5d1dd0661E1D22697943C1F50Cc726eA3143329b", client.clone()).await, + ); + + let target_block = block_num_to_info(17754167, client.clone()).await; + + let _ = bot + .is_sandwichable(ingredients, target_block) + .await + .unwrap(); +} + +/// testing against: https://eigenphi.io/mev/ethereum/tx/0x056ede919e31be59b7e1e8676b3be1272ce2bbd3d18f42317a26a3d1f2951fc8 +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn can_sandwich_sushi_swap() { + let client = Arc::new(Provider::new(Ws::connect(WSS_RPC).await.unwrap())); + + let bot = setup_bot(client.clone()).await; + + let ingredients = RawIngredients::new( + vec![ + victim_tx_hash( + "0xb344fdc6a3b7c65c5dd971cb113567e2ee6d0636f261c3b8d624627b90694cdb", + client.clone(), + ) + .await, + ], + *WETH_ADDRESS, + hex_to_address("0x3b484b82567a09e2588A13D54D032153f0c0aEe0"), + hex_to_univ2_pool("0xB84C45174Bfc6b8F3EaeCBae11deE63114f5c1b2", client.clone()).await, + ); + + let target_block = block_num_to_info(16873148, client.clone()).await; + + let _ = bot + .is_sandwichable(ingredients, target_block) + .await + .unwrap(); +} + +/// testing against: https://eigenphi.io/mev/ethereum/tx/0xc132e351e8c7d3d8763a894512bd8a33e4ca60f56c0516f7a6cafd3128bd59bb +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn can_sandwich_multi_v2_swaps() { + let client = Arc::new(Provider::new(Ws::connect(WSS_RPC).await.unwrap())); + + let bot = setup_bot(client.clone()).await; + + let ingredients = RawIngredients::new( + vec![ + victim_tx_hash( + "0x4791d05bdd6765f036ff4ae44fc27099997417e3bdb053ecb52182bbfc7767c5", + client.clone(), + ) + .await, + victim_tx_hash( + "0x923c9ba97fea8d72e60c14d1cc360a8e7d99dd4b31274928d6a79704a8546eda", + client.clone(), + ) + .await, + ], + *WETH_ADDRESS, + hex_to_address("0x31b16Ff7823096a227Aac78F1C094525A84ab64F"), + hex_to_univ2_pool("0x657c6a08d49B4F0778f9cce1Dc49d196cFCe9d08", client.clone()).await, + ); + + let target_block = block_num_to_info(16780625, client.clone()).await; + + let _ = bot + .is_sandwichable(ingredients, target_block) + .await + .unwrap(); +} + +/// testing against: https://eigenphi.io/mev/ethereum/tx/0x64158690880d053adc2c42fbadd1838bc6d726cb81982443be00f83b51d8c25d +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn can_sandwich_uni_v3() { + let client = Arc::new(Provider::new(Ws::connect(WSS_RPC).await.unwrap())); + + let bot = setup_bot(client.clone()).await; + + let ingredients = RawIngredients::new( + vec![ + victim_tx_hash( + "0x90dfe56814821e7f76f2e4970a7b35948670a968abffebb7be69fe528283e6d8", + client.clone(), + ) + .await, + ], + *WETH_ADDRESS, + hex_to_address("0x24C19F7101c1731b85F1127EaA0407732E36EcDD"), + hex_to_univ3_pool("0x62CBac19051b130746Ec4CF96113aF5618F3A212", client.clone()).await, + ); + + let target_block = block_num_to_info(16863225, client.clone()).await; + + let _ = bot + .is_sandwichable(ingredients, target_block) + .await + .unwrap(); +} diff --git a/bot/sando-bin/Cargo.toml b/bot/sando-bin/Cargo.toml new file mode 100644 index 0000000..5200c9e --- /dev/null +++ b/bot/sando-bin/Cargo.toml @@ -0,0 +1,41 @@ +[package] +name = "rusty-sando" +version = "0.1.0" +edition = "2021" +license = "MIT" +description = "Optimized sandwich bot written using Rust and Huff" +readme = "README.md" +homepage = "https://github.com/mouseless-eth/rusty-sando" +repository = "https://github.com/mouseless-eth/rusty-sando" +keywords = ["Ethereum", "Mev", "Dex", "Sandwich"] +authors = ["0xmouseless "] + +[dependencies] +dotenv = "0.15.0" +hashbrown = "0.14.0" +tokio = { version = "1.29.0", features = ["full"] } +log = "0.4.17" +url = "2.3.1" +dashmap = "5.4.0" +hex = "0.4.3" +serde = "1.0.145" +anyhow = "1.0.71" +reqwest = "0.11.12" +thiserror = "1.0.37" +futures = "0.3.5" + +# EVM based crates +cfmms = "0.6.2" +ethers-flashbots = { git = "https://github.com/onbjerg/ethers-flashbots" } +ethers = {version = "2.0.7", features = ["abigen", "ws"]} +revm = "3.3.0" + +# logging +indoc = "2" +fern = {version = "0.6.2", features = ["colored"]} +chrono = "0.4.23" +colored = "2.0.0" + +# artemis related +artemis-core = { path = "../crates/artemis-core"} +strategy = { path = "../crates/strategy" } diff --git a/bot/sando-bin/src/config.rs b/bot/sando-bin/src/config.rs new file mode 100644 index 0000000..2a25752 --- /dev/null +++ b/bot/sando-bin/src/config.rs @@ -0,0 +1,59 @@ +use dotenv::dotenv; +use reqwest::Url; +use std::{env, str::FromStr}; + +use anyhow::{anyhow, Result}; +use ethers::{ + signers::LocalWallet, + types::{Address, U64}, +}; + +pub struct Config { + pub searcher_signer: LocalWallet, + pub sando_inception_block: U64, + pub sando_address: Address, + pub bundle_signer: LocalWallet, + pub wss_rpc: Url, + pub discord_webhook: String, +} + +impl Config { + pub async fn read_from_dotenv() -> Result { + dotenv().ok(); + + let get_env = |var| { + env::var(var).map_err(|_| anyhow!("Required environment variable \"{}\" not set", var)) + }; + + let searcher_signer = get_env("SEARCHER_PRIVATE_KEY")? + .parse::() + .map_err(|_| anyhow!("Failed to parse \"SEARCHER_PRIVATE_KEY\""))?; + + let sando_inception_block = get_env("SANDWICH_INCEPTION_BLOCK")? + .parse::() + .map(U64::from) + .map_err(|_| anyhow!("Failed to parse \"SANDWICH_INCEPTION_BLOCK\" into u64"))?; + + let sando_address = Address::from_str(&get_env("SANDWICH_CONTRACT")?) + .map_err(|_| anyhow!("Failed to parse \"SANDWICH_CONTRACT\""))?; + + let bundle_signer = get_env("FLASHBOTS_AUTH_KEY")? + .parse::() + .map_err(|_| anyhow!("Failed to parse \"FLASHBOTS_AUTH_KEY\""))?; + + let wss_rpc = get_env("WSS_RPC")? + .parse() + .map_err(|_| anyhow!("Failed to parse \"WSS_RPC\""))?; + + let discord_webhook = get_env("DISCORD_WEBHOOK")?; + + Ok(Self { + searcher_signer, + sando_inception_block, + sando_address, + bundle_signer, + wss_rpc, + discord_webhook, + }) + } +} diff --git a/bot/sando-bin/src/initialization.rs b/bot/sando-bin/src/initialization.rs new file mode 100644 index 0000000..0372c4b --- /dev/null +++ b/bot/sando-bin/src/initialization.rs @@ -0,0 +1,57 @@ +use anyhow::Result; +use colored::Colorize; +use fern::colors::{Color, ColoredLevelConfig}; +use indoc::indoc; +use log::LevelFilter; + +pub fn print_banner() { + let banner = indoc! { +r#" + + _____ ___ _ _ ______ _____ ______ _____ +/ ___| / _ \ | \ | || _ \| _ | | ___ \/ ___| +\ `--. / /_\ \| \| || | | || | | | ______ | |_/ /\ `--. + `--. \| _ || . ` || | | || | | ||______|| / `--. \ +/\__/ /| | | || |\ || |/ / \ \_/ / | |\ \ /\__/ / +\____/ \_| |_/\_| \_/|___/ \___/ \_| \_|\____/ + +______ __ __ _____ ___ ___ _____ _ _ _____ _____ _ _____ _____ _____ +| ___ \\ \ / / _ | _ | | \/ || _ || | | |/ ___|| ___|| | | ___|/ ___|/ ___| +| |_/ / \ V / (_) | |/' |__ __| . . || | | || | | |\ `--. | |__ | | | |__ \ `--. \ `--. +| ___ \ \ / | /| |\ \/ /| |\/| || | | || | | | `--. \| __| | | | __| `--. \ `--. \ +| |_/ / | | _ \ |_/ / > < | | | |\ \_/ /| |_| |/\__/ /| |___ | |____| |___ /\__/ //\__/ / +\____/ \_/ (_) \___/ /_/\_\\_| |_/ \___/ \___/ \____/ \____/ \_____/\____/ \____/ \____/ +"#}; + + log::info!("{}", format!("{}", banner.green().bold())); +} + +pub fn setup_logger() -> Result<()> { + let colors = ColoredLevelConfig { + trace: Color::Cyan, + debug: Color::Magenta, + info: Color::Green, + warn: Color::Red, + error: Color::BrightRed, + ..ColoredLevelConfig::new() + }; + + fern::Dispatch::new() + .format(move |out, message, record| { + out.finish(format_args!( + "{}[{}] {}", + chrono::Local::now().format("[%H:%M:%S]"), + colors.color(record.level()), + message + )) + }) + .chain(std::io::stdout()) + .chain(fern::log_file("output.log")?) + .level(log::LevelFilter::Error) + .level_for("rusty_sando", LevelFilter::Info) + .level_for("strategy", LevelFilter::Info) + .level_for("artemis_core", LevelFilter::Info) + .apply()?; + + Ok(()) +} diff --git a/bot/sando-bin/src/lib.rs b/bot/sando-bin/src/lib.rs new file mode 100644 index 0000000..789b0cc --- /dev/null +++ b/bot/sando-bin/src/lib.rs @@ -0,0 +1,2 @@ +pub mod config; +pub mod initialization; diff --git a/bot/sando-bin/src/main.rs b/bot/sando-bin/src/main.rs new file mode 100644 index 0000000..9c77bd8 --- /dev/null +++ b/bot/sando-bin/src/main.rs @@ -0,0 +1,78 @@ +use std::sync::Arc; + +use anyhow::Result; +use artemis_core::{ + collectors::{block_collector::BlockCollector, mempool_collector::MempoolCollector}, + engine::Engine, + executors::flashbots_executor::FlashbotsExecutor, + types::{CollectorMap, ExecutorMap}, +}; +use ethers::providers::{Provider, Ws}; +use log::info; +use reqwest::Url; +use rusty_sando::{ + config::Config, + initialization::{print_banner, setup_logger}, +}; +use strategy::{ + bot::SandoBot, + types::{Action, Event, StratConfig}, +}; + +#[tokio::main] +async fn main() -> Result<()> { + // Setup + setup_logger()?; + print_banner(); + let config = Config::read_from_dotenv().await?; + + // Setup ethers provider + let ws = Ws::connect(config.wss_rpc).await?; + let provider = Arc::new(Provider::new(ws)); + + // Setup signers + let flashbots_signer = config.bundle_signer; + let searcher_signer = config.searcher_signer; + + // Create engine + let mut engine: Engine = Engine::default(); + + // Setup block collector + let block_collector = Box::new(BlockCollector::new(provider.clone())); + let block_collector = CollectorMap::new(block_collector, Event::NewBlock); + engine.add_collector(Box::new(block_collector)); + + // Setup mempool collector + let mempool_collector = Box::new(MempoolCollector::new(provider.clone())); + let mempool_collector = CollectorMap::new(mempool_collector, Event::NewTransaction); + engine.add_collector(Box::new(mempool_collector)); + + // Setup strategy + let configs = StratConfig { + sando_address: config.sando_address, + sando_inception_block: config.sando_inception_block, + searcher_signer, + }; + let strategy = SandoBot::new(provider.clone(), configs); + engine.add_strategy(Box::new(strategy)); + + // Setup flashbots executor + let executor = Box::new(FlashbotsExecutor::new( + provider.clone(), + flashbots_signer, + Url::parse("https://relay.flashbots.net")?, + )); + let executor = ExecutorMap::new(executor, |action| match action { + Action::SubmitToFlashbots(bundle) => Some(bundle), + }); + engine.add_executor(Box::new(executor)); + + // Start engine + if let Ok(mut set) = engine.run().await { + while let Some(res) = set.join_next().await { + info!("res: {:?}", res) + } + } + + Ok(()) +} diff --git a/bot/src/abi/IBrainDance.abi b/bot/src/abi/IBrainDance.abi deleted file mode 100644 index d8bb5da..0000000 --- a/bot/src/abi/IBrainDance.abi +++ /dev/null @@ -1,159 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "uint256", - "name": "swapIn", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "swapOut", - "type": "uint256" - }, - { - "internalType": "address", - "name": "targetPair", - "type": "address" - }, - { - "internalType": "address", - "name": "inputToken", - "type": "address" - }, - { - "internalType": "address", - "name": "outputToken", - "type": "address" - } - ], - "name": "calculateExactSwapV2", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amountIn", - "type": "int256" - }, - { - "internalType": "int256", - "name": "amountOut", - "type": "int256" - }, - { - "internalType": "address", - "name": "targetPoolAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "inputToken", - "type": "address" - }, - { - "internalType": "address", - "name": "outputToken", - "type": "address" - } - ], - "name": "calculateExactSwapV3", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amountIn", - "type": "uint256" - }, - { - "internalType": "address", - "name": "targetPair", - "type": "address" - }, - { - "internalType": "address", - "name": "inputToken", - "type": "address" - }, - { - "internalType": "address", - "name": "outputToken", - "type": "address" - } - ], - "name": "calculateSwapV2", - "outputs": [ - { - "internalType": "uint256", - "name": "amountOut", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amountIn", - "type": "int256" - }, - { - "internalType": "address", - "name": "targetPoolAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "inputToken", - "type": "address" - }, - { - "internalType": "address", - "name": "outputToken", - "type": "address" - } - ], - "name": "calculateSwapV3", - "outputs": [ - { - "internalType": "uint256", - "name": "amountOut", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amount0Delta", - "type": "int256" - }, - { - "internalType": "int256", - "name": "amount1Delta", - "type": "int256" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "uniswapV3SwapCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/bot/src/cfmm/dex.rs b/bot/src/cfmm/dex.rs deleted file mode 100644 index be94e21..0000000 --- a/bot/src/cfmm/dex.rs +++ /dev/null @@ -1,224 +0,0 @@ -// credit to 0xKitsune's cfmms-rs: https://github.com/0xKitsune/cfmms-rs/tree/main/src/dex -use std::sync::Arc; - -use ethers::prelude::*; -use eyre::Result; -use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; - -use crate::{ - prelude::{Pool, PoolVariant, UniswapV2Factory, UniswapV3Factory}, - types::PairSyncError, - utils, -}; - -#[derive(Clone, Copy)] -pub struct Dex { - pub factory_address: Address, - pub pool_variant: PoolVariant, - pub creation_block: BlockNumber, -} - -impl Dex { - // Creates a new dex instance - pub fn new(factory_address: H160, pool_variant: PoolVariant, creation_block: u64) -> Dex { - Dex { - factory_address, - pool_variant, - creation_block: BlockNumber::Number(creation_block.into()), - } - } - - // Parse logs and extract pools - pub fn new_pool_from_event(&self, log: Log, provider: Arc>) -> Option { - match self.pool_variant { - PoolVariant::UniswapV2 => { - let uniswap_v2_factory = UniswapV2Factory::new(self.factory_address, provider); - let (token_0, token_1, address, _) = if let Ok(pair) = uniswap_v2_factory - .decode_event::<(Address, Address, Address, U256)>( - "PairCreated", - log.topics, - log.data, - ) { - pair - } else { - return None; - }; - - // ignore pool does not have weth as one of its tokens - if ![token_0, token_1].contains(&utils::constants::get_weth_address()) { - return None; - } - - Some(Pool::new( - address, - token_0, - token_1, - U256::from(3000), - PoolVariant::UniswapV2, - )) - } - PoolVariant::UniswapV3 => { - let uniswap_v3_factory = UniswapV3Factory::new(self.factory_address, provider); - - let (token_0, token_1, fee, _, address) = if let Ok(pool) = uniswap_v3_factory - .decode_event::<(Address, Address, u32, u128, Address)>( - "PoolCreated", - log.topics, - log.data, - ) { - pool - } else { - return None; - }; - - // ignore pair does not have weth as one of its tokens - if ![token_0, token_1].contains(&utils::constants::get_weth_address()) { - return None; - } - - Some(Pool::new( - address, - token_0, - token_1, - U256::from(fee), - PoolVariant::UniswapV3, - )) - } - } - } -} - -// get all pairs for a given dex between `start_block` and `current_block` -pub async fn sync_dex( - dexes: Vec, - client: &Arc>, - current_block: U64, - start_block: Option, -) -> Result, PairSyncError> { - // initialize multi progress bar - let multi_progress_bar = MultiProgress::new(); - - let mut handles = vec![]; - - // for each dex supplied, get all pair created events - for dex in dexes { - let async_provider = client.clone(); - let progress_bar = multi_progress_bar.add(ProgressBar::new(0)); - - handles.push(tokio::spawn(async move { - progress_bar.set_style( - ProgressStyle::with_template("{msg} {bar:40.green/grey} {pos:>7}/{len:7} Blocks") - .unwrap() - .progress_chars("##-"), - ); - - let pools = get_all_pools( - dex, - async_provider.clone(), - BlockNumber::Number(current_block), - start_block, - progress_bar.clone(), - ) - .await?; - - progress_bar.reset(); - progress_bar.set_style( - ProgressStyle::with_template("{msg} {bar:40.green/grey} {pos:>7}/{len:7} Pairs") - .unwrap() - .progress_chars("##-"), - ); - - Ok::, PairSyncError>(pools) - })); - } - - // aggregate the populated pools from each thread - let mut aggregated_pools: Vec = vec![]; - - for handle in handles { - match handle.await { - Ok(sync_result) => aggregated_pools.extend(sync_result?), - Err(join_error) => return Err(PairSyncError::JoinError(join_error)), - } - } - - // return the populated aggregated pools vec - Ok(aggregated_pools) -} - -/// function to get all pair created events for a given Dex factory address -async fn get_all_pools( - dex: Dex, - provider: Arc>, - current_block: BlockNumber, - start_block: Option, - progress_bar: ProgressBar, -) -> Result, PairSyncError> { - // define the step for searching a range of blocks for pair created events - let step = 100000; - - // get start block - let creation_block = if let Some(block) = start_block { - block.as_number().unwrap().as_u64() - } else { - dex.creation_block.as_number().unwrap().as_u64() - }; - - let current_block = current_block.as_number().unwrap().as_u64(); - - // initialize the progress bar message - progress_bar.set_length(current_block - creation_block); - progress_bar.set_message(format!("Getting all pools from: {}", dex.factory_address)); - - // init a new vec to keep track of tasks - let mut handles = vec![]; - - // for each block within the range, get all pairs asynchronously - for from_block in (creation_block..=current_block).step_by(step) { - let provider = provider.clone(); - let progress_bar = progress_bar.clone(); - - //Spawn a new task to get pair created events from the block range - handles.push(tokio::spawn(async move { - let mut pools = vec![]; - - //Get pair created event logs within the block range - let to_block = from_block + step as u64; - - let logs = provider - .get_logs( - &Filter::new() - .topic0(ValueOrArray::Value( - dex.pool_variant.pool_created_event_signature(), - )) - .address(dex.factory_address) - .from_block(BlockNumber::Number(U64([from_block]))) - .to_block(BlockNumber::Number(U64([to_block]))), - ) - .await?; - - // increment the progres bar by the step - progress_bar.inc(step as u64); - - // for each pair created log, create a new Pair type and add it to the pairs vec - for log in logs { - match dex.new_pool_from_event(log, provider.clone()) { - Some(pool) => pools.push(pool), - None => continue, - } - } - - Ok::, ProviderError>(pools) - })); - } - - // wait for each thread to finish and aggregate the pairs from each Dex into a single aggregated pairs vec - let mut aggregated_pairs: Vec = vec![]; - for handle in handles { - match handle.await { - Ok(sync_result) => aggregated_pairs.extend(sync_result?), - Err(join_error) => return Err(PairSyncError::JoinError(join_error)), - } - } - Ok(aggregated_pairs) -} diff --git a/bot/src/cfmm/mod.rs b/bot/src/cfmm/mod.rs deleted file mode 100644 index b448015..0000000 --- a/bot/src/cfmm/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub mod dex; -pub use dex::*; - -pub mod pool; -pub use pool::*; diff --git a/bot/src/cfmm/pool.rs b/bot/src/cfmm/pool.rs deleted file mode 100644 index 50e5720..0000000 --- a/bot/src/cfmm/pool.rs +++ /dev/null @@ -1,68 +0,0 @@ -// credit to 0xKitsune's cfmms-rs: https://github.com/0xKitsune/cfmms-rs/tree/main/src/pool -use std::{ - hash::{Hash, Hasher}, - str::FromStr, -}; - -use ethers::prelude::*; - -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub struct Pool { - pub address: Address, - pub token_0: Address, - pub token_1: Address, - pub swap_fee: U256, - pub pool_variant: PoolVariant, -} - -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PoolVariant { - UniswapV2, - UniswapV3, -} - -impl Pool { - // Creates a new pool instance - pub fn new( - address: Address, - token_a: Address, - token_b: Address, - swap_fee: U256, - pool_variant: PoolVariant, - ) -> Pool { - let (token_0, token_1) = if token_a < token_b { - (token_a, token_b) - } else { - (token_b, token_a) - }; - - Pool { - address, - token_0, - token_1, - swap_fee, - pool_variant, - } - } -} - -impl PoolVariant { - pub fn pool_created_event_signature(&self) -> H256 { - match self { - PoolVariant::UniswapV2 => { - H256::from_str("0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9") - .unwrap() - } - PoolVariant::UniswapV3 => { - H256::from_str("0x783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b7118") - .unwrap() - } - } - } -} - -impl Hash for Pool { - fn hash(&self, state: &mut H) { - self.address.hash(state); - } -} diff --git a/bot/src/forked_db/database_error.rs b/bot/src/forked_db/database_error.rs deleted file mode 100644 index da1c406..0000000 --- a/bot/src/forked_db/database_error.rs +++ /dev/null @@ -1,43 +0,0 @@ -use futures::channel::mpsc::{SendError, TrySendError}; -use std::sync::{mpsc::RecvError, Arc}; - -// Errors that can happen when working with [`revm::Database`] -#[derive(Debug, thiserror::Error)] -pub enum DatabaseError { - #[error("Failed to fetch AccountInfo {0:?}")] - MissingAccount(revm::primitives::B160), - #[error("Could should already be loaded: {0:?}")] - MissingCode(revm::primitives::B256), - #[error(transparent)] - Recv(#[from] RecvError), - #[error(transparent)] - Send(#[from] SendError), - #[error("{0}")] - Message(String), - #[error("Failed to get account for {0:?}: {0:?}")] - GetAccount(revm::primitives::Address, Arc), - #[error("Failed to get storage for {0:?} at {1:?}: {2:?}")] - GetStorage( - revm::primitives::Address, - revm::primitives::U256, - Arc, - ), - #[error("Failed to get block hash for {0}: {1:?}")] - GetBlockHash(revm::primitives::U256, Arc), -} - -impl From> for DatabaseError { - fn from(err: TrySendError) -> Self { - err.into_send_error().into() - } -} - -impl DatabaseError { - // Create a new error with a message - pub fn msg(msg: impl Into) -> Self { - DatabaseError::Message(msg.into()) - } -} - -// Result alias with `DatabaseError` as error -pub type DatabaseResult = Result; diff --git a/bot/src/forked_db/fork_db.rs b/bot/src/forked_db/fork_db.rs deleted file mode 100644 index c58e1e7..0000000 --- a/bot/src/forked_db/fork_db.rs +++ /dev/null @@ -1,205 +0,0 @@ -use std::sync::mpsc::channel as oneshot_channel; - -use futures::channel::mpsc::Sender; -use revm::{ - db::{CacheDB, DatabaseRef, EmptyDB}, - primitives::{ - Account, AccountInfo, Address as rAddress, Bytecode as rBytecode, HashMap as rHashMap, - B160, B256, KECCAK_EMPTY, U256 as rU256, - }, - Database, DatabaseCommit, -}; - -use super::{ - database_error::{DatabaseError, DatabaseResult}, - BackendFetchRequest, -}; - -#[derive(Clone, Debug)] -pub struct ForkDB { - // used to make calls for missing data - backend: Sender, - db: CacheDB, -} - -impl ForkDB { - pub fn new(backend: Sender, db: CacheDB) -> Self { - Self { backend, db } - } - - fn do_get_basic(&self, address: rAddress) -> DatabaseResult> { - tokio::task::block_in_place(|| { - let (sender, rx) = oneshot_channel(); - let req = BackendFetchRequest::Basic(address, sender); - self.backend.clone().try_send(req)?; - rx.recv()?.map(Some) - }) - } - - fn do_get_storage(&self, address: rAddress, index: rU256) -> DatabaseResult { - tokio::task::block_in_place(|| { - let (sender, rx) = oneshot_channel(); - let req = BackendFetchRequest::Storage(address, index, sender); - self.backend.clone().try_send(req)?; - rx.recv()? - }) - } - - fn do_get_block_hash(&self, number: rU256) -> DatabaseResult { - tokio::task::block_in_place(|| { - let (sender, rx) = oneshot_channel(); - let req = BackendFetchRequest::BlockHash(number, sender); - self.backend.clone().try_send(req)?; - rx.recv()? - }) - } -} - -impl Database for ForkDB { - type Error = DatabaseError; - - fn basic(&mut self, address: B160) -> Result, Self::Error> { - // found locally, return it - match self.db.accounts.get(&address) { - // basic info is already in db - Some(account) => Ok(Some(account.info.clone())), - None => { - // basic info is not in db, make rpc call to fetch it - let info = match self.do_get_basic(address) { - Ok(i) => i, - Err(e) => return Err(e), - }; - - // keep record of fetched acc basic info - if info.is_some() { - self.db.insert_account_info(address, info.clone().unwrap()); - } - - Ok(info) - } - } - } - - fn storage(&mut self, address: B160, index: rU256) -> Result { - // found locally, return it - if let Some(account) = self.db.accounts.get(&address) { - if let Some(entry) = account.storage.get(&index) { - // account storage exists at slot - return Ok(*entry); - } - } - - // get account info - let acc_info = match self.do_get_basic(address) { - Ok(a) => a, - Err(e) => return Err(e), - }; - - if let Some(a) = acc_info { - self.db.insert_account_info(address, a); - } - - // make rpc call to fetch storage - let storage_val = match self.do_get_storage(address, index) { - Ok(i) => i, - Err(e) => return Err(e), - }; - - // keep record of fetched storage (can unwrap safely as cacheDB always returns true) - self.db - .insert_account_storage(address, index, storage_val) - .unwrap(); - - Ok(storage_val) - } - - fn block_hash(&mut self, number: rU256) -> Result { - match self.db.block_hashes.get(&number) { - // found locally, return it - Some(hash) => Ok(*hash), - None => { - // rpc call to fetch block hash - let block_hash = match self.do_get_block_hash(number) { - Ok(i) => i, - Err(e) => return Err(e), - }; - - // insert fetched block hash into db - self.db.block_hashes.insert(number, block_hash); - - Ok(block_hash) - } - } - } - - /// Get account code by its hash - fn code_by_hash(&mut self, code_hash: B256) -> Result { - match self.db.code_by_hash(code_hash) { - Ok(code) => Ok(code), - Err(_) => { - // should alr be loaded - Err(DatabaseError::MissingCode(code_hash)) - } - } - } -} - -impl DatabaseRef for ForkDB { - type Error = DatabaseError; - - fn basic(&self, address: B160) -> Result, Self::Error> { - match self.db.accounts.get(&address) { - Some(account) => Ok(Some(account.info.clone())), - None => { - // state doesnt exist so fetch it - self.do_get_basic(address) - } - } - } - - fn storage(&self, address: B160, index: rU256) -> Result { - match self.db.accounts.get(&address) { - Some(account) => match account.storage.get(&index) { - Some(entry) => Ok(*entry), - None => { - // state doesnt exist so fetch it - match self.do_get_storage(address, index) { - Ok(storage) => Ok(storage), - Err(e) => Err(e), - } - } - }, - None => { - // state doesnt exist so fetch it - match self.do_get_storage(address, index) { - Ok(storage) => Ok(storage), - Err(e) => Err(e), - } - } - } - } - - fn block_hash(&self, number: rU256) -> Result { - if number > rU256::from(u64::MAX) { - return Ok(KECCAK_EMPTY); - } - self.do_get_block_hash(number) - } - - /// Get account code by its hash - fn code_by_hash(&self, code_hash: B256) -> Result { - match self.db.code_by_hash(code_hash) { - Ok(code) => Ok(code), - Err(_) => { - // should alr be loaded - Err(DatabaseError::MissingCode(code_hash)) - } - } - } -} - -impl DatabaseCommit for ForkDB { - fn commit(&mut self, changes: rHashMap) { - self.db.commit(changes) - } -} diff --git a/bot/src/forked_db/fork_factory.rs b/bot/src/forked_db/fork_factory.rs deleted file mode 100644 index 2c83188..0000000 --- a/bot/src/forked_db/fork_factory.rs +++ /dev/null @@ -1,122 +0,0 @@ -use std::sync::mpsc::channel as oneshot_channel; -use std::sync::Arc; - -use super::{ - database_error::DatabaseResult, - fork_db::ForkDB, - global_backend::{BackendFetchRequest, GlobalBackend}, -}; -use ethers::prelude::*; -use ethers::types::BlockId; -use futures::channel::mpsc::{channel, Sender}; -use revm::{ - db::{CacheDB, EmptyDB}, - primitives::{AccountInfo, Address as rAddress, U256 as rU256}, -}; - -/// Type that setups up backend and clients to talk to backend -/// each client is an own evm instance but we cache request results -/// to avoid excessive rpc calls -#[derive(Clone)] -pub struct ForkFactory { - backend: Sender, - initial_db: CacheDB, -} - -impl ForkFactory { - // Create a new `ForkFactory` instance - // - // Arguments: - // * `provider`: Websocket client used for fetching missing state - // * `initial_db`: Database with initial state - // * `fork_block`: Block to fork from when making rpc calls - // - // Returns: - // `(ForkFactory, GlobalBackend)`: ForkFactory instance and the GlobalBackend it talks to - fn new( - provider: Arc>, - initial_db: CacheDB, - fork_block: Option, - ) -> (Self, GlobalBackend) { - let (backend, backend_rx) = channel(1); - let handler = GlobalBackend::new(backend_rx, fork_block, provider, initial_db.clone()); - ( - Self { - backend, - initial_db, - }, - handler, - ) - } - - // Used locally in `insert_account_storage` to fetch accoutn info if account does not exist - fn do_get_basic(&self, address: rAddress) -> DatabaseResult> { - tokio::task::block_in_place(|| { - let (sender, rx) = oneshot_channel(); - let req = BackendFetchRequest::Basic(address, sender); - self.backend.clone().try_send(req)?; - rx.recv()?.map(Some) - }) - } - - // Create a new sandbox environment with backend running on own thread - pub fn new_sandbox_factory( - provider: Arc>, - initial_db: CacheDB, - fork_block: Option, - ) -> Self { - let (shared, handler) = Self::new(provider, initial_db, fork_block); - - // spawn a light-weight thread with a thread-local async runtime just for - // sending and receiving data from the remote client - let _ = std::thread::Builder::new() - .name("fork-backend-thread".to_string()) - .spawn(move || { - let rt = tokio::runtime::Builder::new_current_thread() - .enable_all() - .build() - .expect("failed to create fork-backend-thread tokio runtime"); - - rt.block_on(async move { handler.await }); - }) - .expect("failed to spawn backendhandler thread"); - - shared - } - - // Creates new ForkDB that fallsback on this `ForkFactory` instance - pub fn new_sandbox_fork(&self) -> ForkDB { - ForkDB::new(self.backend.clone(), self.initial_db.clone()) - } - - // Insert storage into local db - pub fn insert_account_storage( - &mut self, - address: rAddress, - slot: rU256, - value: rU256, - ) -> DatabaseResult<()> { - if self.initial_db.accounts.get(&address).is_none() { - // set basic info as its missing - let info = match self.do_get_basic(address) { - Ok(i) => i, - Err(e) => return Err(e), - }; - - // keep record of fetched acc basic info - if info.is_some() { - self.initial_db.insert_account_info(address, info.unwrap()); - } - } - self.initial_db - .insert_account_storage(address, slot, value) - .unwrap(); - - Ok(()) - } - - // Insert account basic info into local db - pub fn insert_account_info(&mut self, address: rAddress, info: AccountInfo) { - self.initial_db.insert_account_info(address, info); - } -} diff --git a/bot/src/forked_db/global_backend.rs b/bot/src/forked_db/global_backend.rs deleted file mode 100644 index 1d873a1..0000000 --- a/bot/src/forked_db/global_backend.rs +++ /dev/null @@ -1,385 +0,0 @@ -// credit to Foundry's SharedBackend implmenetation: -// https://github.com/foundry-rs/foundry/blob/master/evm/src/executor/fork/backend.rs -use ethers::{ - providers::{Middleware, Provider, ProviderError, Ws}, - types::{Address, BigEndianHash, BlockId, H256, U256}, - utils::keccak256, -}; -use eyre::Result; -use futures::{ - channel::mpsc::Receiver, - task::{Context, Poll}, - Future, FutureExt, Stream, -}; -use hashbrown::{hash_map::Entry, HashMap}; -use revm::{ - db::{CacheDB, EmptyDB}, - primitives::{ - bytes, AccountInfo, Bytecode, Bytes as rBytes, B160 as rAddress, B256, KECCAK_EMPTY, - U256 as rU256, - }, -}; -use std::{ - collections::VecDeque, - pin::Pin, - sync::{mpsc::Sender as OneshotSender, Arc}, -}; - -use super::database_error::{DatabaseError, DatabaseResult}; - -// **incoming req and outcoming req handled using revm types -// all logic internal to this module handled using ethers types (because of provider) -type AccountInfoSender = OneshotSender>; -type StorageSender = OneshotSender>; -type BlockHashSender = OneshotSender>; - -type BasicFuture = - Pin, rAddress)> + Send>>; -type StorageFuture = - Pin, rAddress, rU256)> + Send>>; -type BlockHashFuture = Pin, rU256)> + Send>>; - -/// Request variants that are executed by the provider -enum FetchRequestFuture { - Basic(BasicFuture), - Storage(StorageFuture), - BlockHash(BlockHashFuture), -} - -/// The Request type the Backend listens for -#[derive(Debug)] -pub enum BackendFetchRequest { - /// Fetch the account info - Basic(rAddress, AccountInfoSender), - /// Fetch a storage slot - Storage(rAddress, rU256, StorageSender), - /// Fetch a block hash - BlockHash(rU256, BlockHashSender), -} - -/// Holds db and provdier_db to fallback on so that -/// we can make rpc calls for missing data -pub struct GlobalBackend { - db: CacheDB, - // used to make calls for missing data - provider: Arc>, - block_num: Option, - /// Requests currently in progress - pending_requests: Vec>, - /// Listeners that wait for a `get_account` related response - account_requests: HashMap>, - /// Listeners that wait for a `get_storage_at` response - storage_requests: HashMap<(rAddress, rU256), Vec>, - /// Listeners that wait for a `get_block` response - block_requests: HashMap>, - /// Incoming commands. - incoming: Receiver, - /// unprocessed queued requests - queued_requests: VecDeque, -} - -impl GlobalBackend { - // not so elegeant but create sim env from state diffs - pub fn new( - rx: Receiver, - block_num: Option, - provider: Arc>, - initial_db: CacheDB, - ) -> Self { - Self { - db: initial_db, - provider, - block_num, - pending_requests: Default::default(), - account_requests: Default::default(), - storage_requests: Default::default(), - block_requests: Default::default(), - incoming: rx, - queued_requests: Default::default(), - } - } - - /// handle the request in queue in the future. - /// - /// We always check: - /// 1. if the requested value is already stored in the cache, then answer the sender - /// 2. otherwise, fetch it via the provider but check if a request for that value is already in - /// progress (e.g. another Sender just requested the same account) - fn on_request(&mut self, req: BackendFetchRequest) { - match req { - BackendFetchRequest::Basic(addr, sender) => { - let acc = self.db.accounts.get(&addr); - if let Some(acc) = acc { - let _ = sender.send(Ok(acc.info.clone())); - } else { - self.request_account(addr, sender); - } - } - BackendFetchRequest::Storage(addr, idx, sender) => { - let value = self - .db - .accounts - .get(&addr) - .and_then(|acc| acc.storage.get(&idx)); - if let Some(value) = value { - let _ = sender.send(Ok(*value)); - } else { - // account present but not storage -> fetch storage - self.request_account_storage(addr.0.into(), idx, sender) - } - } - BackendFetchRequest::BlockHash(number, sender) => { - let hash = self.db.block_hashes.get(&number); - if let Some(hash) = hash { - let _ = sender.send(Ok(hash.0.into())); - } else { - self.request_hash(number, sender); - } - } - } - } - - /// process a request for an account - fn request_account(&mut self, address: rAddress, listener: AccountInfoSender) { - match self.account_requests.entry(address) { - Entry::Occupied(mut entry) => { - entry.get_mut().push(listener); - } - Entry::Vacant(entry) => { - entry.insert(vec![listener]); - let provider = self.provider.clone(); - let block_num = self.block_num; - let fut = Box::pin(async move { - // convert from revm to ethers - let address_ethers: Address = address.0.into(); - - let balance = provider.get_balance(address_ethers, block_num); - let nonce = provider.get_transaction_count(address_ethers, block_num); - let code = provider.get_code(address_ethers, block_num); - let resp = tokio::try_join!(balance, nonce, code); - - let resp = resp.map(|(b, n, c)| (b.into(), n.as_u64(), c.0)); - (resp, address) - }); - self.pending_requests.push(FetchRequestFuture::Basic(fut)); - } - } - } - - // Process a request for account's storage - fn request_account_storage(&mut self, address: rAddress, idx: rU256, listener: StorageSender) { - match self.storage_requests.entry((address, idx)) { - Entry::Occupied(mut entry) => { - entry.get_mut().push(listener); - } - Entry::Vacant(entry) => { - entry.insert(vec![listener]); - let provider = self.provider.clone(); - let block_num = self.block_num; - let fut = Box::pin(async move { - // convert from revm to ethers type - let idx_ethers = H256::from_uint(&U256::from(idx)); - let address_ethers: Address = address.0.into(); - - let storage = provider - .get_storage_at(address_ethers, idx_ethers, block_num) - .await; - let storage = storage.map(|storage| storage.into_uint()); - - // convert ethers types to revm types - let storage = storage.map(|s| s.into()); - // convert back to revm types - (storage, address, idx) - }); - self.pending_requests.push(FetchRequestFuture::Storage(fut)); - } - } - } - - // Process a request for a block hash - fn request_hash(&mut self, number: rU256, listener: BlockHashSender) { - match self.block_requests.entry(number) { - Entry::Occupied(mut entry) => { - entry.get_mut().push(listener); - } - Entry::Vacant(entry) => { - entry.insert(vec![listener]); - let provider = self.provider.clone(); - let fut = Box::pin(async move { - // convert from revm to ethers type - let number_ethers: u64 = U256::from(number).as_u64(); - let block = provider.get_block(number_ethers).await; - - let block_hash = match block { - Ok(Some(block)) => Ok(block - .hash - .expect("empty block hash on mined block, this should never happen")), - Ok(None) => { - // if no block was returned then the block does not exist, in which case - // we return empty hash - Ok(KECCAK_EMPTY.0.into()) - } - Err(err) => Err(err), - }; - - // convert from ethers to revm type before returning - let revm_block_hash = block_hash.map(|bh| bh.0.into()); - (revm_block_hash, number) - }); - self.pending_requests - .push(FetchRequestFuture::BlockHash(fut)); - } - } - } -} - -impl Future for GlobalBackend { - type Output = (); - - fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - let pin = self.get_mut(); - loop { - // Drain queued requests first. - while let Some(req) = pin.queued_requests.pop_front() { - pin.on_request(req) - } - - // receive new requests to delegate to the underlying provider - loop { - match Pin::new(&mut pin.incoming).poll_next(cx) { - Poll::Ready(Some(req)) => { - pin.queued_requests.push_back(req); - } - Poll::Ready(None) => { - return Poll::Ready(()); - } - Poll::Pending => break, - } - } - - // poll all requests in progress - for n in (0..pin.pending_requests.len()).rev() { - let mut request = pin.pending_requests.swap_remove(n); - match &mut request { - FetchRequestFuture::Basic(fut) => { - if let Poll::Ready((resp, addr)) = fut.poll_unpin(cx) { - // get the response - let (balance, nonce, code) = match resp { - Ok(res) => res, - Err(err) => { - let err = Arc::new(eyre::Error::new(err)); - if let Some(listeners) = pin.account_requests.remove(&addr) { - listeners.into_iter().for_each(|l| { - let _ = l.send(Err(DatabaseError::GetAccount( - addr, - Arc::clone(&err), - ))); - }) - } - continue; - } - }; - - // convert it to revm-style types - let (code, code_hash) = if !code.is_empty() { - (Some(code.clone()), keccak256(&code).into()) - } else { - (Some(bytes::Bytes::default()), KECCAK_EMPTY) - }; - - // update the cache - let acc = AccountInfo { - nonce, - balance, - code: code.map(|bytes| Bytecode::new_raw(bytes).to_checked()), - code_hash, - }; - pin.db.insert_account_info(addr, acc.clone()); - - // notify all listeners - if let Some(listeners) = pin.account_requests.remove(&addr) { - listeners.into_iter().for_each(|l| { - let _ = l.send(Ok(acc.clone())); - }) - } - continue; - } - } - FetchRequestFuture::Storage(fut) => { - if let Poll::Ready((resp, addr, idx)) = fut.poll_unpin(cx) { - let value = match resp { - Ok(value) => value, - Err(err) => { - // notify all listeners - let err = Arc::new(eyre::Error::new(err)); - if let Some(listeners) = - pin.storage_requests.remove(&(addr, idx)) - { - listeners.into_iter().for_each(|l| { - let _ = l.send(Err(DatabaseError::GetStorage( - addr, - idx, - Arc::clone(&err), - ))); - }) - } - continue; - } - }; - - // update the cache - pin.db.insert_account_storage(addr, idx, value).unwrap(); - - // notify all listeners - if let Some(listeners) = pin.storage_requests.remove(&(addr, idx)) { - listeners.into_iter().for_each(|l| { - let _ = l.send(Ok(value)); - }) - } - continue; - } - } - FetchRequestFuture::BlockHash(fut) => { - if let Poll::Ready((block_hash, number)) = fut.poll_unpin(cx) { - let value = match block_hash { - Ok(value) => value, - Err(err) => { - let err = Arc::new(eyre::Error::new(err)); - // notify all listeners - if let Some(listeners) = pin.block_requests.remove(&number) { - listeners.into_iter().for_each(|l| { - let _ = l.send(Err(DatabaseError::GetBlockHash( - number, - Arc::clone(&err), - ))); - }) - } - continue; - } - }; - - // update the cache - pin.db.block_hashes.insert(number, value); - - // notify all listeners - if let Some(listeners) = pin.block_requests.remove(&number) { - listeners.into_iter().for_each(|l| { - let _ = l.send(Ok(value.0.into())); - }) - } - continue; - } - } - } - // not ready, insert and poll again - pin.pending_requests.push(request); - } - - // If no new requests have been queued, break to - // be polled again later. - if pin.queued_requests.is_empty() { - return Poll::Pending; - } - } - } -} diff --git a/bot/src/forked_db/mod.rs b/bot/src/forked_db/mod.rs deleted file mode 100644 index 12cef0a..0000000 --- a/bot/src/forked_db/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -pub mod database_error; -pub use database_error::DatabaseError; - -pub mod global_backend; -pub use global_backend::*; - -pub mod fork_db; -pub mod fork_factory; diff --git a/bot/src/lib.rs b/bot/src/lib.rs deleted file mode 100644 index 56ebb5e..0000000 --- a/bot/src/lib.rs +++ /dev/null @@ -1,15 +0,0 @@ -pub mod abi; -pub mod cfmm; -pub mod forked_db; -pub mod relay; -pub mod rpc_extensions; -pub mod runner; -pub mod simulate; -pub mod types; -pub mod utils; - -pub mod prelude { - pub use super::{ - abi::*, cfmm::*, forked_db::*, rpc_extensions::*, runner::*, simulate::*, types::*, - }; -} diff --git a/bot/src/main.rs b/bot/src/main.rs deleted file mode 100644 index 3fa6e69..0000000 --- a/bot/src/main.rs +++ /dev/null @@ -1,154 +0,0 @@ -use std::str::FromStr; - -use colored::Colorize; -use dotenv::dotenv; -use ethers::prelude::*; -use eyre::Result; - -use fern::colors::{Color, ColoredLevelConfig}; - -use rusty_sando::{ - prelude::{sync_dex, Dex, PoolVariant}, - runner::Bot, - utils::{self, dotenv::read_env_vars}, -}; - -#[tokio::main] -async fn main() -> Result<()> { - log::info!("Starting Bot Initialization"); - dotenv().ok(); - - // setup logger configs - let mut colors = ColoredLevelConfig::new(); - colors.trace = Color::Cyan; - colors.debug = Color::Magenta; - colors.info = Color::Green; - colors.warn = Color::Red; - colors.error = Color::BrightRed; - - // setup logging both to stdout and file - fern::Dispatch::new() - .format(move |out, message, record| { - out.finish(format_args!( - "{}[{}] {}", - chrono::Local::now().format("[%H:%M:%S]"), - colors.color(record.level()), - message - )) - }) - .chain(std::io::stdout()) - .chain(fern::log_file("output.log")?) - // hide all logs for everything other than bot - .level(log::LevelFilter::Error) - .level_for("rusty_sando", log::LevelFilter::Info) - .apply()?; - - read_env_vars(); - - log::info!( - "{}", - format!("{}", utils::constants::get_banner().green().bold()) - ); - - // Create the websocket client - let client = utils::create_websocket_client().await.unwrap(); - - /////////////////////////////////////// - // Setup all dexes and their pools // - /////////////////////////////////////// - let mut dexes = vec![]; - - // Add UniswapV2 pairs - dexes.push(Dex::new( - H160::from_str("0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f").unwrap(), - PoolVariant::UniswapV2, - 10000835, - )); - - //// Add Sushiswap pairs - dexes.push(Dex::new( - H160::from_str("0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac").unwrap(), - PoolVariant::UniswapV2, - 10794229, - )); - - //// Add CryptoCom-Swap pairs - dexes.push(Dex::new( - H160::from_str("0x9DEB29c9a4c7A88a3C0257393b7f3335338D9A9D").unwrap(), - PoolVariant::UniswapV2, - 10828414, - )); - - //// Add Convergence-Swap pairs - dexes.push(Dex::new( - H160::from_str("0x4eef5746ED22A2fD368629C1852365bf5dcb79f1").unwrap(), - PoolVariant::UniswapV2, - 12385067, - )); - - //// Add Pancake-Swap pairs - dexes.push(Dex::new( - H160::from_str("0x1097053Fd2ea711dad45caCcc45EfF7548fCB362").unwrap(), - PoolVariant::UniswapV2, - 15614590, - )); - - //// Add Shiba-Swap pairs, home of shitcoins - dexes.push(Dex::new( - H160::from_str("0x115934131916C8b277DD010Ee02de363c09d037c").unwrap(), - PoolVariant::UniswapV2, - 12771526, - )); - - //// Add Saitaswap pools - dexes.push(Dex::new( - H160::from_str("0x35113a300ca0D7621374890ABFEAC30E88f214b1").unwrap(), - PoolVariant::UniswapV2, - 15210780, - )); - - //// Add UniswapV3 pools - dexes.push(Dex::new( - H160::from_str("0x1F98431c8aD98523631AE4a59f267346ea31F984").unwrap(), - PoolVariant::UniswapV3, - 12369621, - )); - - let current_block = client.get_block_number().await.unwrap(); - let all_pools = sync_dex(dexes.clone(), &client, current_block, None) - .await - .unwrap(); - - log::info!("all_pools_len: {}", all_pools.len()); - - // Execution loop (reconnect bot if it dies) - loop { - let client = utils::create_websocket_client().await.unwrap(); - let mut bot = Bot::new(client, all_pools.clone(), dexes.clone()) - .await - .unwrap(); - - bot.run().await.unwrap(); - log::error!("Websocket disconnected"); - } -} - -//#[cfg(test)] -//mod test { -// use ethers::providers::Middleware; -// use futures::StreamExt; -// use rusty_sando::utils::testhelper; -// -// #[tokio::test] -// async fn sub_blocks() { -// let client = testhelper::create_ws().await; -// // let client = Provider::::connect("ws://localhost:8545").await.unwrap(); -// -// let mut stream = client.subscribe_blocks().await.unwrap(); -// let mut prev = 0; -// while let Some(block) = stream.next().await { -// println!("{:#?}", block.timestamp.as_u32() - prev); -// prev = block.timestamp.as_u32(); -// } -// } -//} diff --git a/bot/src/relay.rs b/bot/src/relay.rs deleted file mode 100644 index 1a13b05..0000000 --- a/bot/src/relay.rs +++ /dev/null @@ -1,94 +0,0 @@ -use std::sync::Arc; - -use crate::utils; -use ethers::prelude::*; -use ethers_flashbots::*; -use reqwest::Url; - -pub struct BundleRelay { - pub flashbots_client: - SignerMiddleware>, LocalWallet>, LocalWallet>, - pub relay_name: String, -} - -impl BundleRelay { - pub fn new( - relay_end_point: Url, - relay_name: String, - client: &Arc>, - ) -> Result { - // Extract wallets from .env keys - let bundle_private_key = std::env::var("FLASHBOTS_AUTH_KEY").unwrap(); - let searcher_private_key = std::env::var("SEARCHER_PRIVATE_KEY").unwrap(); - - let bundle_signer = bundle_private_key.parse::().unwrap(); - let searcher_signer = searcher_private_key.parse::().unwrap(); - - // Setup the Ethereum client with flashbots middleware - let flashbots_middleware = - FlashbotsMiddleware::new(client.clone(), relay_end_point, bundle_signer); - - // Local node running mev-geth - //flashbots_middleware.set_simulation_relay(Url::parse("http://127.0.0.1:8546").unwrap()); - let flashbots_client = SignerMiddleware::new(flashbots_middleware, searcher_signer); - - Ok(BundleRelay { - flashbots_client, - relay_name, - }) - } -} - -pub fn construct_bundle( - signed_txs: Vec, - target_block: U64, // Current block number - target_timestamp: u64, -) -> BundleRequest { - // Create ethers-flashbots bundle request - let mut bundle_request = BundleRequest::new(); - - for tx in signed_txs { - bundle_request = bundle_request.push_transaction(tx); - } - - // Set other bundle parameters - bundle_request = bundle_request - .set_block(target_block) - .set_simulation_block(target_block - 1) - .set_simulation_timestamp(target_timestamp) - .set_min_timestamp(target_timestamp) - .set_max_timestamp(target_timestamp); - - bundle_request -} - -pub async fn get_all_relay_endpoints() -> Vec { - let client = utils::create_websocket_client().await.unwrap(); - - let endpoints = vec![ - ("flashbots", "https://relay.flashbots.net/"), - ("builder0x69", "http://builder0x69.io/"), - ("edennetwork", "https://api.edennetwork.io/v1/bundle"), - ("beaverbuild", "https://rpc.beaverbuild.org/"), - ("lightspeedbuilder", "https://rpc.lightspeedbuilder.info/"), - ("eth-builder", "https://eth-builder.com/"), - ("ultrasound", "https://relay.ultrasound.money/"), - ("agnostic-relay", "https://agnostic-relay.net/"), - ("relayoor-wtf", "https://relayooor.wtf/"), - ("rsync-builder", "https://rsync-builder.xyz/"), - //"http://relayooor.wtf/", - //"http://mainnet.aestus.live/", - //"https://mainnet-relay.securerpc.com", - //"http://agnostic-relay.net/", - //"http://relay.ultrasound.money/", - ]; - - let mut relays: Vec = vec![]; - - for (name, endpoint) in endpoints { - let relay = BundleRelay::new(Url::parse(endpoint).unwrap(), name.into(), &client).unwrap(); - relays.push(relay); - } - - relays -} diff --git a/bot/src/rpc_extensions/mod.rs b/bot/src/rpc_extensions/mod.rs deleted file mode 100644 index 7bff4c9..0000000 --- a/bot/src/rpc_extensions/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -use std::sync::Arc; - -use ethers::prelude::*; - -/// Subscribe to the rpc endpoint "SubscribePending" -pub async fn subscribe_pending_txs_with_body( - client: &Arc>, -) -> Result, ProviderError> -{ - // this rpc is erigon specific - client.subscribe(["newPendingTransactionsWithBody"]).await -} diff --git a/bot/src/runner/bundle_sender.rs b/bot/src/runner/bundle_sender.rs deleted file mode 100644 index 5de53cb..0000000 --- a/bot/src/runner/bundle_sender.rs +++ /dev/null @@ -1,392 +0,0 @@ -use colored::Colorize; -use ethers::prelude::{rand::Rng, *}; -use hashbrown::HashMap; -use std::{collections::BTreeMap, sync::Arc}; -use tokio::sync::RwLock; - -use crate::{ - prelude::{ - fork_factory::ForkFactory, - make_sandwich, - sandwich_types::{OptimalRecipe, RawIngredients}, - BlockInfo, Pool, PoolVariant, SendBundleError, - }, - relay, utils, - utils::tx_builder::SandwichMaker, -}; - -use super::state::BotState; - -pub struct BundleSender { - pub pending_sandwiches: HashMap>>>, -} - -impl BundleSender { - // Create a new `TxSender` instance - // - // Arguments: no arguments - // - // Returns: a new `TxSender` instance - pub async fn new() -> Self { - Self { - pending_sandwiches: HashMap::new(), - } - } - - // Add a recipe to the pending transaction list for a given pool - // - // Arguments: - // * `&mut self`: a mutable reference to the `TxSender` instance - // * `recipe`: an `OptimalRecipe` instance representing the recipe to add - // - // Returns: This function returns nothing - pub async fn add_recipe(&mut self, recipe: OptimalRecipe) { - let target_pool = recipe.target_pool; - if let Some(sandwich_vec) = self.pending_sandwiches.get(&target_pool) { - sandwich_vec.write().await.push(recipe); - } else { - let new_vector = Arc::new(RwLock::new(vec![recipe])); - self.pending_sandwiches.insert(target_pool, new_vector); - } - } - - // enchanement: proof of concept atm, a lot of room for improvement - // bump victim transactions if detect tx with same sender + nonce - // don't clear at end and just remove recipes based on mined txs in latest block (collect backlog) - pub async fn make_mega_sandwich( - &mut self, - next_block: BlockInfo, - sandwich_state: Arc, - sandwich_maker: Arc, - ) { - for (target_pool, recipes) in self.pending_sandwiches.iter() { - let mut recipes = { - let read_lock = recipes.read().await; - (*read_lock).clone() - }; - - // we alr sent this tx - if recipes.len() <= 1 { - continue; - } - - let sandwich_state = sandwich_state.clone(); - let next_block = next_block.clone(); - let sandwich_maker = sandwich_maker.clone(); - let target_pool = target_pool.clone(); - // could cleanup this code because a lot of copy + pasting from runner/mod.rs - tokio::spawn(async move { - // sort recipes by revenue - recipes.sort_by(|a, b| a.revenue.cmp(&b.revenue)); - - let has_dust = recipes[0].has_dust; - let combined_state_diffs = { - let mut combined: BTreeMap = BTreeMap::new(); - - for recipe in recipes.iter() { - for (key, value) in recipe.state_diffs.clone() { - combined.insert(key, value); - } - } - - combined - }; - - let client = utils::create_websocket_client().await.unwrap(); - let fork_block = Some(BlockId::Number(BlockNumber::Number(next_block.number))); - - // create evm simulation handler by setting up `fork_factory` - let initial_db = - utils::state_diff::to_cache_db(&combined_state_diffs, fork_block, &client) - .await - .unwrap(); - let mut fork_factory = - ForkFactory::new_sandbox_factory(client.clone(), initial_db, fork_block); - - // create raw ingredients - let meats = recipes - .iter() - .flat_map(|recipe| recipe.meats.clone()) - .collect(); - - let raw_ingredients = match RawIngredients::new( - &target_pool, - meats, - utils::constants::get_weth_address(), - combined_state_diffs, - ) - .await - { - Ok(recipe) => recipe, - Err(_) => return, - }; - - let weth_balance = { - let read_lock = sandwich_state.weth_balance.read().await; - (*read_lock).clone() - }; - - //// find optimal input to for multi sandwich - let mut optimal_sandwich = match make_sandwich::create_optimal_sandwich( - &raw_ingredients, - weth_balance, - &next_block, - &mut fork_factory, - &sandwich_maker, - ) - .await - { - Ok(optimal) => optimal, - Err(_) => { - return; - } - }; - - optimal_sandwich.set_has_dust(has_dust); - - // if revenue is non zero send multi-meat sandwich to relays - if optimal_sandwich.revenue != U256::zero() { - match send_bundle( - &optimal_sandwich, - next_block, - sandwich_maker, - sandwich_state, - ) - .await - { - Ok(_) => { /* all reporting already done inside of send_bundle */ } - Err(e) => { - log::info!( - "{}", - format!( - "{:?} failed to send bundle, due to {:?}", - optimal_sandwich.print_meats(), - e - ) - .bright_magenta() - ); - } - }; - } - }); - } - } -} - -// Construct and send bundle based on recipe -// -// Arguments: -// * `&recipe`: information on how to construct sandwich bundle -// * `target_block`: holds basefee and timestamp of target block -// * `sandwich_maker`: holds signer, bot address for constructing frontslice and backslice -// -// Returns: -// Ok(()): return nothing if sent succesful -// Err(SendBundleError): return error if send bundle fails -pub async fn send_bundle( - recipe: &OptimalRecipe, - target_block: BlockInfo, - sandwich_maker: Arc, - sandwich_state: Arc, -) -> Result<(), SendBundleError> { - let nonce = { - let read_lock = sandwich_maker.nonce.read().await; - (*read_lock).clone() - }; - - let front_slice_request = Eip1559TransactionRequest { - to: Some(NameOrAddress::Address(sandwich_maker.sandwich_address)), - from: Some(sandwich_maker.searcher_wallet.address()), - data: Some(recipe.frontrun_data.clone()), - chain_id: Some(U64::from(1)), - max_priority_fee_per_gas: Some(U256::from(0)), - max_fee_per_gas: Some(target_block.base_fee), - gas: Some((U256::from(recipe.frontrun_gas_used) * 10) / 7), // gasused = 70% gaslimit - nonce: Some(nonce), - value: Some(recipe.frontrun_value), - access_list: recipe.frontrun_access_list.clone(), - }; - - let raw_signed_frontrun_tx = - utils::sign_eip1559(front_slice_request, &sandwich_maker.searcher_wallet).await?; - - let raw_signed_meat_txs: Vec = recipe.meats.iter().map(|meat| meat.rlp()).collect(); - - let max_fee = calculate_bribe_for_max_fee(&recipe, &target_block)?; - - let back_slice_request = Eip1559TransactionRequest { - to: Some(NameOrAddress::Address(sandwich_maker.sandwich_address)), - from: Some(sandwich_maker.searcher_wallet.address()), - data: Some(recipe.backrun_data.clone()), - chain_id: Some(U64::from(1)), - max_priority_fee_per_gas: Some(max_fee), - max_fee_per_gas: Some(max_fee), - gas: Some((U256::from(recipe.backrun_gas_used) * 10) / 7), // gasused = 70% gaslimit - nonce: Some(nonce + 1), - value: Some(recipe.backrun_value), - access_list: recipe.backrun_access_list.clone(), - }; - - let raw_signed_backrun_tx = - utils::sign_eip1559(back_slice_request, &sandwich_maker.searcher_wallet).await?; - - let bundle = relay::construct_bundle( - { - let mut bundled_transactions: Vec = vec![raw_signed_frontrun_tx]; - for meat in raw_signed_meat_txs { - bundled_transactions.push(meat.clone()); - } - bundled_transactions.push(raw_signed_backrun_tx); - bundled_transactions - }, - target_block.number, - target_block.timestamp.as_u64(), - ); - - let profit = recipe - .revenue - .checked_sub( - (U256::from(recipe.frontrun_gas_used) * target_block.base_fee) - + (U256::from(recipe.backrun_gas_used) * max_fee), - ) - .unwrap_or_default(); - - // send bundle to all relay endpoints (concurrently) - for relay in relay::get_all_relay_endpoints().await { - let sandwich_state = sandwich_state.clone(); - let sandwich_maker = sandwich_maker.clone(); - let bundle = bundle.clone(); - let recipe = recipe.clone(); - - tokio::spawn(async move { - let pending_bundle = match relay.flashbots_client.inner().send_bundle(&bundle).await { - Ok(pb) => pb, - Err(_) => { - //log::error!("Failed to send bundle: {:?}", e); - return; - } - }; - - log::info!( - "{:?} {}", - recipe.print_meats(), - format!("Bundle sent to {}", relay.relay_name) - .bold() - .white() - .on_black() - ); - - let bundle_hash = pending_bundle.bundle_hash; - - let is_bundle_included = match pending_bundle.await { - Ok(_) => true, - Err(ethers_flashbots::PendingBundleError::BundleNotIncluded) => false, - Err(e) => { - log::error!( - "{:?} Bundle rejected due to error : {:?}", - recipe.print_meats(), - e - ); - false - } - }; - - // only do this operation once (could do this in a cleaner way :<) - if relay.relay_name == "flashbots" { - utils::alert::alert_bundle( - bundle_hash, - target_block.number, - is_bundle_included, - &recipe, - profit, - ) - .await; - - match (is_bundle_included, recipe.has_dust) { - (true, false) => { - let other_token = - if recipe.target_pool.token_0 != utils::constants::get_weth_address() { - recipe.target_pool.token_0 - } else { - recipe.target_pool.token_1 - }; - - sandwich_state.update_weth_balance(profit).await; - sandwich_state.add_dust(other_token).await; - let mut nonce = sandwich_maker.nonce.write().await; - *nonce += U256::from(2); - log::info!("Adding new dust: {:?}", other_token); - } - (true, _) => { - // update weth balance - sandwich_state.update_weth_balance(profit).await; - let mut nonce = sandwich_maker.nonce.write().await; - *nonce += U256::from(2); - log::info!("Updating weth balance"); - } - (false, _) => { /* bundle not included, do nothing */ } - } - } - }); - } - - Ok(()) -} - -// calculates the optimal bribe for a given opportunity -// -// Arguments -// * `recipe`: information on sandwich bundle -// * `target_block`: information on target_block -// -// Returns: -// Ok(U256) -> The maximum fee for opportunity if calculated succesfully -// Err(SendBundleError) -> Error in bribe amount calculation -fn calculate_bribe_for_max_fee( - recipe: &OptimalRecipe, - target_block: &BlockInfo, -) -> Result { - // frontrun txfee is fixed, exclude it from bribe calculations - let revenue_minus_frontrun_tx_fee = match recipe - .revenue - .checked_sub(U256::from(recipe.frontrun_gas_used) * target_block.base_fee) - { - Some(revenue) => revenue, - None => return Err(SendBundleError::FrontrunGasFeesNotCovered()), - }; - - // overpay to get dust onto sandwich contractIf - // more info: https://twitter.com/libevm/status/1474870661373779969 - let bribe_amount = if !recipe.has_dust { - revenue_minus_frontrun_tx_fee + ethers::utils::parse_ether("0.00015").unwrap() - } else { - let mut rng = rand::thread_rng(); - - // enchanement: make bribe adaptive based on competitors - match recipe.target_pool.pool_variant { - PoolVariant::UniswapV2 => { - (revenue_minus_frontrun_tx_fee * (990000000 + rng.gen_range(0..10000000))) - / 1000000000 - } - PoolVariant::UniswapV3 => { - (revenue_minus_frontrun_tx_fee * (970000000 + rng.gen_range(0..30000000))) - / 1000000000 - } - } - }; - - // calculating bribe amount - let max_fee = bribe_amount / recipe.backrun_gas_used; - - if max_fee < target_block.base_fee { - return Err(SendBundleError::MaxFeeLessThanNextBaseFee()); - } - - let effective_miner_tip = max_fee.checked_sub(target_block.base_fee); - - if effective_miner_tip.is_none() { - return Err(SendBundleError::NegativeMinerTip()); - } - - Ok(max_fee) -} diff --git a/bot/src/runner/mod.rs b/bot/src/runner/mod.rs deleted file mode 100644 index 6df061e..0000000 --- a/bot/src/runner/mod.rs +++ /dev/null @@ -1,294 +0,0 @@ -use dashmap::DashMap; -use std::sync::Arc; - -use crate::prelude::fork_factory::ForkFactory; -use crate::prelude::sandwich_types::RawIngredients; -use crate::prelude::{make_sandwich, Dex, Pool}; -use crate::rpc_extensions; -use crate::types::BlockOracle; -use crate::utils; -use crate::utils::tx_builder::SandwichMaker; -use colored::Colorize; -use ethers::prelude::*; -use eyre::Result; -use log; - -mod oracles; -use tokio::sync::RwLock; - -mod state; -use state::BotState; - -mod bundle_sender; -use bundle_sender::*; - -pub struct Bot { - sandwich_state: Arc, - latest_block_oracle: Arc>, - client: Arc>, - all_pools: Arc>, - sandwich_maker: Arc, - bundle_sender: Arc>, - dexes: Vec, -} - -impl Bot { - // Create new bot instance - // - // Arguments: - // * `client`: websocket provider used to make calls - // * `pool_vec`: vector of pools that the bot will monitor - // - // Returns: - // * Ok(Bot) if successful - // * Err(eyre::Error) if not successful - pub async fn new( - client: Arc>, - pool_vec: Vec, - dexes: Vec, - ) -> Result { - // create hashmap from our vec of pools (faster access when doing lookups) - let all_pools: DashMap = DashMap::new(); - for pool in pool_vec { - all_pools.insert(pool.address, pool); - } - - let all_pools = Arc::new(all_pools); - - let sandwich_inception_block = utils::dotenv::get_sandwich_inception_block(); - let sandwich_state = BotState::new(sandwich_inception_block, &client).await?; - let sandwich_state = Arc::new(sandwich_state); - - let sandwich_maker = Arc::new(SandwichMaker::new().await); - - let latest_block_oracle = BlockOracle::new(&client).await?; - let latest_block_oracle = Arc::new(RwLock::new(latest_block_oracle)); - - let bundle_sender = Arc::new(RwLock::new(BundleSender::new().await)); - - Ok(Bot { - client, - all_pools, - latest_block_oracle, - sandwich_state, - sandwich_maker, - bundle_sender, - dexes, - }) - } - - // Run the bot by starting a new mempool stream and filtering txs for opportunities - // - // Arguments: - // * `&mut self`: reference to mutable self - // - // Returns: - // Ok(()) if successful - // Err(eyre::Error) if encounters error during execution - pub async fn run(&mut self) -> Result<()> { - log::info!("Starting bot"); - - oracles::start_add_new_pools(&mut self.all_pools, self.dexes.clone()); - oracles::start_block_oracle(&mut self.latest_block_oracle); - oracles::start_mega_sandwich_oracle( - self.bundle_sender.clone(), - self.sandwich_state.clone(), - self.sandwich_maker.clone(), - ); - - let mut mempool_stream = if let Ok(stream) = - rpc_extensions::subscribe_pending_txs_with_body(&self.client).await - { - stream - } else { - panic!("Failed to create mempool stream"); - }; - - while let Some(mut victim_tx) = mempool_stream.next().await { - let client = utils::create_websocket_client().await?; - let block_oracle = { - let read_lock = self.latest_block_oracle.read().await; - (*read_lock).clone() - }; - let all_pools = &self.all_pools; - let sandwich_balance = { - let read_lock = self.sandwich_state.weth_balance.read().await; - (*read_lock).clone() - }; - // ignore txs that we can't include in next block - // enhancement: simulate all txs, store result, and use result when tx can included - if victim_tx.max_fee_per_gas.unwrap_or(U256::zero()) < block_oracle.next_block.base_fee - { - log::info!("{}", format!("{:?} mf optimal, - Err(e) => { - log::info!( - "{}", - format!("{:?} sim failed due to {:?}", &victim_hash, e).yellow() - ); - return; - } - }; - - // check if has dust - let other_token = if optimal_sandwich.target_pool.token_0 - != utils::constants::get_weth_address() - { - optimal_sandwich.target_pool.token_0 - } else { - optimal_sandwich.target_pool.token_1 - }; - - if sandwich_state.has_dust(&other_token).await { - optimal_sandwich.has_dust = true; - } - - // spawn thread to send tx to builders - let optimal_sandwich = optimal_sandwich.clone(); - let optimal_sandwich_two = optimal_sandwich.clone(); - let sandwich_maker = sandwich_maker.clone(); - let sandwich_state = sandwich_state.clone(); - - if optimal_sandwich.revenue > U256::zero() { - tokio::spawn(async move { - match bundle_sender::send_bundle( - &optimal_sandwich, - block_oracle.next_block, - sandwich_maker, - sandwich_state.clone(), - ) - .await - { - Ok(_) => { /* all reporting already done inside of send_bundle */ } - Err(e) => { - log::info!( - "{}", - format!( - "{:?} failed to send bundle, due to {:?}", - optimal_sandwich.print_meats(), - e - ) - .bright_magenta() - ); - } - }; - }); - } - - // spawn thread to add tx for mega sandwich calculation - let bundle_sender = bundle_sender.clone(); - tokio::spawn(async move { - bundle_sender - .write() - .await - .add_recipe(optimal_sandwich_two) - .await; - }); - }); - } - } - Ok(()) - } -} diff --git a/bot/src/runner/oracles.rs b/bot/src/runner/oracles.rs deleted file mode 100644 index 92f4f52..0000000 --- a/bot/src/runner/oracles.rs +++ /dev/null @@ -1,149 +0,0 @@ -use colored::Colorize; -use dashmap::DashMap; -use ethers::prelude::*; -use std::sync::Arc; -use std::thread; -use std::time::Duration; -use tokio::sync::RwLock; - -use crate::prelude::{sync_dex, BlockInfo, Dex, Pool}; -use crate::types::BlockOracle; -use crate::utils; -use crate::utils::tx_builder::SandwichMaker; - -use super::bundle_sender::BundleSender; -use super::state::BotState; - -// Update latest block variable whenever we recieve a new block -// -// Arguments: -// * `oracle`: oracle to update -pub fn start_block_oracle(oracle: &mut Arc>) { - let next_block_clone = oracle.clone(); - - tokio::spawn(async move { - // loop so we can reconnect if the websocket connection is lost - loop { - let client = utils::create_websocket_client().await.unwrap(); - - let mut block_stream = if let Ok(stream) = client.subscribe_blocks().await { - stream - } else { - panic!("Failed to create new block stream"); - }; - - while let Some(block) = block_stream.next().await { - // lock the RwLock for write access and update the variable - { - let mut lock = next_block_clone.write().await; - lock.update_block_number(block.number.unwrap()); - lock.update_block_timestamp(block.timestamp); - lock.update_base_fee(block); - - let latest_block = &lock.latest_block; - let next_block = &lock.next_block; - log::info!( - "{}", - format!( - "New Block: (number:{:?}, timestamp:{:?}, basefee:{:?}), Next Block: (number:{:?}, timestamp:{:?}, basefee:{:?})", - latest_block.number, latest_block.timestamp, latest_block.base_fee, next_block.number, next_block.timestamp, next_block.base_fee - ) - .bright_purple() - .on_black() - ); - } // remove write lock due to being out of scope here - } - } - }); -} - -pub fn start_add_new_pools(all_pools: &mut Arc>, dexes: Vec) { - let all_pools = all_pools.clone(); - - tokio::spawn(async move { - // loop so we can reconnect if the websocket connection is lost - loop { - let client = utils::create_websocket_client().await.unwrap(); - - let mut block_stream = if let Ok(stream) = client.subscribe_blocks().await { - stream - } else { - panic!("Failed to create new block stream"); - }; - - let mut counter = 0; - let mut current_block_num = client.get_block_number().await.unwrap(); - - while let Some(block) = block_stream.next().await { - counter += 1; - let interval_block_new_pool = utils::dotenv::get_interval_block_new_pool(); - if counter == interval_block_new_pool { - let latest_block_number = block.number.unwrap(); - let fetched_new_pools = sync_dex( - dexes.clone(), - &client, - latest_block_number, - Some(BlockNumber::Number(current_block_num)), - ) - .await - .unwrap(); - - let fetched_pools_count = fetched_new_pools.len(); - - // turn fetched pools into hashmap - for pool in fetched_new_pools { - // Create hashmap from our vec - all_pools.insert(pool.address, pool); - } - - counter = 0; - current_block_num = latest_block_number; - log::info!("added {} new pools", fetched_pools_count); - } - } - } - }); -} - -pub fn start_mega_sandwich_oracle( - bundle_sender: Arc>, - sandwich_state: Arc, - sandwich_maker: Arc, -) { - tokio::spawn(async move { - // loop so we can reconnect if the websocket connection is lost - loop { - let client = utils::create_websocket_client().await.unwrap(); - - let mut block_stream = if let Ok(stream) = client.subscribe_blocks().await { - stream - } else { - panic!("Failed to create new block stream"); - }; - - while let Some(block) = block_stream.next().await { - // clear all recipes - // enchanement: don't do this step but keep recipes because they can be used in future - { - let mut bundle_sender_guard = bundle_sender.write().await; - bundle_sender_guard.pending_sandwiches.clear(); - } // lock removed here - - // 10.5 seconds from when new block was detected, caluclate mega sandwich - thread::sleep(Duration::from_millis(10_500)); - let next_block_info = BlockInfo::find_next_block_info(block); - { - bundle_sender - .write() - .await - .make_mega_sandwich( - next_block_info, - sandwich_state.clone(), - sandwich_maker.clone(), - ) - .await; - } // lock removed here - } - } - }); -} diff --git a/bot/src/runner/state.rs b/bot/src/runner/state.rs deleted file mode 100644 index 74a8111..0000000 --- a/bot/src/runner/state.rs +++ /dev/null @@ -1,195 +0,0 @@ -use hashbrown::HashSet; -use std::sync::Arc; - -use ethers::prelude::*; -use eyre::Result; -use tokio::sync::RwLock; - -use crate::{prelude::Erc20, utils}; - -#[derive(Clone, Debug)] -/// Holds the state of the bot -pub struct BotState { - pub token_dust: Arc>>, - pub weth_balance: Arc>, -} - -impl BotState { - // Create a new instance of the bot state - // - // Arguments: - // * `sandwich_inception_block`: block number sandwich was deployed - // * `client`: websocket provider to use for fetching data - // - // Returns: - // Ok(BotState) if successful - // Err(eyre::Error) if failed to create instance - pub async fn new(sandwich_inception_block: U64, client: &Arc>) -> Result { - let token_dust = Self::find_all_dust(sandwich_inception_block, client).await?; - let token_dust = Arc::new(RwLock::new(token_dust)); - - let weth_contract = - utils::contracts::get_erc20_contract(&utils::constants::get_weth_address(), client); - let weth_balance = weth_contract - .balance_of(utils::dotenv::get_sandwich_contract_address()) - .call() - .await?; - let weth_balance = Arc::new(RwLock::new(weth_balance)); - - Ok(BotState { - token_dust, - weth_balance, - }) - } - - // Check if contract has dust for specific token - // - // Arguments: - // * `&self`: refernce to `BotState` instance - // * `token`: token to check dust for - // - // Returns: - // bool: true if contract has dust for token, false otherwise - pub async fn has_dust(&self, token: &Address) -> bool { - self.token_dust.read().await.contains(token) - } - - // Add dust to contract - // - // Arguments: - // * `&self`: reference to `BotState` instance - // * `token`: token to add dust for - pub async fn add_dust(&self, token: Address) { - let mut dust = self.token_dust.write().await; - dust.push(token); - } - - // Update the WETH balance of the contract - // - // Arguments: - // * `&self`: reference to `BotState` instance - // - // Returns: nothing - pub async fn update_weth_balance(&self, value_to_add: U256) { - let mut lock = self.weth_balance.write().await; - *lock += value_to_add; - } - - // Find dust that bot has collected from a specific block onwards - // - // Arguments: - // * `start_block`: block to start searching for dust - // * `client`: websocket provider to use for fetching data - // - // Returns: - // `Ok(Vec
)`: address of token dust collected by bot - // `Err(eyre::Error)`: failed to find dust - async fn find_all_dust(start_block: U64, client: &Arc>) -> Result> { - // Define the step for searching a range of block logs for transfer events - let step = 10000; - - // Find dust upto this block - let current_block = match client.get_block_number().await { - Ok(block) => block.as_u64(), - Err(e) => { - log::error!("Failed to get current_block {:?}", e); - eyre::bail!("todo error msg here"); - } - }; - - let start_block = start_block.as_u64(); - - // holds erc20 and associated balance - let mut address_interacted_with = HashSet::new(); - - // for each block within the range, get all transfer events asynchronously - for from_block in (start_block..=current_block).step_by(step) { - let to_block = from_block + step as u64; - - // check for all incoming and outgoing txs within step range - let transfer_logs = client - .get_logs( - &Filter::new() - .topic0(utils::constants::get_erc20_transfer_event_signature()) - .topic1(utils::dotenv::get_sandwich_contract_address()) - .from_block(BlockNumber::Number(U64([from_block]))) - .to_block(BlockNumber::Number(U64([to_block]))), - ) - .await?; - - let receive_logs = client - .get_logs( - &Filter::new() - .topic0(utils::constants::get_erc20_transfer_event_signature()) - .topic2(utils::dotenv::get_sandwich_contract_address()) - .from_block(BlockNumber::Number(U64([from_block]))) - .to_block(BlockNumber::Number(U64([to_block]))), - ) - .await?; - - // combine all logs - for log in transfer_logs { - address_interacted_with.insert(log.address); - } - for log in receive_logs { - address_interacted_with.insert(log.address); - } - } - - let mut token_dust = vec![]; - - // doing calls to remove false positives - for touched_addr in address_interacted_with { - let erc20 = Erc20::new(touched_addr, client.clone()); - let balance: U256 = erc20 - .balance_of(utils::dotenv::get_sandwich_contract_address()) - .await?; - - if !balance.is_zero() { - token_dust.push(touched_addr); - } - } - - log::info!("Found {:?} tokens worth of dust", token_dust.len()); - - Ok(token_dust) - } -} - -//#[cfg(test)] -//mod test_get_dust { -// use dotenv::dotenv; -// use std::time::Duration; -// -// use super::*; -// -// #[tokio::test] -// async fn get_dust() { -// dotenv().ok(); -// let ws = Ws::connect("ws://localhost:8545").await.unwrap(); -// let ws_provider = Provider::new(ws).interval(Duration::from_millis(100)); -// let ws_provider = Arc::new(ws_provider); -// -// let sandwich_inception_block = super::utils::dotenv::get_sandwich_inception_block(); -// println!("Sandwich inception block: {:?}", sandwich_inception_block); -// let sandwich_state = BotState::new(sandwich_inception_block, &ws_provider) -// .await -// .unwrap(); -// -// for token_addr in sandwich_state.token_dust.read().await.iter() { -// let erc20 = Erc20::new(*token_addr, ws_provider.clone()); -// let _bal = erc20 -// .balance_of(utils::dotenv::get_sandwich_contract_address()) -// .await -// .unwrap(); -// println!( -// "{:?} - {:?}", -// token_addr, -// erc20 -// .balance_of(utils::dotenv::get_sandwich_contract_address()) -// .await -// .unwrap() -// ); -// } -// } -//} diff --git a/bot/src/simulate/helpers.rs b/bot/src/simulate/helpers.rs deleted file mode 100644 index 15030ed..0000000 --- a/bot/src/simulate/helpers.rs +++ /dev/null @@ -1,280 +0,0 @@ -use crate::prelude::fork_db::ForkDB; -use crate::prelude::fork_factory::ForkFactory; -use crate::types::{BlockInfo, SimulationError}; -use crate::utils::dotenv::{get_sandwich_contract_address, get_searcher_wallet}; -use crate::utils::{self, constants}; -use ethers::abi::{self, parse_abi, ParamType}; -use ethers::prelude::BaseContract; -use ethers::signers::Signer; -use ethers::types::transaction::eip2930::{AccessList, AccessListItem}; -use ethers::types::{Address, BigEndianHash, Bytes, H256, U256}; -use ethers::utils::parse_ether; -use revm::primitives::{ExecutionResult, Output, TransactTo}; -use revm::{ - primitives::{Address as rAddress, Bytecode, U256 as rU256}, - EVM, -}; -use std::str::FromStr; - -// Setup braindance for current fork factory by injecting braindance -// contract code and setting up balances -// -// Arguments: -// * `&mut fork_factory`: mutable reference to fork db factory -// -// Returns: This function returns nothing -pub fn attach_braindance_module(fork_factory: &mut ForkFactory) { - inject_braindance_code(fork_factory); - - // Get balance mapping of braindance contract inside of weth contract - let slot: U256 = ethers::utils::keccak256(abi::encode(&[ - abi::Token::Address(braindance_address().0.into()), - abi::Token::Uint(U256::from(3)), - ])) - .into(); - - let value = braindance_starting_balance(); - - fork_factory - .insert_account_storage( - constants::get_weth_address().0.into(), - slot.into(), - value.into(), - ) - .unwrap(); -} - -// Inject test sandwich code for when we run test. Allows us to test new -// sandwich contact locally -// -// Arguments: -// * `fork_factory`: mutable reference to fork db factory -// * `starting_weth_balance`: weth balance sandwich contract is initialized with -// -// Returns: This function returns nothing -pub fn inject_sando(fork_factory: &mut ForkFactory, starting_weth_balance: U256) { - // give searcher some balance to pay for gas fees - let searcher = get_searcher_wallet().address(); - let gas_money = parse_ether(100).unwrap(); - let account = revm::primitives::AccountInfo::new(gas_money.into(), 0, Bytecode::default()); - fork_factory.insert_account_info(searcher.0.into(), account); - - // setup sandwich contract - let sandwich = get_sandwich_contract_address(); - let account = revm::primitives::AccountInfo::new( - rU256::from(0), - 0, - Bytecode::new_raw(constants::get_test_sandwich_code().0), - ); - fork_factory.insert_account_info(sandwich.0.into(), account); - - // add starting weth balance to sandwich contract - let slot: U256 = ethers::utils::keccak256(abi::encode(&[ - abi::Token::Address(sandwich.0.into()), - abi::Token::Uint(U256::from(3)), - ])) - .into(); - - // update changes - fork_factory - .insert_account_storage( - constants::get_weth_address().0.into(), - slot.into(), - starting_weth_balance.into(), - ) - .unwrap(); -} - -// Add bytecode to braindance address -// -// Arguments: -// `&mut fork_factory`: mutable reference to `ForkFactory` instance to inject -// -// Returns: This function returns nothing -fn inject_braindance_code(fork_factory: &mut ForkFactory) { - // setup braindance contract - let account = revm::primitives::AccountInfo::new( - rU256::from(0), - 0, - Bytecode::new_raw(constants::get_braindance_code().0), - ); - fork_factory.insert_account_info(braindance_address().0.into(), account); - - // setup braindance contract controller - let account = - revm::primitives::AccountInfo::new(parse_ether(69).unwrap().into(), 0, Bytecode::default()); - fork_factory.insert_account_info(braindance_controller_address().0.into(), account); -} - -// Setup evm blockstate -// -// Arguments: -// * `&mut evm`: mutable refernece to `EVM` instance which we want to modify -// * `&next_block`: reference to `BlockInfo` of next block to set values against -// -// Returns: This function returns nothing -pub fn setup_block_state(evm: &mut EVM, next_block: &BlockInfo) { - evm.env.block.number = rU256::from(next_block.number.as_u64()); - evm.env.block.timestamp = next_block.timestamp.into(); - evm.env.block.basefee = next_block.base_fee.into(); - // use something other than default - evm.env.block.coinbase = - rAddress::from_str("0xDecafC0FFEe15BAD000000000000000000000000").unwrap(); -} - -// Find amount out from an amount in using the k=xy formula -// note: assuming fee is set to 3% for all pools (not case irl) -// -// Arguments: -// * `amount_in`: amount of token in -// * `target_pool`: address of pool -// * `token_in`: address of token in -// * `token_out`: address of token out -// * `evm`: mutable reference to evm used for query -// -// Returns: -// Ok(U256): amount out -// Err(SimulationError): if error during caluclation -pub fn get_amount_out_evm( - amount_in: U256, - target_pool: Address, - token_in: Address, - token_out: Address, - evm: &mut EVM, -) -> Result { - // get reserves - evm.env.tx.transact_to = TransactTo::Call(target_pool.0.into()); - evm.env.tx.caller = utils::constants::get_eth_dev().0.into(); - evm.env.tx.value = rU256::ZERO; - evm.env.tx.data = Bytes::from_str("0x0902f1ac").unwrap().0; // getReserves() - let result = match evm.transact_ref() { - Ok(result) => result.result, - Err(e) => return Err(SimulationError::EvmError(e)), - }; - let output: Bytes = match result { - ExecutionResult::Success { output, .. } => match output { - Output::Call(o) => o.into(), - Output::Create(o, _) => o.into(), - }, - ExecutionResult::Revert { output, .. } => return Err(SimulationError::EvmReverted(output)), - ExecutionResult::Halt { reason, .. } => return Err(SimulationError::EvmHalted(reason)), - }; - - let tokens = abi::decode( - &vec![ - ParamType::Uint(128), - ParamType::Uint(128), - ParamType::Uint(32), - ], - &output, - ) - .unwrap(); - - let reserves_0 = tokens[0].clone().into_uint().unwrap(); - let reserves_1 = tokens[1].clone().into_uint().unwrap(); - - let (reserve_in, reserve_out) = match token_in < token_out { - true => (reserves_0, reserves_1), - false => (reserves_1, reserves_0), - }; - - let a_in_with_fee: U256 = amount_in * 997; - let numerator: U256 = a_in_with_fee * reserve_out; - let denominator: U256 = reserve_in * 1000 + a_in_with_fee; - let amount_out: U256 = numerator.checked_div(denominator).unwrap_or(U256::zero()); - - Ok(amount_out) -} - -// Get token balance -// -// Arguments: -// * `token`: erc20 token to query -// * `owner`: address to find balance of -// * `next_block`: block to query balance at -// * `evm`: evm instance to run query on -// -// Returns: -// `Ok(balance: U256)` if successful, Err(SimulationError) otherwise -pub fn get_balance_of_evm( - token: Address, - owner: Address, - next_block: &BlockInfo, - evm: &mut EVM, -) -> Result { - let erc20 = BaseContract::from( - parse_abi(&["function balanceOf(address) external returns (uint)"]).unwrap(), - ); - - evm.env.tx.transact_to = TransactTo::Call(token.0.into()); - evm.env.tx.data = erc20.encode("balanceOf", owner).unwrap().0; - evm.env.tx.caller = utils::constants::get_eth_dev().0.into(); - evm.env.tx.gas_price = next_block.base_fee.into(); - evm.env.tx.gas_limit = 700000; - evm.env.tx.value = rU256::ZERO; - - let result = match evm.transact_ref() { - Ok(result) => result.result, - Err(e) => { - return Err(SimulationError::EvmError(e)); - } - }; - - let output: Bytes = match result { - ExecutionResult::Success { output, .. } => match output { - Output::Call(o) => o.into(), - Output::Create(o, _) => o.into(), - }, - ExecutionResult::Revert { output, .. } => return Err(SimulationError::EvmReverted(output)), - ExecutionResult::Halt { reason, .. } => return Err(SimulationError::EvmHalted(reason)), - }; - - match erc20.decode_output("balanceOf", &output) { - Ok(tokens) => return Ok(tokens), - Err(e) => return Err(SimulationError::AbiError(e)), - } -} - -// Converts access list from revm to ethers type -// -// Arguments: -// * `access_list`: access list in revm format -// -// Returns: -// `AccessList` in ethers format -pub fn convert_access_list(access_list: Vec<(rAddress, Vec)>) -> AccessList { - let mut converted_access_list = Vec::new(); - for access in access_list { - let address = access.0; - let keys = access.1; - let access_item = AccessListItem { - address: address.0.into(), - storage_keys: keys - .iter() - .map(|k| { - let slot_u256: U256 = k.clone().into(); - let slot_h256: H256 = H256::from_uint(&slot_u256); - slot_h256 - }) - .collect::>(), - }; - converted_access_list.push(access_item); - } - - AccessList(converted_access_list) -} - -// Holds constant value representing braindance contract address -pub fn braindance_address() -> rAddress { - rAddress::from_str("00000000000000000000000000000000F3370000").unwrap() -} - -// Holds constant value representing braindance caller -pub fn braindance_controller_address() -> rAddress { - rAddress::from_str("000000000000000000000000000000000420BABE").unwrap() -} - -// Holds constant value representing braindance weth starting balance -pub fn braindance_starting_balance() -> U256 { - parse_ether(420).unwrap() -} diff --git a/bot/src/simulate/inspectors/access_list.rs b/bot/src/simulate/inspectors/access_list.rs deleted file mode 100644 index f2f8ddf..0000000 --- a/bot/src/simulate/inspectors/access_list.rs +++ /dev/null @@ -1,125 +0,0 @@ -// parts of code taken from reth: -// https://github.com/paradigmxyz/reth/blob/6d138daa1159ea92dc28a4e31d6be6a2f07ba565/crates/revm/revm-inspectors/src/access_list.rs -use hashbrown::{HashMap, HashSet}; -use revm::{ - interpreter::{opcode, InstructionResult, Interpreter}, - precompile::Precompiles, - primitives::{B160 as rAddress, B256, U256 as rU256}, - Database, EVMData, Inspector, -}; - -// An [Inspector] that collects touched accounts and storage slots. -// -// This can be used to construct an [AccessList] for a transaction via `eth_createAccessList` -#[derive(Default, Debug)] -pub struct AccessListInspector { - // All addresses that should be excluded from the final accesslist - excluded: HashSet, - // All addresses and touched slots - access_list: HashMap>, -} - -impl AccessListInspector { - // Creates a new inspector instance - // - // Arguments: - // * `from`: sender of transaction (exclude from access list) - // * `to`: receiver of transaction (exclude from access list) - // - // Returns: - // `AccessListInspector`: inspector that creates access list when used in a simulation - pub fn new(from: ethers::types::Address, to: ethers::types::Address) -> Self { - // add precompiles to addys that we ignore - let precompiles: Vec = Precompiles::latest() - .addresses() - .into_iter() - .map(|addy| rAddress::from(addy)) - .collect(); - - let from: rAddress = from.0.into(); - let to: rAddress = to.0.into(); - - AccessListInspector { - // exclude precomiples, from, and to addresses - excluded: vec![from, to] - .iter() - .chain(precompiles.iter()) - .copied() - .collect(), - access_list: HashMap::default(), - } - } - - // Returns list of addresses and storage keys used by the transaction. It gives you the list of - // addresses and storage keys that were touched during execution. - // - // Arguments: - // * `self`: consumes self to produce access list - // - // Returns: - // `Vec<(rAddress, Vec)>`: acces list in the form of list of addresses and storage keys - pub fn into_access_list(self) -> Vec<(rAddress, Vec)> { - self.access_list - .into_iter() - .map(|(address, slots)| { - ( - address, - slots - .into_iter() - .map(|s| rU256::from_be_bytes(s.0)) - .collect(), - ) - }) - .collect() - } -} - -impl Inspector for AccessListInspector -where - DB: Database, -{ - fn step( - &mut self, - interpreter: &mut Interpreter, - _data: &mut EVMData<'_, DB>, - _is_static: bool, - ) -> InstructionResult { - let pc = interpreter.program_counter(); - let op = interpreter.contract.bytecode.bytecode()[pc]; - - match op { - opcode::SLOAD | opcode::SSTORE => { - if let Ok(slot) = interpreter.stack().peek(0) { - let cur_contract = interpreter.contract.address; - self.access_list - .entry(cur_contract) - .or_default() - .insert(B256::from(slot.to_be_bytes())); - } - } - opcode::EXTCODECOPY - | opcode::EXTCODEHASH - | opcode::EXTCODESIZE - | opcode::BALANCE - | opcode::SELFDESTRUCT => { - if let Ok(slot) = interpreter.stack().peek(0) { - let addr: rAddress = B256::from(slot.to_be_bytes()).into(); - if !self.excluded.contains(&addr) { - self.access_list.entry(addr).or_default(); - } - } - } - opcode::DELEGATECALL | opcode::CALL | opcode::STATICCALL | opcode::CALLCODE => { - if let Ok(slot) = interpreter.stack().peek(1) { - let addr: rAddress = B256::from(slot.to_be_bytes()).into(); - if !self.excluded.contains(&addr) { - self.access_list.entry(addr).or_default(); - } - } - } - _ => (), - } - - InstructionResult::Continue - } -} diff --git a/bot/src/simulate/inspectors/mod.rs b/bot/src/simulate/inspectors/mod.rs deleted file mode 100644 index c51c3be..0000000 --- a/bot/src/simulate/inspectors/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod access_list; -pub mod is_sando_safu; diff --git a/bot/src/simulate/make_sandwich.rs b/bot/src/simulate/make_sandwich.rs deleted file mode 100644 index a71b6a8..0000000 --- a/bot/src/simulate/make_sandwich.rs +++ /dev/null @@ -1,865 +0,0 @@ -use ethers::prelude::*; -use revm::primitives::{ExecutionResult, Output, TransactTo, B160 as rAddress, U256 as rU256}; - -use crate::prelude::access_list::AccessListInspector; -use crate::prelude::fork_db::ForkDB; -use crate::prelude::fork_factory::ForkFactory; -use crate::prelude::is_sando_safu::{IsSandoSafu, SalmonellaInspectoooor}; -use crate::prelude::sandwich_types::RawIngredients; -use crate::prelude::{convert_access_list, get_amount_out_evm, get_balance_of_evm, PoolVariant}; -use crate::types::sandwich_types::OptimalRecipe; -use crate::types::{BlockInfo, SimulationError}; -use crate::utils::dotenv; -use crate::utils::tx_builder::{self, braindance, SandwichMaker}; - -use super::{ - attach_braindance_module, braindance_address, braindance_controller_address, - braindance_starting_balance, setup_block_state, -}; - -// Calculate amount in that produces highest revenue and performs honeypot checks -// -// Arguments: -// `&ingredients`: holds onchain information about opportunity -// `sandwich_balance`: balance of sandwich contract -// `&next_block`: holds information about next block -// `&mut fork_factory`: used to create new forked evm instances for simulations -// `sandwich_maker`: handles encoding of transaction for sandwich contract -// -// Returns: -// Ok(OptimalRecipe) if no errors during calculation -// Err(SimulationError) if error during calculation -pub async fn create_optimal_sandwich( - ingredients: &RawIngredients, - sandwich_balance: U256, - next_block: &BlockInfo, - fork_factory: &mut ForkFactory, - sandwich_maker: &SandwichMaker, -) -> Result { - let optimal = juiced_quadratic_search( - ingredients, - U256::zero(), - sandwich_balance, - next_block, - fork_factory, - ) - .await?; - - #[cfg(test)] - { - println!("Optimal amount in: {}", optimal); - } - - sanity_check( - sandwich_balance, - optimal, - ingredients, - next_block, - sandwich_maker, - fork_factory.new_sandbox_fork(), - ) -} - -// Roided implementation of https://research.ijcaonline.org/volume65/number14/pxc3886165.pdf -// splits range in more intervals, search intervals concurrently, compare, repeat till termination -// -// Arguments: -// * `&ingredients`: holds onchain information about opportunity -// * `lower_bound`: lower bound of search interval -// * `upper_bound`: upper bound of search interval, normally equal to sandwich balance -// * `next_block`: holds information about next block -// * `fork_factory`: used to create new forked evm instances for simulations -// -// Returns: -// Ok(U256): optimal amount in, if no errors during calculation -// Err(SimulationError): if error during calculation -async fn juiced_quadratic_search( - ingredients: &RawIngredients, - mut lower_bound: U256, - mut upper_bound: U256, - next_block: &BlockInfo, - mut fork_factory: &mut ForkFactory, -) -> Result { - // - // [EXAMPLE WITH 10 BOUND INTERVALS] - // - // (first) (mid) (last) - // ▼ ▼ ▼ - // +---+---+---+---+---+---+---+---+---+---+ - // | | | | | | | | | | | - // +---+---+---+---+---+---+---+---+---+---+ - // ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ - // 0 1 2 3 4 5 6 7 8 9 X - // - // * [0, X] = search range - // * Find revenue at each interval - // * Find index of interval with highest revenue - // * Search again with bounds set to adjacent index of highest - // - - attach_braindance_module(&mut fork_factory); - - #[cfg(test)] - { - // if running test, setup contract sandwich to allow for backtest - // can also inject new sandwich code for testing - crate::prelude::inject_sando(&mut fork_factory, upper_bound); - } - - // setup values for search termination - let base = U256::from(1000000u64); - let tolerance = U256::from(1u64); - - let tolerance = (tolerance * ((upper_bound + lower_bound) / 2)) / base; - - // initialize variables for search - let left_interval_lower = |i: usize, intervals: &Vec| intervals[i - 1].clone() + 1; - let right_interval_upper = |i: usize, intervals: &Vec| intervals[i + 1].clone() - 1; - let should_loop_terminate = |lower_bound: U256, upper_bound: U256| -> bool { - let search_range = match upper_bound.checked_sub(lower_bound) { - Some(range) => range, - None => return true, - }; - // produces negative result - if lower_bound > upper_bound { - return true; - } - // tolerance condition not met - if search_range < tolerance { - return true; - } - false - }; - let mut highest_sando_input = U256::zero(); - let number_of_intervals = 15; - let mut counter = 0; - - // continue search until termination condition is met (no point seraching down to closest wei) - loop { - counter += 1; - if should_loop_terminate(lower_bound, upper_bound) { - break; - } - - // split search range into intervals - let mut intervals = Vec::new(); - for i in 0..=number_of_intervals { - intervals.push(lower_bound + (((upper_bound - lower_bound) * i) / number_of_intervals)); - } - - // calculate revenue at each interval concurrently - let mut revenues = Vec::new(); - for bound in &intervals { - let sim = tokio::task::spawn(evaluate_sandwich_revenue( - *bound, - ingredients.clone(), - next_block.clone(), - fork_factory.new_sandbox_fork(), - )); - revenues.push(sim); - } - - let revenues = futures::future::join_all(revenues).await; - - let revenues = revenues - .into_iter() - .map(|r| r.unwrap().unwrap_or_default()) - .collect::>(); - - // find interval that produces highest revenue - let (highest_revenue_index, _highest_revenue) = revenues - .iter() - .enumerate() - .max_by(|(_, a), (_, b)| a.cmp(&b)) - .unwrap(); - - highest_sando_input = intervals[highest_revenue_index]; - - // enhancement: find better way to increase finding opps incase of all rev=0 - if revenues[highest_revenue_index] == U256::zero() { - // most likely there is no sandwich possibility - if counter == 10 { - return Ok(U256::zero()); - } - // no revenue found, most likely small optimal so decrease range - upper_bound = intervals[intervals.len() / 3] - 1; - continue; - } - - // if highest revenue is produced at last interval (upper bound stays fixed) - if highest_revenue_index == intervals.len() - 1 { - lower_bound = left_interval_lower(highest_revenue_index, &intervals); - continue; - } - - // if highest revenue is produced at first interval (lower bound stays fixed) - if highest_revenue_index == 0 { - upper_bound = right_interval_upper(highest_revenue_index, &intervals); - continue; - } - - // set bounds to intervals adjacent to highest revenue index and search again - lower_bound = left_interval_lower(highest_revenue_index, &intervals); - upper_bound = right_interval_upper(highest_revenue_index, &intervals); - } - - Ok(highest_sando_input) -} - -// Perform simulation using sandwich contract and check for salmonella -// -// Arguments: -// `sandwich_start_balance`: amount of token held by sandwich contract -// `frontrun_in`: amount to use as frontrun -// `ingredients`: holds information about opportunity -// `next_block`: holds information about next block -// `sandwich_maker`: handles encoding of transaction for sandwich contract -// `fork_db`: fork db used for evm simulations -// -// Returns: -// Ok(OptimalRecipe): params to pass to sandwich contract to capture opportunity -// Err(SimulationError): error encountered during simulation -fn sanity_check( - sandwich_start_balance: U256, - frontrun_in: U256, - ingredients: &RawIngredients, - next_block: &BlockInfo, - sandwich_maker: &SandwichMaker, - fork_db: ForkDB, -) -> Result { - // setup evm simulation - let mut evm = revm::EVM::new(); - evm.database(fork_db); - setup_block_state(&mut evm, &next_block); - - let searcher = dotenv::get_searcher_wallet().address(); - let sandwich_contract = dotenv::get_sandwich_contract_address(); - let pool_variant = ingredients.target_pool.pool_variant; - - // *´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ - // * FRONTRUN TRANSACTION */ - // *.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - // - // encode frontrun_in before passing to sandwich contract - let frontrun_in = match pool_variant { - PoolVariant::UniswapV2 => tx_builder::v2::encode_weth(frontrun_in), - PoolVariant::UniswapV3 => tx_builder::v3::encode_weth(frontrun_in), - }; - - // caluclate frontrun_out using encoded frontrun_in - let frontrun_out = match pool_variant { - PoolVariant::UniswapV2 => { - let target_pool = ingredients.target_pool.address; - let token_in = ingredients.startend_token; - let token_out = ingredients.intermediary_token; - evm.env.tx.gas_price = next_block.base_fee.into(); - evm.env.tx.gas_limit = 700000; - evm.env.tx.value = rU256::ZERO; - let amount_out = - get_amount_out_evm(frontrun_in, target_pool, token_in, token_out, &mut evm)?; - tx_builder::v2::decode_intermediary(amount_out, true, token_out) - } - PoolVariant::UniswapV3 => U256::zero(), - }; - - // create tx.data and tx.value for frontrun_in - let (frontrun_data, frontrun_value) = match pool_variant { - PoolVariant::UniswapV2 => sandwich_maker.v2.create_payload_weth_is_input( - frontrun_in, - frontrun_out, - ingredients.intermediary_token, - ingredients.target_pool, - ), - PoolVariant::UniswapV3 => sandwich_maker.v3.create_payload_weth_is_input( - frontrun_in.as_u128().into(), - ingredients.startend_token, - ingredients.intermediary_token, - ingredients.target_pool, - ), - }; - - // setup evm for frontrun transaction - evm.env.tx.caller = searcher.0.into(); - evm.env.tx.transact_to = TransactTo::Call(sandwich_contract.0.into()); - evm.env.tx.data = frontrun_data.clone().into(); - evm.env.tx.value = frontrun_value.into(); - evm.env.tx.gas_limit = 700000; - evm.env.tx.gas_price = next_block.base_fee.into(); - evm.env.tx.access_list = Vec::default(); - - // get access list - let mut access_list_inspector = AccessListInspector::new(searcher, sandwich_contract); - evm.inspect_ref(&mut access_list_inspector) - .map_err(|e| SimulationError::FrontrunEvmError(e)) - .unwrap(); - let frontrun_access_list = access_list_inspector.into_access_list(); - evm.env.tx.access_list = frontrun_access_list.clone(); - - // run again but now with access list (so that we get accurate gas used) - // run with a salmonella inspector to flag `suspicious` opcodes - let mut salmonella_inspector = SalmonellaInspectoooor::new(); - let frontrun_result = match evm.inspect_commit(&mut salmonella_inspector) { - Ok(result) => result, - Err(e) => return Err(SimulationError::FrontrunEvmError(e)), - }; - match frontrun_result { - ExecutionResult::Success { .. } => { /* continue operation */ } - ExecutionResult::Revert { output, .. } => { - return Err(SimulationError::FrontrunReverted(output)) - } - ExecutionResult::Halt { reason, .. } => { - return Err(SimulationError::FrontrunHalted(reason)) - } - }; - match salmonella_inspector.is_sando_safu() { - IsSandoSafu::Safu => { /* continue operation */ } - IsSandoSafu::NotSafu(not_safu_opcodes) => { - return Err(SimulationError::FrontrunNotSafu(not_safu_opcodes)) - } - } - - let frontrun_gas_used = frontrun_result.gas_used(); - - // *´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ - // * MEAT TRANSACTION/s */ - // *.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - let mut is_meat_good = Vec::new(); - for meat in ingredients.meats.iter() { - evm.env.tx.caller = rAddress::from_slice(&meat.from.0); - evm.env.tx.transact_to = - TransactTo::Call(rAddress::from_slice(&meat.to.unwrap_or_default().0)); - evm.env.tx.data = meat.input.0.clone(); - evm.env.tx.value = meat.value.into(); - evm.env.tx.chain_id = meat.chain_id.map(|id| id.as_u64()); - evm.env.tx.nonce = Some(meat.nonce.as_u64()); - evm.env.tx.gas_limit = meat.gas.as_u64(); - match meat.transaction_type { - Some(ethers::types::U64([0])) => { - // legacy tx - evm.env.tx.gas_price = meat.gas_price.unwrap_or_default().into(); - } - Some(_) => { - // type 2 tx - evm.env.tx.gas_priority_fee = meat.max_priority_fee_per_gas.map(|mpf| mpf.into()); - evm.env.tx.gas_price = meat.max_fee_per_gas.unwrap_or_default().into(); - } - None => { - // legacy tx - evm.env.tx.gas_price = meat.gas_price.unwrap().into(); - } - } - - // keep track of which meat transactions are successful to filter reverted meats at end - // remove reverted meats because mempool tx/s gas costs are accounted for by fb - let res = match evm.transact_commit() { - Ok(result) => result, - Err(e) => return Err(SimulationError::EvmError(e)), - }; - match res.is_success() { - true => is_meat_good.push(true), - false => is_meat_good.push(false), - } - } - - // *´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ - // * BACKRUN TRANSACTION */ - // *.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - // - // encode backrun_in before passing to sandwich contract - let token_in = ingredients.intermediary_token; - let token_out = ingredients.startend_token; - let balance = get_balance_of_evm(token_in, sandwich_contract, next_block, &mut evm)?; - let backrun_in = match pool_variant { - PoolVariant::UniswapV2 => { - tx_builder::v2::encode_intermediary_with_dust(balance, false, token_in) - } - PoolVariant::UniswapV3 => tx_builder::v3::encode_intermediary_token(balance), - }; - - // caluclate backrun_out using encoded backrun_in - let backrun_out = match pool_variant { - PoolVariant::UniswapV2 => { - let target_pool = ingredients.target_pool.address; - let out = get_amount_out_evm(backrun_in, target_pool, token_in, token_out, &mut evm)?; - tx_builder::v2::encode_weth(out) - } - PoolVariant::UniswapV3 => U256::zero(), - }; - - // create tx.data and tx.value for backrun_in - let (backrun_data, backrun_value) = match pool_variant { - PoolVariant::UniswapV2 => sandwich_maker.v2.create_payload_weth_is_output( - backrun_in, - backrun_out, - ingredients.intermediary_token, - ingredients.target_pool, - ), - PoolVariant::UniswapV3 => ( - sandwich_maker.v3.create_payload_weth_is_output( - backrun_in.as_u128().into(), - ingredients.intermediary_token, - ingredients.startend_token, - ingredients.target_pool, - ), - U256::zero(), - ), - }; - - // setup evm for backrun transaction - evm.env.tx.caller = searcher.0.into(); - evm.env.tx.transact_to = TransactTo::Call(sandwich_contract.0.into()); - evm.env.tx.data = backrun_data.clone().into(); - evm.env.tx.gas_limit = 700000; - evm.env.tx.gas_price = next_block.base_fee.into(); - evm.env.tx.value = backrun_value.into(); - - // create access list - let mut access_list_inspector = AccessListInspector::new(searcher, sandwich_contract); - evm.inspect_ref(&mut access_list_inspector) - .map_err(|e| SimulationError::FrontrunEvmError(e)) - .unwrap(); - let backrun_access_list = access_list_inspector.into_access_list(); - evm.env.tx.access_list = backrun_access_list.clone(); - - // run again but now with access list (so that we get accurate gas used) - // run with a salmonella inspector to flag `suspicious` opcodes - let mut salmonella_inspector = SalmonellaInspectoooor::new(); - let backrun_result = match evm.inspect_commit(&mut salmonella_inspector) { - Ok(result) => result, - Err(e) => return Err(SimulationError::BackrunEvmError(e)), - }; - match backrun_result { - ExecutionResult::Success { .. } => { /* continue */ } - ExecutionResult::Revert { output, .. } => { - return Err(SimulationError::BackrunReverted(output)) - } - ExecutionResult::Halt { reason, .. } => return Err(SimulationError::BackrunHalted(reason)), - }; - match salmonella_inspector.is_sando_safu() { - IsSandoSafu::Safu => { /* continue operation */ } - IsSandoSafu::NotSafu(not_safu_opcodes) => { - return Err(SimulationError::BackrunNotSafu(not_safu_opcodes)) - } - } - - let backrun_gas_used = backrun_result.gas_used(); - - // *´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ - // * GENERATE REPORTS */ - // *.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - // - // caluclate revenue from balance change - let post_sandwich_balance = get_balance_of_evm( - ingredients.startend_token, - sandwich_contract, - next_block, - &mut evm, - )?; - let revenue = post_sandwich_balance - .checked_sub(sandwich_start_balance) - .unwrap_or_default(); - - // filter only passing meat txs - let good_meats_only = ingredients - .meats - .iter() - .zip(is_meat_good.iter()) - .filter(|&(_, &b)| b) - .map(|(s, _)| s.to_owned()) - .collect(); - - Ok(OptimalRecipe::new( - frontrun_data.into(), - frontrun_value, - frontrun_gas_used, - convert_access_list(frontrun_access_list), - backrun_data.into(), - backrun_value, - backrun_gas_used, - convert_access_list(backrun_access_list), - good_meats_only, - revenue, - ingredients.target_pool, - ingredients.state_diffs.clone(), - )) -} - -/// Sandwich simulation using BrainDance contract (modified router contract) -/// -/// Arguments: -/// * `frontrun_in`: amount of to frontrun with -/// * `ingredients`: ingredients of the sandwich -/// * `next_block`: block info of the next block -/// * `fork_db`: database instance used for evm simulations -async fn evaluate_sandwich_revenue( - frontrun_in: U256, - ingredients: RawIngredients, - next_block: BlockInfo, - fork_db: ForkDB, -) -> Result { - let mut evm = revm::EVM::new(); - evm.database(fork_db); - setup_block_state(&mut evm, &next_block); - - let pool_variant = ingredients.target_pool.pool_variant; - - /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ - /* FRONTRUN TRANSACTION */ - /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - let frontrun_data = match pool_variant { - PoolVariant::UniswapV2 => braindance::build_swap_v2_data( - frontrun_in, - ingredients.target_pool.address, - ingredients.startend_token, - ingredients.intermediary_token, - ), - PoolVariant::UniswapV3 => braindance::build_swap_v3_data( - frontrun_in.as_u128().into(), - ingredients.target_pool.address, - ingredients.startend_token, - ingredients.intermediary_token, - ), - }; - - evm.env.tx.caller = braindance_controller_address(); - evm.env.tx.transact_to = TransactTo::Call(braindance_address().0.into()); - evm.env.tx.data = frontrun_data.0; - evm.env.tx.gas_limit = 700000; - evm.env.tx.gas_price = next_block.base_fee.into(); - evm.env.tx.value = rU256::ZERO; - - let result = match evm.transact_commit() { - Ok(result) => result, - Err(e) => return Err(SimulationError::FrontrunEvmError(e)), - }; - let output = match result { - ExecutionResult::Success { output, .. } => match output { - Output::Call(o) => o, - Output::Create(o, _) => o, - }, - ExecutionResult::Revert { output, .. } => { - return Err(SimulationError::FrontrunReverted(output)) - } - ExecutionResult::Halt { reason, .. } => { - return Err(SimulationError::FrontrunHalted(reason)) - } - }; - let (_frontrun_out, backrun_in) = match pool_variant { - PoolVariant::UniswapV2 => { - match tx_builder::braindance::decode_swap_v2_result(output.into()) { - Ok(output) => output, - Err(e) => return Err(SimulationError::FailedToDecodeOutput(e)), - } - } - PoolVariant::UniswapV3 => { - match tx_builder::braindance::decode_swap_v3_result(output.into()) { - Ok(output) => output, - Err(e) => return Err(SimulationError::FailedToDecodeOutput(e)), - } - } - }; - - /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ - /* MEAT TRANSACTION/s */ - /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - for meat in ingredients.meats.iter() { - evm.env.tx.caller = rAddress::from_slice(&meat.from.0); - evm.env.tx.transact_to = - TransactTo::Call(rAddress::from_slice(&meat.to.unwrap_or_default().0)); - evm.env.tx.data = meat.input.0.clone(); - evm.env.tx.value = meat.value.into(); - evm.env.tx.chain_id = meat.chain_id.map(|id| id.as_u64()); - evm.env.tx.nonce = Some(meat.nonce.as_u64()); - evm.env.tx.gas_limit = meat.gas.as_u64(); - match meat.transaction_type { - Some(ethers::types::U64([0])) => { - // legacy tx - evm.env.tx.gas_price = meat.gas_price.unwrap_or_default().into(); - } - Some(_) => { - // type 2 tx - evm.env.tx.gas_priority_fee = meat.max_priority_fee_per_gas.map(|mpf| mpf.into()); - evm.env.tx.gas_price = meat.max_fee_per_gas.unwrap_or_default().into(); - } - None => { - // legacy tx - evm.env.tx.gas_price = meat.gas_price.unwrap_or_default().into(); - } - } - - let _res = evm.transact_commit(); - } - - /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ - /* BACKRUN TRANSACTION */ - /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - let backrun_data = match pool_variant { - PoolVariant::UniswapV2 => braindance::build_swap_v2_data( - backrun_in, - ingredients.target_pool.address, - ingredients.intermediary_token, - ingredients.startend_token, - ), - PoolVariant::UniswapV3 => braindance::build_swap_v3_data( - backrun_in.as_u128().into(), - ingredients.target_pool.address, - ingredients.intermediary_token, - ingredients.startend_token, - ), - }; - - evm.env.tx.caller = braindance_controller_address(); - evm.env.tx.transact_to = TransactTo::Call(braindance_address().0.into()); - evm.env.tx.data = backrun_data.0; - evm.env.tx.gas_limit = 700000; - evm.env.tx.gas_price = next_block.base_fee.into(); - evm.env.tx.value = rU256::ZERO; - - let result = match evm.transact_commit() { - Ok(result) => result, - Err(e) => return Err(SimulationError::BackrunEvmError(e)), - }; - let output = match result { - ExecutionResult::Success { output, .. } => match output { - Output::Call(o) => o, - Output::Create(o, _) => o, - }, - ExecutionResult::Revert { output, .. } => { - return Err(SimulationError::BackrunReverted(output)) - } - ExecutionResult::Halt { reason, .. } => return Err(SimulationError::BackrunHalted(reason)), - }; - let (_backrun_out, post_sandwich_balance) = match pool_variant { - PoolVariant::UniswapV2 => { - match tx_builder::braindance::decode_swap_v2_result(output.into()) { - Ok(output) => output, - Err(e) => return Err(SimulationError::FailedToDecodeOutput(e)), - } - } - PoolVariant::UniswapV3 => { - match tx_builder::braindance::decode_swap_v3_result(output.into()) { - Ok(output) => output, - Err(e) => return Err(SimulationError::FailedToDecodeOutput(e)), - } - } - }; - - let revenue = post_sandwich_balance - .checked_sub(braindance_starting_balance()) - .unwrap_or_default(); - - Ok(revenue) -} - -#[cfg(test)] -mod test { - use std::str::FromStr; - - use crate::{ - prelude::{fork_factory::ForkFactory, sandwich_types::RawIngredients}, - utils::{self, constants, testhelper, tx_builder::SandwichMaker}, - }; - use dotenv::dotenv; - use ethers::prelude::*; - use tokio::{runtime::Runtime, time::Instant}; - - async fn create_test(fork_block_num: u64, pool_addr: &str, meats: Vec<&str>, is_v2: bool) { - dotenv().ok(); - let ws_provider = testhelper::create_ws().await; - - let start = Instant::now(); - - let pool = match is_v2 { - true => { - testhelper::create_v2_pool(pool_addr.parse::
().unwrap(), &ws_provider) - .await - } - false => { - testhelper::create_v3_pool(pool_addr.parse::
().unwrap(), &ws_provider) - .await - } - }; - - let mut victim_txs = vec![]; - - for tx_hash in meats { - let tx_hash = TxHash::from_str(tx_hash).unwrap(); - victim_txs.push(ws_provider.get_transaction(tx_hash).await.unwrap().unwrap()); - } - - let state = utils::state_diff::get_from_txs( - &ws_provider, - &victim_txs, - BlockNumber::Number(U64::from(fork_block_num)), - ) - .await - .unwrap(); - - let initial_db = utils::state_diff::to_cache_db( - &state, - Some(BlockId::Number(BlockNumber::Number(fork_block_num.into()))), - &ws_provider, - ) - .await - .unwrap(); - let mut db = ForkFactory::new_sandbox_factory( - ws_provider.clone(), - initial_db, - Some(fork_block_num.into()), - ); - - let ingredients = - RawIngredients::new(&pool, victim_txs, constants::get_weth_address(), state) - .await - .unwrap(); - - match super::create_optimal_sandwich( - &ingredients, - ethers::utils::parse_ether("50").unwrap(), - &testhelper::get_next_block_info(fork_block_num, &ws_provider).await, - &mut db, - &SandwichMaker::new().await, - ) - .await - { - Ok(sandwich) => println!("revenue: {:?}", sandwich.revenue), - Err(_) => println!("not sandwichable"), - }; - println!("total_duration took: {:?}", start.elapsed()); - } - - #[test] - fn sandv2_sushi_router() { - // Can't use [tokio::test] attr with `global_backed` for some reason - // so manually create a runtime - let rt = Runtime::new().unwrap(); - rt.block_on(async { - create_test( - 16873147, - "0xB84C45174Bfc6b8F3EaeCBae11deE63114f5c1b2", - vec!["0xb344fdc6a3b7c65c5dd971cb113567e2ee6d0636f261c3b8d624627b90694cdb"], - true, - ) - .await; - }); - } - - #[test] - fn sandv3_uniswap_universal_router_one() { - // Can't use [tokio::test] attr with `global_backed` for some reason - // so manually create a runtime - let rt = Runtime::new().unwrap(); - rt.block_on(async { - create_test( - 16863224, - "0x62CBac19051b130746Ec4CF96113aF5618F3A212", - vec!["0x90dfe56814821e7f76f2e4970a7b35948670a968abffebb7be69fe528283e6d8"], - false, - ) - .await; - }); - } - - #[test] - fn sandv3_uniswap_universal_router_two() { - // Can't use [tokio::test] attr with `global_backed` for some reason - // so manually create a runtime - let rt = Runtime::new().unwrap(); - rt.block_on(async { - create_test( - 16863008, - "0xa80838D2BB3d6eBaEd1978FA23b38F91775D8378", - vec!["0xcb0d4dc905ae0662e5f18b4ad0c2af4e700e8b5969d878a2dcfd0d9507435f4d"], - false, - ) - .await; - }); - } - - #[test] - fn sandv2_kyber_swap() { - // Can't use [tokio::test] attr with `global_backed` for some reason - // so manually create a runtime - let rt = Runtime::new().unwrap(); - rt.block_on(async { - create_test( - 16863312, - "0x08650bb9dc722C9c8C62E79C2BAfA2d3fc5B3293", - vec!["0x907894174999fdddc8d8f8e90c210cdb894b91c2c0d79ac35603007d3ce54d00"], - true, - ) - .await; - }); - } - - #[test] - fn sandv2_non_sandwichable() { - // Can't use [tokio::test] attr with `global_backed` for some reason - // so manually create a runtime - let rt = Runtime::new().unwrap(); - rt.block_on(async { - create_test( - 16780624, - "0x657c6a08d49b4f0778f9cce1dc49d196cfce9d08", - vec!["0x77b0b15a3216885a66b3b800173e0edcae9d8d191f7093b99a46fc9346f67466"], - true, - ) - .await; - }); - } - - #[test] - fn sandv2_multi_with_three_expect_one_reverts() { - // Can't use [tokio::test] attr with `global_backed` for some reason - // so manually create a runtime - let rt = Runtime::new().unwrap(); - rt.block_on(async { - create_test( - 16780624, - "0x657c6a08d49b4f0778f9cce1dc49d196cfce9d08", - vec![ - "0x4791d05bdd6765f036ff4ae44fc27099997417e3bdb053ecb52182bbfc7767c5", - "0x923c9ba97fea8d72e60c14d1cc360a8e7d99dd4b31274928d6a79704a8546eda", - "0x77b0b15a3216885a66b3b800173e0edcae9d8d191f7093b99a46fc9346f67466", - ], - true, - ) - .await; - }); - } - - #[test] - fn sandv2_multi_two() { - // Can't use [tokio::test] attr with `global_backed` for some reason - // so manually create a runtime - let rt = Runtime::new().unwrap(); - rt.block_on(async { - create_test( - 16780624, - "0x657c6a08d49B4F0778f9cce1Dc49d196cFCe9d08", - vec![ - "0x4791d05bdd6765f036ff4ae44fc27099997417e3bdb053ecb52182bbfc7767c5", - "0x923c9ba97fea8d72e60c14d1cc360a8e7d99dd4b31274928d6a79704a8546eda", - ], - true, - ) - .await; - }); - } - - #[test] - fn sandv2_metamask_swap_router() { - // Can't use [tokio::test] attr with `global_backed` for some reason - // so manually create a runtime - let rt = Runtime::new().unwrap(); - rt.block_on(async { - create_test( - 16873743, - "0x7A9dDcf06260404D14AbE3bE99c1804D2A5239ce", - vec!["0xcce01725bf7abfab3a4a533275cb4558a66d7794153b4ec01debaf5abd0dc21f"], - true, - ) - .await; - }); - } -} diff --git a/bot/src/simulate/mod.rs b/bot/src/simulate/mod.rs deleted file mode 100644 index 1d034e6..0000000 --- a/bot/src/simulate/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -pub mod helpers; -pub mod inspectors; -pub mod make_sandwich; - -pub use helpers::*; -pub use inspectors::*; -pub use make_sandwich::*; diff --git a/bot/src/types/block.rs b/bot/src/types/block.rs deleted file mode 100644 index bcfe2db..0000000 --- a/bot/src/types/block.rs +++ /dev/null @@ -1,94 +0,0 @@ -use std::sync::Arc; - -use crate::utils; -use ethers::prelude::*; - -#[derive(Debug, Clone, Default)] -pub struct BlockInfo { - pub number: U64, - pub timestamp: U256, - pub base_fee: U256, -} - -impl BlockInfo { - // Create a new `BlockInfo` instance - pub fn new(number: U64, timestamp: U256, base_fee: U256) -> Self { - Self { - number, - timestamp, - base_fee, - } - } - - // Find the next block ahead of `prev_block` - pub fn find_next_block_info(prev_block: Block) -> Self { - let number = prev_block.number.unwrap_or_default() + 1; - let timestamp = prev_block.timestamp + 12; - let base_fee = utils::calculate_next_block_base_fee(prev_block); - - Self { - number, - timestamp, - base_fee, - } - } -} - -#[derive(Debug, Clone, Default)] -pub struct BlockOracle { - pub latest_block: BlockInfo, - pub next_block: BlockInfo, -} - -impl BlockOracle { - // Create new latest block oracle - pub async fn new(client: &Arc>) -> Result { - let latest_block = match client.get_block(BlockNumber::Latest).await { - Ok(b) => b, - Err(e) => return Err(e), - }; - - let lb = if let Some(b) = latest_block { - b - } else { - return Err(ProviderError::CustomError("Block not found".to_string())); - }; - - // latets block info - let number = lb.number.unwrap(); - let timestamp = lb.timestamp; - let base_fee = lb.base_fee_per_gas.unwrap_or_default(); - - let latest_block = BlockInfo::new(number, timestamp, base_fee); - - // next block info - let number = number + 1; - let timestamp = timestamp + 12; - let base_fee = utils::calculate_next_block_base_fee(lb); - - let next_block = BlockInfo::new(number, timestamp, base_fee); - - Ok(BlockOracle { - latest_block, - next_block, - }) - } - - // Updates block's number - pub fn update_block_number(&mut self, block_number: U64) { - self.latest_block.number = block_number; - self.next_block.number = block_number + 1; - } - - // Updates block's timestamp - pub fn update_block_timestamp(&mut self, timestamp: U256) { - self.latest_block.timestamp = timestamp; - self.next_block.timestamp = timestamp + 12; - } - - // Updates block's base fee - pub fn update_base_fee(&mut self, latest_block: Block) { - self.latest_block.base_fee = latest_block.base_fee_per_gas.unwrap_or_default(); - self.next_block.base_fee = utils::calculate_next_block_base_fee(latest_block); - } -} diff --git a/bot/src/types/errors.rs b/bot/src/types/errors.rs deleted file mode 100644 index 87b90ad..0000000 --- a/bot/src/types/errors.rs +++ /dev/null @@ -1,108 +0,0 @@ -use std::fmt; - -use ethers::prelude::{AbiError, ContractError}; -use ethers::providers::{Provider, ProviderError, Ws}; -use ethers::signers::WalletError; -use ethers::types::H160; -use thiserror::Error; -use tokio::task::JoinError; - -use crate::prelude::is_sando_safu::OpCode; -use crate::prelude::DatabaseError; - -#[derive(Error, Debug)] -pub enum PairSyncError { - #[error("Provider error")] - ProviderError(#[from] ProviderError), - #[error("Contract error")] - ContractError(#[from] ContractError>), - #[error("ABI error")] - ABIError(#[from] AbiError), - #[error("Join error")] - JoinError(#[from] JoinError), - #[error("Pair for token_a/token_b does not exist in provided dexes")] - PairDoesNotExistInDexes(H160, H160), -} - -#[derive(Error, Debug)] -pub enum SendBundleError { - #[error("Failed to sign transaction")] - SigningError(#[from] WalletError), - #[error("Max fee is less than next base fee")] - MaxFeeLessThanNextBaseFee(), - #[error("Negative miner tip")] - NegativeMinerTip(), - #[error("Failed to create bundle")] - FailedToCreateBundle(), - #[error("Failed to send bundle")] - FailedToSendBundle(), - #[error("Revenue does not cover frontrun gas fees")] - FrontrunGasFeesNotCovered(), -} - -#[derive(Debug)] -pub enum SimulationError { - FrontrunEvmError(revm::primitives::EVMError), - FrontrunHalted(revm::primitives::Halt), - FrontrunReverted(revm::primitives::Bytes), - FrontrunNotSafu(Vec), - BackrunEvmError(revm::primitives::EVMError), - BackrunHalted(revm::primitives::Halt), - BackrunReverted(revm::primitives::Bytes), - BackrunNotSafu(Vec), - FailedToDecodeOutput(AbiError), - EvmError(revm::primitives::EVMError), - EvmHalted(revm::primitives::Halt), - EvmReverted(revm::primitives::Bytes), - AbiError(AbiError), - ZeroOptimal(), -} - -impl fmt::Display for SimulationError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - SimulationError::FrontrunEvmError(db_err) => { - write!(f, "Fromrun ran into an EVM error : {:?}", db_err) - } - SimulationError::FrontrunHalted(halt_reason) => { - write!(f, "Frontrun halted due to : {:?}", halt_reason) - } - SimulationError::FrontrunReverted(bytes) => { - write!(f, "Frontrun reverted and returned : {}", hex::encode(bytes)) - } - SimulationError::FrontrunNotSafu(sus) => { - write!(f, "Frontrun not safu because of the opcodes : {:?}", sus) - } - SimulationError::BackrunEvmError(db_err) => { - write!(f, "Backrun ran into an EVM error : {:?}", db_err) - } - SimulationError::BackrunHalted(halt_reason) => { - write!(f, "Backrun halted due to : {:?}", halt_reason) - } - SimulationError::BackrunReverted(bytes) => { - write!(f, "Backrun reverted and returned : {}", hex::encode(bytes)) - } - SimulationError::BackrunNotSafu(sus) => { - write!(f, "Backrun not safu because of the opcodes : {:?}", sus) - } - SimulationError::FailedToDecodeOutput(error_reason) => { - write!(f, "Failed to decode output : {:?}", error_reason) - } - SimulationError::EvmError(db_err) => { - write!(f, "Ran into an EVM error : {:?}", db_err) - } - SimulationError::EvmHalted(halt_reason) => { - write!(f, "EVM halted due to : {:?}", halt_reason) - } - SimulationError::EvmReverted(bytes) => { - write!(f, "EVM reverted and returned : {}", hex::encode(bytes)) - } - SimulationError::AbiError(reason) => { - write!(f, "Failed to decode ABI due to : {:?}", reason) - } - SimulationError::ZeroOptimal() => { - write!(f, "No optimal sandwich found") - } - } - } -} diff --git a/bot/src/types/mod.rs b/bot/src/types/mod.rs deleted file mode 100644 index 2d6ae73..0000000 --- a/bot/src/types/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -pub mod sandwich_types; - -pub mod errors; -pub use errors::*; - -pub mod block; -pub use block::*; diff --git a/bot/src/types/sandwich_types/mod.rs b/bot/src/types/sandwich_types/mod.rs deleted file mode 100644 index f390c7d..0000000 --- a/bot/src/types/sandwich_types/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -// Holds info needed to prepare sandwich -mod raw_ingredients; -pub use raw_ingredients::*; - -// Holds info to capture sandwich -mod optimal_recipe; -pub use optimal_recipe::*; diff --git a/bot/src/types/sandwich_types/optimal_recipe.rs b/bot/src/types/sandwich_types/optimal_recipe.rs deleted file mode 100644 index 249e22f..0000000 --- a/bot/src/types/sandwich_types/optimal_recipe.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::collections::BTreeMap; - -use ethers::{prelude::*, types::transaction::eip2930::AccessList}; - -use crate::prelude::Pool; -// Keep track of the optimal parameters to succesfully sandwich victim -#[derive(Debug, Clone)] -pub struct OptimalRecipe { - pub frontrun_data: Bytes, - pub frontrun_value: U256, - pub frontrun_gas_used: u64, - pub frontrun_access_list: AccessList, - pub backrun_data: Bytes, - pub backrun_value: U256, - pub backrun_gas_used: u64, - pub backrun_access_list: AccessList, - pub meats: Vec, - pub target_pool: Pool, - pub revenue: U256, - pub has_dust: bool, - pub state_diffs: BTreeMap, -} - -impl OptimalRecipe { - // Create a new `OptimalRecipe` instance - pub fn new( - frontrun_data: Bytes, - frontrun_value: U256, - frontrun_gas_used: u64, - frontrun_access_list: AccessList, - backrun_data: Bytes, - backrun_value: U256, - backrun_gas_used: u64, - backrun_access_list: AccessList, - meats: Vec, - revenue: U256, - target_pool: Pool, - state_diffs: BTreeMap, - ) -> Self { - Self { - frontrun_data, - frontrun_value, - frontrun_gas_used, - frontrun_access_list, - backrun_data, - backrun_value, - backrun_gas_used, - backrun_access_list, - meats, - revenue, - target_pool, - has_dust: false, - state_diffs, - } - } - - // Does contract have dust for the target token associated with this opportunity - pub fn set_has_dust(&mut self, dust: bool) { - self.has_dust = dust; - } - - // Used for logging - pub fn print_meats_new_line(&self) -> String { - let mut s = String::new(); - s.push('['); - for (x, i) in self.meats.iter().zip(0..self.meats.len()) { - s.push_str(&format!("{:?}", x.hash)); - if i != self.meats.len() - 1 { - s.push_str(",\n"); - } - } - s.push(']'); - s - } - - // Used for logging - pub fn print_meats(&self) -> String { - let mut s = String::new(); - s.push('['); - for (i, x) in self.meats.iter().enumerate() { - s.push_str(&format!("{:?}", x.hash)); - if i != self.meats.len() - 1 { - s.push_str(","); - } - } - s.push(']'); - s - } -} diff --git a/bot/src/types/sandwich_types/raw_ingredients.rs b/bot/src/types/sandwich_types/raw_ingredients.rs deleted file mode 100644 index c521ed6..0000000 --- a/bot/src/types/sandwich_types/raw_ingredients.rs +++ /dev/null @@ -1,52 +0,0 @@ -use std::collections::BTreeMap; - -use ethers::prelude::*; -use eyre::Result; - -use crate::{prelude::Pool, utils}; - -#[derive(Debug, Clone)] -/// Holds all info needed to for sandwich simulations -pub struct RawIngredients { - /// the token that we start and end the sandwich with - pub startend_token: Address, - /// the token that bot holds only for duration of sandwich - pub intermediary_token: Address, - pub from: Address, - pub sandwich_contract: Address, - pub meats: Vec, - pub target_pool: Pool, - /// holds the state diffs produced from meats - pub state_diffs: BTreeMap, -} - -impl RawIngredients { - // Create a new `RawIngredients` instance - pub async fn new( - target_pair: &Pool, - victim_txs: Vec, - start_token: Address, // which token to start trade from (input_token) - state_diffs: BTreeMap, - ) -> Result { - let (mut input_token, mut output_token) = (target_pair.token_0, target_pair.token_1); - - // swap if input_token is equal to token_1 - if start_token == target_pair.token_1 { - (input_token, output_token) = (output_token, input_token); - } - - let sandwich_contract = utils::dotenv::get_sandwich_contract_address(); - - let from = utils::dotenv::get_searcher_wallet().address(); - - Ok(RawIngredients { - from, - meats: victim_txs, - target_pool: *target_pair, - sandwich_contract, - startend_token: input_token, - intermediary_token: output_token, - state_diffs, - }) - } -} diff --git a/bot/src/utils/alert.rs b/bot/src/utils/alert.rs deleted file mode 100644 index f497e41..0000000 --- a/bot/src/utils/alert.rs +++ /dev/null @@ -1,107 +0,0 @@ -use ethers::prelude::*; -use std::collections::HashMap; - -use crate::prelude::is_sando_safu::OpCode; -use crate::prelude::{sandwich_types::OptimalRecipe, PoolVariant}; -use crate::utils; - -// Alerts discord channel, via webhook, that a bundle has been sent -pub async fn alert_bundle<'a>( - bundle_hash: H256, - target_block: U64, - is_bundle_included: bool, - recipe: &OptimalRecipe, - profit: U256, -) { - let bundle_hash = format!("{:?}", bundle_hash); - let meat_hashes = format!("{:?}", recipe.print_meats_new_line()); - let response_status = if is_bundle_included { - String::from("🟩") - } else { - String::from("🟥") - }; - - let webhook = match recipe.target_pool.pool_variant { - PoolVariant::UniswapV2 => utils::dotenv::get_v2_alert_webhook(), - PoolVariant::UniswapV3 => utils::dotenv::get_v3_alert_webhook(), - }; - - let msg = format!( - " - {} - bundle hash: {} - target block: {} - meats: {} - ---------- - ---------- - fr gas: {} - br gas: {} - ---------- - ---------- - revenue: {} - profit: {} - ", - response_status.repeat(8), - bundle_hash, - target_block, - meat_hashes, - recipe.frontrun_gas_used, - recipe.backrun_gas_used, - recipe.revenue.as_u128(), - profit - ); - - let max_length = 1900.min(msg.len()); - let message = msg[..max_length].to_string(); - let mut bundle_notif = HashMap::new(); - bundle_notif.insert("content", message.to_string()); - - let client = reqwest::Client::new(); - - tokio::spawn(async move { - let res = client.post(webhook).json(&bundle_notif).send().await; - match res { - Ok(_) => {} - Err(err) => { - log::error!("Could not send alert to discord, err: {}", err); - log::error!("Message: {}", message); - } - } - }) - .await - .unwrap(); -} - -/// Alerts discord channel, via webhook about found a poison token -pub async fn alert_poison(malicious_token: Address, malicious_opcodes: Vec) { - let msg = format!( - " - poison detected: - token: {:?} - opcodes: {:?} - ", - malicious_token, malicious_opcodes - ); - - let max_length = 1900.min(msg.len()); - let message = msg[..max_length].to_string(); - let mut map = HashMap::new(); - map.insert("content", message.to_string()); - - let webhook = utils::dotenv::poison_alert_webhook(); - let client = reqwest::Client::new(); - - tokio::spawn(async move { - let res = client.post(webhook.to_string()).json(&map).send().await; - - match res { - Ok(_) => {} - Err(err) => { - log::error!("Could not send alert to discord, err: {}", err); - log::error!("Message: {}", message); - } - } - }) - .await - .unwrap(); -} diff --git a/bot/src/utils/constants.rs b/bot/src/utils/constants.rs deleted file mode 100644 index f9dbf25..0000000 --- a/bot/src/utils/constants.rs +++ /dev/null @@ -1,50 +0,0 @@ -use std::str::FromStr; - -use ethers::prelude::*; -use indoc::indoc; - -// Return weth address -pub fn get_weth_address() -> Address { - Address::from_str("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2").unwrap() -} - -// Return the ethdev address (used if we need funds) -pub fn get_eth_dev() -> Address { - Address::from_str("0x5AbFEc25f74Cd88437631a7731906932776356f9").unwrap() -} - -// Returns the bytecode for our custom modded router contract -pub fn get_braindance_code() -> Bytes { - "608060405234801561001057600080fd5b506004361061004c5760003560e01c80634b588d401461005157806381eeb93c1461007d57806390063e5914610090578063fa461e33146100a5575b600080fd5b61006461005f366004610994565b6100b8565b6040805192835260208301919091520160405180910390f35b61006461008b366004610994565b61023d565b6100a361009e3660046109e7565b610502565b005b6100a36100b3366004610a46565b61061d565b600080846001600160a01b038085169086161082816100eb5773fffd8963efd1fc6a506488495d951d5263988d256100f2565b6401000276ad5b90506000828860405160200161011d92919091151582526001600160a01b0316602082015260400190565b6040516020818303038152906040529050600080856001600160a01b031663128acb0830878f88886040518663ffffffff1660e01b8152600401610165959493929190610b13565b60408051808303816000875af1158015610183573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a79190610b4e565b91509150846101b657816101b8565b805b6101c190610b88565b6040516370a0823160e01b81523060048201529098506001600160a01b038a16906370a0823190602401602060405180830381865afa158015610208573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061022c9190610ba4565b965050505050505094509492505050565b60405163a9059cbb60e01b81526001600160a01b03848116600483015260248201869052600091829185169063a9059cbb906044016020604051808303816000875af1158015610291573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b59190610bcb565b50600080600080886001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156102fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031e9190610c0b565b506001600160701b031691506001600160701b03169150866001600160a01b0316886001600160a01b0316101561035a57819350809250610361565b8093508192505b50506040516370a0823160e01b81526001600160a01b0388811660048301526000916103dd918591908a16906370a0823190602401602060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d79190610ba4565b90610740565b90506103ea8184846107a1565b9450600080876001600160a01b0316896001600160a01b03161061041057866000610414565b6000875b6040805160008152602081019182905263022c0d9f60e01b90915291935091506001600160a01b038b169063022c0d9f906104589085908590309060248101610c5b565b600060405180830381600087803b15801561047257600080fd5b505af1158015610486573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201526001600160a01b038b1692506370a082319150602401602060405180830381865afa1580156104ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f29190610ba4565b9550505050505094509492505050565b60405163a9059cbb60e01b81526001600160a01b0384811660048301526024820187905283169063a9059cbb906044016020604051808303816000875af1158015610551573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105759190610bcb565b50600080826001600160a01b0316846001600160a01b03161061059a5785600061059e565b6000865b6040805160008152602081019182905263022c0d9f60e01b90915291935091506001600160a01b0386169063022c0d9f906105e29085908590309060248101610c5b565b600060405180830381600087803b1580156105fc57600080fd5b505af1158015610610573d6000803e3d6000fd5b5050505050505050505050565b600084138061062c5750600083135b61063557600080fd5b60008061064483850185610c92565b9150915081156106c55760405163a9059cbb60e01b8152336004820152602481018790526001600160a01b0382169063a9059cbb906044016020604051808303816000875af115801561069b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bf9190610bcb565b50610738565b60405163a9059cbb60e01b8152336004820152602481018690526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610712573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107369190610bcb565b505b505050505050565b60008261074d8382610ccb565b915081111561079b5760405162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b60448201526064015b60405180910390fd5b92915050565b60008084116108065760405162461bcd60e51b815260206004820152602b60248201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4960448201526a1394155517d05353d5539560aa1b6064820152608401610792565b6000831180156108165750600082115b6108735760405162461bcd60e51b815260206004820152602860248201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4c604482015267495155494449545960c01b6064820152608401610792565b6000610881856103e56108c0565b9050600061088f82856108c0565b905060006108a9836108a3886103e86108c0565b90610927565b90506108b58183610ce2565b979650505050505050565b60008115806108e4575082826108d68183610d04565b92506108e29083610ce2565b145b61079b5760405162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b6044820152606401610792565b6000826109348382610d23565b915081101561079b5760405162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b6044820152606401610792565b6001600160a01b038116811461099157600080fd5b50565b600080600080608085870312156109aa57600080fd5b8435935060208501356109bc8161097c565b925060408501356109cc8161097c565b915060608501356109dc8161097c565b939692955090935050565b600080600080600060a086880312156109ff57600080fd5b85359450602086013593506040860135610a188161097c565b92506060860135610a288161097c565b91506080860135610a388161097c565b809150509295509295909350565b60008060008060608587031215610a5c57600080fd5b8435935060208501359250604085013567ffffffffffffffff80821115610a8257600080fd5b818701915087601f830112610a9657600080fd5b813581811115610aa557600080fd5b886020828501011115610ab757600080fd5b95989497505060200194505050565b6000815180845260005b81811015610aec57602081850181015186830182015201610ad0565b81811115610afe576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0386811682528515156020830152604082018590528316606082015260a0608082018190526000906108b590830184610ac6565b60008060408385031215610b6157600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b6000600160ff1b8201610b9d57610b9d610b72565b5060000390565b600060208284031215610bb657600080fd5b5051919050565b801515811461099157600080fd5b600060208284031215610bdd57600080fd5b8151610be881610bbd565b9392505050565b80516001600160701b0381168114610c0657600080fd5b919050565b600080600060608486031215610c2057600080fd5b610c2984610bef565b9250610c3760208501610bef565b9150604084015163ffffffff81168114610c5057600080fd5b809150509250925092565b84815283602082015260018060a01b0383166040820152608060608201526000610c886080830184610ac6565b9695505050505050565b60008060408385031215610ca557600080fd5b8235610cb081610bbd565b91506020830135610cc08161097c565b809150509250929050565b600082821015610cdd57610cdd610b72565b500390565b600082610cff57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610d1e57610d1e610b72565b500290565b60008219821115610d3657610d36610b72565b50019056fea2646970667358221220acb668db58d51617c0d50e902950ba737188460329e57df8dc4a043d4483bdad64736f6c634300080f0033".parse().unwrap() -} - -// Return runtime code for our sandwich contract (if u want to test new contract impl) -pub fn get_test_sandwich_code() -> Bytes { - "3d3560001a565b610624565b61077e565b6106d1565b610843565b6104d2565b610587565b610425565b610390565b6102d4565b610230565b610908565b610928565b61094e5600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005b6099357fff000000000000000000000000000000000000000000000000000000000000006000527f1f98431c8ad98523631ae4a59f267346ea31f98400000000000000000000000046526015527fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54603552605560002073ffffffffffffffffffffffffffffffffffffffff163314156109ba573d3d60443d3d7effffffffffffffffffffffffffffffffffffffff00000000000000000000006084351660581c60843560f81c6101fa577fa9059cbb000000000000000000000000000000000000000000000000000000003d52336004526024356024525af1156109ba57005b7fa9059cbb000000000000000000000000000000000000000000000000000000003d52336004526004356024525af1156109ba57005b737e5f4552091a69125d5dfcb7b8c2659029395bdf3314156109ba573d3d60f93d3d463560601c7f128acb080000000000000000000000000000000000000000000000000000000060005230600452620186a0340260445273fffd8963efd1fc6a506488495d951d5263988d2560645260a0608452603560a45273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc260581b60c45260153560d9525af1156109ba57005b737e5f4552091a69125d5dfcb7b8c2659029395bdf3314156109ba573d3d60f93d3d463560601c7f128acb0800000000000000000000000000000000000000000000000000000000600052306004526001602452620186a034026044526401000276ad60645260a0608452603560a4527f010000000000000000000000000000000000000000000000000000000000000073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc260581b0160c45260153560d9525af1156109ba57005b737e5f4552091a69125d5dfcb7b8c2659029395bdf3314156109ba573d3d60f93d3d463560601c7f128acb08000000000000000000000000000000000000000000000000000000006000523060045260293560d01c60445273fffd8963efd1fc6a506488495d951d5263988d2560645260a0608452603560a45260153560601c60581b60c452602f3560d9525af1156109ba57005b737e5f4552091a69125d5dfcb7b8c2659029395bdf3314156109ba573d3d60f93d3d463560601c7f128acb080000000000000000000000000000000000000000000000000000000060005230600452600160245260293560d01c6044526401000276ad60645260a0608452603560a4527f010000000000000000000000000000000000000000000000000000000000000060153560601c60581b0160c452602f3560d9525af1156109ba57005b737e5f4552091a69125d5dfcb7b8c2659029395bdf3314156109ba573d3d60f93d3d463560601c7f128acb080000000000000000000000000000000000000000000000000000000060005230600452600160245260293560b81c6509184e72a000026044526401000276ad60645260a0608452603560a4527f010000000000000000000000000000000000000000000000000000000000000060153560601c60581b0160c45260323560d9525af1156109ba57005b737e5f4552091a69125d5dfcb7b8c2659029395bdf3314156109ba573d3d60f93d3d463560601c7f128acb08000000000000000000000000000000000000000000000000000000006000523060045260293560b81c6509184e72a0000260445273fffd8963efd1fc6a506488495d951d5263988d2560645260a0608452603560a45260153560601c60581b60c45260323560d9525af1156109ba57005b737e5f4552091a69125d5dfcb7b8c2659029395bdf3314156109ba573d3d60a43d3d463560601c3d3d7fa9059cbb000000000000000000000000000000000000000000000000000000003d52826004526029358060081b9060001a5260443d3d60153560601c5af1507f022c0d9f00000000000000000000000000000000000000000000000000000000600052620186a0340260045260006024523060445260806064525af1156109ba57005b737e5f4552091a69125d5dfcb7b8c2659029395bdf3314156109ba573d3d60a43d3d463560601c3d3d7fa9059cbb000000000000000000000000000000000000000000000000000000003d52826004526029358060081b9060001a5260443d3d60153560601c5af1507f022c0d9f000000000000000000000000000000000000000000000000000000006000526000600452620186a034026024523060445260806064525af1156109ba57005b737e5f4552091a69125d5dfcb7b8c2659029395bdf3314156109ba573d3d60a43d3d463560601c3d3d7f23b872dd000000000000000000000000000000000000000000000000000000003d523060045282602452620186a0340260445260643d3d73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25af1507f022c0d9f00000000000000000000000000000000000000000000000000000000600052600060045260006024526015358060081b9060001a523060445260806064525af1156109ba57005b737e5f4552091a69125d5dfcb7b8c2659029395bdf3314156109ba573d3d60a43d3d463560601c3d3d7f23b872dd000000000000000000000000000000000000000000000000000000003d523060045282602452620186a0340260445260643d3d73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25af1507f022c0d9f0000000000000000000000000000000000000000000000000000000060005260006004526015358060081b9060001a5260006024523060445260806064525af1156109ba57005b732b5ad5c4795c026514f8317c7a215e218dccd6cf3314156109ba5733ff005b732b5ad5c4795c026514f8317c7a215e218dccd6cf3314156109ba573d3d3d3d47335af1005b732b5ad5c4795c026514f8317c7a215e218dccd6cf3314156109ba577fa9059cbb0000000000000000000000000000000000000000000000000000000059523360045246356024523d3d60443d3d73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25af1156109ba57005b600380fd".parse().unwrap() -} - -// Return the event signature to a erc20 transfer -pub fn get_erc20_transfer_event_signature() -> H256 { - H256::from_str("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef").unwrap() -} - -pub fn get_banner() -> &'static str { - let banner = indoc! { -r#" - - _____ ___ _ _ ______ _____ ______ _____ -/ ___| / _ \ | \ | || _ \| _ | | ___ \/ ___| -\ `--. / /_\ \| \| || | | || | | | ______ | |_/ /\ `--. - `--. \| _ || . ` || | | || | | ||______|| / `--. \ -/\__/ /| | | || |\ || |/ / \ \_/ / | |\ \ /\__/ / -\____/ \_| |_/\_| \_/|___/ \___/ \_| \_|\____/ - -______ __ __ _____ ___ ___ _____ _ _ _____ _____ _ _____ _____ _____ -| ___ \\ \ / / _ | _ | | \/ || _ || | | |/ ___|| ___|| | | ___|/ ___|/ ___| -| |_/ / \ V / (_) | |/' |__ __| . . || | | || | | |\ `--. | |__ | | | |__ \ `--. \ `--. -| ___ \ \ / | /| |\ \/ /| |\/| || | | || | | | `--. \| __| | | | __| `--. \ `--. \ -| |_/ / | | _ \ |_/ / > < | | | |\ \_/ /| |_| |/\__/ /| |___ | |____| |___ /\__/ //\__/ / -\____/ \_/ (_) \___/ /_/\_\\_| |_/ \___/ \___/ \____/ \____/ \_____/\____/ \____/ \____/ -"#}; - banner -} diff --git a/bot/src/utils/contracts.rs b/bot/src/utils/contracts.rs deleted file mode 100644 index 053e389..0000000 --- a/bot/src/utils/contracts.rs +++ /dev/null @@ -1,21 +0,0 @@ -use std::sync::Arc; - -use ethers::{prelude::*, providers}; - -use crate::prelude::{Erc20, UniswapV2Pair}; - -/// Create erc20 contract that we can interact with -pub fn get_erc20_contract( - erc20_address: &Address, - client: &Arc>, -) -> Erc20> { - Erc20::new(*erc20_address, client.clone()) -} - -/// Create v2 pair contract that we can interact with -pub fn get_pair_v2_contract( - pair_address: &Address, - client: &Arc>, -) -> UniswapV2Pair> { - UniswapV2Pair::new(*pair_address, client.clone()) -} diff --git a/bot/src/utils/dotenv.rs b/bot/src/utils/dotenv.rs deleted file mode 100644 index 07c2042..0000000 --- a/bot/src/utils/dotenv.rs +++ /dev/null @@ -1,97 +0,0 @@ -use ethers::prelude::*; -use std::str::FromStr; - -// Construct the searcher wallet -pub fn get_searcher_wallet() -> LocalWallet { - let searcher_private_key = std::env::var("SEARCHER_PRIVATE_KEY") - .expect("Required environment variable \"SEARCHER_PRIVATE_KEY\" not set"); - searcher_private_key - .parse::() - .expect("Failed to parse private key") -} - -// Get block number that sandwich contract was deployed in -pub fn get_sandwich_inception_block() -> U64 { - let inception_block = std::env::var("SANDWICH_INCEPTION_BLOCK") - .expect("Required environment variable \"SANDWICH_INCEPTION_BLOCK\" not set"); - - let inception_block = inception_block - .parse::() - .expect("Failed to parse \"SANDWICH_INCEPTION_BLOCK\" into u64"); - - U64::from(inception_block) -} - -/// Construct the bundle signer -/// This is your flashbots searcher identity -pub fn get_bundle_signer() -> LocalWallet { - let private_key = std::env::var("FLASHBOTS_AUTH_KEY") - .expect("Required environment variable \"FLASHBOTS_AUTH_KEY\" not set"); - private_key - .parse::() - .expect("Failed to parse flashbots signer") -} - -/// Returns the configured Sandwich Contract Address -pub fn get_sandwich_contract_address() -> Address { - let addr = std::env::var("SANDWICH_CONTRACT") - .expect("Required environment variable \"SANDWICH_CONTRACT\" not set"); - Address::from_str(&addr).expect("Failed to parse \"SANDWICH_CONTRACT\"") -} - -/// Read environment variables -pub fn read_env_vars() -> Vec<(String, String)> { - let mut env_vars = Vec::new(); - let keys = vec![ - "RPC_URL_WSS", - "SEARCHER_PRIVATE_KEY", - "FLASHBOTS_AUTH_KEY", - "SANDWICH_CONTRACT", - "V2_ALERT_DISCORD_WEBHOOK", - "V3_ALERT_DISCORD_WEBHOOK", - "POISON_ALERT_DISCORD_WEBHOOK", - "SANDWICH_INCEPTION_BLOCK", - ]; - for key in keys { - let value = dotenv::var(key).expect(&format!( - "Required environment variable \"{}\" not set", - key - )); - env_vars.push((key.to_string(), value)); - } - env_vars -} - -/// Return a new ws provider -pub async fn get_ws_provider() -> Provider { - let url = - dotenv::var("RPC_URL_WSS").expect("Required environment variable \"RPC_URL_WSS\" not set"); - Provider::::connect(&url) - .await - .expect("RPC Connection Error") -} - -/// Return a webhook for v2 discord alert channel -pub fn get_v2_alert_webhook() -> String { - dotenv::var("V2_ALERT_DISCORD_WEBHOOK") - .expect("Required environment variable \"V2_ALERT_DISCORD_WEBHOOK\" not set") -} - -/// Return a webhook for v3 discord alert channel -pub fn get_v3_alert_webhook() -> String { - dotenv::var("V3_ALERT_DISCORD_WEBHOOK") - .expect("Required environment variable \"V3_ALERT_DISCORD_WEBHOOK\" not set") -} - -/// Return a webhook for poison discord alert channel -pub fn poison_alert_webhook() -> String { - dotenv::var("POISON_ALERT_DISCORD_WEBHOOK") - .expect("Required environment variable \"POISON_ALERT_DISCORD_WEBHOOK\" not set") -} -/// Return a interval block for update new pools info -pub fn get_interval_block_new_pool() -> u64 { - dotenv::var("INTERVAL_BLOCK_NEW_POOL") - .expect("Required environment variable \"INTERVAL_BLOCK_NEW_POOL\" not set") - .parse() - .expect("INTERVAL_BLOCK_NEW_POOL is not a valid u64") -} \ No newline at end of file diff --git a/bot/src/utils/encode_packed.rs b/bot/src/utils/encode_packed.rs deleted file mode 100644 index 42b89a8..0000000 --- a/bot/src/utils/encode_packed.rs +++ /dev/null @@ -1,68 +0,0 @@ -// credit to: https://github.com/roberts-ivanovs/eth-encode-packed-rs -pub use hex; // Re-export - -use ethers::prelude::*; - -pub struct TakeLastXBytes(pub usize); - -/// Represents a data type in solidity -pub enum PackedToken<'a> { - String(&'a str), - Address(Address), - Bytes(&'a [u8]), - Bool(bool), - Number(U256), - NumberWithShift(U256, TakeLastXBytes), -} - -/// Pack a single `SolidityDataType` into bytes -fn pack<'a>(data_type: &'a PackedToken) -> Vec { - let mut res = Vec::new(); - match data_type { - PackedToken::String(s) => { - res.extend(s.as_bytes()); - } - PackedToken::Address(a) => { - res.extend(a.0); - } - PackedToken::Number(n) => { - for b in n.0.iter().rev() { - let bytes = b.to_be_bytes(); - res.extend(bytes); - } - } - PackedToken::Bytes(b) => { - res.extend(*b); - } - PackedToken::Bool(b) => { - if *b { - res.push(1); - } else { - res.push(0); - } - } - PackedToken::NumberWithShift(n, to_take) => { - let local_res = n.0.iter().rev().fold(vec![], |mut acc, i| { - let bytes = i.to_be_bytes(); - acc.extend(bytes); - acc - }); - - let to_skip = local_res.len() - (to_take.0 / 8); - let local_res = local_res.into_iter().skip(to_skip).collect::>(); - res.extend(local_res); - } - }; - res -} - -pub fn encode_packed(items: &[PackedToken]) -> (Vec, String) { - let res = items.iter().fold(Vec::new(), |mut acc, i| { - let pack = pack(i); - acc.push(pack); - acc - }); - let res = res.join(&[][..]); - let hexed = hex::encode(&res); - (res, hexed) -} diff --git a/bot/src/utils/mod.rs b/bot/src/utils/mod.rs deleted file mode 100644 index 5302e99..0000000 --- a/bot/src/utils/mod.rs +++ /dev/null @@ -1,78 +0,0 @@ -use std::sync::Arc; - -use ethers::{prelude::*, types::transaction::eip2718::TypedTransaction}; - -pub mod alert; -pub mod constants; -pub mod contracts; -pub mod dotenv; -pub mod encode_packed; -pub mod state_diff; -pub mod testhelper; -pub mod tx_builder; - -pub use encode_packed::*; - -// ========= GENERAL HELPERS - -/// Calculate the next block base fee -// based on math provided here: https://ethereum.stackexchange.com/questions/107173/how-is-the-base-fee-per-gas-computed-for-a-new-block -pub fn calculate_next_block_base_fee(block: Block) -> U256 { - // Get the block base fee per gas - let current_base_fee_per_gas = block.base_fee_per_gas.unwrap_or_default(); - - // Get the mount of gas used in the block - let current_gas_used = block.gas_used; - - let current_gas_target = block.gas_limit / 2; - - if current_gas_used == current_gas_target { - current_base_fee_per_gas - } else if current_gas_used > current_gas_target { - let gas_used_delta = current_gas_used - current_gas_target; - let base_fee_per_gas_delta = - current_base_fee_per_gas * gas_used_delta / current_gas_target / 8; - - return current_base_fee_per_gas + base_fee_per_gas_delta; - } else { - let gas_used_delta = current_gas_target - current_gas_used; - let base_fee_per_gas_delta = - current_base_fee_per_gas * gas_used_delta / current_gas_target / 8; - - return current_base_fee_per_gas - base_fee_per_gas_delta; - } -} - -/// Small helper function to convert [U256] into [H256]. -pub fn u256_to_h256_be(u: U256) -> H256 { - let mut h = H256::default(); - u.to_big_endian(h.as_mut()); - h -} - -/// Sign eip1559 transactions -pub async fn sign_eip1559( - tx: Eip1559TransactionRequest, - signer_wallet: &LocalWallet, -) -> Result { - let tx_typed = TypedTransaction::Eip1559(tx); - let signed_frontrun_tx_sig = match signer_wallet.sign_transaction(&tx_typed).await { - Ok(s) => s, - Err(e) => return Err(e), - }; - - Ok(tx_typed.rlp_signed(&signed_frontrun_tx_sig)) -} - -/// Create Websocket Client -pub async fn create_websocket_client() -> eyre::Result>> { - let client = dotenv::get_ws_provider().await; - Ok(Arc::new(client)) -} - -pub async fn get_nonce( - client: &Arc>, - address: Address, -) -> Result { - client.get_transaction_count(address, None).await -} diff --git a/bot/src/utils/state_diff.rs b/bot/src/utils/state_diff.rs deleted file mode 100644 index 3167657..0000000 --- a/bot/src/utils/state_diff.rs +++ /dev/null @@ -1,197 +0,0 @@ -use crate::{prelude::Pool, utils}; -use dashmap::DashMap; -use ethers::prelude::*; -use futures::stream::FuturesUnordered; -use revm::{ - db::{CacheDB, EmptyDB}, - primitives::{AccountInfo, Bytecode}, -}; -use std::{ - collections::{btree_map::Entry, BTreeMap}, - sync::Arc, -}; - -/// Holds pools that have the potential to be sandwiched -#[derive(Clone, Copy, Debug)] -pub struct SandwichablePool { - pub pool: Pool, - // Is swap direction zero to one? - pub is_weth_input: bool, -} - -impl SandwichablePool { - pub fn new(pool: Pool, is_weth_input: bool) -> Self { - Self { - pool, - is_weth_input, - } - } -} - -// Extract state diffs from a given tx -// -// Arguments: -// * `client`: Websocket provider used for making rpc calls -// * `meats`: Vec of transactions to extract state diffs from -// * `block_num`: Block number of the block the txs are in -// -// Returns: -// Some(BTreeMap): State diffs for each address) -// None: If encountered error or state diffs are non existant -pub async fn get_from_txs( - client: &Arc>, - meats: &Vec, - block_num: BlockNumber, -) -> Option> { - // add statediff trace to each transaction - let req = meats - .iter() - .map(|tx| (tx, vec![TraceType::StateDiff])) - .collect(); - - let block_traces = match client.trace_call_many(req, Some(block_num)).await { - Ok(x) => x, - Err(_) => { - // should throw error here but guess None also works :< - return None; - } - }; - - let mut merged_state_diffs = BTreeMap::new(); - - block_traces - .into_iter() - .flat_map(|bt| bt.state_diff.map(|sd| sd.0.into_iter())) - .flatten() - .for_each(|(address, account_diff)| { - match merged_state_diffs.entry(address) { - Entry::Vacant(entry) => { - entry.insert(account_diff); - } - Entry::Occupied(_) => { - // Do nothing if the key already exists - // we only care abt the starting state - } - } - }); - - Some(merged_state_diffs) -} - -/// Decode statediff to produce Vec of pools interacted with -/// -/// Arguments: -/// * `state_diffs`: BTreeMap of Address and AccountDiff -/// * `all_pools`: HashMap of Address and Pool -/// -/// Returns: -/// Some(Vec): Vec of pools that have been interacted with -/// None: If state_diffs is empty -pub fn extract_pools( - state_diffs: &BTreeMap, - all_pools: &DashMap, -) -> Option> { - // capture all addresses that have a state change and are also a pool - let touched_pools: Vec = state_diffs - .keys() - .filter_map(|e| all_pools.get(e).map(|p| (*p.value()).clone())) - .collect(); - - // find direction of swap based on state diff (does weth have state changes?) - let weth_state_diff = &state_diffs - .get(&utils::constants::get_weth_address())? - .storage; - - let mut sandwichable_pools: Vec = vec![]; - - // find storage mapping index for each pool - for pool in touched_pools { - // find mapping storage location - let storage_key = TxHash::from(ethers::utils::keccak256(abi::encode(&[ - abi::Token::Address(pool.address), - abi::Token::Uint(U256::from(3)), - ]))); - let is_weth_input = match weth_state_diff.get(&storage_key)? { - Diff::Changed(c) => { - let from = U256::from(c.from.to_fixed_bytes()); - let to = U256::from(c.to.to_fixed_bytes()); - to > from - } - _ => continue, - }; - sandwichable_pools.push(SandwichablePool::new(pool, is_weth_input)); - } - - Some(sandwichable_pools) -} - -// Turn state_diffs into a new cache_db -// -// Arguments: -// * `state`: Statediffs used as values for creation of cache_db -// * `block_num`: Block number to get state from -// * `provider`: Websocket provider used to make rpc calls -// -// Returns: -// Ok(CacheDB): cacheDB created from statediffs, if no errors -// Err(ProviderError): If encountered error during rpc calls -pub async fn to_cache_db( - state: &BTreeMap, - block_num: Option, - provider: &Arc>, -) -> Result, ProviderError> { - let mut cache_db = CacheDB::new(EmptyDB::default()); - - let mut futures = FuturesUnordered::new(); - - for (address, acc_diff) in state.iter() { - let nonce_provider = provider.clone(); - let balance_provider = provider.clone(); - let code_provider = provider.clone(); - - let addy = *address; - - let future = async move { - let nonce = nonce_provider - .get_transaction_count(addy, block_num) - .await?; - - let balance = balance_provider.get_balance(addy, block_num).await?; - - let code = code_provider.get_code(addy, block_num).await?; - - Ok::<(AccountDiff, Address, U256, U256, Bytes), ProviderError>(( - acc_diff.clone(), - *address, - nonce, - balance, - code, - )) - }; - - futures.push(future); - } - - while let Some(result) = futures.next().await { - let (acc_diff, address, nonce, balance, code) = result?; - let info = AccountInfo::new(balance.into(), nonce.as_u64(), Bytecode::new_raw(code.0)); - cache_db.insert_account_info(address.0.into(), info); - - acc_diff.storage.iter().for_each(|(slot, storage_diff)| { - let slot_value: U256 = match storage_diff.to_owned() { - Diff::Changed(v) => v.from.0.into(), - Diff::Died(v) => v.0.into(), - _ => { - // for cases Born and Same no need to touch - return; - } - }; - let slot: U256 = slot.0.into(); - cache_db - .insert_account_storage(address.0.into(), slot.into(), slot_value.into()) - .unwrap(); - }); - } - - Ok(cache_db) -} diff --git a/bot/src/utils/testhelper.rs b/bot/src/utils/testhelper.rs deleted file mode 100644 index 7eec8b3..0000000 --- a/bot/src/utils/testhelper.rs +++ /dev/null @@ -1,113 +0,0 @@ -use std::{sync::Arc, time::Duration}; - -use ethers::{ - prelude::*, - utils::{Anvil, AnvilInstance}, -}; - -use crate::{ - prelude::{Erc20, Pool, PoolVariant, UniswapV3Pool}, - types::BlockInfo, -}; - -use super::{constants::get_weth_address, dotenv::get_sandwich_contract_address}; - -pub async fn get_next_block_info(prev_block_number: u64, client: &Arc>) -> BlockInfo { - let prev_block = client.get_block(prev_block_number).await.unwrap().unwrap(); - BlockInfo::find_next_block_info(prev_block) -} - -// need to return anvil instance to keep it alive (so that we can make calls) -pub async fn create_fork_ws(fork_block_num: u64) -> (Arc>, AnvilInstance) { - let port_num: u16 = rand::Rng::gen_range(&mut rand::thread_rng(), 3000..4000); - - let _anvil = Anvil::new() - .fork(format!( - "https://eth-mainnet.g.alchemy.com/v2/nijvYQzHc4Fej8kvRvdesJXT5CqZEXSo@{}", - fork_block_num - )) - .port(port_num) - .spawn(); - let ws_fork = Ws::connect(format!("ws://127.0.0.1:{}", port_num)) - .await - .unwrap(); - let ws_provider_fork = Provider::new(ws_fork).interval(Duration::from_millis(100)); - (Arc::new(ws_provider_fork), _anvil) -} - -pub async fn create_ws() -> Arc> { - let ws = Ws::connect("ws://localhost:8545").await.unwrap(); - let ws_provider = Provider::new(ws).interval(Duration::from_millis(100)); - Arc::new(ws_provider) -} - -pub async fn create_v2_pool(pool_address: Address, client: &Arc>) -> Pool { - let pool_contract = super::contracts::get_pair_v2_contract(&pool_address, client); - let token_0 = pool_contract.token_0().call().await.unwrap(); - let token_1 = pool_contract.token_1().call().await.unwrap(); - - Pool::new( - pool_address, - token_0, - token_1, - U256::from(3000), - PoolVariant::UniswapV2, - ) -} - -pub async fn create_v3_pool(pool_address: Address, client: &Arc>) -> Pool { - let pool = UniswapV3Pool::new(pool_address, client.into()); - - let token_0 = pool.token_0().call().await.unwrap(); - let token_1 = pool.token_1().call().await.unwrap(); - let fee = pool.fee().call().await.unwrap(); - - Pool::new( - pool_address, - token_0, - token_1, - U256::from(fee), - PoolVariant::UniswapV3, - ) -} - -/// Override an address's weth balance -pub fn mutate_weth_balance( - state: &mut call_raw::spoof::State, - address_to_mutate: Address, - mutate_amount: U256, -) { - let key = super::u256_to_h256_be( - U256::from_str_radix( - "ffa74f65cef4257058238f071cd4f631a58040052dd622d00aa7a451153252f4", - 16, - ) - .unwrap(), - ); - // Spoofing WETH balance - // cast index address [address] 3 : WETH (give our sandwich contract 100weth) - let val = super::u256_to_h256_be(U256::from("100000000000000000000")); - // Give our acc a fuckton of WETH - state - .account(super::constants::get_weth_address()) - .store(key, val); - state.account(address_to_mutate).balance(mutate_amount); -} - -pub async fn get_weth_balance_at_block(block: u64) -> U256 { - let (fork, _instance) = create_fork_ws(block).await; - let weth_contract = Erc20::new(get_weth_address(), fork); - let owner = get_sandwich_contract_address(); - weth_contract.balance_of(owner).call().await.unwrap() -} - -#[macro_export] -macro_rules! time_function { - ($x:expr) => {{ - let start = std::time::Instant::now(); - let result = $x; - let elapsed = start.elapsed(); - println!("Elapsed time: {:?}", elapsed); - result - }}; -} diff --git a/bot/src/utils/tx_builder/braindance/decode.rs b/bot/src/utils/tx_builder/braindance/decode.rs deleted file mode 100644 index 805ad89..0000000 --- a/bot/src/utils/tx_builder/braindance/decode.rs +++ /dev/null @@ -1,19 +0,0 @@ -use ethers::{abi::parse_abi, prelude::*}; - -// Decode the result of the braindance contract's calculateSwapV2 function -pub fn decode_swap_v2_result(output: Bytes) -> Result<(U256, U256), AbiError> { - let braindance_contract = BaseContract::from(parse_abi(&[ - "function calculateSwapV2(uint amountIn, address targetPair, address inputToken, address outputToken) external returns (uint amountOut, uint realAfterBalance)", - ]).unwrap()); - - braindance_contract.decode_output("calculateSwapV2", output) -} - -// Decode the result of the braindance contract's calculateSwapV3 function -pub fn decode_swap_v3_result(output: Bytes) -> Result<(U256, U256), AbiError> { - let braindance_contract = BaseContract::from(parse_abi(&[ - "function calculateSwapV3(int amountIn, address targetPoolAddress, address inputToken, address outputToken) public returns (uint amountOut, uint realAfterBalance)", - ]).unwrap()); - - braindance_contract.decode_output("calculateSwapV3", output) -} diff --git a/bot/src/utils/tx_builder/braindance/encode.rs b/bot/src/utils/tx_builder/braindance/encode.rs deleted file mode 100644 index 0b5f0e7..0000000 --- a/bot/src/utils/tx_builder/braindance/encode.rs +++ /dev/null @@ -1,39 +0,0 @@ -use ethers::{abi::parse_abi, prelude::*}; - -// Build the data for the braindance contract's calculateSwapV2 function -pub fn build_swap_v2_data( - amount_in: U256, - target_pool: Address, - startend_token: Address, - intermediary_token: Address, -) -> Bytes { - let braindance_contract = BaseContract::from(parse_abi(&[ - "function calculateSwapV2(uint amountIn, address targetPair, address inputToken, address outputToken) external returns (uint amountOut, uint realAfterBalance)", - ]).unwrap()); - - braindance_contract - .encode( - "calculateSwapV2", - (amount_in, target_pool, startend_token, intermediary_token), - ) - .unwrap() -} - -// Build the data for the braindance contract's calculateSwapV3 function -pub fn build_swap_v3_data( - amount_in: I256, - target_pool: Address, - startend_token: Address, - intermediary_token: Address, -) -> Bytes { - let braindance_contract = BaseContract::from(parse_abi(&[ - "function calculateSwapV3(int amountIn, address targetPoolAddress, address inputToken, address outputToken) public returns (uint amountOut, uint realAfterBalance)", - ]).unwrap()); - - braindance_contract - .encode( - "calculateSwapV3", - (amount_in, target_pool, startend_token, intermediary_token), - ) - .unwrap() -} diff --git a/bot/src/utils/tx_builder/braindance/mod.rs b/bot/src/utils/tx_builder/braindance/mod.rs deleted file mode 100644 index 89e7f84..0000000 --- a/bot/src/utils/tx_builder/braindance/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub mod encode; -pub use encode::*; - -pub mod decode; -pub use decode::*; diff --git a/bot/src/utils/tx_builder/mod.rs b/bot/src/utils/tx_builder/mod.rs deleted file mode 100644 index f836d27..0000000 --- a/bot/src/utils/tx_builder/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod braindance; -pub mod sandwich; - -pub use sandwich::*; diff --git a/bot/src/utils/tx_builder/sandwich/mod.rs b/bot/src/utils/tx_builder/sandwich/mod.rs deleted file mode 100644 index 2725e7c..0000000 --- a/bot/src/utils/tx_builder/sandwich/mod.rs +++ /dev/null @@ -1,51 +0,0 @@ -use std::sync::Arc; - -use crate::utils; -use ethers::prelude::{k256::ecdsa::SigningKey, *}; -use tokio::sync::RwLock; - -pub mod v2; -pub mod v3; - -#[derive(Debug, Clone)] -pub struct SandwichMaker { - pub v2: v2::SandwichLogicV2, - pub v3: v3::SandwichLogicV3, - pub sandwich_address: Address, - pub searcher_wallet: Wallet, - pub nonce: Arc>, -} - -impl SandwichMaker { - // Create a new `SandwichMaker` instance - pub async fn new() -> Self { - let sandwich_address = utils::dotenv::get_sandwich_contract_address(); - let searcher_wallet = utils::dotenv::get_searcher_wallet(); - - let client = utils::create_websocket_client().await.unwrap(); - - let nonce = if let Ok(n) = client - .get_transaction_count(searcher_wallet.address(), None) - .await - { - n - } else { - panic!("Failed to get searcher wallet nonce..."); - }; - - let nonce = Arc::new(RwLock::new(nonce)); - - Self { - v2: v2::SandwichLogicV2::new(), - v3: v3::SandwichLogicV3::new(), - sandwich_address, - searcher_wallet, - nonce, - } - } -} - -/// Return the divisor used for encoding call value (weth amount) -pub fn get_weth_encode_divisor() -> U256 { - U256::from(100000) -} diff --git a/bot/src/utils/tx_builder/sandwich/v2.rs b/bot/src/utils/tx_builder/sandwich/v2.rs deleted file mode 100644 index 4ca2755..0000000 --- a/bot/src/utils/tx_builder/sandwich/v2.rs +++ /dev/null @@ -1,216 +0,0 @@ -use std::ops::Sub; - -use super::*; -use hashbrown::HashMap; - -use crate::{prelude::Pool, utils}; - -#[derive(Debug, Clone)] -pub struct SandwichLogicV2 { - jump_labels: HashMap, -} - -/// Encoded swap value used by other token -pub struct EncodedSwapValue { - four_byte_value: U256, - mem_offset: U256, - // real value after encoding - byte_shift: U256, -} - -impl EncodedSwapValue { - fn new(four_byte_value: U256, mem_offset: U256, byte_shift: U256) -> Self { - Self { - four_byte_value, - mem_offset, - byte_shift, - } - } - - // returns the decoded value after applying byteshift (real value used during swaps) - fn decode(&self) -> U256 { - self.four_byte_value * (U256::from(2).pow(U256::from(8) * self.byte_shift)) - } -} - -impl SandwichLogicV2 { - pub fn new() -> Self { - let mut jump_labels: HashMap = HashMap::new(); - - // pattern: {input||output}{isWeth0||isWeth1}_{numBytesToEncodeTo} - let jump_label_names = vec!["v2_output0", "v2_input0", "v2_output1", "v2_input1"]; - - let start_offset = 6; - - for x in 0..jump_label_names.len() { - jump_labels.insert( - jump_label_names[x].to_string(), - start_offset + (5 * (x as u32)), - ); - } - - SandwichLogicV2 { jump_labels } - } - - pub fn create_payload_weth_is_input( - &self, - amount_in: U256, - amount_out: U256, - other_token: Address, // output token - pair: Pool, - ) -> (Vec, U256) { - let encoded_swap_value = encode_four_bytes( - amount_out, - true, - utils::constants::get_weth_address() < other_token, - ); - - let swap_type = self._find_swap_type(true, other_token); - - let (payload, _) = utils::encode_packed(&[ - utils::PackedToken::NumberWithShift(swap_type, utils::TakeLastXBytes(8)), - utils::PackedToken::Address(pair.address), - utils::PackedToken::NumberWithShift( - encoded_swap_value.mem_offset, - utils::TakeLastXBytes(8), - ), - utils::PackedToken::NumberWithShift( - encoded_swap_value.four_byte_value, - utils::TakeLastXBytes(32), - ), - ]); - - let encoded_call_value = amount_in / get_weth_encode_divisor(); - - (payload, encoded_call_value) - } - - pub fn create_payload_weth_is_output( - &self, - amount_in: U256, // backrun_in - amount_out: U256, // backrun_out - other_token: Address, // input_token - pair: Pool, - ) -> (Vec, U256) { - let encoded_swap_value = encode_four_bytes( - amount_in, - false, - utils::constants::get_weth_address() < other_token, - ); - - let swap_type = self._find_swap_type(false, other_token); - - let (payload, _) = utils::encode_packed(&[ - utils::PackedToken::NumberWithShift(swap_type, utils::TakeLastXBytes(8)), - utils::PackedToken::Address(pair.address), - utils::PackedToken::Address(other_token), - utils::PackedToken::NumberWithShift( - encoded_swap_value.mem_offset, - utils::TakeLastXBytes(8), - ), - utils::PackedToken::NumberWithShift( - encoded_swap_value.four_byte_value, - utils::TakeLastXBytes(32), - ), - ]); - - let encoded_call_value = amount_out / get_weth_encode_divisor(); - - (payload, encoded_call_value) - } - - fn _find_swap_type(&self, is_weth_input: bool, other_token_addr: Address) -> U256 { - let weth_addr = utils::constants::get_weth_address(); - - let swap_type = match (is_weth_input, weth_addr < other_token_addr) { - (true, true) => self.jump_labels["v2_input0"], - (true, false) => self.jump_labels["v2_input1"], - (false, true) => self.jump_labels["v2_output0"], - (false, false) => self.jump_labels["v2_output1"], - }; - - U256::from(swap_type) - } -} - -// Encode the swap value into 4 bytes -// -// Returns: -// EncodedSwapValue representing 4 byte value, and byteshift -pub fn encode_four_bytes( - amount: U256, - is_weth_input: bool, - is_weth_token0: bool, -) -> EncodedSwapValue { - let mut byte_shift = 0; - let mut four_byte_encoded_value = U256::zero(); - - for i in 0u8..32u8 { - let _encoded_amount = amount / 2u128.pow(8 * i as u32); - - // if we can fit the value in 4 bytes (0xFFFFFFFF), we can encode it - if _encoded_amount <= U256::from(2).pow(U256::from(4 * 8).sub(1)) { - four_byte_encoded_value = _encoded_amount; - byte_shift = i; - break; - } - } - - match (is_weth_input, is_weth_token0) { - // memory offset calculated using 4 + 32 + 32 - 4 - (false, _) => EncodedSwapValue::new( - four_byte_encoded_value, - U256::from(64 - byte_shift), - U256::from(byte_shift), - ), - // memory offset calculated using 4 + 32 + 32 - 4 - (true, true) => EncodedSwapValue::new( - four_byte_encoded_value, - U256::from(64 - byte_shift), - U256::from(byte_shift), - ), - // memory offset calculated using 4 + 32 - 4 - (true, false) => EncodedSwapValue::new( - four_byte_encoded_value, - U256::from(32 - byte_shift), - U256::from(byte_shift), - ), - } -} - -/// Makes sure that we keep some token dust on contract -pub fn encode_intermediary_with_dust( - amount_in: U256, - is_weth_input: bool, - intermediary_address: Address, -) -> U256 { - let mut backrun_in = encode_four_bytes( - amount_in, - is_weth_input, - utils::constants::get_weth_address() < intermediary_address, - ); - - // makes sure that we keep some dust - backrun_in.four_byte_value -= U256::from(1); - backrun_in.decode() -} - -/// returns the real amount after encoding + decoding -/// we lose some byte due to rounding whilst encoding -pub fn decode_intermediary( - amount_in: U256, - is_weth_input: bool, - intermediary_address: Address, -) -> U256 { - let encoded = encode_four_bytes( - amount_in, - is_weth_input, - utils::constants::get_weth_address() < intermediary_address, - ); - encoded.decode() -} - -/// returns the encoded value of amount in (actual value passed to contract) -pub fn encode_weth(amount_in: U256) -> U256 { - (amount_in / get_weth_encode_divisor()) * get_weth_encode_divisor() -} diff --git a/bot/src/utils/tx_builder/sandwich/v3.rs b/bot/src/utils/tx_builder/sandwich/v3.rs deleted file mode 100644 index 5349a34..0000000 --- a/bot/src/utils/tx_builder/sandwich/v3.rs +++ /dev/null @@ -1,153 +0,0 @@ -use crate::{prelude::Pool, utils}; - -use super::*; - -use hashbrown::HashMap; - -#[derive(Debug, Clone)] -pub struct SandwichLogicV3 { - jump_labels: HashMap, -} - -impl SandwichLogicV3 { - // Create a new `SandwichLogicV3` instance - pub fn new() -> Self { - let mut jump_labels: HashMap = HashMap::new(); - - // encachement: turn this into a macro or constant? - let jump_label_names = vec![ - "v3_output1_big", - "v3_output0_big", - "v3_output1_small", - "v3_output0_small", - "v3_input0", - "v3_input1", - ]; - - let start_offset = 26; - - for x in 0..jump_label_names.len() { - jump_labels.insert( - jump_label_names[x].to_string(), - start_offset + (5 * (x as u32)), - ); - } - - SandwichLogicV3 { jump_labels } - } - - // Handles creation of tx data field when weth is input - pub fn create_payload_weth_is_input( - &self, - amount_in: I256, - input: Address, - output: Address, - pool: Pool, - ) -> (Vec, U256) { - let (token_0, token_1, fee) = (pool.token_0, pool.token_1, pool.swap_fee); - let swap_type = self._find_swap_type(true, input, output, amount_in); - let pool_key_hash = ethers::utils::keccak256(abi::encode(&[ - abi::Token::Address(token_0), - abi::Token::Address(token_1), - abi::Token::Uint(fee), - ])); - - let (payload, _) = utils::encode_packed(&[ - utils::PackedToken::NumberWithShift(swap_type, utils::TakeLastXBytes(8)), - utils::PackedToken::Address(pool.address), - utils::PackedToken::Bytes(&pool_key_hash), - ]); - - let encoded_call_value = U256::from(amount_in.as_u128()) / get_weth_encode_divisor(); - - (payload, encoded_call_value) - } - - // Handles creation of tx data field when weth is output - pub fn create_payload_weth_is_output( - &self, - amount_in: I256, - input: Address, - output: Address, - pool: Pool, - ) -> Vec { - let (token_0, token_1, fee) = (pool.token_0, pool.token_1, pool.swap_fee); - let swap_type = self._find_swap_type(false, input, output, amount_in); - let pool_key_hash = ethers::utils::keccak256(abi::encode(&[ - abi::Token::Address(token_0), - abi::Token::Address(token_1), - abi::Token::Uint(fee), - ])); - - let payload; - - if amount_in <= I256::from(281474976710655u128) { - // use small encoding method (encode amount_in to 6 bytes) - (payload, _) = utils::encode_packed(&vec![ - utils::PackedToken::NumberWithShift(swap_type, utils::TakeLastXBytes(8)), - utils::PackedToken::Address(pool.address), - utils::PackedToken::Address(input), - utils::PackedToken::NumberWithShift( - amount_in.as_u128().into(), - utils::TakeLastXBytes(48), - ), - utils::PackedToken::Bytes(&pool_key_hash), - ]); - } else { - // use big encoding method (encode amount_in by dividing by 1e13 and storing result into 9 bytes) - let encoded_amount_in = amount_in / I256::from_dec_str("10000000000000").unwrap(); - (payload, _) = utils::encode_packed(&vec![ - utils::PackedToken::NumberWithShift(swap_type, utils::TakeLastXBytes(8)), - utils::PackedToken::Address(pool.address), - utils::PackedToken::Address(input), - utils::PackedToken::NumberWithShift( - encoded_amount_in.as_u128().into(), - utils::TakeLastXBytes(72), - ), - utils::PackedToken::Bytes(&pool_key_hash), - ]); - } - - payload - } - - // Internal helper function to find correct JUMPDEST - fn _find_swap_type( - &self, - is_weth_input: bool, - input: Address, - output: Address, - amount_in: I256, - ) -> U256 { - let swap_type: u32 = match ( - is_weth_input, - (input < output), - (amount_in <= I256::from(281474976710655u128)), // 281474976710655 (0xFFFFFFFFFFFF) - ) { - // weth is input and token0 - (true, true, _) => self.jump_labels["v3_input0"], - // weth is input and token1 - (true, false, _) => self.jump_labels["v3_input1"], - // weth is output and token1 && amountIn <= 281474976710655 - (false, true, true) => self.jump_labels["v3_output1_small"], - // weth is output and token1 && amountIn > 281474976710655 - (false, true, false) => self.jump_labels["v3_output1_big"], - // weth is output and token0 && amountIn <= 281474976710655 - (false, false, true) => self.jump_labels["v3_output0_small"], - // weth is output and token0 && amountIn > 281474976710655 - (false, false, false) => self.jump_labels["v3_output0_big"], - }; - - U256::from(swap_type) - } -} - -/// returns the encoded value of amount in (actual value passed to contract) -pub fn encode_intermediary_token(amount_in: U256) -> U256 { - (amount_in / U256::from(10000000000000u128)) * U256::from(10000000000000u128) -} - -/// returns the encoded value of amount in (actual value passed to contract) -pub fn encode_weth(amount_in: U256) -> U256 { - (amount_in / get_weth_encode_divisor()) * get_weth_encode_divisor() -} diff --git a/contract/.gitmodules b/contract/.gitmodules deleted file mode 100644 index f48a73b..0000000 --- a/contract/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "lib/foundry-huff"] - path = lib/foundry-huff - url = https://github.com/huff-language/foundry-huff -[submodule "lib/forge-std"] - path = lib/forge-std - url = https://github.com/foundry-rs/forge-std diff --git a/contract/README.md b/contract/README.md index 05f2105..effe73c 100644 --- a/contract/README.md +++ b/contract/README.md @@ -1,21 +1,21 @@ # Rusty-Sando/Contract ![license](https://img.shields.io/badge/License-MIT-green.svg?label=license) -Gas optimized sando contract written in Huff to make use unconventional gas optimizations. +Gas-optimized sando contract written in Huff to make use of unconventional gas optimizations. -> Why not Yul? Yul does not give access to the stack or jump instructions. +> Why not Yul? Yul does not give access to the stack or jump instructions. ## Gas Optimizations ### JUMPDEST Function Sig -Instead of reserving 4 bytes for a function selector, store a JUMPDEST in the first byte of calldata and jump to it at the beginning of execution. Doing so allows us to jump to the code range 0x00-0xFF, fill range with place holder JUMPDEST that point to location of function body. +Instead of reserving 4 bytes for a function selector, store a JUMPDEST in the first byte of calldata and jump to it at the beginning of execution. Doing so allows us to jump to the code range 0x00-0xFF, so we fill that range with place holder JUMPDEST that point to the location of the associated function body. Example: ```as #define macro MAIN() = takes (0) returns (0) { // extract function selector (JUMPDEST encoding) - returndatasize // [0x00] + push0 // [0x00] calldataload // [calldata] - returndatasize // [0x00, calldata] + push0 // [0x00, calldata] byte // [jumplabel] jump // [] ``` @@ -24,116 +24,100 @@ Example: > JUMPDEST 0xfa is reserved to handle [UniswapV3 callback](https://docs.uniswap.org/contracts/v3/reference/core/interfaces/callback/IUniswapV3SwapCallback). ### Encoding WETH Value Using tx.value -When dealing with WETH amounts, the amount is encoded by first dividing the value by 100000, and setting the divided value as `tx.value` when calling the contract. The contract then multiplies `tx.value` by 100000 to get the original amount. +When dealing with WETH amounts, the amount is encoded by first dividing the value by 100000, and setting the divided value as `tx.value` when calling the contract. The contract then multiplies `tx.value` by 100000 to get the original amount. -> the last 5 digits of the original value are lost after encoding, however it is a small amount of wei and can be ignored. +> The last 5 digits of the original value are lost after encoding, however, it is a small amount of wei and can be ignored. Example: ```as // setup calldata for swap(wethOut, 0, address(this), "") - [V2_Swap_Sig] 0x00 mstore - 0x0186a0 callvalue mul 0x04 mstore // original weth value is decoded here by doing 100000 * callvalue - 0x00 0x24 mstore - address 0x44 mstore - 0x80 0x64 mstore + [V2_Swap_Sig] 0x00 mstore + 0x0186a0 callvalue mul 0x04 mstore // original weth value is decoded here by doing `100000 * callvalue` + 0x00 0x24 mstore + address 0x44 mstore + 0x80 0x64 mstore ``` ### Encoding Other Token Value Using 5 Bytes Of Calldata -When dealing with the other token amount, the values can range significantlly depending on token decimal and total supply. To account for full range, we encode by fitting the value into 4 bytes of calldata plus a byte shift. To decode, we byteshift the 4bytes to the left. +When dealing with the other token amount, the values can range significantly depending on the token decimal and total supply. To account for the full range, we encode by fitting the value into 4 bytes of calldata plus a byte shift. To decode, we byteshift the 4bytes to the left. -We use byteshifts instead of bitshifts because we perform a byteshift by storing the 4bytes in memory N bytes to the left of its memory slot. +We use byte shifts instead of bitshifts because we perform a byteshift by storing the 4bytes in memory N bytes to the left of its memory slot. -However, instead of encoding the byteshift into our calldata, we encode the offset in memory such that when the 4bytes are stored, it will be N bytes from the left of its storage slot. - -> **Note** -> Free alfa: Might be able to optimize contract by eliminating unnecessary [memory expansions](https://www.evm.codes/about#memoryexpansion) by changing order that params are stored in memory. I did not account for this when writing the contract. +To optimize further, instead of encoding the byteshift into our calldata, we encode the offset in memory such that when the 4bytes are stored, it will be N bytes from the left of its storage slot. [more details](https://github.com/mouseless-eth/rusty-sando/blob/1a0f775a00ae932f64d7e926605134892fcf56f9/contract/test/misc/V2SandoUtility.sol#L28). ### Hardcoded values -Weth address is hardcoded into the contract and there are individual methods to handle when Weth is token0 or token1. +Weth address is hardcoded into the contract and there are individual methods to handle when Weth is token0 or token1. ### Encode Packed -All calldata is encoded by packing the values together. +All calldata is encoded by packing the values together. + +> **Note** +> Free alfa: Might be able to optimize contract by eliminating unnecessary [memory expansions](https://www.evm.codes/about#memoryexpansion) by changing order that params are stored in memory. I did not account for this when writing the contract. ## Interface | JUMPDEST | Function Name | | :-------------: | :------------- | -| 0x06 | V2 Swap, Weth is Token0 and Output | -| 0x0B | V2 Swap, Weth is Token0 and Input | -| 0x10 | V2 Swap, Weth is Token1 and Output | -| 0x15 | V2 Swap, Weth is Token1 and Input | -| 0x1A | V3 Swap, Weth is Token1 and Output, Big Encoding | -| 0x1F | V3 Swap, Weth is Token0 and Output, Big Encoding | -| 0x24 | V3 Swap, Weth is Token1 and Output, Small Encoding | -| 0x29 | V3 Swap, Weth is Token0 and Output, Small Encoding | -| 0x2E | V3 Swap, Weth is Token0 and Input | -| 0x33 | V3 Swap, Weth is Token1 and Input | -| 0x38 | Seppuku (self-destruct) | -| 0x3D | Recover Eth | -| 0x42 | Recover Weth | +| 0x05 | V2 Backrun, Weth is Token0 and Output | +| 0x0A | V2 Frontrun, Weth is Token0 and Input | +| 0x0F | V2 Backrun, Weth is Token1 and Output | +| 0x14 | V2 Frontrun, Weth is Token1 and Input | +| 0x1E | V3 Backrun, Weth is Token0 and Output | +| 0x2D | V3 Frontrun, Weth is Token0 and Input | +| 0x19 | V3 Backrun, Weth is Token1 and Output | +| 0x32 | V3 Frontrun, Weth is Token1 and Input | +| 0x37 | Seppuku (self-destruct) | +| 0x3C | Recover Eth | +| 0x41 | Recover Weth | +| ... | ... | | 0xFA | UniswapV3 Callback | -## Calldata Encoding +## Calldata Encoding (Interface) ### Uniswap V2 Calldata Encoding Format -#### When Weth is input (0x0B, 0x15) +#### Frontrun (weth is input) | Byte Length | Variable | | :-------------: | :------------- | | 1 | JUMPDEST | | 20 | PairAddress | | 1 | Where to store AmountOut | -| 4 | AmountOut | +| 4 | EncodedAmountOut | -#### When Weth is output (0x06, 0x10) +#### Backrun(weth is output) | Byte Length | Variable | | :-------------: | :------------- | | 1 | JUMPDEST | | 20 | PairAddress | | 20 | TokenInAddress | | 1 | Where to store AmountIn | -| 4 | AmountIn | +| 4 | EncodedAmountIn | ### Uniswap V3 Calldata Encoding Format -#### When Weth is input (0x2E, 0x33) -| Byte Length | Variable | -| :-------------: | :------------- | -| 1 | JUMPDEST | -| 20 | PairAddress | -| 32 | PairInitHash | -> PairInitHash used to verify msg.sender is pool in callback - -#### When Weth is output small (0x2E, 0x33) +#### Frontrun (weth is input) | Byte Length | Variable | | :-------------: | :------------- | | 1 | JUMPDEST | | 20 | PairAddress | -| 20 | TokenInAddress | -| 6 | AmountIn | -| 32 | PairInitHash | -> Small encoding when AmountIn < 10^12 +| 32 | PoolKeyHash | +> PoolKeyHash used to verify that msg.sender is a uniswawp v3 pool in callback (protection) -#### When Weth is output big (0x1A, 0x1F) +#### Backrun (weth is output) | Byte Length | Variable | | :-------------: | :------------- | | 1 | JUMPDEST | | 20 | PairAddress | | 20 | TokenInAddress | -| 9 | AmountIn | -| 32 | PairInitHash | -> AmountIn will be multiplied by 10^12 - -## Tests +| 32 | PoolKeyHash | +| 1 | Where to store AmountIn | +| 4 | EncodedAmountIn | -```console -forge test --rpc-url -``` -> **Note** -> Due to the changing state of the latest blocks, you may need to specify a block height to complete the test. Here is the code with the block height for the test to pass. +> **Note** +> PairAddress can be omitted from calldata because it can be derived from PoolKeyHash +## Running Tests ```console -forge test --rpc-url --fork-block-number 17401879 +forge install +forge test ``` -## Benchmarks -!todo diff --git a/contract/foundry.toml b/contract/foundry.toml index 04f1316..05dda53 100644 --- a/contract/foundry.toml +++ b/contract/foundry.toml @@ -1,4 +1,3 @@ - [profile.default] solc_version = '0.8.15' auto_detect_solc = false @@ -16,4 +15,8 @@ remappings = [ "v2-core/=lib/v2-core/contracts/", "v2-periphery/=lib/v2-periphery/contracts/", "v3-core/=lib/v3-core/contracts/", + "v3-periphery/=lib/v3-periphery/contracts/", + "solmate=lib/solmate/src/", ] +eth-rpc-url = "http://localhost:8545" +evm_version = "shanghai" diff --git a/contract/interfaces/IERC20.sol b/contract/interfaces/IERC20.sol deleted file mode 100644 index 572951c..0000000 --- a/contract/interfaces/IERC20.sol +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.15; - -/// @dev Interface of the ERC20 standard as defined in the EIP. -interface IERC20 { - /// @dev Returns the amount of tokens in existence. - function totalSupply() external view returns (uint256); - - /// @dev Returns the amount of tokens owned by `account`. - function balanceOf(address account) external view returns (uint256); - - /// @dev Moves `amount` tokens from the caller's account to `recipient`. - function transfer(address recipient, uint256 amount) - external - returns (bool); - - /// @dev Returns the remaining number of tokens that `spender` will be - function allowance(address owner, address spender) - external - view - returns (uint256); - - /// @dev Sets `amount` as the allowance of `spender` over the caller's tokens. - function approve(address spender, uint256 amount) external returns (bool); - - /// @dev Moves `amount` tokens from `sender` to `recipient` using the - function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); - - /// @dev Emitted when `value` tokens are moved from one account (`from`) to - event Transfer(address indexed from, address indexed to, uint256 value); - - /// @dev Emitted when the allowance of a `spender` for an `owner` is set by - event Approval(address indexed owner, address indexed spender, uint256 value); -} diff --git a/contract/interfaces/IWETH.sol b/contract/interfaces/IWETH.sol deleted file mode 100644 index 6f4ea43..0000000 --- a/contract/interfaces/IWETH.sol +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.15; - -interface IWETH { - function name() external view returns (string memory); - - function approve(address guy, uint256 wad) external returns (bool); - - function totalSupply() external view returns (uint256); - - function transferFrom( - address src, - address dst, - uint256 wad - ) external returns (bool); - - function withdraw(uint256 wad) external; - - function decimals() external view returns (uint8); - - function balanceOf(address) external view returns (uint256); - - function symbol() external view returns (string memory); - - function transfer(address dst, uint256 wad) external returns (bool); - - function deposit() external payable; - - function allowance(address, address) external view returns (uint256); -} diff --git a/contract/lib/forge-std b/contract/lib/forge-std new file mode 160000 index 0000000..e8a047e --- /dev/null +++ b/contract/lib/forge-std @@ -0,0 +1 @@ +Subproject commit e8a047e3f40f13fa37af6fe14e6e06283d9a060e diff --git a/contract/lib/forge-std/.github/workflows/ci.yml b/contract/lib/forge-std/.github/workflows/ci.yml deleted file mode 100644 index 96b2336..0000000 --- a/contract/lib/forge-std/.github/workflows/ci.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 - with: - version: nightly - - - name: Print forge version - run: forge --version - - # Backwards compatibility checks. - - name: Check compatibility with 0.8.0 - if: always() - run: forge build --skip test --use solc:0.8.0 - - - name: Check compatibility with 0.7.6 - if: always() - run: forge build --skip test --use solc:0.7.6 - - - name: Check compatibility with 0.7.0 - if: always() - run: forge build --skip test --use solc:0.7.0 - - - name: Check compatibility with 0.6.12 - if: always() - run: forge build --skip test --use solc:0.6.12 - - - name: Check compatibility with 0.6.2 - if: always() - run: forge build --skip test --use solc:0.6.2 - - # via-ir compilation time checks. - - name: Measure compilation time of Test with 0.8.17 --via-ir - if: always() - run: forge build --skip test --contracts test/compilation/CompilationTest.sol --use solc:0.8.17 --via-ir - - - name: Measure compilation time of TestBase with 0.8.17 --via-ir - if: always() - run: forge build --skip test --contracts test/compilation/CompilationTestBase.sol --use solc:0.8.17 --via-ir - - - name: Measure compilation time of Script with 0.8.17 --via-ir - if: always() - run: forge build --skip test --contracts test/compilation/CompilationScript.sol --use solc:0.8.17 --via-ir - - - name: Measure compilation time of ScriptBase with 0.8.17 --via-ir - if: always() - run: forge build --skip test --contracts test/compilation/CompilationScriptBase.sol --use solc:0.8.17 --via-ir - - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 - with: - version: nightly - - - name: Print forge version - run: forge --version - - - name: Run tests - run: forge test -vvv - - fmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 - with: - version: nightly - - - name: Print forge version - run: forge --version - - - name: Check formatting - run: forge fmt --check diff --git a/contract/lib/forge-std/.github/workflows/tests.yml b/contract/lib/forge-std/.github/workflows/tests.yml deleted file mode 100644 index 8e86b25..0000000 --- a/contract/lib/forge-std/.github/workflows/tests.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Tests -on: [push, pull_request] - -jobs: - check: - name: Foundry project - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 - with: - version: nightly - - - name: Install dependencies - run: forge install - - name: Run tests - run: forge test -vvv - - name: Build Test with older solc versions - run: | - forge build --contracts src/Test.sol --use solc:0.8.0 - forge build --contracts src/Test.sol --use solc:0.7.6 - forge build --contracts src/Test.sol --use solc:0.7.0 - forge build --contracts src/Test.sol --use solc:0.6.0 diff --git a/contract/lib/forge-std/.gitmodules b/contract/lib/forge-std/.gitmodules deleted file mode 100644 index e124719..0000000 --- a/contract/lib/forge-std/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "lib/ds-test"] - path = lib/ds-test - url = https://github.com/dapphub/ds-test diff --git a/contract/lib/forge-std/LICENSE-APACHE b/contract/lib/forge-std/LICENSE-APACHE deleted file mode 100644 index cf01a49..0000000 --- a/contract/lib/forge-std/LICENSE-APACHE +++ /dev/null @@ -1,203 +0,0 @@ -Copyright Contributors to Forge Standard Library - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/contract/lib/forge-std/LICENSE-MIT b/contract/lib/forge-std/LICENSE-MIT deleted file mode 100644 index 28f9830..0000000 --- a/contract/lib/forge-std/LICENSE-MIT +++ /dev/null @@ -1,25 +0,0 @@ -Copyright Contributors to Forge Standard Library - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE O THE USE OR OTHER -DEALINGS IN THE SOFTWARE.R diff --git a/contract/lib/forge-std/README.md b/contract/lib/forge-std/README.md deleted file mode 100644 index 8494a7d..0000000 --- a/contract/lib/forge-std/README.md +++ /dev/null @@ -1,250 +0,0 @@ -# Forge Standard Library • [![CI status](https://github.com/foundry-rs/forge-std/actions/workflows/ci.yml/badge.svg)](https://github.com/foundry-rs/forge-std/actions/workflows/ci.yml) - -Forge Standard Library is a collection of helpful contracts and libraries for use with [Forge and Foundry](https://github.com/foundry-rs/foundry). It leverages Forge's cheatcodes to make writing tests easier and faster, while improving the UX of cheatcodes. - -**Learn how to use Forge-Std with the [📖 Foundry Book (Forge-Std Guide)](https://book.getfoundry.sh/forge/forge-std.html).** - -## Install - -```bash -forge install foundry-rs/forge-std -``` - -## Contracts -### stdError - -This is a helper contract for errors and reverts. In Forge, this contract is particularly helpful for the `expectRevert` cheatcode, as it provides all compiler builtin errors. - -See the contract itself for all error codes. - -#### Example usage - -```solidity - -import "forge-std/Test.sol"; - -contract TestContract is Test { - ErrorsTest test; - - function setUp() public { - test = new ErrorsTest(); - } - - function testExpectArithmetic() public { - vm.expectRevert(stdError.arithmeticError); - test.arithmeticError(10); - } -} - -contract ErrorsTest { - function arithmeticError(uint256 a) public { - uint256 a = a - 100; - } -} -``` - -### stdStorage - -This is a rather large contract due to all of the overloading to make the UX decent. Primarily, it is a wrapper around the `record` and `accesses` cheatcodes. It can *always* find and write the storage slot(s) associated with a particular variable without knowing the storage layout. The one _major_ caveat to this is while a slot can be found for packed storage variables, we can't write to that variable safely. If a user tries to write to a packed slot, the execution throws an error, unless it is uninitialized (`bytes32(0)`). - -This works by recording all `SLOAD`s and `SSTORE`s during a function call. If there is a single slot read or written to, it immediately returns the slot. Otherwise, behind the scenes, we iterate through and check each one (assuming the user passed in a `depth` parameter). If the variable is a struct, you can pass in a `depth` parameter which is basically the field depth. - -I.e.: -```solidity -struct T { - // depth 0 - uint256 a; - // depth 1 - uint256 b; -} -``` - -#### Example usage - -```solidity -import "forge-std/Test.sol"; - -contract TestContract is Test { - using stdStorage for StdStorage; - - Storage test; - - function setUp() public { - test = new Storage(); - } - - function testFindExists() public { - // Lets say we want to find the slot for the public - // variable `exists`. We just pass in the function selector - // to the `find` command - uint256 slot = stdstore.target(address(test)).sig("exists()").find(); - assertEq(slot, 0); - } - - function testWriteExists() public { - // Lets say we want to write to the slot for the public - // variable `exists`. We just pass in the function selector - // to the `checked_write` command - stdstore.target(address(test)).sig("exists()").checked_write(100); - assertEq(test.exists(), 100); - } - - // It supports arbitrary storage layouts, like assembly based storage locations - function testFindHidden() public { - // `hidden` is a random hash of a bytes, iteration through slots would - // not find it. Our mechanism does - // Also, you can use the selector instead of a string - uint256 slot = stdstore.target(address(test)).sig(test.hidden.selector).find(); - assertEq(slot, uint256(keccak256("my.random.var"))); - } - - // If targeting a mapping, you have to pass in the keys necessary to perform the find - // i.e.: - function testFindMapping() public { - uint256 slot = stdstore - .target(address(test)) - .sig(test.map_addr.selector) - .with_key(address(this)) - .find(); - // in the `Storage` constructor, we wrote that this address' value was 1 in the map - // so when we load the slot, we expect it to be 1 - assertEq(uint(vm.load(address(test), bytes32(slot))), 1); - } - - // If the target is a struct, you can specify the field depth: - function testFindStruct() public { - // NOTE: see the depth parameter - 0 means 0th field, 1 means 1st field, etc. - uint256 slot_for_a_field = stdstore - .target(address(test)) - .sig(test.basicStruct.selector) - .depth(0) - .find(); - - uint256 slot_for_b_field = stdstore - .target(address(test)) - .sig(test.basicStruct.selector) - .depth(1) - .find(); - - assertEq(uint(vm.load(address(test), bytes32(slot_for_a_field))), 1); - assertEq(uint(vm.load(address(test), bytes32(slot_for_b_field))), 2); - } -} - -// A complex storage contract -contract Storage { - struct UnpackedStruct { - uint256 a; - uint256 b; - } - - constructor() { - map_addr[msg.sender] = 1; - } - - uint256 public exists = 1; - mapping(address => uint256) public map_addr; - // mapping(address => Packed) public map_packed; - mapping(address => UnpackedStruct) public map_struct; - mapping(address => mapping(address => uint256)) public deep_map; - mapping(address => mapping(address => UnpackedStruct)) public deep_map_struct; - UnpackedStruct public basicStruct = UnpackedStruct({ - a: 1, - b: 2 - }); - - function hidden() public view returns (bytes32 t) { - // an extremely hidden storage slot - bytes32 slot = keccak256("my.random.var"); - assembly { - t := sload(slot) - } - } -} -``` - -### stdCheats - -This is a wrapper over miscellaneous cheatcodes that need wrappers to be more dev friendly. Currently there are only functions related to `prank`. In general, users may expect ETH to be put into an address on `prank`, but this is not the case for safety reasons. Explicitly this `hoax` function should only be used for address that have expected balances as it will get overwritten. If an address already has ETH, you should just use `prank`. If you want to change that balance explicitly, just use `deal`. If you want to do both, `hoax` is also right for you. - - -#### Example usage: -```solidity - -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "forge-std/Test.sol"; - -// Inherit the stdCheats -contract StdCheatsTest is Test { - Bar test; - function setUp() public { - test = new Bar(); - } - - function testHoax() public { - // we call `hoax`, which gives the target address - // eth and then calls `prank` - hoax(address(1337)); - test.bar{value: 100}(address(1337)); - - // overloaded to allow you to specify how much eth to - // initialize the address with - hoax(address(1337), 1); - test.bar{value: 1}(address(1337)); - } - - function testStartHoax() public { - // we call `startHoax`, which gives the target address - // eth and then calls `startPrank` - // - // it is also overloaded so that you can specify an eth amount - startHoax(address(1337)); - test.bar{value: 100}(address(1337)); - test.bar{value: 100}(address(1337)); - vm.stopPrank(); - test.bar(address(this)); - } -} - -contract Bar { - function bar(address expectedSender) public payable { - require(msg.sender == expectedSender, "!prank"); - } -} -``` - -### Std Assertions - -Expand upon the assertion functions from the `DSTest` library. - -### `console.log` - -Usage follows the same format as [Hardhat](https://hardhat.org/hardhat-network/reference/#console-log). -It's recommended to use `console2.sol` as shown below, as this will show the decoded logs in Forge traces. - -```solidity -// import it indirectly via Test.sol -import "forge-std/Test.sol"; -// or directly import it -import "forge-std/console2.sol"; -... -console2.log(someValue); -``` - -If you need compatibility with Hardhat, you must use the standard `console.sol` instead. -Due to a bug in `console.sol`, logs that use `uint256` or `int256` types will not be properly decoded in Forge traces. - -```solidity -// import it indirectly via Test.sol -import "forge-std/Test.sol"; -// or directly import it -import "forge-std/console.sol"; -... -console.log(someValue); -``` - -## License - -Forge Standard Library is offered under either [MIT](LICENSE-MIT) or [Apache 2.0](LICENSE-APACHE) license. diff --git a/contract/lib/forge-std/foundry.toml b/contract/lib/forge-std/foundry.toml deleted file mode 100644 index 36e4e63..0000000 --- a/contract/lib/forge-std/foundry.toml +++ /dev/null @@ -1,21 +0,0 @@ -[profile.default] -fs_permissions = [{ access = "read-write", path = "./"}] - -[rpc_endpoints] -# The RPC URLs are modified versions of the default for testing initialization. -mainnet = "https://mainnet.infura.io/v3/16a8be88795540b9b3903d8de0f7baa5" # Different API key. -optimism_goerli = "https://goerli.optimism.io/" # Adds a trailing slash. -arbitrum_one_goerli = "https://goerli-rollup.arbitrum.io/rpc/" # Adds a trailing slash. -needs_undefined_env_var = "${UNDEFINED_RPC_URL_PLACEHOLDER}" - -[fmt] -# These are all the `forge fmt` defaults. -line_length = 120 -tab_width = 4 -bracket_spacing = false -int_types = 'long' -multiline_func_header = 'attributes_first' -quote_style = 'double' -number_underscore = 'preserve' -single_line_statement_blocks = 'preserve' -ignore = ["src/console.sol", "src/console2.sol"] \ No newline at end of file diff --git a/contract/lib/forge-std/lib/ds-test/.github/workflows/build.yml b/contract/lib/forge-std/lib/ds-test/.github/workflows/build.yml deleted file mode 100644 index a2c31df..0000000 --- a/contract/lib/forge-std/lib/ds-test/.github/workflows/build.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: "Build" -on: - pull_request: - push: -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v18 - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - - name: setup dapp binary cache - uses: cachix/cachix-action@v12 - with: - name: dapp - - - name: install dapptools - run: nix profile install github:dapphub/dapptools#dapp --accept-flake-config - - - name: install foundry - uses: foundry-rs/foundry-toolchain@v1 - - - name: test with solc-0.5.17 - run: dapp --use solc-0.5.17 test -v - - - name: test with solc-0.6.11 - run: dapp --use solc-0.6.11 test -v - - - name: test with solc-0.7.6 - run: dapp --use solc-0.7.6 test -v - - - name: test with solc-0.8.18 - run: dapp --use solc-0.8.18 test -v - - - name: Run tests with foundry - run: forge test -vvv - diff --git a/contract/lib/forge-std/lib/ds-test/LICENSE b/contract/lib/forge-std/lib/ds-test/LICENSE deleted file mode 100644 index 94a9ed0..0000000 --- a/contract/lib/forge-std/lib/ds-test/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/contract/lib/forge-std/lib/ds-test/Makefile b/contract/lib/forge-std/lib/ds-test/Makefile deleted file mode 100644 index 661dac4..0000000 --- a/contract/lib/forge-std/lib/ds-test/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -all:; dapp build - -test: - -dapp --use solc:0.4.23 build - -dapp --use solc:0.4.26 build - -dapp --use solc:0.5.17 build - -dapp --use solc:0.6.12 build - -dapp --use solc:0.7.5 build - -demo: - DAPP_SRC=demo dapp --use solc:0.7.5 build - -hevm dapp-test --verbose 3 - -.PHONY: test demo diff --git a/contract/lib/forge-std/lib/ds-test/default.nix b/contract/lib/forge-std/lib/ds-test/default.nix deleted file mode 100644 index cf65419..0000000 --- a/contract/lib/forge-std/lib/ds-test/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ solidityPackage, dappsys }: solidityPackage { - name = "ds-test"; - src = ./src; -} diff --git a/contract/lib/forge-std/lib/ds-test/demo/demo.sol b/contract/lib/forge-std/lib/ds-test/demo/demo.sol deleted file mode 100644 index f3bb48e..0000000 --- a/contract/lib/forge-std/lib/ds-test/demo/demo.sol +++ /dev/null @@ -1,222 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.5.0; - -import "../src/test.sol"; - -contract DemoTest is DSTest { - function test_this() public pure { - require(true); - } - function test_logs() public { - emit log("-- log(string)"); - emit log("a string"); - - emit log("-- log_named_uint(string, uint)"); - emit log_named_uint("uint", 512); - - emit log("-- log_named_int(string, int)"); - emit log_named_int("int", -512); - - emit log("-- log_named_address(string, address)"); - emit log_named_address("address", address(this)); - - emit log("-- log_named_bytes32(string, bytes32)"); - emit log_named_bytes32("bytes32", "a string"); - - emit log("-- log_named_bytes(string, bytes)"); - emit log_named_bytes("bytes", hex"cafefe"); - - emit log("-- log_named_string(string, string)"); - emit log_named_string("string", "a string"); - - emit log("-- log_named_decimal_uint(string, uint, uint)"); - emit log_named_decimal_uint("decimal uint", 1.0e18, 18); - - emit log("-- log_named_decimal_int(string, int, uint)"); - emit log_named_decimal_int("decimal int", -1.0e18, 18); - } - event log_old_named_uint(bytes32,uint); - function test_old_logs() public { - emit log_old_named_uint("key", 500); - emit log_named_bytes32("bkey", "val"); - } - function test_trace() public view { - this.echo("string 1", "string 2"); - } - function test_multiline() public { - emit log("a multiline\\nstring"); - emit log("a multiline string"); - emit log_bytes("a string"); - emit log_bytes("a multiline\nstring"); - emit log_bytes("a multiline\\nstring"); - emit logs(hex"0000"); - emit log_named_bytes("0x0000", hex"0000"); - emit logs(hex"ff"); - } - function echo(string memory s1, string memory s2) public pure - returns (string memory, string memory) - { - return (s1, s2); - } - - function prove_this(uint x) public { - emit log_named_uint("sym x", x); - assertGt(x + 1, 0); - } - - function test_logn() public { - assembly { - log0(0x01, 0x02) - log1(0x01, 0x02, 0x03) - log2(0x01, 0x02, 0x03, 0x04) - log3(0x01, 0x02, 0x03, 0x04, 0x05) - } - } - - event MyEvent(uint, uint indexed, uint, uint indexed); - function test_events() public { - emit MyEvent(1, 2, 3, 4); - } - - function test_asserts() public { - string memory err = "this test has failed!"; - emit log("## assertTrue(bool)\n"); - assertTrue(false); - emit log("\n"); - assertTrue(false, err); - - emit log("\n## assertEq(address,address)\n"); - assertEq(address(this), msg.sender); - emit log("\n"); - assertEq(address(this), msg.sender, err); - - emit log("\n## assertEq32(bytes32,bytes32)\n"); - assertEq32("bytes 1", "bytes 2"); - emit log("\n"); - assertEq32("bytes 1", "bytes 2", err); - - emit log("\n## assertEq(bytes32,bytes32)\n"); - assertEq32("bytes 1", "bytes 2"); - emit log("\n"); - assertEq32("bytes 1", "bytes 2", err); - - emit log("\n## assertEq(uint,uint)\n"); - assertEq(uint(0), 1); - emit log("\n"); - assertEq(uint(0), 1, err); - - emit log("\n## assertEq(int,int)\n"); - assertEq(-1, -2); - emit log("\n"); - assertEq(-1, -2, err); - - emit log("\n## assertEqDecimal(int,int,uint)\n"); - assertEqDecimal(-1.0e18, -1.1e18, 18); - emit log("\n"); - assertEqDecimal(-1.0e18, -1.1e18, 18, err); - - emit log("\n## assertEqDecimal(uint,uint,uint)\n"); - assertEqDecimal(uint(1.0e18), 1.1e18, 18); - emit log("\n"); - assertEqDecimal(uint(1.0e18), 1.1e18, 18, err); - - emit log("\n## assertGt(uint,uint)\n"); - assertGt(uint(0), 0); - emit log("\n"); - assertGt(uint(0), 0, err); - - emit log("\n## assertGt(int,int)\n"); - assertGt(-1, -1); - emit log("\n"); - assertGt(-1, -1, err); - - emit log("\n## assertGtDecimal(int,int,uint)\n"); - assertGtDecimal(-2.0e18, -1.1e18, 18); - emit log("\n"); - assertGtDecimal(-2.0e18, -1.1e18, 18, err); - - emit log("\n## assertGtDecimal(uint,uint,uint)\n"); - assertGtDecimal(uint(1.0e18), 1.1e18, 18); - emit log("\n"); - assertGtDecimal(uint(1.0e18), 1.1e18, 18, err); - - emit log("\n## assertGe(uint,uint)\n"); - assertGe(uint(0), 1); - emit log("\n"); - assertGe(uint(0), 1, err); - - emit log("\n## assertGe(int,int)\n"); - assertGe(-1, 0); - emit log("\n"); - assertGe(-1, 0, err); - - emit log("\n## assertGeDecimal(int,int,uint)\n"); - assertGeDecimal(-2.0e18, -1.1e18, 18); - emit log("\n"); - assertGeDecimal(-2.0e18, -1.1e18, 18, err); - - emit log("\n## assertGeDecimal(uint,uint,uint)\n"); - assertGeDecimal(uint(1.0e18), 1.1e18, 18); - emit log("\n"); - assertGeDecimal(uint(1.0e18), 1.1e18, 18, err); - - emit log("\n## assertLt(uint,uint)\n"); - assertLt(uint(0), 0); - emit log("\n"); - assertLt(uint(0), 0, err); - - emit log("\n## assertLt(int,int)\n"); - assertLt(-1, -1); - emit log("\n"); - assertLt(-1, -1, err); - - emit log("\n## assertLtDecimal(int,int,uint)\n"); - assertLtDecimal(-1.0e18, -1.1e18, 18); - emit log("\n"); - assertLtDecimal(-1.0e18, -1.1e18, 18, err); - - emit log("\n## assertLtDecimal(uint,uint,uint)\n"); - assertLtDecimal(uint(2.0e18), 1.1e18, 18); - emit log("\n"); - assertLtDecimal(uint(2.0e18), 1.1e18, 18, err); - - emit log("\n## assertLe(uint,uint)\n"); - assertLe(uint(1), 0); - emit log("\n"); - assertLe(uint(1), 0, err); - - emit log("\n## assertLe(int,int)\n"); - assertLe(0, -1); - emit log("\n"); - assertLe(0, -1, err); - - emit log("\n## assertLeDecimal(int,int,uint)\n"); - assertLeDecimal(-1.0e18, -1.1e18, 18); - emit log("\n"); - assertLeDecimal(-1.0e18, -1.1e18, 18, err); - - emit log("\n## assertLeDecimal(uint,uint,uint)\n"); - assertLeDecimal(uint(2.0e18), 1.1e18, 18); - emit log("\n"); - assertLeDecimal(uint(2.0e18), 1.1e18, 18, err); - - emit log("\n## assertEq(string,string)\n"); - string memory s1 = "string 1"; - string memory s2 = "string 2"; - assertEq(s1, s2); - emit log("\n"); - assertEq(s1, s2, err); - - emit log("\n## assertEq0(bytes,bytes)\n"); - assertEq0(hex"abcdef01", hex"abcdef02"); - emit log("\n"); - assertEq0(hex"abcdef01", hex"abcdef02", err); - } -} - -contract DemoTestWithSetUp { - function setUp() public { - } - function test_pass() public pure { - } -} diff --git a/contract/lib/forge-std/lib/ds-test/package.json b/contract/lib/forge-std/lib/ds-test/package.json deleted file mode 100644 index 4802ada..0000000 --- a/contract/lib/forge-std/lib/ds-test/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "ds-test", - "version": "1.0.0", - "description": "Assertions, equality checks and other test helpers ", - "bugs": "https://github.com/dapphub/ds-test/issues", - "license": "GPL-3.0", - "author": "Contributors to ds-test", - "files": [ - "src/*" - ], - "repository": { - "type": "git", - "url": "https://github.com/dapphub/ds-test.git" - } -} diff --git a/contract/lib/forge-std/lib/ds-test/src/test.sol b/contract/lib/forge-std/lib/ds-test/src/test.sol deleted file mode 100644 index de504d3..0000000 --- a/contract/lib/forge-std/lib/ds-test/src/test.sol +++ /dev/null @@ -1,469 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity >=0.5.0; - -contract DSTest { - event log (string); - event logs (bytes); - - event log_address (address); - event log_bytes32 (bytes32); - event log_int (int); - event log_uint (uint); - event log_bytes (bytes); - event log_string (string); - - event log_named_address (string key, address val); - event log_named_bytes32 (string key, bytes32 val); - event log_named_decimal_int (string key, int val, uint decimals); - event log_named_decimal_uint (string key, uint val, uint decimals); - event log_named_int (string key, int val); - event log_named_uint (string key, uint val); - event log_named_bytes (string key, bytes val); - event log_named_string (string key, string val); - - bool public IS_TEST = true; - bool private _failed; - - address constant HEVM_ADDRESS = - address(bytes20(uint160(uint256(keccak256('hevm cheat code'))))); - - modifier mayRevert() { _; } - modifier testopts(string memory) { _; } - - function failed() public returns (bool) { - if (_failed) { - return _failed; - } else { - bool globalFailed = false; - if (hasHEVMContext()) { - (, bytes memory retdata) = HEVM_ADDRESS.call( - abi.encodePacked( - bytes4(keccak256("load(address,bytes32)")), - abi.encode(HEVM_ADDRESS, bytes32("failed")) - ) - ); - globalFailed = abi.decode(retdata, (bool)); - } - return globalFailed; - } - } - - function fail() internal virtual { - if (hasHEVMContext()) { - (bool status, ) = HEVM_ADDRESS.call( - abi.encodePacked( - bytes4(keccak256("store(address,bytes32,bytes32)")), - abi.encode(HEVM_ADDRESS, bytes32("failed"), bytes32(uint256(0x01))) - ) - ); - status; // Silence compiler warnings - } - _failed = true; - } - - function hasHEVMContext() internal view returns (bool) { - uint256 hevmCodeSize = 0; - assembly { - hevmCodeSize := extcodesize(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D) - } - return hevmCodeSize > 0; - } - - modifier logs_gas() { - uint startGas = gasleft(); - _; - uint endGas = gasleft(); - emit log_named_uint("gas", startGas - endGas); - } - - function assertTrue(bool condition) internal { - if (!condition) { - emit log("Error: Assertion Failed"); - fail(); - } - } - - function assertTrue(bool condition, string memory err) internal { - if (!condition) { - emit log_named_string("Error", err); - assertTrue(condition); - } - } - - function assertEq(address a, address b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [address]"); - emit log_named_address(" Left", a); - emit log_named_address(" Right", b); - fail(); - } - } - function assertEq(address a, address b, string memory err) internal { - if (a != b) { - emit log_named_string ("Error", err); - assertEq(a, b); - } - } - - function assertEq(bytes32 a, bytes32 b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [bytes32]"); - emit log_named_bytes32(" Left", a); - emit log_named_bytes32(" Right", b); - fail(); - } - } - function assertEq(bytes32 a, bytes32 b, string memory err) internal { - if (a != b) { - emit log_named_string ("Error", err); - assertEq(a, b); - } - } - function assertEq32(bytes32 a, bytes32 b) internal { - assertEq(a, b); - } - function assertEq32(bytes32 a, bytes32 b, string memory err) internal { - assertEq(a, b, err); - } - - function assertEq(int a, int b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [int]"); - emit log_named_int(" Left", a); - emit log_named_int(" Right", b); - fail(); - } - } - function assertEq(int a, int b, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - function assertEq(uint a, uint b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [uint]"); - emit log_named_uint(" Left", a); - emit log_named_uint(" Right", b); - fail(); - } - } - function assertEq(uint a, uint b, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - function assertEqDecimal(int a, int b, uint decimals) internal { - if (a != b) { - emit log("Error: a == b not satisfied [decimal int]"); - emit log_named_decimal_int(" Left", a, decimals); - emit log_named_decimal_int(" Right", b, decimals); - fail(); - } - } - function assertEqDecimal(int a, int b, uint decimals, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEqDecimal(a, b, decimals); - } - } - function assertEqDecimal(uint a, uint b, uint decimals) internal { - if (a != b) { - emit log("Error: a == b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Left", a, decimals); - emit log_named_decimal_uint(" Right", b, decimals); - fail(); - } - } - function assertEqDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEqDecimal(a, b, decimals); - } - } - - function assertGt(uint a, uint b) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertGt(uint a, uint b, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGt(a, b); - } - } - function assertGt(int a, int b) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertGt(int a, int b, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGt(a, b); - } - } - function assertGtDecimal(int a, int b, uint decimals) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertGtDecimal(int a, int b, uint decimals, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGtDecimal(a, b, decimals); - } - } - function assertGtDecimal(uint a, uint b, uint decimals) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertGtDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGtDecimal(a, b, decimals); - } - } - - function assertGe(uint a, uint b) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertGe(uint a, uint b, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGe(a, b); - } - } - function assertGe(int a, int b) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertGe(int a, int b, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGe(a, b); - } - } - function assertGeDecimal(int a, int b, uint decimals) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertGeDecimal(int a, int b, uint decimals, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGeDecimal(a, b, decimals); - } - } - function assertGeDecimal(uint a, uint b, uint decimals) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertGeDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGeDecimal(a, b, decimals); - } - } - - function assertLt(uint a, uint b) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertLt(uint a, uint b, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLt(a, b); - } - } - function assertLt(int a, int b) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertLt(int a, int b, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLt(a, b); - } - } - function assertLtDecimal(int a, int b, uint decimals) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertLtDecimal(int a, int b, uint decimals, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLtDecimal(a, b, decimals); - } - } - function assertLtDecimal(uint a, uint b, uint decimals) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertLtDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLtDecimal(a, b, decimals); - } - } - - function assertLe(uint a, uint b) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertLe(uint a, uint b, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLe(a, b); - } - } - function assertLe(int a, int b) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertLe(int a, int b, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLe(a, b); - } - } - function assertLeDecimal(int a, int b, uint decimals) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertLeDecimal(int a, int b, uint decimals, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLeDecimal(a, b, decimals); - } - } - function assertLeDecimal(uint a, uint b, uint decimals) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertLeDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLeDecimal(a, b, decimals); - } - } - - function assertEq(string memory a, string memory b) internal { - if (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b))) { - emit log("Error: a == b not satisfied [string]"); - emit log_named_string(" Left", a); - emit log_named_string(" Right", b); - fail(); - } - } - function assertEq(string memory a, string memory b, string memory err) internal { - if (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b))) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - - function checkEq0(bytes memory a, bytes memory b) internal pure returns (bool ok) { - ok = true; - if (a.length == b.length) { - for (uint i = 0; i < a.length; i++) { - if (a[i] != b[i]) { - ok = false; - } - } - } else { - ok = false; - } - } - function assertEq0(bytes memory a, bytes memory b) internal { - if (!checkEq0(a, b)) { - emit log("Error: a == b not satisfied [bytes]"); - emit log_named_bytes(" Left", a); - emit log_named_bytes(" Right", b); - fail(); - } - } - function assertEq0(bytes memory a, bytes memory b, string memory err) internal { - if (!checkEq0(a, b)) { - emit log_named_string("Error", err); - assertEq0(a, b); - } - } -} diff --git a/contract/lib/forge-std/lib/ds-test/src/test.t.sol b/contract/lib/forge-std/lib/ds-test/src/test.t.sol deleted file mode 100644 index 996f52f..0000000 --- a/contract/lib/forge-std/lib/ds-test/src/test.t.sol +++ /dev/null @@ -1,313 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.5.0; - -import {DSTest} from "./test.sol"; - -contract DemoTest is DSTest { - - // --- assertTrue --- - - function testAssertTrue() public { - assertTrue(true, "msg"); - assertTrue(true); - } - function testFailAssertTrue() public { - assertTrue(false); - } - function testFailAssertTrueWithMsg() public { - assertTrue(false, "msg"); - } - - // --- assertEq (Addr) --- - - function testAssertEqAddr() public { - assertEq(address(0x0), address(0x0), "msg"); - assertEq(address(0x0), address(0x0)); - } - function testFailAssertEqAddr() public { - assertEq(address(0x0), address(0x1)); - } - function testFailAssertEqAddrWithMsg() public { - assertEq(address(0x0), address(0x1), "msg"); - } - - // --- assertEq (Bytes32) --- - - function testAssertEqBytes32() public { - assertEq(bytes32("hi"), bytes32("hi"), "msg"); - assertEq(bytes32("hi"), bytes32("hi")); - } - function testFailAssertEqBytes32() public { - assertEq(bytes32("hi"), bytes32("ho")); - } - function testFailAssertEqBytes32WithMsg() public { - assertEq(bytes32("hi"), bytes32("ho"), "msg"); - } - - // --- assertEq (Int) --- - - function testAssertEqInt() public { - assertEq(-1, -1, "msg"); - assertEq(-1, -1); - } - function testFailAssertEqInt() public { - assertEq(-1, -2); - } - function testFailAssertEqIntWithMsg() public { - assertEq(-1, -2, "msg"); - } - - // --- assertEq (UInt) --- - - function testAssertEqUInt() public { - assertEq(uint(1), uint(1), "msg"); - assertEq(uint(1), uint(1)); - } - function testFailAssertEqUInt() public { - assertEq(uint(1), uint(2)); - } - function testFailAssertEqUIntWithMsg() public { - assertEq(uint(1), uint(2), "msg"); - } - - // --- assertEqDecimal (Int) --- - - function testAssertEqDecimalInt() public { - assertEqDecimal(-1, -1, 18, "msg"); - assertEqDecimal(-1, -1, 18); - } - function testFailAssertEqDecimalInt() public { - assertEqDecimal(-1, -2, 18); - } - function testFailAssertEqDecimalIntWithMsg() public { - assertEqDecimal(-1, -2, 18, "msg"); - } - - // --- assertEqDecimal (UInt) --- - - function testAssertEqDecimalUInt() public { - assertEqDecimal(uint(1), uint(1), 18, "msg"); - assertEqDecimal(uint(1), uint(1), 18); - } - function testFailAssertEqDecimalUInt() public { - assertEqDecimal(uint(1), uint(2), 18); - } - function testFailAssertEqDecimalUIntWithMsg() public { - assertEqDecimal(uint(1), uint(2), 18, "msg"); - } - - // --- assertGt (UInt) --- - - function testAssertGtUInt() public { - assertGt(uint(2), uint(1), "msg"); - assertGt(uint(3), uint(2)); - } - function testFailAssertGtUInt() public { - assertGt(uint(1), uint(2)); - } - function testFailAssertGtUIntWithMsg() public { - assertGt(uint(1), uint(2), "msg"); - } - - // --- assertGt (Int) --- - - function testAssertGtInt() public { - assertGt(-1, -2, "msg"); - assertGt(-1, -3); - } - function testFailAssertGtInt() public { - assertGt(-2, -1); - } - function testFailAssertGtIntWithMsg() public { - assertGt(-2, -1, "msg"); - } - - // --- assertGtDecimal (UInt) --- - - function testAssertGtDecimalUInt() public { - assertGtDecimal(uint(2), uint(1), 18, "msg"); - assertGtDecimal(uint(3), uint(2), 18); - } - function testFailAssertGtDecimalUInt() public { - assertGtDecimal(uint(1), uint(2), 18); - } - function testFailAssertGtDecimalUIntWithMsg() public { - assertGtDecimal(uint(1), uint(2), 18, "msg"); - } - - // --- assertGtDecimal (Int) --- - - function testAssertGtDecimalInt() public { - assertGtDecimal(-1, -2, 18, "msg"); - assertGtDecimal(-1, -3, 18); - } - function testFailAssertGtDecimalInt() public { - assertGtDecimal(-2, -1, 18); - } - function testFailAssertGtDecimalIntWithMsg() public { - assertGtDecimal(-2, -1, 18, "msg"); - } - - // --- assertGe (UInt) --- - - function testAssertGeUInt() public { - assertGe(uint(2), uint(1), "msg"); - assertGe(uint(2), uint(2)); - } - function testFailAssertGeUInt() public { - assertGe(uint(1), uint(2)); - } - function testFailAssertGeUIntWithMsg() public { - assertGe(uint(1), uint(2), "msg"); - } - - // --- assertGe (Int) --- - - function testAssertGeInt() public { - assertGe(-1, -2, "msg"); - assertGe(-1, -1); - } - function testFailAssertGeInt() public { - assertGe(-2, -1); - } - function testFailAssertGeIntWithMsg() public { - assertGe(-2, -1, "msg"); - } - - // --- assertGeDecimal (UInt) --- - - function testAssertGeDecimalUInt() public { - assertGeDecimal(uint(2), uint(1), 18, "msg"); - assertGeDecimal(uint(2), uint(2), 18); - } - function testFailAssertGeDecimalUInt() public { - assertGeDecimal(uint(1), uint(2), 18); - } - function testFailAssertGeDecimalUIntWithMsg() public { - assertGeDecimal(uint(1), uint(2), 18, "msg"); - } - - // --- assertGeDecimal (Int) --- - - function testAssertGeDecimalInt() public { - assertGeDecimal(-1, -2, 18, "msg"); - assertGeDecimal(-1, -2, 18); - } - function testFailAssertGeDecimalInt() public { - assertGeDecimal(-2, -1, 18); - } - function testFailAssertGeDecimalIntWithMsg() public { - assertGeDecimal(-2, -1, 18, "msg"); - } - - // --- assertLt (UInt) --- - - function testAssertLtUInt() public { - assertLt(uint(1), uint(2), "msg"); - assertLt(uint(1), uint(3)); - } - function testFailAssertLtUInt() public { - assertLt(uint(2), uint(2)); - } - function testFailAssertLtUIntWithMsg() public { - assertLt(uint(3), uint(2), "msg"); - } - - // --- assertLt (Int) --- - - function testAssertLtInt() public { - assertLt(-2, -1, "msg"); - assertLt(-1, 0); - } - function testFailAssertLtInt() public { - assertLt(-1, -2); - } - function testFailAssertLtIntWithMsg() public { - assertLt(-1, -1, "msg"); - } - - // --- assertLtDecimal (UInt) --- - - function testAssertLtDecimalUInt() public { - assertLtDecimal(uint(1), uint(2), 18, "msg"); - assertLtDecimal(uint(2), uint(3), 18); - } - function testFailAssertLtDecimalUInt() public { - assertLtDecimal(uint(1), uint(1), 18); - } - function testFailAssertLtDecimalUIntWithMsg() public { - assertLtDecimal(uint(2), uint(1), 18, "msg"); - } - - // --- assertLtDecimal (Int) --- - - function testAssertLtDecimalInt() public { - assertLtDecimal(-2, -1, 18, "msg"); - assertLtDecimal(-2, -1, 18); - } - function testFailAssertLtDecimalInt() public { - assertLtDecimal(-2, -2, 18); - } - function testFailAssertLtDecimalIntWithMsg() public { - assertLtDecimal(-1, -2, 18, "msg"); - } - - // --- assertLe (UInt) --- - - function testAssertLeUInt() public { - assertLe(uint(1), uint(2), "msg"); - assertLe(uint(1), uint(1)); - } - function testFailAssertLeUInt() public { - assertLe(uint(4), uint(2)); - } - function testFailAssertLeUIntWithMsg() public { - assertLe(uint(3), uint(2), "msg"); - } - - // --- assertLe (Int) --- - - function testAssertLeInt() public { - assertLe(-2, -1, "msg"); - assertLe(-1, -1); - } - function testFailAssertLeInt() public { - assertLe(-1, -2); - } - function testFailAssertLeIntWithMsg() public { - assertLe(-1, -3, "msg"); - } - - // --- assertLeDecimal (UInt) --- - - function testAssertLeDecimalUInt() public { - assertLeDecimal(uint(1), uint(2), 18, "msg"); - assertLeDecimal(uint(2), uint(2), 18); - } - function testFailAssertLeDecimalUInt() public { - assertLeDecimal(uint(1), uint(0), 18); - } - function testFailAssertLeDecimalUIntWithMsg() public { - assertLeDecimal(uint(1), uint(0), 18, "msg"); - } - - // --- assertLeDecimal (Int) --- - - function testAssertLeDecimalInt() public { - assertLeDecimal(-2, -1, 18, "msg"); - assertLeDecimal(-2, -2, 18); - } - function testFailAssertLeDecimalInt() public { - assertLeDecimal(-2, -3, 18); - } - function testFailAssertLeDecimalIntWithMsg() public { - assertLeDecimal(-1, -2, 18, "msg"); - } - - // --- fail override --- - - // ensure that fail can be overridden - function fail() internal override { - super.fail(); - } -} diff --git a/contract/lib/forge-std/package.json b/contract/lib/forge-std/package.json deleted file mode 100644 index b7f26f0..0000000 --- a/contract/lib/forge-std/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "forge-std", - "version": "1.5.2", - "description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.", - "homepage": "https://book.getfoundry.sh/forge/forge-std", - "bugs": "https://github.com/foundry-rs/forge-std/issues", - "license": "(Apache-2.0 OR MIT)", - "author": "Contributors to Forge Standard Library", - "files": [ - "src/**/*" - ], - "repository": { - "type": "git", - "url": "https://github.com/foundry-rs/forge-std.git" - } -} diff --git a/contract/lib/forge-std/src/Base.sol b/contract/lib/forge-std/src/Base.sol deleted file mode 100644 index 83c5c1c..0000000 --- a/contract/lib/forge-std/src/Base.sol +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -import {StdStorage} from "./StdStorage.sol"; -import {Vm, VmSafe} from "./Vm.sol"; - -abstract contract CommonBase { - // Cheat code address, 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D. - address internal constant VM_ADDRESS = address(uint160(uint256(keccak256("hevm cheat code")))); - // console.sol and console2.sol work by executing a staticcall to this address. - address internal constant CONSOLE = 0x000000000000000000636F6e736F6c652e6c6f67; - // Default address for tx.origin and msg.sender, 0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38. - address internal constant DEFAULT_SENDER = address(uint160(uint256(keccak256("foundry default caller")))); - // Address of the test contract, deployed by the DEFAULT_SENDER. - address internal constant DEFAULT_TEST_CONTRACT = 0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f; - // Deterministic deployment address of the Multicall3 contract. - address internal constant MULTICALL3_ADDRESS = 0xcA11bde05977b3631167028862bE2a173976CA11; - - uint256 internal constant UINT256_MAX = - 115792089237316195423570985008687907853269984665640564039457584007913129639935; - - Vm internal constant vm = Vm(VM_ADDRESS); - StdStorage internal stdstore; -} - -abstract contract TestBase is CommonBase {} - -abstract contract ScriptBase is CommonBase { - // Used when deploying with create2, https://github.com/Arachnid/deterministic-deployment-proxy. - address internal constant CREATE2_FACTORY = 0x4e59b44847b379578588920cA78FbF26c0B4956C; - - VmSafe internal constant vmSafe = VmSafe(VM_ADDRESS); -} diff --git a/contract/lib/forge-std/src/Script.sol b/contract/lib/forge-std/src/Script.sol deleted file mode 100644 index bffccad..0000000 --- a/contract/lib/forge-std/src/Script.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -// 💬 ABOUT -// Standard Library's default Script. - -// 🧩 MODULES -import {ScriptBase} from "./Base.sol"; -import {console} from "./console.sol"; -import {console2} from "./console2.sol"; -import {StdChains} from "./StdChains.sol"; -import {StdCheatsSafe} from "./StdCheats.sol"; -import {stdJson} from "./StdJson.sol"; -import {stdMath} from "./StdMath.sol"; -import {StdStorage, stdStorageSafe} from "./StdStorage.sol"; -import {StdUtils} from "./StdUtils.sol"; -import {VmSafe} from "./Vm.sol"; - -// 📦 BOILERPLATE -import {ScriptBase} from "./Base.sol"; - -// ⭐️ SCRIPT -abstract contract Script is StdChains, StdCheatsSafe, StdUtils, ScriptBase { - // Note: IS_SCRIPT() must return true. - bool public IS_SCRIPT = true; -} diff --git a/contract/lib/forge-std/src/StdAssertions.sol b/contract/lib/forge-std/src/StdAssertions.sol deleted file mode 100644 index 198a1ba..0000000 --- a/contract/lib/forge-std/src/StdAssertions.sol +++ /dev/null @@ -1,376 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -import {DSTest} from "ds-test/test.sol"; -import {stdMath} from "./StdMath.sol"; - -abstract contract StdAssertions is DSTest { - event log_array(uint256[] val); - event log_array(int256[] val); - event log_array(address[] val); - event log_named_array(string key, uint256[] val); - event log_named_array(string key, int256[] val); - event log_named_array(string key, address[] val); - - function fail(string memory err) internal virtual { - emit log_named_string("Error", err); - fail(); - } - - function assertFalse(bool data) internal virtual { - assertTrue(!data); - } - - function assertFalse(bool data, string memory err) internal virtual { - assertTrue(!data, err); - } - - function assertEq(bool a, bool b) internal virtual { - if (a != b) { - emit log("Error: a == b not satisfied [bool]"); - emit log_named_string(" Left", a ? "true" : "false"); - emit log_named_string(" Right", b ? "true" : "false"); - fail(); - } - } - - function assertEq(bool a, bool b, string memory err) internal virtual { - if (a != b) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - - function assertEq(bytes memory a, bytes memory b) internal virtual { - assertEq0(a, b); - } - - function assertEq(bytes memory a, bytes memory b, string memory err) internal virtual { - assertEq0(a, b, err); - } - - function assertEq(uint256[] memory a, uint256[] memory b) internal virtual { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log("Error: a == b not satisfied [uint[]]"); - emit log_named_array(" Left", a); - emit log_named_array(" Right", b); - fail(); - } - } - - function assertEq(int256[] memory a, int256[] memory b) internal virtual { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log("Error: a == b not satisfied [int[]]"); - emit log_named_array(" Left", a); - emit log_named_array(" Right", b); - fail(); - } - } - - function assertEq(address[] memory a, address[] memory b) internal virtual { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log("Error: a == b not satisfied [address[]]"); - emit log_named_array(" Left", a); - emit log_named_array(" Right", b); - fail(); - } - } - - function assertEq(uint256[] memory a, uint256[] memory b, string memory err) internal virtual { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - - function assertEq(int256[] memory a, int256[] memory b, string memory err) internal virtual { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - - function assertEq(address[] memory a, address[] memory b, string memory err) internal virtual { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - - // Legacy helper - function assertEqUint(uint256 a, uint256 b) internal virtual { - assertEq(uint256(a), uint256(b)); - } - - function assertApproxEqAbs(uint256 a, uint256 b, uint256 maxDelta) internal virtual { - uint256 delta = stdMath.delta(a, b); - - if (delta > maxDelta) { - emit log("Error: a ~= b not satisfied [uint]"); - emit log_named_uint(" Left", a); - emit log_named_uint(" Right", b); - emit log_named_uint(" Max Delta", maxDelta); - emit log_named_uint(" Delta", delta); - fail(); - } - } - - function assertApproxEqAbs(uint256 a, uint256 b, uint256 maxDelta, string memory err) internal virtual { - uint256 delta = stdMath.delta(a, b); - - if (delta > maxDelta) { - emit log_named_string("Error", err); - assertApproxEqAbs(a, b, maxDelta); - } - } - - function assertApproxEqAbsDecimal(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) internal virtual { - uint256 delta = stdMath.delta(a, b); - - if (delta > maxDelta) { - emit log("Error: a ~= b not satisfied [uint]"); - emit log_named_decimal_uint(" Left", a, decimals); - emit log_named_decimal_uint(" Right", b, decimals); - emit log_named_decimal_uint(" Max Delta", maxDelta, decimals); - emit log_named_decimal_uint(" Delta", delta, decimals); - fail(); - } - } - - function assertApproxEqAbsDecimal(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals, string memory err) - internal - virtual - { - uint256 delta = stdMath.delta(a, b); - - if (delta > maxDelta) { - emit log_named_string("Error", err); - assertApproxEqAbsDecimal(a, b, maxDelta, decimals); - } - } - - function assertApproxEqAbs(int256 a, int256 b, uint256 maxDelta) internal virtual { - uint256 delta = stdMath.delta(a, b); - - if (delta > maxDelta) { - emit log("Error: a ~= b not satisfied [int]"); - emit log_named_int(" Left", a); - emit log_named_int(" Right", b); - emit log_named_uint(" Max Delta", maxDelta); - emit log_named_uint(" Delta", delta); - fail(); - } - } - - function assertApproxEqAbs(int256 a, int256 b, uint256 maxDelta, string memory err) internal virtual { - uint256 delta = stdMath.delta(a, b); - - if (delta > maxDelta) { - emit log_named_string("Error", err); - assertApproxEqAbs(a, b, maxDelta); - } - } - - function assertApproxEqAbsDecimal(int256 a, int256 b, uint256 maxDelta, uint256 decimals) internal virtual { - uint256 delta = stdMath.delta(a, b); - - if (delta > maxDelta) { - emit log("Error: a ~= b not satisfied [int]"); - emit log_named_decimal_int(" Left", a, decimals); - emit log_named_decimal_int(" Right", b, decimals); - emit log_named_decimal_uint(" Max Delta", maxDelta, decimals); - emit log_named_decimal_uint(" Delta", delta, decimals); - fail(); - } - } - - function assertApproxEqAbsDecimal(int256 a, int256 b, uint256 maxDelta, uint256 decimals, string memory err) - internal - virtual - { - uint256 delta = stdMath.delta(a, b); - - if (delta > maxDelta) { - emit log_named_string("Error", err); - assertApproxEqAbsDecimal(a, b, maxDelta, decimals); - } - } - - function assertApproxEqRel( - uint256 a, - uint256 b, - uint256 maxPercentDelta // An 18 decimal fixed point number, where 1e18 == 100% - ) internal virtual { - if (b == 0) return assertEq(a, b); // If the left is 0, right must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log("Error: a ~= b not satisfied [uint]"); - emit log_named_uint(" Left", a); - emit log_named_uint(" Right", b); - emit log_named_decimal_uint(" Max % Delta", maxPercentDelta, 18); - emit log_named_decimal_uint(" % Delta", percentDelta, 18); - fail(); - } - } - - function assertApproxEqRel( - uint256 a, - uint256 b, - uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100% - string memory err - ) internal virtual { - if (b == 0) return assertEq(a, b, err); // If the left is 0, right must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log_named_string("Error", err); - assertApproxEqRel(a, b, maxPercentDelta); - } - } - - function assertApproxEqRelDecimal( - uint256 a, - uint256 b, - uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100% - uint256 decimals - ) internal virtual { - if (b == 0) return assertEq(a, b); // If the left is 0, right must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log("Error: a ~= b not satisfied [uint]"); - emit log_named_decimal_uint(" Left", a, decimals); - emit log_named_decimal_uint(" Right", b, decimals); - emit log_named_decimal_uint(" Max % Delta", maxPercentDelta, 18); - emit log_named_decimal_uint(" % Delta", percentDelta, 18); - fail(); - } - } - - function assertApproxEqRelDecimal( - uint256 a, - uint256 b, - uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100% - uint256 decimals, - string memory err - ) internal virtual { - if (b == 0) return assertEq(a, b, err); // If the left is 0, right must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log_named_string("Error", err); - assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals); - } - } - - function assertApproxEqRel(int256 a, int256 b, uint256 maxPercentDelta) internal virtual { - if (b == 0) return assertEq(a, b); // If the left is 0, right must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log("Error: a ~= b not satisfied [int]"); - emit log_named_int(" Left", a); - emit log_named_int(" Right", b); - emit log_named_decimal_uint(" Max % Delta", maxPercentDelta, 18); - emit log_named_decimal_uint(" % Delta", percentDelta, 18); - fail(); - } - } - - function assertApproxEqRel(int256 a, int256 b, uint256 maxPercentDelta, string memory err) internal virtual { - if (b == 0) return assertEq(a, b, err); // If the left is 0, right must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log_named_string("Error", err); - assertApproxEqRel(a, b, maxPercentDelta); - } - } - - function assertApproxEqRelDecimal(int256 a, int256 b, uint256 maxPercentDelta, uint256 decimals) internal virtual { - if (b == 0) return assertEq(a, b); // If the left is 0, right must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log("Error: a ~= b not satisfied [int]"); - emit log_named_decimal_int(" Left", a, decimals); - emit log_named_decimal_int(" Right", b, decimals); - emit log_named_decimal_uint(" Max % Delta", maxPercentDelta, 18); - emit log_named_decimal_uint(" % Delta", percentDelta, 18); - fail(); - } - } - - function assertApproxEqRelDecimal(int256 a, int256 b, uint256 maxPercentDelta, uint256 decimals, string memory err) - internal - virtual - { - if (b == 0) return assertEq(a, b, err); // If the left is 0, right must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log_named_string("Error", err); - assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals); - } - } - - function assertEqCall(address target, bytes memory callDataA, bytes memory callDataB) internal virtual { - assertEqCall(target, callDataA, target, callDataB, true); - } - - function assertEqCall(address targetA, bytes memory callDataA, address targetB, bytes memory callDataB) - internal - virtual - { - assertEqCall(targetA, callDataA, targetB, callDataB, true); - } - - function assertEqCall(address target, bytes memory callDataA, bytes memory callDataB, bool strictRevertData) - internal - virtual - { - assertEqCall(target, callDataA, target, callDataB, strictRevertData); - } - - function assertEqCall( - address targetA, - bytes memory callDataA, - address targetB, - bytes memory callDataB, - bool strictRevertData - ) internal virtual { - (bool successA, bytes memory returnDataA) = address(targetA).call(callDataA); - (bool successB, bytes memory returnDataB) = address(targetB).call(callDataB); - - if (successA && successB) { - assertEq(returnDataA, returnDataB, "Call return data does not match"); - } - - if (!successA && !successB && strictRevertData) { - assertEq(returnDataA, returnDataB, "Call revert data does not match"); - } - - if (!successA && successB) { - emit log("Error: Calls were not equal"); - emit log_named_bytes(" Left call revert data", returnDataA); - emit log_named_bytes(" Right call return data", returnDataB); - fail(); - } - - if (successA && !successB) { - emit log("Error: Calls were not equal"); - emit log_named_bytes(" Left call return data", returnDataA); - emit log_named_bytes(" Right call revert data", returnDataB); - fail(); - } - } -} diff --git a/contract/lib/forge-std/src/StdChains.sol b/contract/lib/forge-std/src/StdChains.sol deleted file mode 100644 index b1f0e6d..0000000 --- a/contract/lib/forge-std/src/StdChains.sol +++ /dev/null @@ -1,233 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -pragma experimental ABIEncoderV2; - -import {VmSafe} from "./Vm.sol"; - -/** - * StdChains provides information about EVM compatible chains that can be used in scripts/tests. - * For each chain, the chain's name, chain ID, and a default RPC URL are provided. Chains are - * identified by their alias, which is the same as the alias in the `[rpc_endpoints]` section of - * the `foundry.toml` file. For best UX, ensure the alias in the `foundry.toml` file match the - * alias used in this contract, which can be found as the first argument to the - * `setChainWithDefaultRpcUrl` call in the `initialize` function. - * - * There are two main ways to use this contract: - * 1. Set a chain with `setChain(string memory chainAlias, ChainData memory chain)` or - * `setChain(string memory chainAlias, Chain memory chain)` - * 2. Get a chain with `getChain(string memory chainAlias)` or `getChain(uint256 chainId)`. - * - * The first time either of those are used, chains are initialized with the default set of RPC URLs. - * This is done in `initialize`, which uses `setChainWithDefaultRpcUrl`. Defaults are recorded in - * `defaultRpcUrls`. - * - * The `setChain` function is straightforward, and it simply saves off the given chain data. - * - * The `getChain` methods use `getChainWithUpdatedRpcUrl` to return a chain. For example, let's say - * we want to retrieve `mainnet`'s RPC URL: - * - If you haven't set any mainnet chain info with `setChain`, you haven't specified that - * chain in `foundry.toml` and no env var is set, the default data and RPC URL will be returned. - * - If you have set a mainnet RPC URL in `foundry.toml` it will return that, if valid (e.g. if - * a URL is given or if an environment variable is given and that environment variable exists). - * Otherwise, the default data is returned. - * - If you specified data with `setChain` it will return that. - * - * Summarizing the above, the prioritization hierarchy is `setChain` -> `foundry.toml` -> environment variable -> defaults. - */ -abstract contract StdChains { - VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code"))))); - - bool private initialized; - - struct ChainData { - string name; - uint256 chainId; - string rpcUrl; - } - - struct Chain { - // The chain name. - string name; - // The chain's Chain ID. - uint256 chainId; - // The chain's alias. (i.e. what gets specified in `foundry.toml`). - string chainAlias; - // A default RPC endpoint for this chain. - // NOTE: This default RPC URL is included for convenience to facilitate quick tests and - // experimentation. Do not use this RPC URL for production test suites, CI, or other heavy - // usage as you will be throttled and this is a disservice to others who need this endpoint. - string rpcUrl; - } - - // Maps from the chain's alias (matching the alias in the `foundry.toml` file) to chain data. - mapping(string => Chain) private chains; - // Maps from the chain's alias to it's default RPC URL. - mapping(string => string) private defaultRpcUrls; - // Maps from a chain ID to it's alias. - mapping(uint256 => string) private idToAlias; - - bool private fallbackToDefaultRpcUrls = true; - - // The RPC URL will be fetched from config or defaultRpcUrls if possible. - function getChain(string memory chainAlias) internal virtual returns (Chain memory chain) { - require(bytes(chainAlias).length != 0, "StdChains getChain(string): Chain alias cannot be the empty string."); - - initialize(); - chain = chains[chainAlias]; - require( - chain.chainId != 0, - string(abi.encodePacked("StdChains getChain(string): Chain with alias \"", chainAlias, "\" not found.")) - ); - - chain = getChainWithUpdatedRpcUrl(chainAlias, chain); - } - - function getChain(uint256 chainId) internal virtual returns (Chain memory chain) { - require(chainId != 0, "StdChains getChain(uint256): Chain ID cannot be 0."); - initialize(); - string memory chainAlias = idToAlias[chainId]; - - chain = chains[chainAlias]; - - require( - chain.chainId != 0, - string(abi.encodePacked("StdChains getChain(uint256): Chain with ID ", vm.toString(chainId), " not found.")) - ); - - chain = getChainWithUpdatedRpcUrl(chainAlias, chain); - } - - // set chain info, with priority to argument's rpcUrl field. - function setChain(string memory chainAlias, ChainData memory chain) internal virtual { - require( - bytes(chainAlias).length != 0, - "StdChains setChain(string,ChainData): Chain alias cannot be the empty string." - ); - - require(chain.chainId != 0, "StdChains setChain(string,ChainData): Chain ID cannot be 0."); - - initialize(); - string memory foundAlias = idToAlias[chain.chainId]; - - require( - bytes(foundAlias).length == 0 || keccak256(bytes(foundAlias)) == keccak256(bytes(chainAlias)), - string( - abi.encodePacked( - "StdChains setChain(string,ChainData): Chain ID ", - vm.toString(chain.chainId), - " already used by \"", - foundAlias, - "\"." - ) - ) - ); - - uint256 oldChainId = chains[chainAlias].chainId; - delete idToAlias[oldChainId]; - - chains[chainAlias] = - Chain({name: chain.name, chainId: chain.chainId, chainAlias: chainAlias, rpcUrl: chain.rpcUrl}); - idToAlias[chain.chainId] = chainAlias; - } - - // set chain info, with priority to argument's rpcUrl field. - function setChain(string memory chainAlias, Chain memory chain) internal virtual { - setChain(chainAlias, ChainData({name: chain.name, chainId: chain.chainId, rpcUrl: chain.rpcUrl})); - } - - function _toUpper(string memory str) private pure returns (string memory) { - bytes memory strb = bytes(str); - bytes memory copy = new bytes(strb.length); - for (uint256 i = 0; i < strb.length; i++) { - bytes1 b = strb[i]; - if (b >= 0x61 && b <= 0x7A) { - copy[i] = bytes1(uint8(b) - 32); - } else { - copy[i] = b; - } - } - return string(copy); - } - - // lookup rpcUrl, in descending order of priority: - // current -> config (foundry.toml) -> environment variable -> default - function getChainWithUpdatedRpcUrl(string memory chainAlias, Chain memory chain) private returns (Chain memory) { - if (bytes(chain.rpcUrl).length == 0) { - try vm.rpcUrl(chainAlias) returns (string memory configRpcUrl) { - chain.rpcUrl = configRpcUrl; - } catch (bytes memory err) { - string memory envName = string(abi.encodePacked(_toUpper(chainAlias), "_RPC_URL")); - if (fallbackToDefaultRpcUrls) { - chain.rpcUrl = vm.envOr(envName, defaultRpcUrls[chainAlias]); - } else { - chain.rpcUrl = vm.envString(envName); - } - // distinguish 'not found' from 'cannot read' - bytes memory notFoundError = - abi.encodeWithSignature("CheatCodeError", string(abi.encodePacked("invalid rpc url ", chainAlias))); - if (keccak256(notFoundError) != keccak256(err) || bytes(chain.rpcUrl).length == 0) { - /// @solidity memory-safe-assembly - assembly { - revert(add(32, err), mload(err)) - } - } - } - } - return chain; - } - - function setFallbackToDefaultRpcUrls(bool useDefault) internal { - fallbackToDefaultRpcUrls = useDefault; - } - - function initialize() private { - if (initialized) return; - - initialized = true; - - // If adding an RPC here, make sure to test the default RPC URL in `testRpcs` - setChainWithDefaultRpcUrl("anvil", ChainData("Anvil", 31337, "http://127.0.0.1:8545")); - setChainWithDefaultRpcUrl( - "mainnet", ChainData("Mainnet", 1, "https://mainnet.infura.io/v3/f4a0bdad42674adab5fc0ac077ffab2b") - ); - setChainWithDefaultRpcUrl( - "goerli", ChainData("Goerli", 5, "https://goerli.infura.io/v3/f4a0bdad42674adab5fc0ac077ffab2b") - ); - setChainWithDefaultRpcUrl( - "sepolia", ChainData("Sepolia", 11155111, "https://sepolia.infura.io/v3/f4a0bdad42674adab5fc0ac077ffab2b") - ); - setChainWithDefaultRpcUrl("optimism", ChainData("Optimism", 10, "https://mainnet.optimism.io")); - setChainWithDefaultRpcUrl("optimism_goerli", ChainData("Optimism Goerli", 420, "https://goerli.optimism.io")); - setChainWithDefaultRpcUrl("arbitrum_one", ChainData("Arbitrum One", 42161, "https://arb1.arbitrum.io/rpc")); - setChainWithDefaultRpcUrl( - "arbitrum_one_goerli", ChainData("Arbitrum One Goerli", 421613, "https://goerli-rollup.arbitrum.io/rpc") - ); - setChainWithDefaultRpcUrl("arbitrum_nova", ChainData("Arbitrum Nova", 42170, "https://nova.arbitrum.io/rpc")); - setChainWithDefaultRpcUrl("polygon", ChainData("Polygon", 137, "https://polygon-rpc.com")); - setChainWithDefaultRpcUrl( - "polygon_mumbai", ChainData("Polygon Mumbai", 80001, "https://rpc-mumbai.maticvigil.com") - ); - setChainWithDefaultRpcUrl("avalanche", ChainData("Avalanche", 43114, "https://api.avax.network/ext/bc/C/rpc")); - setChainWithDefaultRpcUrl( - "avalanche_fuji", ChainData("Avalanche Fuji", 43113, "https://api.avax-test.network/ext/bc/C/rpc") - ); - setChainWithDefaultRpcUrl( - "bnb_smart_chain", ChainData("BNB Smart Chain", 56, "https://bsc-dataseed1.binance.org") - ); - setChainWithDefaultRpcUrl( - "bnb_smart_chain_testnet", - ChainData("BNB Smart Chain Testnet", 97, "https://rpc.ankr.com/bsc_testnet_chapel") - ); - setChainWithDefaultRpcUrl("gnosis_chain", ChainData("Gnosis Chain", 100, "https://rpc.gnosischain.com")); - } - - // set chain info, with priority to chainAlias' rpc url in foundry.toml - function setChainWithDefaultRpcUrl(string memory chainAlias, ChainData memory chain) private { - string memory rpcUrl = chain.rpcUrl; - defaultRpcUrls[chainAlias] = rpcUrl; - chain.rpcUrl = ""; - setChain(chainAlias, chain); - chain.rpcUrl = rpcUrl; // restore argument - } -} diff --git a/contract/lib/forge-std/src/StdCheats.sol b/contract/lib/forge-std/src/StdCheats.sol deleted file mode 100644 index c1afa6c..0000000 --- a/contract/lib/forge-std/src/StdCheats.sol +++ /dev/null @@ -1,629 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -pragma experimental ABIEncoderV2; - -import {StdStorage, stdStorage} from "./StdStorage.sol"; -import {Vm} from "./Vm.sol"; - -abstract contract StdCheatsSafe { - Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); - - bool private gasMeteringOff; - - // Data structures to parse Transaction objects from the broadcast artifact - // that conform to EIP1559. The Raw structs is what is parsed from the JSON - // and then converted to the one that is used by the user for better UX. - - struct RawTx1559 { - string[] arguments; - address contractAddress; - string contractName; - // json value name = function - string functionSig; - bytes32 hash; - // json value name = tx - RawTx1559Detail txDetail; - // json value name = type - string opcode; - } - - struct RawTx1559Detail { - AccessList[] accessList; - bytes data; - address from; - bytes gas; - bytes nonce; - address to; - bytes txType; - bytes value; - } - - struct Tx1559 { - string[] arguments; - address contractAddress; - string contractName; - string functionSig; - bytes32 hash; - Tx1559Detail txDetail; - string opcode; - } - - struct Tx1559Detail { - AccessList[] accessList; - bytes data; - address from; - uint256 gas; - uint256 nonce; - address to; - uint256 txType; - uint256 value; - } - - // Data structures to parse Transaction objects from the broadcast artifact - // that DO NOT conform to EIP1559. The Raw structs is what is parsed from the JSON - // and then converted to the one that is used by the user for better UX. - - struct TxLegacy { - string[] arguments; - address contractAddress; - string contractName; - string functionSig; - string hash; - string opcode; - TxDetailLegacy transaction; - } - - struct TxDetailLegacy { - AccessList[] accessList; - uint256 chainId; - bytes data; - address from; - uint256 gas; - uint256 gasPrice; - bytes32 hash; - uint256 nonce; - bytes1 opcode; - bytes32 r; - bytes32 s; - uint256 txType; - address to; - uint8 v; - uint256 value; - } - - struct AccessList { - address accessAddress; - bytes32[] storageKeys; - } - - // Data structures to parse Receipt objects from the broadcast artifact. - // The Raw structs is what is parsed from the JSON - // and then converted to the one that is used by the user for better UX. - - struct RawReceipt { - bytes32 blockHash; - bytes blockNumber; - address contractAddress; - bytes cumulativeGasUsed; - bytes effectiveGasPrice; - address from; - bytes gasUsed; - RawReceiptLog[] logs; - bytes logsBloom; - bytes status; - address to; - bytes32 transactionHash; - bytes transactionIndex; - } - - struct Receipt { - bytes32 blockHash; - uint256 blockNumber; - address contractAddress; - uint256 cumulativeGasUsed; - uint256 effectiveGasPrice; - address from; - uint256 gasUsed; - ReceiptLog[] logs; - bytes logsBloom; - uint256 status; - address to; - bytes32 transactionHash; - uint256 transactionIndex; - } - - // Data structures to parse the entire broadcast artifact, assuming the - // transactions conform to EIP1559. - - struct EIP1559ScriptArtifact { - string[] libraries; - string path; - string[] pending; - Receipt[] receipts; - uint256 timestamp; - Tx1559[] transactions; - TxReturn[] txReturns; - } - - struct RawEIP1559ScriptArtifact { - string[] libraries; - string path; - string[] pending; - RawReceipt[] receipts; - TxReturn[] txReturns; - uint256 timestamp; - RawTx1559[] transactions; - } - - struct RawReceiptLog { - // json value = address - address logAddress; - bytes32 blockHash; - bytes blockNumber; - bytes data; - bytes logIndex; - bool removed; - bytes32[] topics; - bytes32 transactionHash; - bytes transactionIndex; - bytes transactionLogIndex; - } - - struct ReceiptLog { - // json value = address - address logAddress; - bytes32 blockHash; - uint256 blockNumber; - bytes data; - uint256 logIndex; - bytes32[] topics; - uint256 transactionIndex; - uint256 transactionLogIndex; - bool removed; - } - - struct TxReturn { - string internalType; - string value; - } - - function assumeNoPrecompiles(address addr) internal virtual { - // Assembly required since `block.chainid` was introduced in 0.8.0. - uint256 chainId; - assembly { - chainId := chainid() - } - assumeNoPrecompiles(addr, chainId); - } - - function assumeNoPrecompiles(address addr, uint256 chainId) internal pure virtual { - // Note: For some chains like Optimism these are technically predeploys (i.e. bytecode placed at a specific - // address), but the same rationale for excluding them applies so we include those too. - - // These should be present on all EVM-compatible chains. - vm.assume(addr < address(0x1) || addr > address(0x9)); - - // forgefmt: disable-start - if (chainId == 10 || chainId == 420) { - // https://github.com/ethereum-optimism/optimism/blob/eaa371a0184b56b7ca6d9eb9cb0a2b78b2ccd864/op-bindings/predeploys/addresses.go#L6-L21 - vm.assume(addr < address(0x4200000000000000000000000000000000000000) || addr > address(0x4200000000000000000000000000000000000800)); - } else if (chainId == 42161 || chainId == 421613) { - // https://developer.arbitrum.io/useful-addresses#arbitrum-precompiles-l2-same-on-all-arb-chains - vm.assume(addr < address(0x0000000000000000000000000000000000000064) || addr > address(0x0000000000000000000000000000000000000068)); - } else if (chainId == 43114 || chainId == 43113) { - // https://github.com/ava-labs/subnet-evm/blob/47c03fd007ecaa6de2c52ea081596e0a88401f58/precompile/params.go#L18-L59 - vm.assume(addr < address(0x0100000000000000000000000000000000000000) || addr > address(0x01000000000000000000000000000000000000ff)); - vm.assume(addr < address(0x0200000000000000000000000000000000000000) || addr > address(0x02000000000000000000000000000000000000FF)); - vm.assume(addr < address(0x0300000000000000000000000000000000000000) || addr > address(0x03000000000000000000000000000000000000Ff)); - } - // forgefmt: disable-end - } - - function readEIP1559ScriptArtifact(string memory path) - internal - view - virtual - returns (EIP1559ScriptArtifact memory) - { - string memory data = vm.readFile(path); - bytes memory parsedData = vm.parseJson(data); - RawEIP1559ScriptArtifact memory rawArtifact = abi.decode(parsedData, (RawEIP1559ScriptArtifact)); - EIP1559ScriptArtifact memory artifact; - artifact.libraries = rawArtifact.libraries; - artifact.path = rawArtifact.path; - artifact.timestamp = rawArtifact.timestamp; - artifact.pending = rawArtifact.pending; - artifact.txReturns = rawArtifact.txReturns; - artifact.receipts = rawToConvertedReceipts(rawArtifact.receipts); - artifact.transactions = rawToConvertedEIPTx1559s(rawArtifact.transactions); - return artifact; - } - - function rawToConvertedEIPTx1559s(RawTx1559[] memory rawTxs) internal pure virtual returns (Tx1559[] memory) { - Tx1559[] memory txs = new Tx1559[](rawTxs.length); - for (uint256 i; i < rawTxs.length; i++) { - txs[i] = rawToConvertedEIPTx1559(rawTxs[i]); - } - return txs; - } - - function rawToConvertedEIPTx1559(RawTx1559 memory rawTx) internal pure virtual returns (Tx1559 memory) { - Tx1559 memory transaction; - transaction.arguments = rawTx.arguments; - transaction.contractName = rawTx.contractName; - transaction.functionSig = rawTx.functionSig; - transaction.hash = rawTx.hash; - transaction.txDetail = rawToConvertedEIP1559Detail(rawTx.txDetail); - transaction.opcode = rawTx.opcode; - return transaction; - } - - function rawToConvertedEIP1559Detail(RawTx1559Detail memory rawDetail) - internal - pure - virtual - returns (Tx1559Detail memory) - { - Tx1559Detail memory txDetail; - txDetail.data = rawDetail.data; - txDetail.from = rawDetail.from; - txDetail.to = rawDetail.to; - txDetail.nonce = _bytesToUint(rawDetail.nonce); - txDetail.txType = _bytesToUint(rawDetail.txType); - txDetail.value = _bytesToUint(rawDetail.value); - txDetail.gas = _bytesToUint(rawDetail.gas); - txDetail.accessList = rawDetail.accessList; - return txDetail; - } - - function readTx1559s(string memory path) internal view virtual returns (Tx1559[] memory) { - string memory deployData = vm.readFile(path); - bytes memory parsedDeployData = vm.parseJson(deployData, ".transactions"); - RawTx1559[] memory rawTxs = abi.decode(parsedDeployData, (RawTx1559[])); - return rawToConvertedEIPTx1559s(rawTxs); - } - - function readTx1559(string memory path, uint256 index) internal view virtual returns (Tx1559 memory) { - string memory deployData = vm.readFile(path); - string memory key = string(abi.encodePacked(".transactions[", vm.toString(index), "]")); - bytes memory parsedDeployData = vm.parseJson(deployData, key); - RawTx1559 memory rawTx = abi.decode(parsedDeployData, (RawTx1559)); - return rawToConvertedEIPTx1559(rawTx); - } - - // Analogous to readTransactions, but for receipts. - function readReceipts(string memory path) internal view virtual returns (Receipt[] memory) { - string memory deployData = vm.readFile(path); - bytes memory parsedDeployData = vm.parseJson(deployData, ".receipts"); - RawReceipt[] memory rawReceipts = abi.decode(parsedDeployData, (RawReceipt[])); - return rawToConvertedReceipts(rawReceipts); - } - - function readReceipt(string memory path, uint256 index) internal view virtual returns (Receipt memory) { - string memory deployData = vm.readFile(path); - string memory key = string(abi.encodePacked(".receipts[", vm.toString(index), "]")); - bytes memory parsedDeployData = vm.parseJson(deployData, key); - RawReceipt memory rawReceipt = abi.decode(parsedDeployData, (RawReceipt)); - return rawToConvertedReceipt(rawReceipt); - } - - function rawToConvertedReceipts(RawReceipt[] memory rawReceipts) internal pure virtual returns (Receipt[] memory) { - Receipt[] memory receipts = new Receipt[](rawReceipts.length); - for (uint256 i; i < rawReceipts.length; i++) { - receipts[i] = rawToConvertedReceipt(rawReceipts[i]); - } - return receipts; - } - - function rawToConvertedReceipt(RawReceipt memory rawReceipt) internal pure virtual returns (Receipt memory) { - Receipt memory receipt; - receipt.blockHash = rawReceipt.blockHash; - receipt.to = rawReceipt.to; - receipt.from = rawReceipt.from; - receipt.contractAddress = rawReceipt.contractAddress; - receipt.effectiveGasPrice = _bytesToUint(rawReceipt.effectiveGasPrice); - receipt.cumulativeGasUsed = _bytesToUint(rawReceipt.cumulativeGasUsed); - receipt.gasUsed = _bytesToUint(rawReceipt.gasUsed); - receipt.status = _bytesToUint(rawReceipt.status); - receipt.transactionIndex = _bytesToUint(rawReceipt.transactionIndex); - receipt.blockNumber = _bytesToUint(rawReceipt.blockNumber); - receipt.logs = rawToConvertedReceiptLogs(rawReceipt.logs); - receipt.logsBloom = rawReceipt.logsBloom; - receipt.transactionHash = rawReceipt.transactionHash; - return receipt; - } - - function rawToConvertedReceiptLogs(RawReceiptLog[] memory rawLogs) - internal - pure - virtual - returns (ReceiptLog[] memory) - { - ReceiptLog[] memory logs = new ReceiptLog[](rawLogs.length); - for (uint256 i; i < rawLogs.length; i++) { - logs[i].logAddress = rawLogs[i].logAddress; - logs[i].blockHash = rawLogs[i].blockHash; - logs[i].blockNumber = _bytesToUint(rawLogs[i].blockNumber); - logs[i].data = rawLogs[i].data; - logs[i].logIndex = _bytesToUint(rawLogs[i].logIndex); - logs[i].topics = rawLogs[i].topics; - logs[i].transactionIndex = _bytesToUint(rawLogs[i].transactionIndex); - logs[i].transactionLogIndex = _bytesToUint(rawLogs[i].transactionLogIndex); - logs[i].removed = rawLogs[i].removed; - } - return logs; - } - - // Deploy a contract by fetching the contract bytecode from - // the artifacts directory - // e.g. `deployCode(code, abi.encode(arg1,arg2,arg3))` - function deployCode(string memory what, bytes memory args) internal virtual returns (address addr) { - bytes memory bytecode = abi.encodePacked(vm.getCode(what), args); - /// @solidity memory-safe-assembly - assembly { - addr := create(0, add(bytecode, 0x20), mload(bytecode)) - } - - require(addr != address(0), "StdCheats deployCode(string,bytes): Deployment failed."); - } - - function deployCode(string memory what) internal virtual returns (address addr) { - bytes memory bytecode = vm.getCode(what); - /// @solidity memory-safe-assembly - assembly { - addr := create(0, add(bytecode, 0x20), mload(bytecode)) - } - - require(addr != address(0), "StdCheats deployCode(string): Deployment failed."); - } - - /// @dev deploy contract with value on construction - function deployCode(string memory what, bytes memory args, uint256 val) internal virtual returns (address addr) { - bytes memory bytecode = abi.encodePacked(vm.getCode(what), args); - /// @solidity memory-safe-assembly - assembly { - addr := create(val, add(bytecode, 0x20), mload(bytecode)) - } - - require(addr != address(0), "StdCheats deployCode(string,bytes,uint256): Deployment failed."); - } - - function deployCode(string memory what, uint256 val) internal virtual returns (address addr) { - bytes memory bytecode = vm.getCode(what); - /// @solidity memory-safe-assembly - assembly { - addr := create(val, add(bytecode, 0x20), mload(bytecode)) - } - - require(addr != address(0), "StdCheats deployCode(string,uint256): Deployment failed."); - } - - // creates a labeled address and the corresponding private key - function makeAddrAndKey(string memory name) internal virtual returns (address addr, uint256 privateKey) { - privateKey = uint256(keccak256(abi.encodePacked(name))); - addr = vm.addr(privateKey); - vm.label(addr, name); - } - - // creates a labeled address - function makeAddr(string memory name) internal virtual returns (address addr) { - (addr,) = makeAddrAndKey(name); - } - - function deriveRememberKey(string memory mnemonic, uint32 index) - internal - virtual - returns (address who, uint256 privateKey) - { - privateKey = vm.deriveKey(mnemonic, index); - who = vm.rememberKey(privateKey); - } - - function _bytesToUint(bytes memory b) private pure returns (uint256) { - require(b.length <= 32, "StdCheats _bytesToUint(bytes): Bytes length exceeds 32."); - return abi.decode(abi.encodePacked(new bytes(32 - b.length), b), (uint256)); - } - - function isFork() internal view virtual returns (bool status) { - try vm.activeFork() { - status = true; - } catch (bytes memory) {} - } - - modifier skipWhenForking() { - if (!isFork()) { - _; - } - } - - modifier skipWhenNotForking() { - if (isFork()) { - _; - } - } - - modifier noGasMetering() { - vm.pauseGasMetering(); - // To prevent turning gas monitoring back on with nested functions that use this modifier, - // we check if gasMetering started in the off position. If it did, we don't want to turn - // it back on until we exit the top level function that used the modifier - // - // i.e. funcA() noGasMetering { funcB() }, where funcB has noGasMetering as well. - // funcA will have `gasStartedOff` as false, funcB will have it as true, - // so we only turn metering back on at the end of the funcA - bool gasStartedOff = gasMeteringOff; - gasMeteringOff = true; - - _; - - // if gas metering was on when this modifier was called, turn it back on at the end - if (!gasStartedOff) { - gasMeteringOff = false; - vm.resumeGasMetering(); - } - } - - // a cheat for fuzzing addresses that are payable only - // see https://github.com/foundry-rs/foundry/issues/3631 - function assumePayable(address addr) internal virtual { - (bool success,) = payable(addr).call{value: 0}(""); - vm.assume(success); - } -} - -// Wrappers around cheatcodes to avoid footguns -abstract contract StdCheats is StdCheatsSafe { - using stdStorage for StdStorage; - - StdStorage private stdstore; - Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); - - // Skip forward or rewind time by the specified number of seconds - function skip(uint256 time) internal virtual { - vm.warp(block.timestamp + time); - } - - function rewind(uint256 time) internal virtual { - vm.warp(block.timestamp - time); - } - - // Setup a prank from an address that has some ether - function hoax(address msgSender) internal virtual { - vm.deal(msgSender, 1 << 128); - vm.prank(msgSender); - } - - function hoax(address msgSender, uint256 give) internal virtual { - vm.deal(msgSender, give); - vm.prank(msgSender); - } - - function hoax(address msgSender, address origin) internal virtual { - vm.deal(msgSender, 1 << 128); - vm.prank(msgSender, origin); - } - - function hoax(address msgSender, address origin, uint256 give) internal virtual { - vm.deal(msgSender, give); - vm.prank(msgSender, origin); - } - - // Start perpetual prank from an address that has some ether - function startHoax(address msgSender) internal virtual { - vm.deal(msgSender, 1 << 128); - vm.startPrank(msgSender); - } - - function startHoax(address msgSender, uint256 give) internal virtual { - vm.deal(msgSender, give); - vm.startPrank(msgSender); - } - - // Start perpetual prank from an address that has some ether - // tx.origin is set to the origin parameter - function startHoax(address msgSender, address origin) internal virtual { - vm.deal(msgSender, 1 << 128); - vm.startPrank(msgSender, origin); - } - - function startHoax(address msgSender, address origin, uint256 give) internal virtual { - vm.deal(msgSender, give); - vm.startPrank(msgSender, origin); - } - - function changePrank(address msgSender) internal virtual { - vm.stopPrank(); - vm.startPrank(msgSender); - } - - function changePrank(address msgSender, address txOrigin) internal virtual { - vm.stopPrank(); - vm.startPrank(msgSender, txOrigin); - } - - // The same as Vm's `deal` - // Use the alternative signature for ERC20 tokens - function deal(address to, uint256 give) internal virtual { - vm.deal(to, give); - } - - // Set the balance of an account for any ERC20 token - // Use the alternative signature to update `totalSupply` - function deal(address token, address to, uint256 give) internal virtual { - deal(token, to, give, false); - } - - // Set the balance of an account for any ERC1155 token - // Use the alternative signature to update `totalSupply` - function dealERC1155(address token, address to, uint256 id, uint256 give) internal virtual { - dealERC1155(token, to, id, give, false); - } - - function deal(address token, address to, uint256 give, bool adjust) internal virtual { - // get current balance - (, bytes memory balData) = token.call(abi.encodeWithSelector(0x70a08231, to)); - uint256 prevBal = abi.decode(balData, (uint256)); - - // update balance - stdstore.target(token).sig(0x70a08231).with_key(to).checked_write(give); - - // update total supply - if (adjust) { - (, bytes memory totSupData) = token.call(abi.encodeWithSelector(0x18160ddd)); - uint256 totSup = abi.decode(totSupData, (uint256)); - if (give < prevBal) { - totSup -= (prevBal - give); - } else { - totSup += (give - prevBal); - } - stdstore.target(token).sig(0x18160ddd).checked_write(totSup); - } - } - - function dealERC1155(address token, address to, uint256 id, uint256 give, bool adjust) internal virtual { - // get current balance - (, bytes memory balData) = token.call(abi.encodeWithSelector(0x00fdd58e, to, id)); - uint256 prevBal = abi.decode(balData, (uint256)); - - // update balance - stdstore.target(token).sig(0x00fdd58e).with_key(to).with_key(id).checked_write(give); - - // update total supply - if (adjust) { - (, bytes memory totSupData) = token.call(abi.encodeWithSelector(0xbd85b039, id)); - require( - totSupData.length != 0, - "StdCheats deal(address,address,uint,uint,bool): target contract is not ERC1155Supply." - ); - uint256 totSup = abi.decode(totSupData, (uint256)); - if (give < prevBal) { - totSup -= (prevBal - give); - } else { - totSup += (give - prevBal); - } - stdstore.target(token).sig(0xbd85b039).with_key(id).checked_write(totSup); - } - } - - function dealERC721(address token, address to, uint256 id) internal virtual { - // check if token id is already minted and the actual owner. - (bool successMinted, bytes memory ownerData) = token.staticcall(abi.encodeWithSelector(0x6352211e, id)); - require(successMinted, "StdCheats deal(address,address,uint,bool): id not minted."); - - // get owner current balance - (, bytes memory fromBalData) = token.call(abi.encodeWithSelector(0x70a08231, abi.decode(ownerData, (address)))); - uint256 fromPrevBal = abi.decode(fromBalData, (uint256)); - - // get new user current balance - (, bytes memory toBalData) = token.call(abi.encodeWithSelector(0x70a08231, to)); - uint256 toPrevBal = abi.decode(toBalData, (uint256)); - - // update balances - stdstore.target(token).sig(0x70a08231).with_key(abi.decode(ownerData, (address))).checked_write(--fromPrevBal); - stdstore.target(token).sig(0x70a08231).with_key(to).checked_write(++toPrevBal); - - // update owner - stdstore.target(token).sig(0x6352211e).with_key(id).checked_write(to); - } -} diff --git a/contract/lib/forge-std/src/StdError.sol b/contract/lib/forge-std/src/StdError.sol deleted file mode 100644 index a302191..0000000 --- a/contract/lib/forge-std/src/StdError.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: MIT -// Panics work for versions >=0.8.0, but we lowered the pragma to make this compatible with Test -pragma solidity >=0.6.2 <0.9.0; - -library stdError { - bytes public constant assertionError = abi.encodeWithSignature("Panic(uint256)", 0x01); - bytes public constant arithmeticError = abi.encodeWithSignature("Panic(uint256)", 0x11); - bytes public constant divisionError = abi.encodeWithSignature("Panic(uint256)", 0x12); - bytes public constant enumConversionError = abi.encodeWithSignature("Panic(uint256)", 0x21); - bytes public constant encodeStorageError = abi.encodeWithSignature("Panic(uint256)", 0x22); - bytes public constant popError = abi.encodeWithSignature("Panic(uint256)", 0x31); - bytes public constant indexOOBError = abi.encodeWithSignature("Panic(uint256)", 0x32); - bytes public constant memOverflowError = abi.encodeWithSignature("Panic(uint256)", 0x41); - bytes public constant zeroVarError = abi.encodeWithSignature("Panic(uint256)", 0x51); -} diff --git a/contract/lib/forge-std/src/StdInvariant.sol b/contract/lib/forge-std/src/StdInvariant.sol deleted file mode 100644 index efa1129..0000000 --- a/contract/lib/forge-std/src/StdInvariant.sol +++ /dev/null @@ -1,92 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -pragma experimental ABIEncoderV2; - -contract StdInvariant { - struct FuzzSelector { - address addr; - bytes4[] selectors; - } - - address[] private _excludedContracts; - address[] private _excludedSenders; - address[] private _targetedContracts; - address[] private _targetedSenders; - - string[] private _excludedArtifacts; - string[] private _targetedArtifacts; - - FuzzSelector[] private _targetedArtifactSelectors; - FuzzSelector[] private _targetedSelectors; - - // Functions for users: - // These are intended to be called in tests. - - function excludeContract(address newExcludedContract_) internal { - _excludedContracts.push(newExcludedContract_); - } - - function excludeSender(address newExcludedSender_) internal { - _excludedSenders.push(newExcludedSender_); - } - - function excludeArtifact(string memory newExcludedArtifact_) internal { - _excludedArtifacts.push(newExcludedArtifact_); - } - - function targetArtifact(string memory newTargetedArtifact_) internal { - _targetedArtifacts.push(newTargetedArtifact_); - } - - function targetArtifactSelector(FuzzSelector memory newTargetedArtifactSelector_) internal { - _targetedArtifactSelectors.push(newTargetedArtifactSelector_); - } - - function targetContract(address newTargetedContract_) internal { - _targetedContracts.push(newTargetedContract_); - } - - function targetSelector(FuzzSelector memory newTargetedSelector_) internal { - _targetedSelectors.push(newTargetedSelector_); - } - - function targetSender(address newTargetedSender_) internal { - _targetedSenders.push(newTargetedSender_); - } - - // Functions for forge: - // These are called by forge to run invariant tests and don't need to be called in tests. - - function excludeArtifacts() public view returns (string[] memory excludedArtifacts_) { - excludedArtifacts_ = _excludedArtifacts; - } - - function excludeContracts() public view returns (address[] memory excludedContracts_) { - excludedContracts_ = _excludedContracts; - } - - function excludeSenders() public view returns (address[] memory excludedSenders_) { - excludedSenders_ = _excludedSenders; - } - - function targetArtifacts() public view returns (string[] memory targetedArtifacts_) { - targetedArtifacts_ = _targetedArtifacts; - } - - function targetArtifactSelectors() public view returns (FuzzSelector[] memory targetedArtifactSelectors_) { - targetedArtifactSelectors_ = _targetedArtifactSelectors; - } - - function targetContracts() public view returns (address[] memory targetedContracts_) { - targetedContracts_ = _targetedContracts; - } - - function targetSelectors() public view returns (FuzzSelector[] memory targetedSelectors_) { - targetedSelectors_ = _targetedSelectors; - } - - function targetSenders() public view returns (address[] memory targetedSenders_) { - targetedSenders_ = _targetedSenders; - } -} diff --git a/contract/lib/forge-std/src/StdJson.sol b/contract/lib/forge-std/src/StdJson.sol deleted file mode 100644 index 014e6b1..0000000 --- a/contract/lib/forge-std/src/StdJson.sol +++ /dev/null @@ -1,179 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.9.0; - -pragma experimental ABIEncoderV2; - -import {VmSafe} from "./Vm.sol"; - -// Helpers for parsing and writing JSON files -// To parse: -// ``` -// using stdJson for string; -// string memory json = vm.readFile("some_peth"); -// json.parseUint(""); -// ``` -// To write: -// ``` -// using stdJson for string; -// string memory json = "deploymentArtifact"; -// Contract contract = new Contract(); -// json.serialize("contractAddress", address(contract)); -// json = json.serialize("deploymentTimes", uint(1)); -// // store the stringified JSON to the 'json' variable we have been using as a key -// // as we won't need it any longer -// string memory json2 = "finalArtifact"; -// string memory final = json2.serialize("depArtifact", json); -// final.write(""); -// ``` - -library stdJson { - VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code"))))); - - function parseRaw(string memory json, string memory key) internal pure returns (bytes memory) { - return vm.parseJson(json, key); - } - - function readUint(string memory json, string memory key) internal returns (uint256) { - return vm.parseJsonUint(json, key); - } - - function readUintArray(string memory json, string memory key) internal returns (uint256[] memory) { - return vm.parseJsonUintArray(json, key); - } - - function readInt(string memory json, string memory key) internal returns (int256) { - return vm.parseJsonInt(json, key); - } - - function readIntArray(string memory json, string memory key) internal returns (int256[] memory) { - return vm.parseJsonIntArray(json, key); - } - - function readBytes32(string memory json, string memory key) internal returns (bytes32) { - return vm.parseJsonBytes32(json, key); - } - - function readBytes32Array(string memory json, string memory key) internal returns (bytes32[] memory) { - return vm.parseJsonBytes32Array(json, key); - } - - function readString(string memory json, string memory key) internal returns (string memory) { - return vm.parseJsonString(json, key); - } - - function readStringArray(string memory json, string memory key) internal returns (string[] memory) { - return vm.parseJsonStringArray(json, key); - } - - function readAddress(string memory json, string memory key) internal returns (address) { - return vm.parseJsonAddress(json, key); - } - - function readAddressArray(string memory json, string memory key) internal returns (address[] memory) { - return vm.parseJsonAddressArray(json, key); - } - - function readBool(string memory json, string memory key) internal returns (bool) { - return vm.parseJsonBool(json, key); - } - - function readBoolArray(string memory json, string memory key) internal returns (bool[] memory) { - return vm.parseJsonBoolArray(json, key); - } - - function readBytes(string memory json, string memory key) internal returns (bytes memory) { - return vm.parseJsonBytes(json, key); - } - - function readBytesArray(string memory json, string memory key) internal returns (bytes[] memory) { - return vm.parseJsonBytesArray(json, key); - } - - function serialize(string memory jsonKey, string memory key, bool value) internal returns (string memory) { - return vm.serializeBool(jsonKey, key, value); - } - - function serialize(string memory jsonKey, string memory key, bool[] memory value) - internal - returns (string memory) - { - return vm.serializeBool(jsonKey, key, value); - } - - function serialize(string memory jsonKey, string memory key, uint256 value) internal returns (string memory) { - return vm.serializeUint(jsonKey, key, value); - } - - function serialize(string memory jsonKey, string memory key, uint256[] memory value) - internal - returns (string memory) - { - return vm.serializeUint(jsonKey, key, value); - } - - function serialize(string memory jsonKey, string memory key, int256 value) internal returns (string memory) { - return vm.serializeInt(jsonKey, key, value); - } - - function serialize(string memory jsonKey, string memory key, int256[] memory value) - internal - returns (string memory) - { - return vm.serializeInt(jsonKey, key, value); - } - - function serialize(string memory jsonKey, string memory key, address value) internal returns (string memory) { - return vm.serializeAddress(jsonKey, key, value); - } - - function serialize(string memory jsonKey, string memory key, address[] memory value) - internal - returns (string memory) - { - return vm.serializeAddress(jsonKey, key, value); - } - - function serialize(string memory jsonKey, string memory key, bytes32 value) internal returns (string memory) { - return vm.serializeBytes32(jsonKey, key, value); - } - - function serialize(string memory jsonKey, string memory key, bytes32[] memory value) - internal - returns (string memory) - { - return vm.serializeBytes32(jsonKey, key, value); - } - - function serialize(string memory jsonKey, string memory key, bytes memory value) internal returns (string memory) { - return vm.serializeBytes(jsonKey, key, value); - } - - function serialize(string memory jsonKey, string memory key, bytes[] memory value) - internal - returns (string memory) - { - return vm.serializeBytes(jsonKey, key, value); - } - - function serialize(string memory jsonKey, string memory key, string memory value) - internal - returns (string memory) - { - return vm.serializeString(jsonKey, key, value); - } - - function serialize(string memory jsonKey, string memory key, string[] memory value) - internal - returns (string memory) - { - return vm.serializeString(jsonKey, key, value); - } - - function write(string memory jsonKey, string memory path) internal { - vm.writeJson(jsonKey, path); - } - - function write(string memory jsonKey, string memory path, string memory valueKey) internal { - vm.writeJson(jsonKey, path, valueKey); - } -} diff --git a/contract/lib/forge-std/src/StdMath.sol b/contract/lib/forge-std/src/StdMath.sol deleted file mode 100644 index 459523b..0000000 --- a/contract/lib/forge-std/src/StdMath.sol +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -library stdMath { - int256 private constant INT256_MIN = -57896044618658097711785492504343953926634992332820282019728792003956564819968; - - function abs(int256 a) internal pure returns (uint256) { - // Required or it will fail when `a = type(int256).min` - if (a == INT256_MIN) { - return 57896044618658097711785492504343953926634992332820282019728792003956564819968; - } - - return uint256(a > 0 ? a : -a); - } - - function delta(uint256 a, uint256 b) internal pure returns (uint256) { - return a > b ? a - b : b - a; - } - - function delta(int256 a, int256 b) internal pure returns (uint256) { - // a and b are of the same sign - // this works thanks to two's complement, the left-most bit is the sign bit - if ((a ^ b) > -1) { - return delta(abs(a), abs(b)); - } - - // a and b are of opposite signs - return abs(a) + abs(b); - } - - function percentDelta(uint256 a, uint256 b) internal pure returns (uint256) { - uint256 absDelta = delta(a, b); - - return absDelta * 1e18 / b; - } - - function percentDelta(int256 a, int256 b) internal pure returns (uint256) { - uint256 absDelta = delta(a, b); - uint256 absB = abs(b); - - return absDelta * 1e18 / absB; - } -} diff --git a/contract/lib/forge-std/src/StdStorage.sol b/contract/lib/forge-std/src/StdStorage.sol deleted file mode 100644 index 73a5ceb..0000000 --- a/contract/lib/forge-std/src/StdStorage.sol +++ /dev/null @@ -1,327 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -import {Vm} from "./Vm.sol"; - -struct StdStorage { - mapping(address => mapping(bytes4 => mapping(bytes32 => uint256))) slots; - mapping(address => mapping(bytes4 => mapping(bytes32 => bool))) finds; - bytes32[] _keys; - bytes4 _sig; - uint256 _depth; - address _target; - bytes32 _set; -} - -library stdStorageSafe { - event SlotFound(address who, bytes4 fsig, bytes32 keysHash, uint256 slot); - event WARNING_UninitedSlot(address who, uint256 slot); - - Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); - - function sigs(string memory sigStr) internal pure returns (bytes4) { - return bytes4(keccak256(bytes(sigStr))); - } - - /// @notice find an arbitrary storage slot given a function sig, input data, address of the contract and a value to check against - // slot complexity: - // if flat, will be bytes32(uint256(uint)); - // if map, will be keccak256(abi.encode(key, uint(slot))); - // if deep map, will be keccak256(abi.encode(key1, keccak256(abi.encode(key0, uint(slot))))); - // if map struct, will be bytes32(uint256(keccak256(abi.encode(key1, keccak256(abi.encode(key0, uint(slot)))))) + structFieldDepth); - function find(StdStorage storage self) internal returns (uint256) { - address who = self._target; - bytes4 fsig = self._sig; - uint256 field_depth = self._depth; - bytes32[] memory ins = self._keys; - - // calldata to test against - if (self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]) { - return self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]; - } - bytes memory cald = abi.encodePacked(fsig, flatten(ins)); - vm.record(); - bytes32 fdat; - { - (, bytes memory rdat) = who.staticcall(cald); - fdat = bytesToBytes32(rdat, 32 * field_depth); - } - - (bytes32[] memory reads,) = vm.accesses(address(who)); - if (reads.length == 1) { - bytes32 curr = vm.load(who, reads[0]); - if (curr == bytes32(0)) { - emit WARNING_UninitedSlot(who, uint256(reads[0])); - } - if (fdat != curr) { - require( - false, - "stdStorage find(StdStorage): Packed slot. This would cause dangerous overwriting and currently isn't supported." - ); - } - emit SlotFound(who, fsig, keccak256(abi.encodePacked(ins, field_depth)), uint256(reads[0])); - self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = uint256(reads[0]); - self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = true; - } else if (reads.length > 1) { - for (uint256 i = 0; i < reads.length; i++) { - bytes32 prev = vm.load(who, reads[i]); - if (prev == bytes32(0)) { - emit WARNING_UninitedSlot(who, uint256(reads[i])); - } - // store - vm.store(who, reads[i], bytes32(hex"1337")); - bool success; - bytes memory rdat; - { - (success, rdat) = who.staticcall(cald); - fdat = bytesToBytes32(rdat, 32 * field_depth); - } - - if (success && fdat == bytes32(hex"1337")) { - // we found which of the slots is the actual one - emit SlotFound(who, fsig, keccak256(abi.encodePacked(ins, field_depth)), uint256(reads[i])); - self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = uint256(reads[i]); - self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = true; - vm.store(who, reads[i], prev); - break; - } - vm.store(who, reads[i], prev); - } - } else { - revert("stdStorage find(StdStorage): No storage use detected for target."); - } - - require( - self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))], - "stdStorage find(StdStorage): Slot(s) not found." - ); - - delete self._target; - delete self._sig; - delete self._keys; - delete self._depth; - - return self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]; - } - - function target(StdStorage storage self, address _target) internal returns (StdStorage storage) { - self._target = _target; - return self; - } - - function sig(StdStorage storage self, bytes4 _sig) internal returns (StdStorage storage) { - self._sig = _sig; - return self; - } - - function sig(StdStorage storage self, string memory _sig) internal returns (StdStorage storage) { - self._sig = sigs(_sig); - return self; - } - - function with_key(StdStorage storage self, address who) internal returns (StdStorage storage) { - self._keys.push(bytes32(uint256(uint160(who)))); - return self; - } - - function with_key(StdStorage storage self, uint256 amt) internal returns (StdStorage storage) { - self._keys.push(bytes32(amt)); - return self; - } - - function with_key(StdStorage storage self, bytes32 key) internal returns (StdStorage storage) { - self._keys.push(key); - return self; - } - - function depth(StdStorage storage self, uint256 _depth) internal returns (StdStorage storage) { - self._depth = _depth; - return self; - } - - function read(StdStorage storage self) private returns (bytes memory) { - address t = self._target; - uint256 s = find(self); - return abi.encode(vm.load(t, bytes32(s))); - } - - function read_bytes32(StdStorage storage self) internal returns (bytes32) { - return abi.decode(read(self), (bytes32)); - } - - function read_bool(StdStorage storage self) internal returns (bool) { - int256 v = read_int(self); - if (v == 0) return false; - if (v == 1) return true; - revert("stdStorage read_bool(StdStorage): Cannot decode. Make sure you are reading a bool."); - } - - function read_address(StdStorage storage self) internal returns (address) { - return abi.decode(read(self), (address)); - } - - function read_uint(StdStorage storage self) internal returns (uint256) { - return abi.decode(read(self), (uint256)); - } - - function read_int(StdStorage storage self) internal returns (int256) { - return abi.decode(read(self), (int256)); - } - - function bytesToBytes32(bytes memory b, uint256 offset) private pure returns (bytes32) { - bytes32 out; - - uint256 max = b.length > 32 ? 32 : b.length; - for (uint256 i = 0; i < max; i++) { - out |= bytes32(b[offset + i] & 0xFF) >> (i * 8); - } - return out; - } - - function flatten(bytes32[] memory b) private pure returns (bytes memory) { - bytes memory result = new bytes(b.length * 32); - for (uint256 i = 0; i < b.length; i++) { - bytes32 k = b[i]; - /// @solidity memory-safe-assembly - assembly { - mstore(add(result, add(32, mul(32, i))), k) - } - } - - return result; - } -} - -library stdStorage { - Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); - - function sigs(string memory sigStr) internal pure returns (bytes4) { - return stdStorageSafe.sigs(sigStr); - } - - function find(StdStorage storage self) internal returns (uint256) { - return stdStorageSafe.find(self); - } - - function target(StdStorage storage self, address _target) internal returns (StdStorage storage) { - return stdStorageSafe.target(self, _target); - } - - function sig(StdStorage storage self, bytes4 _sig) internal returns (StdStorage storage) { - return stdStorageSafe.sig(self, _sig); - } - - function sig(StdStorage storage self, string memory _sig) internal returns (StdStorage storage) { - return stdStorageSafe.sig(self, _sig); - } - - function with_key(StdStorage storage self, address who) internal returns (StdStorage storage) { - return stdStorageSafe.with_key(self, who); - } - - function with_key(StdStorage storage self, uint256 amt) internal returns (StdStorage storage) { - return stdStorageSafe.with_key(self, amt); - } - - function with_key(StdStorage storage self, bytes32 key) internal returns (StdStorage storage) { - return stdStorageSafe.with_key(self, key); - } - - function depth(StdStorage storage self, uint256 _depth) internal returns (StdStorage storage) { - return stdStorageSafe.depth(self, _depth); - } - - function checked_write(StdStorage storage self, address who) internal { - checked_write(self, bytes32(uint256(uint160(who)))); - } - - function checked_write(StdStorage storage self, uint256 amt) internal { - checked_write(self, bytes32(amt)); - } - - function checked_write(StdStorage storage self, bool write) internal { - bytes32 t; - /// @solidity memory-safe-assembly - assembly { - t := write - } - checked_write(self, t); - } - - function checked_write(StdStorage storage self, bytes32 set) internal { - address who = self._target; - bytes4 fsig = self._sig; - uint256 field_depth = self._depth; - bytes32[] memory ins = self._keys; - - bytes memory cald = abi.encodePacked(fsig, flatten(ins)); - if (!self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]) { - find(self); - } - bytes32 slot = bytes32(self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]); - - bytes32 fdat; - { - (, bytes memory rdat) = who.staticcall(cald); - fdat = bytesToBytes32(rdat, 32 * field_depth); - } - bytes32 curr = vm.load(who, slot); - - if (fdat != curr) { - require( - false, - "stdStorage find(StdStorage): Packed slot. This would cause dangerous overwriting and currently isn't supported." - ); - } - vm.store(who, slot, set); - delete self._target; - delete self._sig; - delete self._keys; - delete self._depth; - } - - function read_bytes32(StdStorage storage self) internal returns (bytes32) { - return stdStorageSafe.read_bytes32(self); - } - - function read_bool(StdStorage storage self) internal returns (bool) { - return stdStorageSafe.read_bool(self); - } - - function read_address(StdStorage storage self) internal returns (address) { - return stdStorageSafe.read_address(self); - } - - function read_uint(StdStorage storage self) internal returns (uint256) { - return stdStorageSafe.read_uint(self); - } - - function read_int(StdStorage storage self) internal returns (int256) { - return stdStorageSafe.read_int(self); - } - - // Private function so needs to be copied over - function bytesToBytes32(bytes memory b, uint256 offset) private pure returns (bytes32) { - bytes32 out; - - uint256 max = b.length > 32 ? 32 : b.length; - for (uint256 i = 0; i < max; i++) { - out |= bytes32(b[offset + i] & 0xFF) >> (i * 8); - } - return out; - } - - // Private function so needs to be copied over - function flatten(bytes32[] memory b) private pure returns (bytes memory) { - bytes memory result = new bytes(b.length * 32); - for (uint256 i = 0; i < b.length; i++) { - bytes32 k = b[i]; - /// @solidity memory-safe-assembly - assembly { - mstore(add(result, add(32, mul(32, i))), k) - } - } - - return result; - } -} diff --git a/contract/lib/forge-std/src/StdStyle.sol b/contract/lib/forge-std/src/StdStyle.sol deleted file mode 100644 index 46f4e81..0000000 --- a/contract/lib/forge-std/src/StdStyle.sol +++ /dev/null @@ -1,333 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.4.22 <0.9.0; - -import {Vm} from "./Vm.sol"; - -library StdStyle { - Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); - - string constant RED = "\u001b[91m"; - string constant GREEN = "\u001b[92m"; - string constant YELLOW = "\u001b[93m"; - string constant BLUE = "\u001b[94m"; - string constant MAGENTA = "\u001b[95m"; - string constant CYAN = "\u001b[96m"; - string constant BOLD = "\u001b[1m"; - string constant DIM = "\u001b[2m"; - string constant ITALIC = "\u001b[3m"; - string constant UNDERLINE = "\u001b[4m"; - string constant INVERSE = "\u001b[7m"; - string constant RESET = "\u001b[0m"; - - function styleConcat(string memory style, string memory self) private pure returns (string memory) { - return string(abi.encodePacked(style, self, RESET)); - } - - function red(string memory self) internal pure returns (string memory) { - return styleConcat(RED, self); - } - - function red(uint256 self) internal pure returns (string memory) { - return red(vm.toString(self)); - } - - function red(int256 self) internal pure returns (string memory) { - return red(vm.toString(self)); - } - - function red(address self) internal pure returns (string memory) { - return red(vm.toString(self)); - } - - function red(bool self) internal pure returns (string memory) { - return red(vm.toString(self)); - } - - function redBytes(bytes memory self) internal pure returns (string memory) { - return red(vm.toString(self)); - } - - function redBytes32(bytes32 self) internal pure returns (string memory) { - return red(vm.toString(self)); - } - - function green(string memory self) internal pure returns (string memory) { - return styleConcat(GREEN, self); - } - - function green(uint256 self) internal pure returns (string memory) { - return green(vm.toString(self)); - } - - function green(int256 self) internal pure returns (string memory) { - return green(vm.toString(self)); - } - - function green(address self) internal pure returns (string memory) { - return green(vm.toString(self)); - } - - function green(bool self) internal pure returns (string memory) { - return green(vm.toString(self)); - } - - function greenBytes(bytes memory self) internal pure returns (string memory) { - return green(vm.toString(self)); - } - - function greenBytes32(bytes32 self) internal pure returns (string memory) { - return green(vm.toString(self)); - } - - function yellow(string memory self) internal pure returns (string memory) { - return styleConcat(YELLOW, self); - } - - function yellow(uint256 self) internal pure returns (string memory) { - return yellow(vm.toString(self)); - } - - function yellow(int256 self) internal pure returns (string memory) { - return yellow(vm.toString(self)); - } - - function yellow(address self) internal pure returns (string memory) { - return yellow(vm.toString(self)); - } - - function yellow(bool self) internal pure returns (string memory) { - return yellow(vm.toString(self)); - } - - function yellowBytes(bytes memory self) internal pure returns (string memory) { - return yellow(vm.toString(self)); - } - - function yellowBytes32(bytes32 self) internal pure returns (string memory) { - return yellow(vm.toString(self)); - } - - function blue(string memory self) internal pure returns (string memory) { - return styleConcat(BLUE, self); - } - - function blue(uint256 self) internal pure returns (string memory) { - return blue(vm.toString(self)); - } - - function blue(int256 self) internal pure returns (string memory) { - return blue(vm.toString(self)); - } - - function blue(address self) internal pure returns (string memory) { - return blue(vm.toString(self)); - } - - function blue(bool self) internal pure returns (string memory) { - return blue(vm.toString(self)); - } - - function blueBytes(bytes memory self) internal pure returns (string memory) { - return blue(vm.toString(self)); - } - - function blueBytes32(bytes32 self) internal pure returns (string memory) { - return blue(vm.toString(self)); - } - - function magenta(string memory self) internal pure returns (string memory) { - return styleConcat(MAGENTA, self); - } - - function magenta(uint256 self) internal pure returns (string memory) { - return magenta(vm.toString(self)); - } - - function magenta(int256 self) internal pure returns (string memory) { - return magenta(vm.toString(self)); - } - - function magenta(address self) internal pure returns (string memory) { - return magenta(vm.toString(self)); - } - - function magenta(bool self) internal pure returns (string memory) { - return magenta(vm.toString(self)); - } - - function magentaBytes(bytes memory self) internal pure returns (string memory) { - return magenta(vm.toString(self)); - } - - function magentaBytes32(bytes32 self) internal pure returns (string memory) { - return magenta(vm.toString(self)); - } - - function cyan(string memory self) internal pure returns (string memory) { - return styleConcat(CYAN, self); - } - - function cyan(uint256 self) internal pure returns (string memory) { - return cyan(vm.toString(self)); - } - - function cyan(int256 self) internal pure returns (string memory) { - return cyan(vm.toString(self)); - } - - function cyan(address self) internal pure returns (string memory) { - return cyan(vm.toString(self)); - } - - function cyan(bool self) internal pure returns (string memory) { - return cyan(vm.toString(self)); - } - - function cyanBytes(bytes memory self) internal pure returns (string memory) { - return cyan(vm.toString(self)); - } - - function cyanBytes32(bytes32 self) internal pure returns (string memory) { - return cyan(vm.toString(self)); - } - - function bold(string memory self) internal pure returns (string memory) { - return styleConcat(BOLD, self); - } - - function bold(uint256 self) internal pure returns (string memory) { - return bold(vm.toString(self)); - } - - function bold(int256 self) internal pure returns (string memory) { - return bold(vm.toString(self)); - } - - function bold(address self) internal pure returns (string memory) { - return bold(vm.toString(self)); - } - - function bold(bool self) internal pure returns (string memory) { - return bold(vm.toString(self)); - } - - function boldBytes(bytes memory self) internal pure returns (string memory) { - return bold(vm.toString(self)); - } - - function boldBytes32(bytes32 self) internal pure returns (string memory) { - return bold(vm.toString(self)); - } - - function dim(string memory self) internal pure returns (string memory) { - return styleConcat(DIM, self); - } - - function dim(uint256 self) internal pure returns (string memory) { - return dim(vm.toString(self)); - } - - function dim(int256 self) internal pure returns (string memory) { - return dim(vm.toString(self)); - } - - function dim(address self) internal pure returns (string memory) { - return dim(vm.toString(self)); - } - - function dim(bool self) internal pure returns (string memory) { - return dim(vm.toString(self)); - } - - function dimBytes(bytes memory self) internal pure returns (string memory) { - return dim(vm.toString(self)); - } - - function dimBytes32(bytes32 self) internal pure returns (string memory) { - return dim(vm.toString(self)); - } - - function italic(string memory self) internal pure returns (string memory) { - return styleConcat(ITALIC, self); - } - - function italic(uint256 self) internal pure returns (string memory) { - return italic(vm.toString(self)); - } - - function italic(int256 self) internal pure returns (string memory) { - return italic(vm.toString(self)); - } - - function italic(address self) internal pure returns (string memory) { - return italic(vm.toString(self)); - } - - function italic(bool self) internal pure returns (string memory) { - return italic(vm.toString(self)); - } - - function italicBytes(bytes memory self) internal pure returns (string memory) { - return italic(vm.toString(self)); - } - - function italicBytes32(bytes32 self) internal pure returns (string memory) { - return italic(vm.toString(self)); - } - - function underline(string memory self) internal pure returns (string memory) { - return styleConcat(UNDERLINE, self); - } - - function underline(uint256 self) internal pure returns (string memory) { - return underline(vm.toString(self)); - } - - function underline(int256 self) internal pure returns (string memory) { - return underline(vm.toString(self)); - } - - function underline(address self) internal pure returns (string memory) { - return underline(vm.toString(self)); - } - - function underline(bool self) internal pure returns (string memory) { - return underline(vm.toString(self)); - } - - function underlineBytes(bytes memory self) internal pure returns (string memory) { - return underline(vm.toString(self)); - } - - function underlineBytes32(bytes32 self) internal pure returns (string memory) { - return underline(vm.toString(self)); - } - - function inverse(string memory self) internal pure returns (string memory) { - return styleConcat(INVERSE, self); - } - - function inverse(uint256 self) internal pure returns (string memory) { - return inverse(vm.toString(self)); - } - - function inverse(int256 self) internal pure returns (string memory) { - return inverse(vm.toString(self)); - } - - function inverse(address self) internal pure returns (string memory) { - return inverse(vm.toString(self)); - } - - function inverse(bool self) internal pure returns (string memory) { - return inverse(vm.toString(self)); - } - - function inverseBytes(bytes memory self) internal pure returns (string memory) { - return inverse(vm.toString(self)); - } - - function inverseBytes32(bytes32 self) internal pure returns (string memory) { - return inverse(vm.toString(self)); - } -} diff --git a/contract/lib/forge-std/src/StdUtils.sol b/contract/lib/forge-std/src/StdUtils.sol deleted file mode 100644 index f68d11f..0000000 --- a/contract/lib/forge-std/src/StdUtils.sol +++ /dev/null @@ -1,189 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -pragma experimental ABIEncoderV2; - -import {IMulticall3} from "./interfaces/IMulticall3.sol"; -// TODO Remove import. -import {VmSafe} from "./Vm.sol"; - -abstract contract StdUtils { - /*////////////////////////////////////////////////////////////////////////// - CONSTANTS - //////////////////////////////////////////////////////////////////////////*/ - - IMulticall3 private constant multicall = IMulticall3(0xcA11bde05977b3631167028862bE2a173976CA11); - VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code"))))); - address private constant CONSOLE2_ADDRESS = 0x000000000000000000636F6e736F6c652e6c6f67; - uint256 private constant INT256_MIN_ABS = - 57896044618658097711785492504343953926634992332820282019728792003956564819968; - uint256 private constant UINT256_MAX = - 115792089237316195423570985008687907853269984665640564039457584007913129639935; - - // Used by default when deploying with create2, https://github.com/Arachnid/deterministic-deployment-proxy. - address private constant CREATE2_FACTORY = 0x4e59b44847b379578588920cA78FbF26c0B4956C; - - /*////////////////////////////////////////////////////////////////////////// - INTERNAL FUNCTIONS - //////////////////////////////////////////////////////////////////////////*/ - - function _bound(uint256 x, uint256 min, uint256 max) internal pure virtual returns (uint256 result) { - require(min <= max, "StdUtils bound(uint256,uint256,uint256): Max is less than min."); - // If x is between min and max, return x directly. This is to ensure that dictionary values - // do not get shifted if the min is nonzero. More info: https://github.com/foundry-rs/forge-std/issues/188 - if (x >= min && x <= max) return x; - - uint256 size = max - min + 1; - - // If the value is 0, 1, 2, 3, warp that to min, min+1, min+2, min+3. Similarly for the UINT256_MAX side. - // This helps ensure coverage of the min/max values. - if (x <= 3 && size > x) return min + x; - if (x >= UINT256_MAX - 3 && size > UINT256_MAX - x) return max - (UINT256_MAX - x); - - // Otherwise, wrap x into the range [min, max], i.e. the range is inclusive. - if (x > max) { - uint256 diff = x - max; - uint256 rem = diff % size; - if (rem == 0) return max; - result = min + rem - 1; - } else if (x < min) { - uint256 diff = min - x; - uint256 rem = diff % size; - if (rem == 0) return min; - result = max - rem + 1; - } - } - - function bound(uint256 x, uint256 min, uint256 max) internal view virtual returns (uint256 result) { - result = _bound(x, min, max); - console2_log("Bound Result", result); - } - - function bound(int256 x, int256 min, int256 max) internal view virtual returns (int256 result) { - require(min <= max, "StdUtils bound(int256,int256,int256): Max is less than min."); - - // Shifting all int256 values to uint256 to use _bound function. The range of two types are: - // int256 : -(2**255) ~ (2**255 - 1) - // uint256: 0 ~ (2**256 - 1) - // So, add 2**255, INT256_MIN_ABS to the integer values. - // - // If the given integer value is -2**255, we cannot use `-uint256(-x)` because of the overflow. - // So, use `~uint256(x) + 1` instead. - uint256 _x = x < 0 ? (INT256_MIN_ABS - ~uint256(x) - 1) : (uint256(x) + INT256_MIN_ABS); - uint256 _min = min < 0 ? (INT256_MIN_ABS - ~uint256(min) - 1) : (uint256(min) + INT256_MIN_ABS); - uint256 _max = max < 0 ? (INT256_MIN_ABS - ~uint256(max) - 1) : (uint256(max) + INT256_MIN_ABS); - - uint256 y = _bound(_x, _min, _max); - - // To move it back to int256 value, subtract INT256_MIN_ABS at here. - result = y < INT256_MIN_ABS ? int256(~(INT256_MIN_ABS - y) + 1) : int256(y - INT256_MIN_ABS); - console2_log("Bound result", vm.toString(result)); - } - - function bytesToUint(bytes memory b) internal pure virtual returns (uint256) { - require(b.length <= 32, "StdUtils bytesToUint(bytes): Bytes length exceeds 32."); - return abi.decode(abi.encodePacked(new bytes(32 - b.length), b), (uint256)); - } - - /// @dev Compute the address a contract will be deployed at for a given deployer address and nonce - /// @notice adapted from Solmate implementation (https://github.com/Rari-Capital/solmate/blob/main/src/utils/LibRLP.sol) - function computeCreateAddress(address deployer, uint256 nonce) internal pure virtual returns (address) { - // forgefmt: disable-start - // The integer zero is treated as an empty byte string, and as a result it only has a length prefix, 0x80, computed via 0x80 + 0. - // A one byte integer uses its own value as its length prefix, there is no additional "0x80 + length" prefix that comes before it. - if (nonce == 0x00) return addressFromLast20Bytes(keccak256(abi.encodePacked(bytes1(0xd6), bytes1(0x94), deployer, bytes1(0x80)))); - if (nonce <= 0x7f) return addressFromLast20Bytes(keccak256(abi.encodePacked(bytes1(0xd6), bytes1(0x94), deployer, uint8(nonce)))); - - // Nonces greater than 1 byte all follow a consistent encoding scheme, where each value is preceded by a prefix of 0x80 + length. - if (nonce <= 2**8 - 1) return addressFromLast20Bytes(keccak256(abi.encodePacked(bytes1(0xd7), bytes1(0x94), deployer, bytes1(0x81), uint8(nonce)))); - if (nonce <= 2**16 - 1) return addressFromLast20Bytes(keccak256(abi.encodePacked(bytes1(0xd8), bytes1(0x94), deployer, bytes1(0x82), uint16(nonce)))); - if (nonce <= 2**24 - 1) return addressFromLast20Bytes(keccak256(abi.encodePacked(bytes1(0xd9), bytes1(0x94), deployer, bytes1(0x83), uint24(nonce)))); - // forgefmt: disable-end - - // More details about RLP encoding can be found here: https://eth.wiki/fundamentals/rlp - // 0xda = 0xc0 (short RLP prefix) + 0x16 (length of: 0x94 ++ proxy ++ 0x84 ++ nonce) - // 0x94 = 0x80 + 0x14 (0x14 = the length of an address, 20 bytes, in hex) - // 0x84 = 0x80 + 0x04 (0x04 = the bytes length of the nonce, 4 bytes, in hex) - // We assume nobody can have a nonce large enough to require more than 32 bytes. - return addressFromLast20Bytes( - keccak256(abi.encodePacked(bytes1(0xda), bytes1(0x94), deployer, bytes1(0x84), uint32(nonce))) - ); - } - - function computeCreate2Address(bytes32 salt, bytes32 initcodeHash, address deployer) - internal - pure - virtual - returns (address) - { - return addressFromLast20Bytes(keccak256(abi.encodePacked(bytes1(0xff), deployer, salt, initcodeHash))); - } - - /// @dev returns the address of a contract created with CREATE2 using the default CREATE2 deployer - function computeCreate2Address(bytes32 salt, bytes32 initCodeHash) internal pure returns (address) { - return computeCreate2Address(salt, initCodeHash, CREATE2_FACTORY); - } - - /// @dev returns the hash of the init code (creation code + no args) used in CREATE2 with no constructor arguments - /// @param creationCode the creation code of a contract C, as returned by type(C).creationCode - function hashInitCode(bytes memory creationCode) internal pure returns (bytes32) { - return hashInitCode(creationCode, ""); - } - - /// @dev returns the hash of the init code (creation code + ABI-encoded args) used in CREATE2 - /// @param creationCode the creation code of a contract C, as returned by type(C).creationCode - /// @param args the ABI-encoded arguments to the constructor of C - function hashInitCode(bytes memory creationCode, bytes memory args) internal pure returns (bytes32) { - return keccak256(abi.encodePacked(creationCode, args)); - } - - // Performs a single call with Multicall3 to query the ERC-20 token balances of the given addresses. - function getTokenBalances(address token, address[] memory addresses) - internal - virtual - returns (uint256[] memory balances) - { - uint256 tokenCodeSize; - assembly { - tokenCodeSize := extcodesize(token) - } - require(tokenCodeSize > 0, "StdUtils getTokenBalances(address,address[]): Token address is not a contract."); - - // ABI encode the aggregate call to Multicall3. - uint256 length = addresses.length; - IMulticall3.Call[] memory calls = new IMulticall3.Call[](length); - for (uint256 i = 0; i < length; ++i) { - // 0x70a08231 = bytes4("balanceOf(address)")) - calls[i] = IMulticall3.Call({target: token, callData: abi.encodeWithSelector(0x70a08231, (addresses[i]))}); - } - - // Make the aggregate call. - (, bytes[] memory returnData) = multicall.aggregate(calls); - - // ABI decode the return data and return the balances. - balances = new uint256[](length); - for (uint256 i = 0; i < length; ++i) { - balances[i] = abi.decode(returnData[i], (uint256)); - } - } - - /*////////////////////////////////////////////////////////////////////////// - PRIVATE FUNCTIONS - //////////////////////////////////////////////////////////////////////////*/ - - function addressFromLast20Bytes(bytes32 bytesValue) private pure returns (address) { - return address(uint160(uint256(bytesValue))); - } - - // Used to prevent the compilation of console, which shortens the compilation time when console is not used elsewhere. - - function console2_log(string memory p0, uint256 p1) private view { - (bool status,) = address(CONSOLE2_ADDRESS).staticcall(abi.encodeWithSignature("log(string,uint256)", p0, p1)); - status; - } - - function console2_log(string memory p0, string memory p1) private view { - (bool status,) = address(CONSOLE2_ADDRESS).staticcall(abi.encodeWithSignature("log(string,string)", p0, p1)); - status; - } -} diff --git a/contract/lib/forge-std/src/Test.sol b/contract/lib/forge-std/src/Test.sol deleted file mode 100644 index 9ff5cb8..0000000 --- a/contract/lib/forge-std/src/Test.sol +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -pragma experimental ABIEncoderV2; - -// 💬 ABOUT -// Standard Library's default Test - -// 🧩 MODULES -import {console} from "./console.sol"; -import {console2} from "./console2.sol"; -import {StdAssertions} from "./StdAssertions.sol"; -import {StdChains} from "./StdChains.sol"; -import {StdCheats} from "./StdCheats.sol"; -import {stdError} from "./StdError.sol"; -import {StdInvariant} from "./StdInvariant.sol"; -import {stdJson} from "./StdJson.sol"; -import {stdMath} from "./StdMath.sol"; -import {StdStorage, stdStorage} from "./StdStorage.sol"; -import {StdUtils} from "./StdUtils.sol"; -import {Vm} from "./Vm.sol"; -import {StdStyle} from "./StdStyle.sol"; - -// 📦 BOILERPLATE -import {TestBase} from "./Base.sol"; -import {DSTest} from "ds-test/test.sol"; - -// ⭐️ TEST -abstract contract Test is DSTest, StdAssertions, StdChains, StdCheats, StdInvariant, StdUtils, TestBase { -// Note: IS_TEST() must return true. -// Note: Must have failure system, https://github.com/dapphub/ds-test/blob/cd98eff28324bfac652e63a239a60632a761790b/src/test.sol#L39-L76. -} diff --git a/contract/lib/forge-std/src/Vm.sol b/contract/lib/forge-std/src/Vm.sol deleted file mode 100644 index 1ce49f1..0000000 --- a/contract/lib/forge-std/src/Vm.sol +++ /dev/null @@ -1,419 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -pragma experimental ABIEncoderV2; - -// Cheatcodes are marked as view/pure/none using the following rules: -// 0. A call's observable behaviour includes its return value, logs, reverts and state writes, -// 1. If you can influence a later call's observable behaviour, you're neither `view` nor `pure (you are modifying some state be it the EVM, interpreter, filesystem, etc), -// 2. Otherwise if you can be influenced by an earlier call, or if reading some state, you're `view`, -// 3. Otherwise you're `pure`. - -interface VmSafe { - struct Log { - bytes32[] topics; - bytes data; - address emitter; - } - - struct Rpc { - string key; - string url; - } - - struct FsMetadata { - bool isDir; - bool isSymlink; - uint256 length; - bool readOnly; - uint256 modified; - uint256 accessed; - uint256 created; - } - - // Loads a storage slot from an address - function load(address target, bytes32 slot) external view returns (bytes32 data); - // Signs data - function sign(uint256 privateKey, bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s); - // Gets the address for a given private key - function addr(uint256 privateKey) external pure returns (address keyAddr); - // Gets the nonce of an account - function getNonce(address account) external view returns (uint64 nonce); - // Performs a foreign function call via the terminal - function ffi(string[] calldata commandInput) external returns (bytes memory result); - // Sets environment variables - function setEnv(string calldata name, string calldata value) external; - // Reads environment variables, (name) => (value) - function envBool(string calldata name) external view returns (bool value); - function envUint(string calldata name) external view returns (uint256 value); - function envInt(string calldata name) external view returns (int256 value); - function envAddress(string calldata name) external view returns (address value); - function envBytes32(string calldata name) external view returns (bytes32 value); - function envString(string calldata name) external view returns (string memory value); - function envBytes(string calldata name) external view returns (bytes memory value); - // Reads environment variables as arrays - function envBool(string calldata name, string calldata delim) external view returns (bool[] memory value); - function envUint(string calldata name, string calldata delim) external view returns (uint256[] memory value); - function envInt(string calldata name, string calldata delim) external view returns (int256[] memory value); - function envAddress(string calldata name, string calldata delim) external view returns (address[] memory value); - function envBytes32(string calldata name, string calldata delim) external view returns (bytes32[] memory value); - function envString(string calldata name, string calldata delim) external view returns (string[] memory value); - function envBytes(string calldata name, string calldata delim) external view returns (bytes[] memory value); - // Read environment variables with default value - function envOr(string calldata name, bool defaultValue) external returns (bool value); - function envOr(string calldata name, uint256 defaultValue) external returns (uint256 value); - function envOr(string calldata name, int256 defaultValue) external returns (int256 value); - function envOr(string calldata name, address defaultValue) external returns (address value); - function envOr(string calldata name, bytes32 defaultValue) external returns (bytes32 value); - function envOr(string calldata name, string calldata defaultValue) external returns (string memory value); - function envOr(string calldata name, bytes calldata defaultValue) external returns (bytes memory value); - // Read environment variables as arrays with default value - function envOr(string calldata name, string calldata delim, bool[] calldata defaultValue) - external - returns (bool[] memory value); - function envOr(string calldata name, string calldata delim, uint256[] calldata defaultValue) - external - returns (uint256[] memory value); - function envOr(string calldata name, string calldata delim, int256[] calldata defaultValue) - external - returns (int256[] memory value); - function envOr(string calldata name, string calldata delim, address[] calldata defaultValue) - external - returns (address[] memory value); - function envOr(string calldata name, string calldata delim, bytes32[] calldata defaultValue) - external - returns (bytes32[] memory value); - function envOr(string calldata name, string calldata delim, string[] calldata defaultValue) - external - returns (string[] memory value); - function envOr(string calldata name, string calldata delim, bytes[] calldata defaultValue) - external - returns (bytes[] memory value); - // Records all storage reads and writes - function record() external; - // Gets all accessed reads and write slot from a recording session, for a given address - function accesses(address target) external returns (bytes32[] memory readSlots, bytes32[] memory writeSlots); - // Gets the _creation_ bytecode from an artifact file. Takes in the relative path to the json file - function getCode(string calldata artifactPath) external view returns (bytes memory creationBytecode); - // Gets the _deployed_ bytecode from an artifact file. Takes in the relative path to the json file - function getDeployedCode(string calldata artifactPath) external view returns (bytes memory runtimeBytecode); - // Labels an address in call traces - function label(address account, string calldata newLabel) external; - // Using the address that calls the test contract, has the next call (at this call depth only) create a transaction that can later be signed and sent onchain - function broadcast() external; - // Has the next call (at this call depth only) create a transaction with the address provided as the sender that can later be signed and sent onchain - function broadcast(address signer) external; - // Has the next call (at this call depth only) create a transaction with the private key provided as the sender that can later be signed and sent onchain - function broadcast(uint256 privateKey) external; - // Using the address that calls the test contract, has all subsequent calls (at this call depth only) create transactions that can later be signed and sent onchain - function startBroadcast() external; - // Has all subsequent calls (at this call depth only) create transactions with the address provided that can later be signed and sent onchain - function startBroadcast(address signer) external; - // Has all subsequent calls (at this call depth only) create transactions with the private key provided that can later be signed and sent onchain - function startBroadcast(uint256 privateKey) external; - // Stops collecting onchain transactions - function stopBroadcast() external; - // Reads the entire content of file to string - function readFile(string calldata path) external view returns (string memory data); - // Reads the entire content of file as binary. Path is relative to the project root. - function readFileBinary(string calldata path) external view returns (bytes memory data); - // Get the path of the current project root - function projectRoot() external view returns (string memory path); - // Get the metadata for a file/directory - function fsMetadata(string calldata fileOrDir) external returns (FsMetadata memory metadata); - // Reads next line of file to string - function readLine(string calldata path) external view returns (string memory line); - // Writes data to file, creating a file if it does not exist, and entirely replacing its contents if it does. - function writeFile(string calldata path, string calldata data) external; - // Writes binary data to a file, creating a file if it does not exist, and entirely replacing its contents if it does. - // Path is relative to the project root. - function writeFileBinary(string calldata path, bytes calldata data) external; - // Writes line to file, creating a file if it does not exist. - function writeLine(string calldata path, string calldata data) external; - // Closes file for reading, resetting the offset and allowing to read it from beginning with readLine. - function closeFile(string calldata path) external; - // Removes file. This cheatcode will revert in the following situations, but is not limited to just these cases: - // - Path points to a directory. - // - The file doesn't exist. - // - The user lacks permissions to remove the file. - function removeFile(string calldata path) external; - // Convert values to a string - function toString(address value) external pure returns (string memory stringifiedValue); - function toString(bytes calldata value) external pure returns (string memory stringifiedValue); - function toString(bytes32 value) external pure returns (string memory stringifiedValue); - function toString(bool value) external pure returns (string memory stringifiedValue); - function toString(uint256 value) external pure returns (string memory stringifiedValue); - function toString(int256 value) external pure returns (string memory stringifiedValue); - // Convert values from a string - function parseBytes(string calldata stringifiedValue) external pure returns (bytes memory parsedValue); - function parseAddress(string calldata stringifiedValue) external pure returns (address parsedValue); - function parseUint(string calldata stringifiedValue) external pure returns (uint256 parsedValue); - function parseInt(string calldata stringifiedValue) external pure returns (int256 parsedValue); - function parseBytes32(string calldata stringifiedValue) external pure returns (bytes32 parsedValue); - function parseBool(string calldata stringifiedValue) external pure returns (bool parsedValue); - // Record all the transaction logs - function recordLogs() external; - // Gets all the recorded logs - function getRecordedLogs() external returns (Log[] memory logs); - // Derive a private key from a provided mnenomic string (or mnenomic file path) at the derivation path m/44'/60'/0'/0/{index} - function deriveKey(string calldata mnemonic, uint32 index) external pure returns (uint256 privateKey); - // Derive a private key from a provided mnenomic string (or mnenomic file path) at {derivationPath}{index} - function deriveKey(string calldata mnemonic, string calldata derivationPath, uint32 index) - external - pure - returns (uint256 privateKey); - // Adds a private key to the local forge wallet and returns the address - function rememberKey(uint256 privateKey) external returns (address keyAddr); - // - // parseJson - // - // ---- - // In case the returned value is a JSON object, it's encoded as a ABI-encoded tuple. As JSON objects - // don't have the notion of ordered, but tuples do, they JSON object is encoded with it's fields ordered in - // ALPHABETICAL order. That means that in order to successfully decode the tuple, we need to define a tuple that - // encodes the fields in the same order, which is alphabetical. In the case of Solidity structs, they are encoded - // as tuples, with the attributes in the order in which they are defined. - // For example: json = { 'a': 1, 'b': 0xa4tb......3xs} - // a: uint256 - // b: address - // To decode that json, we need to define a struct or a tuple as follows: - // struct json = { uint256 a; address b; } - // If we defined a json struct with the opposite order, meaning placing the address b first, it would try to - // decode the tuple in that order, and thus fail. - // ---- - // Given a string of JSON, return it as ABI-encoded - function parseJson(string calldata json, string calldata key) external pure returns (bytes memory abiEncodedData); - function parseJson(string calldata json) external pure returns (bytes memory abiEncodedData); - - // The following parseJson cheatcodes will do type coercion, for the type that they indicate. - // For example, parseJsonUint will coerce all values to a uint256. That includes stringified numbers '12' - // and hex numbers '0xEF'. - // Type coercion works ONLY for discrete values or arrays. That means that the key must return a value or array, not - // a JSON object. - function parseJsonUint(string calldata, string calldata) external returns (uint256); - function parseJsonUintArray(string calldata, string calldata) external returns (uint256[] memory); - function parseJsonInt(string calldata, string calldata) external returns (int256); - function parseJsonIntArray(string calldata, string calldata) external returns (int256[] memory); - function parseJsonBool(string calldata, string calldata) external returns (bool); - function parseJsonBoolArray(string calldata, string calldata) external returns (bool[] memory); - function parseJsonAddress(string calldata, string calldata) external returns (address); - function parseJsonAddressArray(string calldata, string calldata) external returns (address[] memory); - function parseJsonString(string calldata, string calldata) external returns (string memory); - function parseJsonStringArray(string calldata, string calldata) external returns (string[] memory); - function parseJsonBytes(string calldata, string calldata) external returns (bytes memory); - function parseJsonBytesArray(string calldata, string calldata) external returns (bytes[] memory); - function parseJsonBytes32(string calldata, string calldata) external returns (bytes32); - function parseJsonBytes32Array(string calldata, string calldata) external returns (bytes32[] memory); - - // Serialize a key and value to a JSON object stored in-memory that can be later written to a file - // It returns the stringified version of the specific JSON file up to that moment. - function serializeBool(string calldata objectKey, string calldata valueKey, bool value) - external - returns (string memory json); - function serializeUint(string calldata objectKey, string calldata valueKey, uint256 value) - external - returns (string memory json); - function serializeInt(string calldata objectKey, string calldata valueKey, int256 value) - external - returns (string memory json); - function serializeAddress(string calldata objectKey, string calldata valueKey, address value) - external - returns (string memory json); - function serializeBytes32(string calldata objectKey, string calldata valueKey, bytes32 value) - external - returns (string memory json); - function serializeString(string calldata objectKey, string calldata valueKey, string calldata value) - external - returns (string memory json); - function serializeBytes(string calldata objectKey, string calldata valueKey, bytes calldata value) - external - returns (string memory json); - - function serializeBool(string calldata objectKey, string calldata valueKey, bool[] calldata values) - external - returns (string memory json); - function serializeUint(string calldata objectKey, string calldata valueKey, uint256[] calldata values) - external - returns (string memory json); - function serializeInt(string calldata objectKey, string calldata valueKey, int256[] calldata values) - external - returns (string memory json); - function serializeAddress(string calldata objectKey, string calldata valueKey, address[] calldata values) - external - returns (string memory json); - function serializeBytes32(string calldata objectKey, string calldata valueKey, bytes32[] calldata values) - external - returns (string memory json); - function serializeString(string calldata objectKey, string calldata valueKey, string[] calldata values) - external - returns (string memory json); - function serializeBytes(string calldata objectKey, string calldata valueKey, bytes[] calldata values) - external - returns (string memory json); - - // - // writeJson - // - // ---- - // Write a serialized JSON object to a file. If the file exists, it will be overwritten. - // Let's assume we want to write the following JSON to a file: - // - // { "boolean": true, "number": 342, "object": { "title": "finally json serialization" } } - // - // ``` - // string memory json1 = "some key"; - // vm.serializeBool(json1, "boolean", true); - // vm.serializeBool(json1, "number", uint256(342)); - // json2 = "some other key"; - // string memory output = vm.serializeString(json2, "title", "finally json serialization"); - // string memory finalJson = vm.serialize(json1, "object", output); - // vm.writeJson(finalJson, "./output/example.json"); - // ``` - // The critical insight is that every invocation of serialization will return the stringified version of the JSON - // up to that point. That means we can construct arbitrary JSON objects and then use the return stringified version - // to serialize them as values to another JSON object. - // - // json1 and json2 are simply keys used by the backend to keep track of the objects. So vm.serializeJson(json1,..) - // will find the object in-memory that is keyed by "some key". - function writeJson(string calldata json, string calldata path) external; - // Write a serialized JSON object to an **existing** JSON file, replacing a value with key = - // This is useful to replace a specific value of a JSON file, without having to parse the entire thing - function writeJson(string calldata json, string calldata path, string calldata valueKey) external; - // Returns the RPC url for the given alias - function rpcUrl(string calldata rpcAlias) external view returns (string memory json); - // Returns all rpc urls and their aliases `[alias, url][]` - function rpcUrls() external view returns (string[2][] memory urls); - // Returns all rpc urls and their aliases as structs. - function rpcUrlStructs() external view returns (Rpc[] memory urls); - // If the condition is false, discard this run's fuzz inputs and generate new ones. - function assume(bool condition) external pure; - // Pauses gas metering (i.e. gas usage is not counted). Noop if already paused. - function pauseGasMetering() external; - // Resumes gas metering (i.e. gas usage is counted again). Noop if already on. - function resumeGasMetering() external; -} - -interface Vm is VmSafe { - // Sets block.timestamp - function warp(uint256 newTimestamp) external; - // Sets block.height - function roll(uint256 newHeight) external; - // Sets block.basefee - function fee(uint256 newBasefee) external; - // Sets block.difficulty - function difficulty(uint256 newDifficulty) external; - // Sets block.chainid - function chainId(uint256 newChainId) external; - // Stores a value to an address' storage slot. - function store(address target, bytes32 slot, bytes32 value) external; - // Sets the nonce of an account; must be higher than the current nonce of the account - function setNonce(address account, uint64 newNonce) external; - // Sets the *next* call's msg.sender to be the input address - function prank(address msgSender) external; - // Sets all subsequent calls' msg.sender to be the input address until `stopPrank` is called - function startPrank(address msgSender) external; - // Sets the *next* call's msg.sender to be the input address, and the tx.origin to be the second input - function prank(address msgSender, address txOrigin) external; - // Sets all subsequent calls' msg.sender to be the input address until `stopPrank` is called, and the tx.origin to be the second input - function startPrank(address msgSender, address txOrigin) external; - // Resets subsequent calls' msg.sender to be `address(this)` - function stopPrank() external; - // Sets an address' balance - function deal(address account, uint256 newBalance) external; - // Sets an address' code - function etch(address target, bytes calldata newRuntimeBytecode) external; - // Expects an error on next call - function expectRevert(bytes calldata revertData) external; - function expectRevert(bytes4 revertData) external; - function expectRevert() external; - - // Prepare an expected log with all four checks enabled. - // Call this function, then emit an event, then call a function. Internally after the call, we check if - // logs were emitted in the expected order with the expected topics and data. - // Second form also checks supplied address against emitting contract. - function expectEmit() external; - function expectEmit(address) external; - - // Prepare an expected log with (bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData). - // Call this function, then emit an event, then call a function. Internally after the call, we check if - // logs were emitted in the expected order with the expected topics and data (as specified by the booleans). - // Second form also checks supplied address against emitting contract. - function expectEmit(bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData) external; - function expectEmit(bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData, address emitter) - external; - - // Mocks a call to an address, returning specified data. - // Calldata can either be strict or a partial match, e.g. if you only - // pass a Solidity selector to the expected calldata, then the entire Solidity - // function will be mocked. - function mockCall(address callee, bytes calldata data, bytes calldata returnData) external; - // Mocks a call to an address with a specific msg.value, returning specified data. - // Calldata match takes precedence over msg.value in case of ambiguity. - function mockCall(address callee, uint256 msgValue, bytes calldata data, bytes calldata returnData) external; - // Clears all mocked calls - function clearMockedCalls() external; - // Expects a call to an address with the specified calldata. - // Calldata can either be a strict or a partial match - function expectCall(address callee, bytes calldata data) external; - // Expects a call to an address with the specified msg.value and calldata - function expectCall(address callee, uint256 msgValue, bytes calldata data) external; - // Expect a call to an address with the specified msg.value, gas, and calldata. - function expectCall(address callee, uint256 msgValue, uint64 gas, bytes calldata data) external; - // Expect a call to an address with the specified msg.value and calldata, and a *minimum* amount of gas. - function expectCallMinGas(address callee, uint256 msgValue, uint64 minGas, bytes calldata data) external; - // Sets block.coinbase - function coinbase(address newCoinbase) external; - // Snapshot the current state of the evm. - // Returns the id of the snapshot that was created. - // To revert a snapshot use `revertTo` - function snapshot() external returns (uint256 snapshotId); - // Revert the state of the EVM to a previous snapshot - // Takes the snapshot id to revert to. - // This deletes the snapshot and all snapshots taken after the given snapshot id. - function revertTo(uint256 snapshotId) external returns (bool success); - // Creates a new fork with the given endpoint and block and returns the identifier of the fork - function createFork(string calldata urlOrAlias, uint256 blockNumber) external returns (uint256 forkId); - // Creates a new fork with the given endpoint and the _latest_ block and returns the identifier of the fork - function createFork(string calldata urlOrAlias) external returns (uint256 forkId); - // Creates a new fork with the given endpoint and at the block the given transaction was mined in, replays all transaction mined in the block before the transaction, - // and returns the identifier of the fork - function createFork(string calldata urlOrAlias, bytes32 txHash) external returns (uint256 forkId); - // Creates _and_ also selects a new fork with the given endpoint and block and returns the identifier of the fork - function createSelectFork(string calldata urlOrAlias, uint256 blockNumber) external returns (uint256 forkId); - // Creates _and_ also selects new fork with the given endpoint and at the block the given transaction was mined in, replays all transaction mined in the block before - // the transaction, returns the identifier of the fork - function createSelectFork(string calldata urlOrAlias, bytes32 txHash) external returns (uint256 forkId); - // Creates _and_ also selects a new fork with the given endpoint and the latest block and returns the identifier of the fork - function createSelectFork(string calldata urlOrAlias) external returns (uint256 forkId); - // Takes a fork identifier created by `createFork` and sets the corresponding forked state as active. - function selectFork(uint256 forkId) external; - /// Returns the identifier of the currently active fork. Reverts if no fork is currently active. - function activeFork() external view returns (uint256 forkId); - // Updates the currently active fork to given block number - // This is similar to `roll` but for the currently active fork - function rollFork(uint256 blockNumber) external; - // Updates the currently active fork to given transaction - // this will `rollFork` with the number of the block the transaction was mined in and replays all transaction mined before it in the block - function rollFork(bytes32 txHash) external; - // Updates the given fork to given block number - function rollFork(uint256 forkId, uint256 blockNumber) external; - // Updates the given fork to block number of the given transaction and replays all transaction mined before it in the block - function rollFork(uint256 forkId, bytes32 txHash) external; - // Marks that the account(s) should use persistent storage across fork swaps in a multifork setup - // Meaning, changes made to the state of this account will be kept when switching forks - function makePersistent(address account) external; - function makePersistent(address account0, address account1) external; - function makePersistent(address account0, address account1, address account2) external; - function makePersistent(address[] calldata accounts) external; - // Revokes persistent status from the address, previously added via `makePersistent` - function revokePersistent(address account) external; - function revokePersistent(address[] calldata accounts) external; - // Returns true if the account is marked as persistent - function isPersistent(address account) external view returns (bool persistent); - // In forking mode, explicitly grant the given address cheatcode access - function allowCheatcodes(address account) external; - // Fetches the given transaction from the active fork and executes it on the current state - function transact(bytes32 txHash) external; - // Fetches the given transaction from the given fork and executes it on the current state - function transact(uint256 forkId, bytes32 txHash) external; -} diff --git a/contract/lib/forge-std/src/console.sol b/contract/lib/forge-std/src/console.sol deleted file mode 100644 index ad57e53..0000000 --- a/contract/lib/forge-std/src/console.sol +++ /dev/null @@ -1,1533 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.4.22 <0.9.0; - -library console { - address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); - - function _sendLogPayload(bytes memory payload) private view { - uint256 payloadLength = payload.length; - address consoleAddress = CONSOLE_ADDRESS; - /// @solidity memory-safe-assembly - assembly { - let payloadStart := add(payload, 32) - let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) - } - } - - function log() internal view { - _sendLogPayload(abi.encodeWithSignature("log()")); - } - - function logInt(int p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(int)", p0)); - } - - function logUint(uint p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); - } - - function logString(string memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); - } - - function logBool(bool p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); - } - - function logAddress(address p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); - } - - function logBytes(bytes memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); - } - - function logBytes1(bytes1 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); - } - - function logBytes2(bytes2 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); - } - - function logBytes3(bytes3 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); - } - - function logBytes4(bytes4 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); - } - - function logBytes5(bytes5 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); - } - - function logBytes6(bytes6 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); - } - - function logBytes7(bytes7 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); - } - - function logBytes8(bytes8 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); - } - - function logBytes9(bytes9 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); - } - - function logBytes10(bytes10 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); - } - - function logBytes11(bytes11 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); - } - - function logBytes12(bytes12 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); - } - - function logBytes13(bytes13 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); - } - - function logBytes14(bytes14 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); - } - - function logBytes15(bytes15 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); - } - - function logBytes16(bytes16 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); - } - - function logBytes17(bytes17 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); - } - - function logBytes18(bytes18 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); - } - - function logBytes19(bytes19 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); - } - - function logBytes20(bytes20 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); - } - - function logBytes21(bytes21 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); - } - - function logBytes22(bytes22 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); - } - - function logBytes23(bytes23 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); - } - - function logBytes24(bytes24 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); - } - - function logBytes25(bytes25 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); - } - - function logBytes26(bytes26 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); - } - - function logBytes27(bytes27 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); - } - - function logBytes28(bytes28 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); - } - - function logBytes29(bytes29 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); - } - - function logBytes30(bytes30 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); - } - - function logBytes31(bytes31 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); - } - - function logBytes32(bytes32 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); - } - - function log(uint p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); - } - - function log(string memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); - } - - function log(bool p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); - } - - function log(address p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); - } - - function log(uint p0, uint p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint)", p0, p1)); - } - - function log(uint p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string)", p0, p1)); - } - - function log(uint p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool)", p0, p1)); - } - - function log(uint p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address)", p0, p1)); - } - - function log(string memory p0, uint p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint)", p0, p1)); - } - - function log(string memory p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); - } - - function log(string memory p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); - } - - function log(string memory p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); - } - - function log(bool p0, uint p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint)", p0, p1)); - } - - function log(bool p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); - } - - function log(bool p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); - } - - function log(bool p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); - } - - function log(address p0, uint p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint)", p0, p1)); - } - - function log(address p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); - } - - function log(address p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); - } - - function log(address p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); - } - - function log(uint p0, uint p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint)", p0, p1, p2)); - } - - function log(uint p0, uint p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string)", p0, p1, p2)); - } - - function log(uint p0, uint p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool)", p0, p1, p2)); - } - - function log(uint p0, uint p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address)", p0, p1, p2)); - } - - function log(uint p0, string memory p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint)", p0, p1, p2)); - } - - function log(uint p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string)", p0, p1, p2)); - } - - function log(uint p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool)", p0, p1, p2)); - } - - function log(uint p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address)", p0, p1, p2)); - } - - function log(uint p0, bool p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint)", p0, p1, p2)); - } - - function log(uint p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string)", p0, p1, p2)); - } - - function log(uint p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool)", p0, p1, p2)); - } - - function log(uint p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address)", p0, p1, p2)); - } - - function log(uint p0, address p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint)", p0, p1, p2)); - } - - function log(uint p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string)", p0, p1, p2)); - } - - function log(uint p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool)", p0, p1, p2)); - } - - function log(uint p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address)", p0, p1, p2)); - } - - function log(string memory p0, uint p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint)", p0, p1, p2)); - } - - function log(string memory p0, uint p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string)", p0, p1, p2)); - } - - function log(string memory p0, uint p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool)", p0, p1, p2)); - } - - function log(string memory p0, uint p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); - } - - function log(string memory p0, address p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint)", p0, p1, p2)); - } - - function log(string memory p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); - } - - function log(string memory p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); - } - - function log(string memory p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); - } - - function log(bool p0, uint p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint)", p0, p1, p2)); - } - - function log(bool p0, uint p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string)", p0, p1, p2)); - } - - function log(bool p0, uint p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool)", p0, p1, p2)); - } - - function log(bool p0, uint p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); - } - - function log(bool p0, bool p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint)", p0, p1, p2)); - } - - function log(bool p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); - } - - function log(bool p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); - } - - function log(bool p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); - } - - function log(bool p0, address p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint)", p0, p1, p2)); - } - - function log(bool p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); - } - - function log(bool p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); - } - - function log(bool p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); - } - - function log(address p0, uint p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint)", p0, p1, p2)); - } - - function log(address p0, uint p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string)", p0, p1, p2)); - } - - function log(address p0, uint p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool)", p0, p1, p2)); - } - - function log(address p0, uint p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address)", p0, p1, p2)); - } - - function log(address p0, string memory p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint)", p0, p1, p2)); - } - - function log(address p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); - } - - function log(address p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); - } - - function log(address p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); - } - - function log(address p0, bool p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint)", p0, p1, p2)); - } - - function log(address p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); - } - - function log(address p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); - } - - function log(address p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); - } - - function log(address p0, address p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint)", p0, p1, p2)); - } - - function log(address p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); - } - - function log(address p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); - } - - function log(address p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); - } - - function log(uint p0, uint p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,string)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,address)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,string)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,address)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,string)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,address)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,string)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,address)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,string)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,address)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,string)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,address)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,string)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,address)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,string)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,address)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,string)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,address)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,string)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,address)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,string)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,address)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,string)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,address)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,string)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,address)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,string)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,address)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,string)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,uint)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,uint)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,uint)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,uint)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,uint)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,uint)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,uint)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); - } - -} \ No newline at end of file diff --git a/contract/lib/forge-std/src/console2.sol b/contract/lib/forge-std/src/console2.sol deleted file mode 100644 index 8596233..0000000 --- a/contract/lib/forge-std/src/console2.sol +++ /dev/null @@ -1,1546 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.4.22 <0.9.0; - -/// @dev The original console.sol uses `int` and `uint` for computing function selectors, but it should -/// use `int256` and `uint256`. This modified version fixes that. This version is recommended -/// over `console.sol` if you don't need compatibility with Hardhat as the logs will show up in -/// forge stack traces. If you do need compatibility with Hardhat, you must use `console.sol`. -/// Reference: https://github.com/NomicFoundation/hardhat/issues/2178 -library console2 { - address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); - - function _sendLogPayload(bytes memory payload) private view { - uint256 payloadLength = payload.length; - address consoleAddress = CONSOLE_ADDRESS; - /// @solidity memory-safe-assembly - assembly { - let payloadStart := add(payload, 32) - let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) - } - } - - function log() internal view { - _sendLogPayload(abi.encodeWithSignature("log()")); - } - - function logInt(int256 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(int256)", p0)); - } - - function logUint(uint256 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256)", p0)); - } - - function logString(string memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); - } - - function logBool(bool p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); - } - - function logAddress(address p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); - } - - function logBytes(bytes memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); - } - - function logBytes1(bytes1 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); - } - - function logBytes2(bytes2 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); - } - - function logBytes3(bytes3 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); - } - - function logBytes4(bytes4 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); - } - - function logBytes5(bytes5 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); - } - - function logBytes6(bytes6 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); - } - - function logBytes7(bytes7 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); - } - - function logBytes8(bytes8 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); - } - - function logBytes9(bytes9 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); - } - - function logBytes10(bytes10 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); - } - - function logBytes11(bytes11 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); - } - - function logBytes12(bytes12 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); - } - - function logBytes13(bytes13 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); - } - - function logBytes14(bytes14 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); - } - - function logBytes15(bytes15 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); - } - - function logBytes16(bytes16 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); - } - - function logBytes17(bytes17 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); - } - - function logBytes18(bytes18 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); - } - - function logBytes19(bytes19 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); - } - - function logBytes20(bytes20 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); - } - - function logBytes21(bytes21 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); - } - - function logBytes22(bytes22 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); - } - - function logBytes23(bytes23 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); - } - - function logBytes24(bytes24 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); - } - - function logBytes25(bytes25 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); - } - - function logBytes26(bytes26 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); - } - - function logBytes27(bytes27 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); - } - - function logBytes28(bytes28 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); - } - - function logBytes29(bytes29 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); - } - - function logBytes30(bytes30 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); - } - - function logBytes31(bytes31 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); - } - - function logBytes32(bytes32 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); - } - - function log(uint256 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256)", p0)); - } - - function log(int256 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(int256)", p0)); - } - - function log(string memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); - } - - function log(bool p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); - } - - function log(address p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); - } - - function log(uint256 p0, uint256 p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256)", p0, p1)); - } - - function log(uint256 p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string)", p0, p1)); - } - - function log(uint256 p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool)", p0, p1)); - } - - function log(uint256 p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address)", p0, p1)); - } - - function log(string memory p0, uint256 p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256)", p0, p1)); - } - - function log(string memory p0, int256 p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,int256)", p0, p1)); - } - - function log(string memory p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); - } - - function log(string memory p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); - } - - function log(string memory p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); - } - - function log(bool p0, uint256 p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256)", p0, p1)); - } - - function log(bool p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); - } - - function log(bool p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); - } - - function log(bool p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); - } - - function log(address p0, uint256 p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256)", p0, p1)); - } - - function log(address p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); - } - - function log(address p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); - } - - function log(address p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); - } - - function log(uint256 p0, uint256 p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256)", p0, p1, p2)); - } - - function log(uint256 p0, uint256 p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string)", p0, p1, p2)); - } - - function log(uint256 p0, uint256 p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool)", p0, p1, p2)); - } - - function log(uint256 p0, uint256 p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address)", p0, p1, p2)); - } - - function log(uint256 p0, string memory p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256)", p0, p1, p2)); - } - - function log(uint256 p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string)", p0, p1, p2)); - } - - function log(uint256 p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool)", p0, p1, p2)); - } - - function log(uint256 p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address)", p0, p1, p2)); - } - - function log(uint256 p0, bool p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256)", p0, p1, p2)); - } - - function log(uint256 p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string)", p0, p1, p2)); - } - - function log(uint256 p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool)", p0, p1, p2)); - } - - function log(uint256 p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address)", p0, p1, p2)); - } - - function log(uint256 p0, address p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256)", p0, p1, p2)); - } - - function log(uint256 p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string)", p0, p1, p2)); - } - - function log(uint256 p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool)", p0, p1, p2)); - } - - function log(uint256 p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address)", p0, p1, p2)); - } - - function log(string memory p0, uint256 p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256)", p0, p1, p2)); - } - - function log(string memory p0, uint256 p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string)", p0, p1, p2)); - } - - function log(string memory p0, uint256 p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool)", p0, p1, p2)); - } - - function log(string memory p0, uint256 p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); - } - - function log(string memory p0, address p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256)", p0, p1, p2)); - } - - function log(string memory p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); - } - - function log(string memory p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); - } - - function log(string memory p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); - } - - function log(bool p0, uint256 p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256)", p0, p1, p2)); - } - - function log(bool p0, uint256 p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string)", p0, p1, p2)); - } - - function log(bool p0, uint256 p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool)", p0, p1, p2)); - } - - function log(bool p0, uint256 p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); - } - - function log(bool p0, bool p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256)", p0, p1, p2)); - } - - function log(bool p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); - } - - function log(bool p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); - } - - function log(bool p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); - } - - function log(bool p0, address p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256)", p0, p1, p2)); - } - - function log(bool p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); - } - - function log(bool p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); - } - - function log(bool p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); - } - - function log(address p0, uint256 p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256)", p0, p1, p2)); - } - - function log(address p0, uint256 p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string)", p0, p1, p2)); - } - - function log(address p0, uint256 p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool)", p0, p1, p2)); - } - - function log(address p0, uint256 p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address)", p0, p1, p2)); - } - - function log(address p0, string memory p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256)", p0, p1, p2)); - } - - function log(address p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); - } - - function log(address p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); - } - - function log(address p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); - } - - function log(address p0, bool p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256)", p0, p1, p2)); - } - - function log(address p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); - } - - function log(address p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); - } - - function log(address p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); - } - - function log(address p0, address p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256)", p0, p1, p2)); - } - - function log(address p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); - } - - function log(address p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); - } - - function log(address p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); - } - - function log(uint256 p0, uint256 p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); - } - -} \ No newline at end of file diff --git a/contract/lib/forge-std/src/interfaces/IERC1155.sol b/contract/lib/forge-std/src/interfaces/IERC1155.sol deleted file mode 100644 index f7dd2b4..0000000 --- a/contract/lib/forge-std/src/interfaces/IERC1155.sol +++ /dev/null @@ -1,105 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2; - -import "./IERC165.sol"; - -/// @title ERC-1155 Multi Token Standard -/// @dev See https://eips.ethereum.org/EIPS/eip-1155 -/// Note: The ERC-165 identifier for this interface is 0xd9b67a26. -interface IERC1155 is IERC165 { - /// @dev - /// - Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). - /// - The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer (SHOULD be msg.sender). - /// - The `_from` argument MUST be the address of the holder whose balance is decreased. - /// - The `_to` argument MUST be the address of the recipient whose balance is increased. - /// - The `_id` argument MUST be the token type being transferred. - /// - The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by. - /// - When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). - /// - When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). - event TransferSingle( - address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value - ); - - /// @dev - /// - Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). - /// - The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer (SHOULD be msg.sender). - /// - The `_from` argument MUST be the address of the holder whose balance is decreased. - /// - The `_to` argument MUST be the address of the recipient whose balance is increased. - /// - The `_ids` argument MUST be the list of tokens being transferred. - /// - The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by. - /// - When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). - /// - When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). - event TransferBatch( - address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values - ); - - /// @dev MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absence of an event assumes disabled). - event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); - - /// @dev MUST emit when the URI is updated for a token ID. URIs are defined in RFC 3986. - /// The URI MUST point to a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema". - event URI(string _value, uint256 indexed _id); - - /// @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call). - /// @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). - /// - MUST revert if `_to` is the zero address. - /// - MUST revert if balance of holder for token `_id` is lower than the `_value` sent. - /// - MUST revert on any other error. - /// - MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard). - /// - After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). - /// @param _from Source address - /// @param _to Target address - /// @param _id ID of the token type - /// @param _value Transfer amount - /// @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to` - function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external; - - /// @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call). - /// @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). - /// - MUST revert if `_to` is the zero address. - /// - MUST revert if length of `_ids` is not the same as length of `_values`. - /// - MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient. - /// - MUST revert on any other error. - /// - MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard). - /// - Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc). - /// - After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). - /// @param _from Source address - /// @param _to Target address - /// @param _ids IDs of each token type (order and length must match _values array) - /// @param _values Transfer amounts per token type (order and length must match _ids array) - /// @param _data Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to` - function safeBatchTransferFrom( - address _from, - address _to, - uint256[] calldata _ids, - uint256[] calldata _values, - bytes calldata _data - ) external; - - /// @notice Get the balance of an account's tokens. - /// @param _owner The address of the token holder - /// @param _id ID of the token - /// @return The _owner's balance of the token type requested - function balanceOf(address _owner, uint256 _id) external view returns (uint256); - - /// @notice Get the balance of multiple account/token pairs - /// @param _owners The addresses of the token holders - /// @param _ids ID of the tokens - /// @return The _owner's balance of the token types requested (i.e. balance for each (owner, id) pair) - function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) - external - view - returns (uint256[] memory); - - /// @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens. - /// @dev MUST emit the ApprovalForAll event on success. - /// @param _operator Address to add to the set of authorized operators - /// @param _approved True if the operator is approved, false to revoke approval - function setApprovalForAll(address _operator, bool _approved) external; - - /// @notice Queries the approval status of an operator for a given owner. - /// @param _owner The owner of the tokens - /// @param _operator Address of authorized operator - /// @return True if the operator is approved, false if not - function isApprovedForAll(address _owner, address _operator) external view returns (bool); -} diff --git a/contract/lib/forge-std/src/interfaces/IERC165.sol b/contract/lib/forge-std/src/interfaces/IERC165.sol deleted file mode 100644 index 9af4bf8..0000000 --- a/contract/lib/forge-std/src/interfaces/IERC165.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2; - -interface IERC165 { - /// @notice Query if a contract implements an interface - /// @param interfaceID The interface identifier, as specified in ERC-165 - /// @dev Interface identification is specified in ERC-165. This function - /// uses less than 30,000 gas. - /// @return `true` if the contract implements `interfaceID` and - /// `interfaceID` is not 0xffffffff, `false` otherwise - function supportsInterface(bytes4 interfaceID) external view returns (bool); -} diff --git a/contract/lib/forge-std/src/interfaces/IERC20.sol b/contract/lib/forge-std/src/interfaces/IERC20.sol deleted file mode 100644 index ba40806..0000000 --- a/contract/lib/forge-std/src/interfaces/IERC20.sol +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2; - -/// @dev Interface of the ERC20 standard as defined in the EIP. -/// @dev This includes the optional name, symbol, and decimals metadata. -interface IERC20 { - /// @dev Emitted when `value` tokens are moved from one account (`from`) to another (`to`). - event Transfer(address indexed from, address indexed to, uint256 value); - - /// @dev Emitted when the allowance of a `spender` for an `owner` is set, where `value` - /// is the new allowance. - event Approval(address indexed owner, address indexed spender, uint256 value); - - /// @notice Returns the amount of tokens in existence. - function totalSupply() external view returns (uint256); - - /// @notice Returns the amount of tokens owned by `account`. - function balanceOf(address account) external view returns (uint256); - - /// @notice Moves `amount` tokens from the caller's account to `to`. - function transfer(address to, uint256 amount) external returns (bool); - - /// @notice Returns the remaining number of tokens that `spender` is allowed - /// to spend on behalf of `owner` - function allowance(address owner, address spender) external view returns (uint256); - - /// @notice Sets `amount` as the allowance of `spender` over the caller's tokens. - /// @dev Be aware of front-running risks: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - function approve(address spender, uint256 amount) external returns (bool); - - /// @notice Moves `amount` tokens from `from` to `to` using the allowance mechanism. - /// `amount` is then deducted from the caller's allowance. - function transferFrom(address from, address to, uint256 amount) external returns (bool); - - /// @notice Returns the name of the token. - function name() external view returns (string memory); - - /// @notice Returns the symbol of the token. - function symbol() external view returns (string memory); - - /// @notice Returns the decimals places of the token. - function decimals() external view returns (uint8); -} diff --git a/contract/lib/forge-std/src/interfaces/IERC4626.sol b/contract/lib/forge-std/src/interfaces/IERC4626.sol deleted file mode 100644 index bfe3a11..0000000 --- a/contract/lib/forge-std/src/interfaces/IERC4626.sol +++ /dev/null @@ -1,190 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2; - -import "./IERC20.sol"; - -/// @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in -/// https://eips.ethereum.org/EIPS/eip-4626 -interface IERC4626 is IERC20 { - event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares); - - event Withdraw( - address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares - ); - - /// @notice Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing. - /// @dev - /// - MUST be an ERC-20 token contract. - /// - MUST NOT revert. - function asset() external view returns (address assetTokenAddress); - - /// @notice Returns the total amount of the underlying asset that is “managed” by Vault. - /// @dev - /// - SHOULD include any compounding that occurs from yield. - /// - MUST be inclusive of any fees that are charged against assets in the Vault. - /// - MUST NOT revert. - function totalAssets() external view returns (uint256 totalManagedAssets); - - /// @notice Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal - /// scenario where all the conditions are met. - /// @dev - /// - MUST NOT be inclusive of any fees that are charged against assets in the Vault. - /// - MUST NOT show any variations depending on the caller. - /// - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. - /// - MUST NOT revert. - /// - /// NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the - /// “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and - /// from. - function convertToShares(uint256 assets) external view returns (uint256 shares); - - /// @notice Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal - /// scenario where all the conditions are met. - /// @dev - /// - MUST NOT be inclusive of any fees that are charged against assets in the Vault. - /// - MUST NOT show any variations depending on the caller. - /// - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. - /// - MUST NOT revert. - /// - /// NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the - /// “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and - /// from. - function convertToAssets(uint256 shares) external view returns (uint256 assets); - - /// @notice Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver, - /// through a deposit call. - /// @dev - /// - MUST return a limited value if receiver is subject to some deposit limit. - /// - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited. - /// - MUST NOT revert. - function maxDeposit(address receiver) external view returns (uint256 maxAssets); - - /// @notice Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given - /// current on-chain conditions. - /// @dev - /// - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit - /// call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called - /// in the same transaction. - /// - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the - /// deposit would be accepted, regardless if the user has enough tokens approved, etc. - /// - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. - /// - MUST NOT revert. - /// - /// NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in - /// share price or some other type of condition, meaning the depositor will lose assets by depositing. - function previewDeposit(uint256 assets) external view returns (uint256 shares); - - /// @notice Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens. - /// @dev - /// - MUST emit the Deposit event. - /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the - /// deposit execution, and are accounted for during deposit. - /// - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not - /// approving enough underlying tokens to the Vault contract, etc). - /// - /// NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. - function deposit(uint256 assets, address receiver) external returns (uint256 shares); - - /// @notice Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call. - /// @dev - /// - MUST return a limited value if receiver is subject to some mint limit. - /// - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted. - /// - MUST NOT revert. - function maxMint(address receiver) external view returns (uint256 maxShares); - - /// @notice Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given - /// current on-chain conditions. - /// @dev - /// - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call - /// in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the - /// same transaction. - /// - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint - /// would be accepted, regardless if the user has enough tokens approved, etc. - /// - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. - /// - MUST NOT revert. - /// - /// NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in - /// share price or some other type of condition, meaning the depositor will lose assets by minting. - function previewMint(uint256 shares) external view returns (uint256 assets); - - /// @notice Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens. - /// @dev - /// - MUST emit the Deposit event. - /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint - /// execution, and are accounted for during mint. - /// - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not - /// approving enough underlying tokens to the Vault contract, etc). - /// - /// NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. - function mint(uint256 shares, address receiver) external returns (uint256 assets); - - /// @notice Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the - /// Vault, through a withdraw call. - /// @dev - /// - MUST return a limited value if owner is subject to some withdrawal limit or timelock. - /// - MUST NOT revert. - function maxWithdraw(address owner) external view returns (uint256 maxAssets); - - /// @notice Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block, - /// given current on-chain conditions. - /// @dev - /// - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw - /// call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if - /// called - /// in the same transaction. - /// - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though - /// the withdrawal would be accepted, regardless if the user has enough shares, etc. - /// - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. - /// - MUST NOT revert. - /// - /// NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in - /// share price or some other type of condition, meaning the depositor will lose assets by depositing. - function previewWithdraw(uint256 assets) external view returns (uint256 shares); - - /// @notice Burns shares from owner and sends exactly assets of underlying tokens to receiver. - /// @dev - /// - MUST emit the Withdraw event. - /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the - /// withdraw execution, and are accounted for during withdraw. - /// - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner - /// not having enough shares, etc). - /// - /// Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed. - /// Those methods should be performed separately. - function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares); - - /// @notice Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault, - /// through a redeem call. - /// @dev - /// - MUST return a limited value if owner is subject to some withdrawal limit or timelock. - /// - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock. - /// - MUST NOT revert. - function maxRedeem(address owner) external view returns (uint256 maxShares); - - /// @notice Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block, - /// given current on-chain conditions. - /// @dev - /// - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call - /// in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the - /// same transaction. - /// - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the - /// redemption would be accepted, regardless if the user has enough shares, etc. - /// - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. - /// - MUST NOT revert. - /// - /// NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in - /// share price or some other type of condition, meaning the depositor will lose assets by redeeming. - function previewRedeem(uint256 shares) external view returns (uint256 assets); - - /// @notice Burns exactly shares from owner and sends assets of underlying tokens to receiver. - /// @dev - /// - MUST emit the Withdraw event. - /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the - /// redeem execution, and are accounted for during redeem. - /// - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner - /// not having enough shares, etc). - /// - /// NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed. - /// Those methods should be performed separately. - function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets); -} diff --git a/contract/lib/forge-std/src/interfaces/IERC721.sol b/contract/lib/forge-std/src/interfaces/IERC721.sol deleted file mode 100644 index 0a16f45..0000000 --- a/contract/lib/forge-std/src/interfaces/IERC721.sol +++ /dev/null @@ -1,164 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2; - -import "./IERC165.sol"; - -/// @title ERC-721 Non-Fungible Token Standard -/// @dev See https://eips.ethereum.org/EIPS/eip-721 -/// Note: the ERC-165 identifier for this interface is 0x80ac58cd. -interface IERC721 is IERC165 { - /// @dev This emits when ownership of any NFT changes by any mechanism. - /// This event emits when NFTs are created (`from` == 0) and destroyed - /// (`to` == 0). Exception: during contract creation, any number of NFTs - /// may be created and assigned without emitting Transfer. At the time of - /// any transfer, the approved address for that NFT (if any) is reset to none. - event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId); - - /// @dev This emits when the approved address for an NFT is changed or - /// reaffirmed. The zero address indicates there is no approved address. - /// When a Transfer event emits, this also indicates that the approved - /// address for that NFT (if any) is reset to none. - event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId); - - /// @dev This emits when an operator is enabled or disabled for an owner. - /// The operator can manage all NFTs of the owner. - event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); - - /// @notice Count all NFTs assigned to an owner - /// @dev NFTs assigned to the zero address are considered invalid, and this - /// function throws for queries about the zero address. - /// @param _owner An address for whom to query the balance - /// @return The number of NFTs owned by `_owner`, possibly zero - function balanceOf(address _owner) external view returns (uint256); - - /// @notice Find the owner of an NFT - /// @dev NFTs assigned to zero address are considered invalid, and queries - /// about them do throw. - /// @param _tokenId The identifier for an NFT - /// @return The address of the owner of the NFT - function ownerOf(uint256 _tokenId) external view returns (address); - - /// @notice Transfers the ownership of an NFT from one address to another address - /// @dev Throws unless `msg.sender` is the current owner, an authorized - /// operator, or the approved address for this NFT. Throws if `_from` is - /// not the current owner. Throws if `_to` is the zero address. Throws if - /// `_tokenId` is not a valid NFT. When transfer is complete, this function - /// checks if `_to` is a smart contract (code size > 0). If so, it calls - /// `onERC721Received` on `_to` and throws if the return value is not - /// `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`. - /// @param _from The current owner of the NFT - /// @param _to The new owner - /// @param _tokenId The NFT to transfer - /// @param data Additional data with no specified format, sent in call to `_to` - function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata data) external payable; - - /// @notice Transfers the ownership of an NFT from one address to another address - /// @dev This works identically to the other function with an extra data parameter, - /// except this function just sets data to "". - /// @param _from The current owner of the NFT - /// @param _to The new owner - /// @param _tokenId The NFT to transfer - function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable; - - /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE - /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE - /// THEY MAY BE PERMANENTLY LOST - /// @dev Throws unless `msg.sender` is the current owner, an authorized - /// operator, or the approved address for this NFT. Throws if `_from` is - /// not the current owner. Throws if `_to` is the zero address. Throws if - /// `_tokenId` is not a valid NFT. - /// @param _from The current owner of the NFT - /// @param _to The new owner - /// @param _tokenId The NFT to transfer - function transferFrom(address _from, address _to, uint256 _tokenId) external payable; - - /// @notice Change or reaffirm the approved address for an NFT - /// @dev The zero address indicates there is no approved address. - /// Throws unless `msg.sender` is the current NFT owner, or an authorized - /// operator of the current owner. - /// @param _approved The new approved NFT controller - /// @param _tokenId The NFT to approve - function approve(address _approved, uint256 _tokenId) external payable; - - /// @notice Enable or disable approval for a third party ("operator") to manage - /// all of `msg.sender`'s assets - /// @dev Emits the ApprovalForAll event. The contract MUST allow - /// multiple operators per owner. - /// @param _operator Address to add to the set of authorized operators - /// @param _approved True if the operator is approved, false to revoke approval - function setApprovalForAll(address _operator, bool _approved) external; - - /// @notice Get the approved address for a single NFT - /// @dev Throws if `_tokenId` is not a valid NFT. - /// @param _tokenId The NFT to find the approved address for - /// @return The approved address for this NFT, or the zero address if there is none - function getApproved(uint256 _tokenId) external view returns (address); - - /// @notice Query if an address is an authorized operator for another address - /// @param _owner The address that owns the NFTs - /// @param _operator The address that acts on behalf of the owner - /// @return True if `_operator` is an approved operator for `_owner`, false otherwise - function isApprovedForAll(address _owner, address _operator) external view returns (bool); -} - -/// @dev Note: the ERC-165 identifier for this interface is 0x150b7a02. -interface IERC721TokenReceiver { - /// @notice Handle the receipt of an NFT - /// @dev The ERC721 smart contract calls this function on the recipient - /// after a `transfer`. This function MAY throw to revert and reject the - /// transfer. Return of other than the magic value MUST result in the - /// transaction being reverted. - /// Note: the contract address is always the message sender. - /// @param _operator The address which called `safeTransferFrom` function - /// @param _from The address which previously owned the token - /// @param _tokenId The NFT identifier which is being transferred - /// @param _data Additional data with no specified format - /// @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` - /// unless throwing - function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) - external - returns (bytes4); -} - -/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension -/// @dev See https://eips.ethereum.org/EIPS/eip-721 -/// Note: the ERC-165 identifier for this interface is 0x5b5e139f. -interface IERC721Metadata is IERC721 { - /// @notice A descriptive name for a collection of NFTs in this contract - function name() external view returns (string memory _name); - - /// @notice An abbreviated name for NFTs in this contract - function symbol() external view returns (string memory _symbol); - - /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. - /// @dev Throws if `_tokenId` is not a valid NFT. URIs are defined in RFC - /// 3986. The URI may point to a JSON file that conforms to the "ERC721 - /// Metadata JSON Schema". - function tokenURI(uint256 _tokenId) external view returns (string memory); -} - -/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension -/// @dev See https://eips.ethereum.org/EIPS/eip-721 -/// Note: the ERC-165 identifier for this interface is 0x780e9d63. -interface IERC721Enumerable is IERC721 { - /// @notice Count NFTs tracked by this contract - /// @return A count of valid NFTs tracked by this contract, where each one of - /// them has an assigned and queryable owner not equal to the zero address - function totalSupply() external view returns (uint256); - - /// @notice Enumerate valid NFTs - /// @dev Throws if `_index` >= `totalSupply()`. - /// @param _index A counter less than `totalSupply()` - /// @return The token identifier for the `_index`th NFT, - /// (sort order not specified) - function tokenByIndex(uint256 _index) external view returns (uint256); - - /// @notice Enumerate NFTs assigned to an owner - /// @dev Throws if `_index` >= `balanceOf(_owner)` or if - /// `_owner` is the zero address, representing invalid NFTs. - /// @param _owner An address where we are interested in NFTs owned by them - /// @param _index A counter less than `balanceOf(_owner)` - /// @return The token identifier for the `_index`th NFT assigned to `_owner`, - /// (sort order not specified) - function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256); -} diff --git a/contract/lib/forge-std/src/interfaces/IMulticall3.sol b/contract/lib/forge-std/src/interfaces/IMulticall3.sol deleted file mode 100644 index 0d031b7..0000000 --- a/contract/lib/forge-std/src/interfaces/IMulticall3.sol +++ /dev/null @@ -1,73 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -pragma experimental ABIEncoderV2; - -interface IMulticall3 { - struct Call { - address target; - bytes callData; - } - - struct Call3 { - address target; - bool allowFailure; - bytes callData; - } - - struct Call3Value { - address target; - bool allowFailure; - uint256 value; - bytes callData; - } - - struct Result { - bool success; - bytes returnData; - } - - function aggregate(Call[] calldata calls) - external - payable - returns (uint256 blockNumber, bytes[] memory returnData); - - function aggregate3(Call3[] calldata calls) external payable returns (Result[] memory returnData); - - function aggregate3Value(Call3Value[] calldata calls) external payable returns (Result[] memory returnData); - - function blockAndAggregate(Call[] calldata calls) - external - payable - returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData); - - function getBasefee() external view returns (uint256 basefee); - - function getBlockHash(uint256 blockNumber) external view returns (bytes32 blockHash); - - function getBlockNumber() external view returns (uint256 blockNumber); - - function getChainId() external view returns (uint256 chainid); - - function getCurrentBlockCoinbase() external view returns (address coinbase); - - function getCurrentBlockDifficulty() external view returns (uint256 difficulty); - - function getCurrentBlockGasLimit() external view returns (uint256 gaslimit); - - function getCurrentBlockTimestamp() external view returns (uint256 timestamp); - - function getEthBalance(address addr) external view returns (uint256 balance); - - function getLastBlockHash() external view returns (bytes32 blockHash); - - function tryAggregate(bool requireSuccess, Call[] calldata calls) - external - payable - returns (Result[] memory returnData); - - function tryBlockAndAggregate(bool requireSuccess, Call[] calldata calls) - external - payable - returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData); -} diff --git a/contract/lib/forge-std/src/test/Script.t.sol b/contract/lib/forge-std/src/test/Script.t.sol deleted file mode 100644 index b26db7f..0000000 --- a/contract/lib/forge-std/src/test/Script.t.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../Test.sol"; - -contract ScriptTest is Test -{ - function testGenerateCorrectAddress() external { - address creation = computeCreateAddress(0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9, 14); - assertEq(creation, 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45); - } - - function testDeriveRememberKey() external { - string memory mnemonic = "test test test test test test test test test test test junk"; - - (address deployer, uint256 privateKey) = deriveRememberKey(mnemonic, 0); - assertEq(deployer, 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266); - assertEq(privateKey, 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80); - } -} \ No newline at end of file diff --git a/contract/lib/forge-std/src/test/StdAssertions.t.sol b/contract/lib/forge-std/src/test/StdAssertions.t.sol deleted file mode 100644 index 3f26f76..0000000 --- a/contract/lib/forge-std/src/test/StdAssertions.t.sol +++ /dev/null @@ -1,602 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../Test.sol"; - -contract StdAssertionsTest is Test -{ - string constant CUSTOM_ERROR = "guh!"; - - bool constant EXPECT_PASS = false; - bool constant EXPECT_FAIL = true; - - TestTest t = new TestTest(); - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertions() public { - assertEqUint(uint32(1), uint32(1)); - assertEqUint(uint64(1), uint64(1)); - assertEqUint(uint96(1), uint96(1)); - assertEqUint(uint128(1), uint128(1)); - } - - /*////////////////////////////////////////////////////////////////////////// - FAIL(STRING) - //////////////////////////////////////////////////////////////////////////*/ - - function testShouldFail() external { - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._fail(CUSTOM_ERROR); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_FALSE - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertFalse_Pass() external { - t._assertFalse(false, EXPECT_PASS); - } - - function testAssertFalse_Fail() external { - vm.expectEmit(false, false, false, true); - emit log("Error: Assertion Failed"); - t._assertFalse(true, EXPECT_FAIL); - } - - function testAssertFalse_Err_Pass() external { - t._assertFalse(false, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertFalse_Err_Fail() external { - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertFalse(true, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(BOOL) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertEq_Bool_Pass(bool a) external { - t._assertEq(a, a, EXPECT_PASS); - } - - function testAssertEq_Bool_Fail(bool a, bool b) external { - vm.assume(a != b); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [bool]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_BoolErr_Pass(bool a) external { - t._assertEq(a, a, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertEq_BoolErr_Fail(bool a, bool b) external { - vm.assume(a != b); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(BYTES) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertEq_Bytes_Pass(bytes calldata a) external { - t._assertEq(a, a, EXPECT_PASS); - } - - function testAssertEq_Bytes_Fail(bytes calldata a, bytes calldata b) external { - vm.assume(keccak256(a) != keccak256(b)); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [bytes]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_BytesErr_Pass(bytes calldata a) external { - t._assertEq(a, a, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertEq_BytesErr_Fail(bytes calldata a, bytes calldata b) external { - vm.assume(keccak256(a) != keccak256(b)); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(ARRAY) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertEq_UintArr_Pass(uint256 e0, uint256 e1, uint256 e2) public { - uint256[] memory a = new uint256[](3); - a[0] = e0; - a[1] = e1; - a[2] = e2; - uint256[] memory b = new uint256[](3); - b[0] = e0; - b[1] = e1; - b[2] = e2; - - t._assertEq(a, b, EXPECT_PASS); - } - - function testAssertEq_IntArr_Pass(int256 e0, int256 e1, int256 e2) public { - int256[] memory a = new int256[](3); - a[0] = e0; - a[1] = e1; - a[2] = e2; - int256[] memory b = new int256[](3); - b[0] = e0; - b[1] = e1; - b[2] = e2; - - t._assertEq(a, b, EXPECT_PASS); - } - - function testAssertEq_AddressArr_Pass(address e0, address e1, address e2) public { - address[] memory a = new address[](3); - a[0] = e0; - a[1] = e1; - a[2] = e2; - address[] memory b = new address[](3); - b[0] = e0; - b[1] = e1; - b[2] = e2; - - t._assertEq(a, b, EXPECT_PASS); - } - - function testAssertEq_UintArr_FailEl(uint256 e1) public { - vm.assume(e1 != 0); - uint256[] memory a = new uint256[](3); - uint256[] memory b = new uint256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_IntArr_FailEl(int256 e1) public { - vm.assume(e1 != 0); - int256[] memory a = new int256[](3); - int256[] memory b = new int256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - - function testAssertEq_AddressArr_FailEl(address e1) public { - vm.assume(e1 != address(0)); - address[] memory a = new address[](3); - address[] memory b = new address[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_UintArrErr_FailEl(uint256 e1) public { - vm.assume(e1 != 0); - uint256[] memory a = new uint256[](3); - uint256[] memory b = new uint256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testAssertEq_IntArrErr_FailEl(int256 e1) public { - vm.assume(e1 != 0); - int256[] memory a = new int256[](3); - int256[] memory b = new int256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - - function testAssertEq_AddressArrErr_FailEl(address e1) public { - vm.assume(e1 != address(0)); - address[] memory a = new address[](3); - address[] memory b = new address[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testAssertEq_UintArr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - uint256[] memory a = new uint256[](lenA); - uint256[] memory b = new uint256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_IntArr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - int256[] memory a = new int256[](lenA); - int256[] memory b = new int256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_AddressArr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - address[] memory a = new address[](lenA); - address[] memory b = new address[](lenB); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_UintArrErr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - uint256[] memory a = new uint256[](lenA); - uint256[] memory b = new uint256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testAssertEq_IntArrErr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - int256[] memory a = new int256[](lenA); - int256[] memory b = new int256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testAssertEq_AddressArrErr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - address[] memory a = new address[](lenA); - address[] memory b = new address[](lenB); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_ABS(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqAbs_Uint_Pass(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_PASS); - } - - function testAssertApproxEqAbs_Uint_Fail(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [uint]"); - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_FAIL); - } - - function testAssertApproxEqAbs_UintErr_Pass(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqAbs_UintErr_Fail(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_ABS(INT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqAbs_Int_Pass(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_PASS); - } - - function testAssertApproxEqAbs_Int_Fail(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [int]"); - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_FAIL); - } - - function testAssertApproxEqAbs_IntErr_Pass(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqAbs_IntErr_Fail(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_REL(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqRel_Uint_Pass(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_PASS); - } - - function testAssertApproxEqRel_Uint_Fail(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [uint]"); - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_FAIL); - } - - function testAssertApproxEqRel_UintErr_Pass(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqRel_UintErr_Fail(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_REL(INT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqRel_Int_Pass(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_PASS); - } - - function testAssertApproxEqRel_Int_Fail(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [int]"); - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_FAIL); - } - - function testAssertApproxEqRel_IntErr_Pass(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqRel_IntErr_Fail(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_FAIL); - } -} - - -contract TestTest is Test -{ - modifier expectFailure(bool expectFail) { - bool preState = vm.load(HEVM_ADDRESS, bytes32("failed")) != bytes32(0x00); - _; - bool postState = vm.load(HEVM_ADDRESS, bytes32("failed")) != bytes32(0x00); - - if (preState == true) { - return; - } - - if (expectFail) { - require(postState == true, "expected failure not triggered"); - - // unwind the expected failure - vm.store(HEVM_ADDRESS, bytes32("failed"), bytes32(uint256(0x00))); - } else { - require(postState == false, "unexpected failure was triggered"); - } - } - - function _fail(string memory err) external expectFailure(true) { - fail(err); - } - - function _assertFalse(bool data, bool expectFail) external expectFailure(expectFail) { - assertFalse(data); - } - - function _assertFalse(bool data, string memory err, bool expectFail) external expectFailure(expectFail) { - assertFalse(data, err); - } - - function _assertEq(bool a, bool b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(bool a, bool b, string memory err, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b, err); - } - - function _assertEq(bytes memory a, bytes memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(bytes memory a, - bytes memory b, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertEq(a, b, err); - } - - function _assertEq(uint256[] memory a, uint256[] memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(int256[] memory a, int256[] memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(address[] memory a, address[] memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(uint256[] memory a, uint256[] memory b, string memory err, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b, err); - } - - function _assertEq(int256[] memory a, int256[] memory b, string memory err, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b, err); - } - - function _assertEq(address[] memory a, address[] memory b, string memory err, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b, err); - } - - - function _assertApproxEqAbs( - uint256 a, - uint256 b, - uint256 maxDelta, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqAbs(a, b, maxDelta); - } - - function _assertApproxEqAbs( - uint256 a, - uint256 b, - uint256 maxDelta, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqAbs(a, b, maxDelta, err); - } - - function _assertApproxEqAbs( - int256 a, - int256 b, - uint256 maxDelta, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqAbs(a, b, maxDelta); - } - - function _assertApproxEqAbs( - int256 a, - int256 b, - uint256 maxDelta, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqAbs(a, b, maxDelta, err); - } - - function _assertApproxEqRel( - uint256 a, - uint256 b, - uint256 maxPercentDelta, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqRel(a, b, maxPercentDelta); - } - - function _assertApproxEqRel( - uint256 a, - uint256 b, - uint256 maxPercentDelta, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqRel(a, b, maxPercentDelta, err); - } - - function _assertApproxEqRel( - int256 a, - int256 b, - uint256 maxPercentDelta, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqRel(a, b, maxPercentDelta); - } - - function _assertApproxEqRel( - int256 a, - int256 b, - uint256 maxPercentDelta, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqRel(a, b, maxPercentDelta, err); - } -} diff --git a/contract/lib/forge-std/src/test/StdCheats.t.sol b/contract/lib/forge-std/src/test/StdCheats.t.sol deleted file mode 100644 index 05e240a..0000000 --- a/contract/lib/forge-std/src/test/StdCheats.t.sol +++ /dev/null @@ -1,282 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../Test.sol"; -import "../StdJson.sol"; - -contract StdCheatsTest is Test { - Bar test; - - using stdJson for string; - - function setUp() public { - test = new Bar(); - } - - function testSkip() public { - vm.warp(100); - skip(25); - assertEq(block.timestamp, 125); - } - - function testRewind() public { - vm.warp(100); - rewind(25); - assertEq(block.timestamp, 75); - } - - function testHoax() public { - hoax(address(1337)); - test.bar{value: 100}(address(1337)); - } - - function testHoaxOrigin() public { - hoax(address(1337), address(1337)); - test.origin{value: 100}(address(1337)); - } - - function testHoaxDifferentAddresses() public { - hoax(address(1337), address(7331)); - test.origin{value: 100}(address(1337), address(7331)); - } - - function testStartHoax() public { - startHoax(address(1337)); - test.bar{value: 100}(address(1337)); - test.bar{value: 100}(address(1337)); - vm.stopPrank(); - test.bar(address(this)); - } - - function testStartHoaxOrigin() public { - startHoax(address(1337), address(1337)); - test.origin{value: 100}(address(1337)); - test.origin{value: 100}(address(1337)); - vm.stopPrank(); - test.bar(address(this)); - } - - function testChangePrank() public { - vm.startPrank(address(1337)); - test.bar(address(1337)); - changePrank(address(0xdead)); - test.bar(address(0xdead)); - changePrank(address(1337)); - test.bar(address(1337)); - vm.stopPrank(); - } - - function testMakeAddrEquivalence() public { - (address addr, ) = makeAddrAndKey("1337"); - assertEq(makeAddr("1337"), addr); - } - - function testMakeAddrSigning() public { - (address addr, uint256 key) = makeAddrAndKey("1337"); - bytes32 hash = keccak256("some_message"); - - (uint8 v, bytes32 r, bytes32 s) = vm.sign(key, hash); - assertEq(ecrecover(hash, v, r, s), addr); - } - - function testDeal() public { - deal(address(this), 1 ether); - assertEq(address(this).balance, 1 ether); - } - - function testDealToken() public { - Bar barToken = new Bar(); - address bar = address(barToken); - deal(bar, address(this), 10000e18); - assertEq(barToken.balanceOf(address(this)), 10000e18); - } - - function testDealTokenAdjustTS() public { - Bar barToken = new Bar(); - address bar = address(barToken); - deal(bar, address(this), 10000e18, true); - assertEq(barToken.balanceOf(address(this)), 10000e18); - assertEq(barToken.totalSupply(), 20000e18); - deal(bar, address(this), 0, true); - assertEq(barToken.balanceOf(address(this)), 0); - assertEq(barToken.totalSupply(), 10000e18); - } - - function testBound() public { - assertEq(bound(5, 0, 4), 0); - assertEq(bound(0, 69, 69), 69); - assertEq(bound(0, 68, 69), 68); - assertEq(bound(10, 150, 190), 160); - assertEq(bound(300, 2800, 3200), 3100); - assertEq(bound(9999, 1337, 6666), 6006); - } - - function testCannotBoundMaxLessThanMin() public { - vm.expectRevert(bytes("Test bound(uint256,uint256,uint256): Max is less than min.")); - bound(5, 100, 10); - } - - function testBound( - uint256 num, - uint256 min, - uint256 max - ) public { - if (min > max) (min, max) = (max, min); - - uint256 bounded = bound(num, min, max); - - assertGe(bounded, min); - assertLe(bounded, max); - } - - function testBoundUint256Max() public { - assertEq(bound(0, type(uint256).max - 1, type(uint256).max), type(uint256).max - 1); - assertEq(bound(1, type(uint256).max - 1, type(uint256).max), type(uint256).max); - } - - function testCannotBoundMaxLessThanMin( - uint256 num, - uint256 min, - uint256 max - ) public { - vm.assume(min > max); - vm.expectRevert(bytes("Test bound(uint256,uint256,uint256): Max is less than min.")); - bound(num, min, max); - } - - function testDeployCode() public { - address deployed = deployCode("StdCheats.t.sol:StdCheatsTest", bytes("")); - assertEq(string(getCode(deployed)), string(getCode(address(this)))); - } - - function testDeployCodeNoArgs() public { - address deployed = deployCode("StdCheats.t.sol:StdCheatsTest"); - assertEq(string(getCode(deployed)), string(getCode(address(this)))); - } - - // We need that payable constructor in order to send ETH on construction - constructor() payable {} - - function testDeployCodeVal() public { - address deployed = deployCode("StdCheats.t.sol:StdCheatsTest", bytes(""), 1 ether); - assertEq(string(getCode(deployed)), string(getCode(address(this)))); - assertEq(deployed.balance, 1 ether); - } - - function testDeployCodeValNoArgs() public { - address deployed = deployCode("StdCheats.t.sol:StdCheatsTest", 1 ether); - assertEq(string(getCode(deployed)), string(getCode(address(this)))); - assertEq(deployed.balance, 1 ether); - } - - // We need this so we can call "this.deployCode" rather than "deployCode" directly - function deployCodeHelper(string memory what) external { - deployCode(what); - } - - function testDeployCodeFail() public { - vm.expectRevert(bytes("Test deployCode(string): Deployment failed.")); - this.deployCodeHelper("StdCheats.t.sol:RevertingContract"); - } - - function getCode(address who) internal view returns (bytes memory o_code) { - /// @solidity memory-safe-assembly - assembly { - // retrieve the size of the code, this needs assembly - let size := extcodesize(who) - // allocate output byte array - this could also be done without assembly - // by using o_code = new bytes(size) - o_code := mload(0x40) - // new "memory end" including padding - mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), not(0x1f)))) - // store length in memory - mstore(o_code, size) - // actually retrieve the code, this needs assembly - extcodecopy(who, add(o_code, 0x20), 0, size) - } - } - - function testBytesToUint() public { - assertEq(3, bytesToUint(hex'03')); - assertEq(2, bytesToUint(hex'02')); - assertEq(255, bytesToUint(hex'ff')); - assertEq(29625, bytesToUint(hex'73b9')); - } - - function testParseJsonTxDetail() public { - string memory root = vm.projectRoot(); - string memory path = string.concat(root, "/src/test/fixtures/broadcast.log.json"); - string memory json = vm.readFile(path); - bytes memory transactionDetails = json.parseRaw(".transactions[0].tx"); - RawTx1559Detail memory rawTxDetail = abi.decode(transactionDetails, (RawTx1559Detail)); - Tx1559Detail memory txDetail = rawToConvertedEIP1559Detail(rawTxDetail); - assertEq(txDetail.from, 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266); - assertEq(txDetail.to, 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512); - assertEq(txDetail.data, hex'23e99187000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000013370000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004'); - assertEq(txDetail.nonce, 3); - assertEq(txDetail.txType, 2); - assertEq(txDetail.gas, 29625); - assertEq(txDetail.value, 0); - } - - function testReadEIP1559Transaction() public { - string memory root = vm.projectRoot(); - string memory path = string.concat(root, "/src/test/fixtures/broadcast.log.json"); - uint256 index = 0; - Tx1559 memory transaction = readTx1559(path, index); - } - - function testReadEIP1559Transactions() public { - string memory root = vm.projectRoot(); - string memory path = string.concat(root, "/src/test/fixtures/broadcast.log.json"); - Tx1559[] memory transactions = readTx1559s(path); - } - - function testReadReceipt() public { - string memory root = vm.projectRoot(); - string memory path = string.concat(root, "/src/test/fixtures/broadcast.log.json"); - uint index = 5; - Receipt memory receipt = readReceipt(path, index); - assertEq(receipt.logsBloom, - hex"00000000000800000000000000000010000000000000000000000000000180000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100"); - } - - function testReadReceipts() public { - string memory root = vm.projectRoot(); - string memory path = string.concat(root, "/src/test/fixtures/broadcast.log.json"); - Receipt[] memory receipts = readReceipts(path); - } - -} - -contract Bar { - constructor() { - /// `DEAL` STDCHEAT - totalSupply = 10000e18; - balanceOf[address(this)] = totalSupply; - } - - /// `HOAX` STDCHEATS - function bar(address expectedSender) public payable { - require(msg.sender == expectedSender, "!prank"); - } - function origin(address expectedSender) public payable { - require(msg.sender == expectedSender, "!prank"); - require(tx.origin == expectedSender, "!prank"); - } - function origin(address expectedSender, address expectedOrigin) public payable { - require(msg.sender == expectedSender, "!prank"); - require(tx.origin == expectedOrigin, "!prank"); - } - - /// `DEAL` STDCHEAT - mapping (address => uint256) public balanceOf; - uint256 public totalSupply; -} - -contract RevertingContract { - constructor() { - revert(); - } -} - diff --git a/contract/lib/forge-std/src/test/StdError.t.sol b/contract/lib/forge-std/src/test/StdError.t.sol deleted file mode 100644 index 0d6601e..0000000 --- a/contract/lib/forge-std/src/test/StdError.t.sol +++ /dev/null @@ -1,124 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.10 <0.9.0; - -import "../Test.sol"; - -contract StdErrorsTest is Test { - ErrorsTest test; - - function setUp() public { - test = new ErrorsTest(); - } - - function testExpectAssertion() public { - vm.expectRevert(stdError.assertionError); - test.assertionError(); - } - - function testExpectArithmetic() public { - vm.expectRevert(stdError.arithmeticError); - test.arithmeticError(10); - } - - function testExpectDiv() public { - vm.expectRevert(stdError.divisionError); - test.divError(0); - } - - function testExpectMod() public { - vm.expectRevert(stdError.divisionError); - test.modError(0); - } - - function testExpectEnum() public { - vm.expectRevert(stdError.enumConversionError); - test.enumConversion(1); - } - - function testExpectEncodeStg() public { - vm.expectRevert(stdError.encodeStorageError); - test.encodeStgError(); - } - - function testExpectPop() public { - vm.expectRevert(stdError.popError); - test.pop(); - } - - function testExpectOOB() public { - vm.expectRevert(stdError.indexOOBError); - test.indexOOBError(1); - } - - function testExpectMem() public { - vm.expectRevert(stdError.memOverflowError); - test.mem(); - } - - function testExpectIntern() public { - vm.expectRevert(stdError.zeroVarError); - test.intern(); - } - - function testExpectLowLvl() public { - vm.expectRevert(stdError.lowLevelError); - test.someArr(0); - } -} - -contract ErrorsTest { - enum T { - T1 - } - - uint256[] public someArr; - bytes someBytes; - - function assertionError() public pure { - assert(false); - } - - function arithmeticError(uint256 a) public pure { - a -= 100; - } - - function divError(uint256 a) public pure { - 100 / a; - } - - function modError(uint256 a) public pure { - 100 % a; - } - - function enumConversion(uint256 a) public pure { - T(a); - } - - function encodeStgError() public { - /// @solidity memory-safe-assembly - assembly { - sstore(someBytes.slot, 1) - } - keccak256(someBytes); - } - - function pop() public { - someArr.pop(); - } - - function indexOOBError(uint256 a) public pure { - uint256[] memory t = new uint256[](0); - t[a]; - } - - function mem() public pure { - uint256 l = 2**256 / 32; - new uint256[](l); - } - - function intern() public returns (uint256) { - function(uint256) internal returns (uint256) x; - x(2); - return 7; - } -} diff --git a/contract/lib/forge-std/src/test/StdMath.t.sol b/contract/lib/forge-std/src/test/StdMath.t.sol deleted file mode 100644 index 9d09b81..0000000 --- a/contract/lib/forge-std/src/test/StdMath.t.sol +++ /dev/null @@ -1,200 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.0 <0.9.0; - -import "../Test.sol"; - -contract StdMathTest is Test -{ - function testGetAbs() external { - assertEq(stdMath.abs(-50), 50); - assertEq(stdMath.abs(50), 50); - assertEq(stdMath.abs(-1337), 1337); - assertEq(stdMath.abs(0), 0); - - assertEq(stdMath.abs(type(int256).min), (type(uint256).max >> 1) + 1); - assertEq(stdMath.abs(type(int256).max), (type(uint256).max >> 1)); - } - - function testGetAbs_Fuzz(int256 a) external { - uint256 manualAbs = getAbs(a); - - uint256 abs = stdMath.abs(a); - - assertEq(abs, manualAbs); - } - - function testGetDelta_Uint() external { - assertEq(stdMath.delta(uint256(0), uint256(0)), 0); - assertEq(stdMath.delta(uint256(0), uint256(1337)), 1337); - assertEq(stdMath.delta(uint256(0), type(uint64).max), type(uint64).max); - assertEq(stdMath.delta(uint256(0), type(uint128).max), type(uint128).max); - assertEq(stdMath.delta(uint256(0), type(uint256).max), type(uint256).max); - - assertEq(stdMath.delta(0, uint256(0)), 0); - assertEq(stdMath.delta(1337, uint256(0)), 1337); - assertEq(stdMath.delta(type(uint64).max, uint256(0)), type(uint64).max); - assertEq(stdMath.delta(type(uint128).max, uint256(0)), type(uint128).max); - assertEq(stdMath.delta(type(uint256).max, uint256(0)), type(uint256).max); - - assertEq(stdMath.delta(1337, uint256(1337)), 0); - assertEq(stdMath.delta(type(uint256).max, type(uint256).max), 0); - assertEq(stdMath.delta(5000, uint256(1250)), 3750); - } - - function testGetDelta_Uint_Fuzz(uint256 a, uint256 b) external { - uint256 manualDelta; - if (a > b) { - manualDelta = a - b; - } else { - manualDelta = b - a; - } - - uint256 delta = stdMath.delta(a, b); - - assertEq(delta, manualDelta); - } - - function testGetDelta_Int() external { - assertEq(stdMath.delta(int256(0), int256(0)), 0); - assertEq(stdMath.delta(int256(0), int256(1337)), 1337); - assertEq(stdMath.delta(int256(0), type(int64).max), type(uint64).max >> 1); - assertEq(stdMath.delta(int256(0), type(int128).max), type(uint128).max >> 1); - assertEq(stdMath.delta(int256(0), type(int256).max), type(uint256).max >> 1); - - assertEq(stdMath.delta(0, int256(0)), 0); - assertEq(stdMath.delta(1337, int256(0)), 1337); - assertEq(stdMath.delta(type(int64).max, int256(0)), type(uint64).max >> 1); - assertEq(stdMath.delta(type(int128).max, int256(0)), type(uint128).max >> 1); - assertEq(stdMath.delta(type(int256).max, int256(0)), type(uint256).max >> 1); - - assertEq(stdMath.delta(-0, int256(0)), 0); - assertEq(stdMath.delta(-1337, int256(0)), 1337); - assertEq(stdMath.delta(type(int64).min, int256(0)), (type(uint64).max >> 1) + 1); - assertEq(stdMath.delta(type(int128).min, int256(0)), (type(uint128).max >> 1) + 1); - assertEq(stdMath.delta(type(int256).min, int256(0)), (type(uint256).max >> 1) + 1); - - assertEq(stdMath.delta(int256(0), -0), 0); - assertEq(stdMath.delta(int256(0), -1337), 1337); - assertEq(stdMath.delta(int256(0), type(int64).min), (type(uint64).max >> 1) + 1); - assertEq(stdMath.delta(int256(0), type(int128).min), (type(uint128).max >> 1) + 1); - assertEq(stdMath.delta(int256(0), type(int256).min), (type(uint256).max >> 1) + 1); - - assertEq(stdMath.delta(1337, int256(1337)), 0); - assertEq(stdMath.delta(type(int256).max, type(int256).max), 0); - assertEq(stdMath.delta(type(int256).min, type(int256).min), 0); - assertEq(stdMath.delta(type(int256).min, type(int256).max), type(uint256).max); - assertEq(stdMath.delta(5000, int256(1250)), 3750); - } - - function testGetDelta_Int_Fuzz(int256 a, int256 b) external { - uint256 absA = getAbs(a); - uint256 absB = getAbs(b); - uint256 absDelta = absA > absB - ? absA - absB - : absB - absA; - - uint256 manualDelta; - if ((a >= 0 && b >= 0) || (a < 0 && b < 0)) { - manualDelta = absDelta; - } - // (a < 0 && b >= 0) || (a >= 0 && b < 0) - else { - manualDelta = absA + absB; - } - - uint256 delta = stdMath.delta(a, b); - - assertEq(delta, manualDelta); - } - - function testGetPercentDelta_Uint() external { - assertEq(stdMath.percentDelta(uint256(0), uint256(1337)), 1e18); - assertEq(stdMath.percentDelta(uint256(0), type(uint64).max), 1e18); - assertEq(stdMath.percentDelta(uint256(0), type(uint128).max), 1e18); - assertEq(stdMath.percentDelta(uint256(0), type(uint192).max), 1e18); - - assertEq(stdMath.percentDelta(1337, uint256(1337)), 0); - assertEq(stdMath.percentDelta(type(uint192).max, type(uint192).max), 0); - assertEq(stdMath.percentDelta(0, uint256(2500)), 1e18); - assertEq(stdMath.percentDelta(2500, uint256(2500)), 0); - assertEq(stdMath.percentDelta(5000, uint256(2500)), 1e18); - assertEq(stdMath.percentDelta(7500, uint256(2500)), 2e18); - - vm.expectRevert(stdError.divisionError); - stdMath.percentDelta(uint256(1), 0); - } - - function testGetPercentDelta_Uint_Fuzz(uint192 a, uint192 b) external { - vm.assume(b != 0); - uint256 manualDelta; - if (a > b) { - manualDelta = a - b; - } else { - manualDelta = b - a; - } - - uint256 manualPercentDelta = manualDelta * 1e18 / b; - uint256 percentDelta = stdMath.percentDelta(a, b); - - assertEq(percentDelta, manualPercentDelta); - } - - function testGetPercentDelta_Int() external { - assertEq(stdMath.percentDelta(int256(0), int256(1337)), 1e18); - assertEq(stdMath.percentDelta(int256(0), -1337), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int64).min), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int128).min), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int192).min), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int64).max), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int128).max), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int192).max), 1e18); - - assertEq(stdMath.percentDelta(1337, int256(1337)), 0); - assertEq(stdMath.percentDelta(type(int192).max, type(int192).max), 0); - assertEq(stdMath.percentDelta(type(int192).min, type(int192).min), 0); - - assertEq(stdMath.percentDelta(type(int192).min, type(int192).max), 2e18); // rounds the 1 wei diff down - assertEq(stdMath.percentDelta(type(int192).max, type(int192).min), 2e18 - 1); // rounds the 1 wei diff down - assertEq(stdMath.percentDelta(0, int256(2500)), 1e18); - assertEq(stdMath.percentDelta(2500, int256(2500)), 0); - assertEq(stdMath.percentDelta(5000, int256(2500)), 1e18); - assertEq(stdMath.percentDelta(7500, int256(2500)), 2e18); - - vm.expectRevert(stdError.divisionError); - stdMath.percentDelta(int256(1), 0); - } - - function testGetPercentDelta_Int_Fuzz(int192 a, int192 b) external { - vm.assume(b != 0); - uint256 absA = getAbs(a); - uint256 absB = getAbs(b); - uint256 absDelta = absA > absB - ? absA - absB - : absB - absA; - - uint256 manualDelta; - if ((a >= 0 && b >= 0) || (a < 0 && b < 0)) { - manualDelta = absDelta; - } - // (a < 0 && b >= 0) || (a >= 0 && b < 0) - else { - manualDelta = absA + absB; - } - - uint256 manualPercentDelta = manualDelta * 1e18 / absB; - uint256 percentDelta = stdMath.percentDelta(a, b); - - assertEq(percentDelta, manualPercentDelta); - } - - /*////////////////////////////////////////////////////////////////////////// - HELPERS - //////////////////////////////////////////////////////////////////////////*/ - - function getAbs(int256 a) private pure returns (uint256) { - if (a < 0) - return a == type(int256).min ? uint256(type(int256).max) + 1 : uint256(-a); - - return uint256(a); - } -} diff --git a/contract/lib/forge-std/src/test/StdStorage.t.sol b/contract/lib/forge-std/src/test/StdStorage.t.sol deleted file mode 100644 index 6e238d0..0000000 --- a/contract/lib/forge-std/src/test/StdStorage.t.sol +++ /dev/null @@ -1,321 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../Test.sol"; - -contract StdStorageTest is Test { - using stdStorage for StdStorage; - - StorageTest test; - - function setUp() public { - test = new StorageTest(); - } - - function testStorageHidden() public { - assertEq(uint256(keccak256("my.random.var")), stdstore.target(address(test)).sig("hidden()").find()); - } - - function testStorageObvious() public { - assertEq(uint256(0), stdstore.target(address(test)).sig("exists()").find()); - } - - function testStorageCheckedWriteHidden() public { - stdstore.target(address(test)).sig(test.hidden.selector).checked_write(100); - assertEq(uint256(test.hidden()), 100); - } - - function testStorageCheckedWriteObvious() public { - stdstore.target(address(test)).sig(test.exists.selector).checked_write(100); - assertEq(test.exists(), 100); - } - - function testStorageMapStructA() public { - uint256 slot = stdstore - .target(address(test)) - .sig(test.map_struct.selector) - .with_key(address(this)) - .depth(0) - .find(); - assertEq(uint256(keccak256(abi.encode(address(this), 4))), slot); - } - - function testStorageMapStructB() public { - uint256 slot = stdstore - .target(address(test)) - .sig(test.map_struct.selector) - .with_key(address(this)) - .depth(1) - .find(); - assertEq(uint256(keccak256(abi.encode(address(this), 4))) + 1, slot); - } - - function testStorageDeepMap() public { - uint256 slot = stdstore - .target(address(test)) - .sig(test.deep_map.selector) - .with_key(address(this)) - .with_key(address(this)) - .find(); - assertEq(uint256(keccak256(abi.encode(address(this), keccak256(abi.encode(address(this), uint(5)))))), slot); - } - - function testStorageCheckedWriteDeepMap() public { - stdstore - .target(address(test)) - .sig(test.deep_map.selector) - .with_key(address(this)) - .with_key(address(this)) - .checked_write(100); - assertEq(100, test.deep_map(address(this), address(this))); - } - - function testStorageDeepMapStructA() public { - uint256 slot = stdstore - .target(address(test)) - .sig(test.deep_map_struct.selector) - .with_key(address(this)) - .with_key(address(this)) - .depth(0) - .find(); - assertEq(bytes32(uint256(keccak256(abi.encode(address(this), keccak256(abi.encode(address(this), uint(6)))))) + 0), bytes32(slot)); - } - - function testStorageDeepMapStructB() public { - uint256 slot = stdstore - .target(address(test)) - .sig(test.deep_map_struct.selector) - .with_key(address(this)) - .with_key(address(this)) - .depth(1) - .find(); - assertEq(bytes32(uint256(keccak256(abi.encode(address(this), keccak256(abi.encode(address(this), uint(6)))))) + 1), bytes32(slot)); - } - - function testStorageCheckedWriteDeepMapStructA() public { - stdstore - .target(address(test)) - .sig(test.deep_map_struct.selector) - .with_key(address(this)) - .with_key(address(this)) - .depth(0) - .checked_write(100); - (uint256 a, uint256 b) = test.deep_map_struct(address(this), address(this)); - assertEq(100, a); - assertEq(0, b); - } - - function testStorageCheckedWriteDeepMapStructB() public { - stdstore - .target(address(test)) - .sig(test.deep_map_struct.selector) - .with_key(address(this)) - .with_key(address(this)) - .depth(1) - .checked_write(100); - (uint256 a, uint256 b) = test.deep_map_struct(address(this), address(this)); - assertEq(0, a); - assertEq(100, b); - } - - function testStorageCheckedWriteMapStructA() public { - stdstore - .target(address(test)) - .sig(test.map_struct.selector) - .with_key(address(this)) - .depth(0) - .checked_write(100); - (uint256 a, uint256 b) = test.map_struct(address(this)); - assertEq(a, 100); - assertEq(b, 0); - } - - function testStorageCheckedWriteMapStructB() public { - stdstore - .target(address(test)) - .sig(test.map_struct.selector) - .with_key(address(this)) - .depth(1) - .checked_write(100); - (uint256 a, uint256 b) = test.map_struct(address(this)); - assertEq(a, 0); - assertEq(b, 100); - } - - function testStorageStructA() public { - uint256 slot = stdstore.target(address(test)).sig(test.basic.selector).depth(0).find(); - assertEq(uint256(7), slot); - } - - function testStorageStructB() public { - uint256 slot = stdstore.target(address(test)).sig(test.basic.selector).depth(1).find(); - assertEq(uint256(7) + 1, slot); - } - - function testStorageCheckedWriteStructA() public { - stdstore.target(address(test)).sig(test.basic.selector).depth(0).checked_write(100); - (uint256 a, uint256 b) = test.basic(); - assertEq(a, 100); - assertEq(b, 1337); - } - - function testStorageCheckedWriteStructB() public { - stdstore.target(address(test)).sig(test.basic.selector).depth(1).checked_write(100); - (uint256 a, uint256 b) = test.basic(); - assertEq(a, 1337); - assertEq(b, 100); - } - - function testStorageMapAddrFound() public { - uint256 slot = stdstore.target(address(test)).sig(test.map_addr.selector).with_key(address(this)).find(); - assertEq(uint256(keccak256(abi.encode(address(this), uint(1)))), slot); - } - - function testStorageMapUintFound() public { - uint256 slot = stdstore.target(address(test)).sig(test.map_uint.selector).with_key(100).find(); - assertEq(uint256(keccak256(abi.encode(100, uint(2)))), slot); - } - - function testStorageCheckedWriteMapUint() public { - stdstore.target(address(test)).sig(test.map_uint.selector).with_key(100).checked_write(100); - assertEq(100, test.map_uint(100)); - } - - function testStorageCheckedWriteMapAddr() public { - stdstore.target(address(test)).sig(test.map_addr.selector).with_key(address(this)).checked_write(100); - assertEq(100, test.map_addr(address(this))); - } - - function testStorageCheckedWriteMapBool() public { - stdstore.target(address(test)).sig(test.map_bool.selector).with_key(address(this)).checked_write(true); - assertTrue(test.map_bool(address(this))); - } - - function testFailStorageCheckedWriteMapPacked() public { - // expect PackedSlot error but not external call so cant expectRevert - stdstore.target(address(test)).sig(test.read_struct_lower.selector).with_key(address(uint160(1337))).checked_write(100); - } - - function testStorageCheckedWriteMapPackedSuccess() public { - uint256 full = test.map_packed(address(1337)); - // keep upper 128, set lower 128 to 1337 - full = (full & (uint256((1 << 128) - 1) << 128)) | 1337; - stdstore.target(address(test)).sig(test.map_packed.selector).with_key(address(uint160(1337))).checked_write(full); - assertEq(1337, test.read_struct_lower(address(1337))); - } - - function testFailStorageConst() public { - // vm.expectRevert(abi.encodeWithSignature("NotStorage(bytes4)", bytes4(keccak256("const()")))); - stdstore.target(address(test)).sig("const()").find(); - } - - function testFailStorageNativePack() public { - stdstore.target(address(test)).sig(test.tA.selector).find(); - stdstore.target(address(test)).sig(test.tB.selector).find(); - - // these both would fail - stdstore.target(address(test)).sig(test.tC.selector).find(); - stdstore.target(address(test)).sig(test.tD.selector).find(); - } - - function testStorageReadBytes32() public { - bytes32 val = stdstore.target(address(test)).sig(test.tE.selector).read_bytes32(); - assertEq(val, hex"1337"); - } - - function testStorageReadBool_False() public { - bool val = stdstore.target(address(test)).sig(test.tB.selector).read_bool(); - assertEq(val, false); - } - - function testStorageReadBool_True() public { - bool val = stdstore.target(address(test)).sig(test.tH.selector).read_bool(); - assertEq(val, true); - } - - function testStorageReadBool_Revert() public { - vm.expectRevert("stdStorage read_bool(StdStorage): Cannot decode. Make sure you are reading a bool."); - this.readNonBoolValue(); - } - - function readNonBoolValue() public { - stdstore.target(address(test)).sig(test.tE.selector).read_bool(); - } - - function testStorageReadAddress() public { - address val = stdstore.target(address(test)).sig(test.tF.selector).read_address(); - assertEq(val, address(1337)); - } - - function testStorageReadUint() public { - uint256 val = stdstore.target(address(test)).sig(test.exists.selector).read_uint(); - assertEq(val, 1); - } - - function testStorageReadInt() public { - int256 val = stdstore.target(address(test)).sig(test.tG.selector).read_int(); - assertEq(val, type(int256).min); - } -} - -contract StorageTest { - uint256 public exists = 1; - mapping(address => uint256) public map_addr; - mapping(uint256 => uint256) public map_uint; - mapping(address => uint256) public map_packed; - mapping(address => UnpackedStruct) public map_struct; - mapping(address => mapping(address => uint256)) public deep_map; - mapping(address => mapping(address => UnpackedStruct)) public deep_map_struct; - UnpackedStruct public basic; - - uint248 public tA; - bool public tB; - - - bool public tC = false; - uint248 public tD = 1; - - - struct UnpackedStruct { - uint256 a; - uint256 b; - } - - mapping(address => bool) public map_bool; - - bytes32 public tE = hex"1337"; - address public tF = address(1337); - int256 public tG = type(int256).min; - bool public tH = true; - - constructor() { - basic = UnpackedStruct({ - a: 1337, - b: 1337 - }); - - uint256 two = (1<<128) | 1; - map_packed[msg.sender] = two; - map_packed[address(bytes20(uint160(1337)))] = 1<<128; - } - - function read_struct_upper(address who) public view returns (uint256) { - return map_packed[who] >> 128; - } - - function read_struct_lower(address who) public view returns (uint256) { - return map_packed[who] & ((1 << 128) - 1); - } - - function hidden() public view returns (bytes32 t) { - bytes32 slot = keccak256("my.random.var"); - /// @solidity memory-safe-assembly - assembly { - t := sload(slot) - } - } - - function const() public pure returns (bytes32 t) { - t = bytes32(hex"1337"); - } -} diff --git a/contract/lib/forge-std/src/test/fixtures/broadcast.log.json b/contract/lib/forge-std/src/test/fixtures/broadcast.log.json deleted file mode 100644 index 0a0200b..0000000 --- a/contract/lib/forge-std/src/test/fixtures/broadcast.log.json +++ /dev/null @@ -1,187 +0,0 @@ -{ - "transactions": [ - { - "hash": "0xc6006863c267735a11476b7f15b15bc718e117e2da114a2be815dd651e1a509f", - "type": "CALL", - "contractName": "Test", - "contractAddress": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "function": "multiple_arguments(uint256,address,uint256[]):(uint256)", - "arguments": ["1", "0000000000000000000000000000000000001337", "[3,4]"], - "tx": { - "type": "0x02", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "gas": "0x73b9", - "value": "0x0", - "data": "0x23e99187000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000013370000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004", - "nonce": "0x3", - "accessList": [] - } - }, - { - "hash": "0xedf2b38d8d896519a947a1acf720f859bb35c0c5ecb8dd7511995b67b9853298", - "type": "CALL", - "contractName": "Test", - "contractAddress": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "function": "inc():(uint256)", - "arguments": [], - "tx": { - "type": "0x02", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "gas": "0xdcb2", - "value": "0x0", - "data": "0x371303c0", - "nonce": "0x4", - "accessList": [] - } - }, - { - "hash": "0xa57e8e3981a6c861442e46c9471bd19cb3e21f9a8a6c63a72e7b5c47c6675a7c", - "type": "CALL", - "contractName": "Test", - "contractAddress": "0x7c6b4bbe207d642d98d5c537142d85209e585087", - "function": "t(uint256):(uint256)", - "arguments": ["1"], - "tx": { - "type": "0x02", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0x7c6b4bbe207d642d98d5c537142d85209e585087", - "gas": "0x8599", - "value": "0x0", - "data": "0xafe29f710000000000000000000000000000000000000000000000000000000000000001", - "nonce": "0x5", - "accessList": [] - } - } - ], - "receipts": [ - { - "transactionHash": "0x481dc86e40bba90403c76f8e144aa9ff04c1da2164299d0298573835f0991181", - "transactionIndex": "0x0", - "blockHash": "0xef0730448490304e5403be0fa8f8ce64f118e9adcca60c07a2ae1ab921d748af", - "blockNumber": "0x1", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": null, - "cumulativeGasUsed": "0x13f3a", - "gasUsed": "0x13f3a", - "contractAddress": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "effectiveGasPrice": "0xee6b2800" - }, - { - "transactionHash": "0x6a187183545b8a9e7f1790e847139379bf5622baff2cb43acf3f5c79470af782", - "transactionIndex": "0x0", - "blockHash": "0xf3acb96a90071640c2a8c067ae4e16aad87e634ea8d8bbbb5b352fba86ba0148", - "blockNumber": "0x2", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": null, - "cumulativeGasUsed": "0x45d80", - "gasUsed": "0x45d80", - "contractAddress": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "effectiveGasPrice": "0xee6b2800" - }, - { - "transactionHash": "0x064ad173b4867bdef2fb60060bbdaf01735fbf10414541ea857772974e74ea9d", - "transactionIndex": "0x0", - "blockHash": "0x8373d02109d3ee06a0225f23da4c161c656ccc48fe0fcee931d325508ae73e58", - "blockNumber": "0x3", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", - "cumulativeGasUsed": "0x45feb", - "gasUsed": "0x45feb", - "contractAddress": null, - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "effectiveGasPrice": "0xee6b2800" - }, - { - "transactionHash": "0xc6006863c267735a11476b7f15b15bc718e117e2da114a2be815dd651e1a509f", - "transactionIndex": "0x0", - "blockHash": "0x16712fae5c0e18f75045f84363fb6b4d9a9fe25e660c4ce286833a533c97f629", - "blockNumber": "0x4", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "cumulativeGasUsed": "0x5905", - "gasUsed": "0x5905", - "contractAddress": null, - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "effectiveGasPrice": "0xee6b2800" - }, - { - "transactionHash": "0xedf2b38d8d896519a947a1acf720f859bb35c0c5ecb8dd7511995b67b9853298", - "transactionIndex": "0x0", - "blockHash": "0x156b88c3eb9a1244ba00a1834f3f70de735b39e3e59006dd03af4fe7d5480c11", - "blockNumber": "0x5", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "cumulativeGasUsed": "0xa9c4", - "gasUsed": "0xa9c4", - "contractAddress": null, - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "effectiveGasPrice": "0xee6b2800" - }, - { - "transactionHash": "0xa57e8e3981a6c861442e46c9471bd19cb3e21f9a8a6c63a72e7b5c47c6675a7c", - "transactionIndex": "0x0", - "blockHash": "0xcf61faca67dbb2c28952b0b8a379e53b1505ae0821e84779679390cb8571cadb", - "blockNumber": "0x6", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0x7c6b4bbe207d642d98d5c537142d85209e585087", - "cumulativeGasUsed": "0x66c5", - "gasUsed": "0x66c5", - "contractAddress": null, - "logs": [ - { - "address": "0x7c6b4bbe207d642d98d5c537142d85209e585087", - "topics": [ - "0x0b2e13ff20ac7b474198655583edf70dedd2c1dc980e329c4fbb2fc0748b796b" - ], - "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000046865726500000000000000000000000000000000000000000000000000000000", - "blockHash": "0xcf61faca67dbb2c28952b0b8a379e53b1505ae0821e84779679390cb8571cadb", - "blockNumber": "0x6", - "transactionHash": "0xa57e8e3981a6c861442e46c9471bd19cb3e21f9a8a6c63a72e7b5c47c6675a7c", - "transactionIndex": "0x1", - "logIndex": "0x0", - "transactionLogIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000800000000000000000010000000000000000000000000000180000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100", - "effectiveGasPrice": "0xee6b2800" - }, - { - "transactionHash": "0x11fbb10230c168ca1e36a7e5c69a6dbcd04fd9e64ede39d10a83e36ee8065c16", - "transactionIndex": "0x0", - "blockHash": "0xf1e0ed2eda4e923626ec74621006ed50b3fc27580dc7b4cf68a07ca77420e29c", - "blockNumber": "0x7", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0x0000000000000000000000000000000000001337", - "cumulativeGasUsed": "0x5208", - "gasUsed": "0x5208", - "contractAddress": null, - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "effectiveGasPrice": "0xee6b2800" - } - ], - "libraries": [ - "src/Broadcast.t.sol:F:0x5fbdb2315678afecb367f032d93f642f64180aa3" - ], - "pending": [], - "path": "broadcast/Broadcast.t.sol/31337/run-latest.json", - "returns": {}, - "timestamp": 1655140035 -} diff --git a/contract/lib/forge-std/test/StdAssertions.t.sol b/contract/lib/forge-std/test/StdAssertions.t.sol deleted file mode 100644 index 2922780..0000000 --- a/contract/lib/forge-std/test/StdAssertions.t.sol +++ /dev/null @@ -1,954 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../src/Test.sol"; - -contract StdAssertionsTest is Test { - string constant CUSTOM_ERROR = "guh!"; - - bool constant EXPECT_PASS = false; - bool constant EXPECT_FAIL = true; - - bool constant SHOULD_REVERT = true; - bool constant SHOULD_RETURN = false; - - bool constant STRICT_REVERT_DATA = true; - bool constant NON_STRICT_REVERT_DATA = false; - - TestTest t = new TestTest(); - - /*////////////////////////////////////////////////////////////////////////// - FAIL(STRING) - //////////////////////////////////////////////////////////////////////////*/ - - function testShouldFail() external { - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._fail(CUSTOM_ERROR); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_FALSE - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertFalse_Pass() external { - t._assertFalse(false, EXPECT_PASS); - } - - function testAssertFalse_Fail() external { - vm.expectEmit(false, false, false, true); - emit log("Error: Assertion Failed"); - t._assertFalse(true, EXPECT_FAIL); - } - - function testAssertFalse_Err_Pass() external { - t._assertFalse(false, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertFalse_Err_Fail() external { - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertFalse(true, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(BOOL) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertEq_Bool_Pass(bool a) external { - t._assertEq(a, a, EXPECT_PASS); - } - - function testAssertEq_Bool_Fail(bool a, bool b) external { - vm.assume(a != b); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [bool]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_BoolErr_Pass(bool a) external { - t._assertEq(a, a, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertEq_BoolErr_Fail(bool a, bool b) external { - vm.assume(a != b); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(BYTES) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertEq_Bytes_Pass(bytes calldata a) external { - t._assertEq(a, a, EXPECT_PASS); - } - - function testAssertEq_Bytes_Fail(bytes calldata a, bytes calldata b) external { - vm.assume(keccak256(a) != keccak256(b)); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [bytes]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_BytesErr_Pass(bytes calldata a) external { - t._assertEq(a, a, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertEq_BytesErr_Fail(bytes calldata a, bytes calldata b) external { - vm.assume(keccak256(a) != keccak256(b)); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(ARRAY) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertEq_UintArr_Pass(uint256 e0, uint256 e1, uint256 e2) public { - uint256[] memory a = new uint256[](3); - a[0] = e0; - a[1] = e1; - a[2] = e2; - uint256[] memory b = new uint256[](3); - b[0] = e0; - b[1] = e1; - b[2] = e2; - - t._assertEq(a, b, EXPECT_PASS); - } - - function testAssertEq_IntArr_Pass(int256 e0, int256 e1, int256 e2) public { - int256[] memory a = new int256[](3); - a[0] = e0; - a[1] = e1; - a[2] = e2; - int256[] memory b = new int256[](3); - b[0] = e0; - b[1] = e1; - b[2] = e2; - - t._assertEq(a, b, EXPECT_PASS); - } - - function testAssertEq_AddressArr_Pass(address e0, address e1, address e2) public { - address[] memory a = new address[](3); - a[0] = e0; - a[1] = e1; - a[2] = e2; - address[] memory b = new address[](3); - b[0] = e0; - b[1] = e1; - b[2] = e2; - - t._assertEq(a, b, EXPECT_PASS); - } - - function testAssertEq_UintArr_FailEl(uint256 e1) public { - vm.assume(e1 != 0); - uint256[] memory a = new uint256[](3); - uint256[] memory b = new uint256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_IntArr_FailEl(int256 e1) public { - vm.assume(e1 != 0); - int256[] memory a = new int256[](3); - int256[] memory b = new int256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_AddressArr_FailEl(address e1) public { - vm.assume(e1 != address(0)); - address[] memory a = new address[](3); - address[] memory b = new address[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_UintArrErr_FailEl(uint256 e1) public { - vm.assume(e1 != 0); - uint256[] memory a = new uint256[](3); - uint256[] memory b = new uint256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testAssertEq_IntArrErr_FailEl(int256 e1) public { - vm.assume(e1 != 0); - int256[] memory a = new int256[](3); - int256[] memory b = new int256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testAssertEq_AddressArrErr_FailEl(address e1) public { - vm.assume(e1 != address(0)); - address[] memory a = new address[](3); - address[] memory b = new address[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testAssertEq_UintArr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - uint256[] memory a = new uint256[](lenA); - uint256[] memory b = new uint256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_IntArr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - int256[] memory a = new int256[](lenA); - int256[] memory b = new int256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_AddressArr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - address[] memory a = new address[](lenA); - address[] memory b = new address[](lenB); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_UintArrErr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - uint256[] memory a = new uint256[](lenA); - uint256[] memory b = new uint256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testAssertEq_IntArrErr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - int256[] memory a = new int256[](lenA); - int256[] memory b = new int256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testAssertEq_AddressArrErr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - address[] memory a = new address[](lenA); - address[] memory b = new address[](lenB); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertEqUint() public { - assertEqUint(uint8(1), uint128(1)); - assertEqUint(uint64(2), uint64(2)); - } - - function testFailAssertEqUint() public { - assertEqUint(uint64(1), uint96(2)); - assertEqUint(uint160(3), uint160(4)); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_ABS(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqAbs_Uint_Pass(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_PASS); - } - - function testAssertApproxEqAbs_Uint_Fail(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [uint]"); - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_FAIL); - } - - function testAssertApproxEqAbs_UintErr_Pass(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqAbs_UintErr_Fail(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_ABS_DECIMAL(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqAbsDecimal_Uint_Pass(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, EXPECT_PASS); - } - - function testAssertApproxEqAbsDecimal_Uint_Fail(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [uint]"); - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, EXPECT_FAIL); - } - - function testAssertApproxEqAbsDecimal_UintErr_Pass(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqAbsDecimal_UintErr_Fail(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_ABS(INT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqAbs_Int_Pass(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_PASS); - } - - function testAssertApproxEqAbs_Int_Fail(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [int]"); - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_FAIL); - } - - function testAssertApproxEqAbs_IntErr_Pass(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqAbs_IntErr_Fail(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_ABS_DECIMAL(INT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqAbsDecimal_Int_Pass(int256 a, int256 b, uint256 maxDelta, uint256 decimals) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, EXPECT_PASS); - } - - function testAssertApproxEqAbsDecimal_Int_Fail(int256 a, int256 b, uint256 maxDelta, uint256 decimals) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [int]"); - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, EXPECT_FAIL); - } - - function testAssertApproxEqAbsDecimal_IntErr_Pass(int256 a, int256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqAbsDecimal_IntErr_Fail(int256 a, int256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_REL(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqRel_Uint_Pass(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_PASS); - } - - function testAssertApproxEqRel_Uint_Fail(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [uint]"); - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_FAIL); - } - - function testAssertApproxEqRel_UintErr_Pass(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqRel_UintErr_Fail(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_REL_DECIMAL(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqRelDecimal_Uint_Pass(uint256 a, uint256 b, uint256 maxPercentDelta, uint256 decimals) - external - { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, EXPECT_PASS); - } - - function testAssertApproxEqRelDecimal_Uint_Fail(uint256 a, uint256 b, uint256 maxPercentDelta, uint256 decimals) - external - { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [uint]"); - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, EXPECT_FAIL); - } - - function testAssertApproxEqRelDecimal_UintErr_Pass(uint256 a, uint256 b, uint256 maxPercentDelta, uint256 decimals) - external - { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqRelDecimal_UintErr_Fail(uint256 a, uint256 b, uint256 maxPercentDelta, uint256 decimals) - external - { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_REL(INT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqRel_Int_Pass(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_PASS); - } - - function testAssertApproxEqRel_Int_Fail(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [int]"); - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_FAIL); - } - - function testAssertApproxEqRel_IntErr_Pass(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqRel_IntErr_Fail(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_REL_DECIMAL(INT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqRelDecimal_Int_Pass(int128 a, int128 b, uint128 maxPercentDelta, uint128 decimals) - external - { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, EXPECT_PASS); - } - - function testAssertApproxEqRelDecimal_Int_Fail(int128 a, int128 b, uint128 maxPercentDelta, uint128 decimals) - external - { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [int]"); - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, EXPECT_FAIL); - } - - function testAssertApproxEqRelDecimal_IntErr_Pass(int128 a, int128 b, uint128 maxPercentDelta, uint128 decimals) - external - { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqRelDecimal_IntErr_Fail(int128 a, int128 b, uint128 maxPercentDelta, uint128 decimals) - external - { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ_CALL - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertEqCall_Return_Pass( - bytes memory callDataA, - bytes memory callDataB, - bytes memory returnData, - bool strictRevertData - ) external { - address targetA = address(new TestMockCall(returnData, SHOULD_RETURN)); - address targetB = address(new TestMockCall(returnData, SHOULD_RETURN)); - - t._assertEqCall(targetA, targetB, callDataA, callDataB, returnData, returnData, strictRevertData, EXPECT_PASS); - } - - function testAssertEqCall_Return_Fail( - bytes memory callDataA, - bytes memory callDataB, - bytes memory returnDataA, - bytes memory returnDataB, - bool strictRevertData - ) external { - vm.assume(keccak256(returnDataA) != keccak256(returnDataB)); - - address targetA = address(new TestMockCall(returnDataA, SHOULD_RETURN)); - address targetB = address(new TestMockCall(returnDataB, SHOULD_RETURN)); - - vm.expectEmit(true, true, true, true); - emit log_named_string("Error", "Call return data does not match"); - t._assertEqCall(targetA, targetB, callDataA, callDataB, returnDataA, returnDataB, strictRevertData, EXPECT_FAIL); - } - - function testAssertEqCall_Revert_Pass( - bytes memory callDataA, - bytes memory callDataB, - bytes memory revertDataA, - bytes memory revertDataB - ) external { - address targetA = address(new TestMockCall(revertDataA, SHOULD_REVERT)); - address targetB = address(new TestMockCall(revertDataB, SHOULD_REVERT)); - - t._assertEqCall( - targetA, targetB, callDataA, callDataB, revertDataA, revertDataB, NON_STRICT_REVERT_DATA, EXPECT_PASS - ); - } - - function testAssertEqCall_Revert_Fail( - bytes memory callDataA, - bytes memory callDataB, - bytes memory revertDataA, - bytes memory revertDataB - ) external { - vm.assume(keccak256(revertDataA) != keccak256(revertDataB)); - - address targetA = address(new TestMockCall(revertDataA, SHOULD_REVERT)); - address targetB = address(new TestMockCall(revertDataB, SHOULD_REVERT)); - - vm.expectEmit(true, true, true, true); - emit log_named_string("Error", "Call revert data does not match"); - t._assertEqCall( - targetA, targetB, callDataA, callDataB, revertDataA, revertDataB, STRICT_REVERT_DATA, EXPECT_FAIL - ); - } - - function testAssertEqCall_Fail( - bytes memory callDataA, - bytes memory callDataB, - bytes memory returnDataA, - bytes memory returnDataB, - bool strictRevertData - ) external { - address targetA = address(new TestMockCall(returnDataA, SHOULD_RETURN)); - address targetB = address(new TestMockCall(returnDataB, SHOULD_REVERT)); - - vm.expectEmit(true, true, true, true); - emit log_named_bytes(" Left call return data", returnDataA); - vm.expectEmit(true, true, true, true); - emit log_named_bytes(" Right call revert data", returnDataB); - t._assertEqCall(targetA, targetB, callDataA, callDataB, returnDataA, returnDataB, strictRevertData, EXPECT_FAIL); - - vm.expectEmit(true, true, true, true); - emit log_named_bytes(" Left call revert data", returnDataB); - vm.expectEmit(true, true, true, true); - emit log_named_bytes(" Right call return data", returnDataA); - t._assertEqCall(targetB, targetA, callDataB, callDataA, returnDataB, returnDataA, strictRevertData, EXPECT_FAIL); - } -} - -contract TestTest is Test { - modifier expectFailure(bool expectFail) { - bool preState = vm.load(HEVM_ADDRESS, bytes32("failed")) != bytes32(0x00); - _; - bool postState = vm.load(HEVM_ADDRESS, bytes32("failed")) != bytes32(0x00); - - if (preState == true) { - return; - } - - if (expectFail) { - require(postState == true, "expected failure not triggered"); - - // unwind the expected failure - vm.store(HEVM_ADDRESS, bytes32("failed"), bytes32(uint256(0x00))); - } else { - require(postState == false, "unexpected failure was triggered"); - } - } - - function _fail(string memory err) external expectFailure(true) { - fail(err); - } - - function _assertFalse(bool data, bool expectFail) external expectFailure(expectFail) { - assertFalse(data); - } - - function _assertFalse(bool data, string memory err, bool expectFail) external expectFailure(expectFail) { - assertFalse(data, err); - } - - function _assertEq(bool a, bool b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(bool a, bool b, string memory err, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b, err); - } - - function _assertEq(bytes memory a, bytes memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(bytes memory a, bytes memory b, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertEq(a, b, err); - } - - function _assertEq(uint256[] memory a, uint256[] memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(int256[] memory a, int256[] memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(address[] memory a, address[] memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(uint256[] memory a, uint256[] memory b, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertEq(a, b, err); - } - - function _assertEq(int256[] memory a, int256[] memory b, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertEq(a, b, err); - } - - function _assertEq(address[] memory a, address[] memory b, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertEq(a, b, err); - } - - function _assertApproxEqAbs(uint256 a, uint256 b, uint256 maxDelta, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqAbs(a, b, maxDelta); - } - - function _assertApproxEqAbs(uint256 a, uint256 b, uint256 maxDelta, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqAbs(a, b, maxDelta, err); - } - - function _assertApproxEqAbsDecimal(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqAbsDecimal(a, b, maxDelta, decimals); - } - - function _assertApproxEqAbsDecimal( - uint256 a, - uint256 b, - uint256 maxDelta, - uint256 decimals, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqAbsDecimal(a, b, maxDelta, decimals, err); - } - - function _assertApproxEqAbs(int256 a, int256 b, uint256 maxDelta, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqAbs(a, b, maxDelta); - } - - function _assertApproxEqAbs(int256 a, int256 b, uint256 maxDelta, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqAbs(a, b, maxDelta, err); - } - - function _assertApproxEqAbsDecimal(int256 a, int256 b, uint256 maxDelta, uint256 decimals, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqAbsDecimal(a, b, maxDelta, decimals); - } - - function _assertApproxEqAbsDecimal( - int256 a, - int256 b, - uint256 maxDelta, - uint256 decimals, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqAbsDecimal(a, b, maxDelta, decimals, err); - } - - function _assertApproxEqRel(uint256 a, uint256 b, uint256 maxPercentDelta, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqRel(a, b, maxPercentDelta); - } - - function _assertApproxEqRel(uint256 a, uint256 b, uint256 maxPercentDelta, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqRel(a, b, maxPercentDelta, err); - } - - function _assertApproxEqRelDecimal(uint256 a, uint256 b, uint256 maxPercentDelta, uint256 decimals, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals); - } - - function _assertApproxEqRelDecimal( - uint256 a, - uint256 b, - uint256 maxPercentDelta, - uint256 decimals, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, err); - } - - function _assertApproxEqRel(int256 a, int256 b, uint256 maxPercentDelta, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqRel(a, b, maxPercentDelta); - } - - function _assertApproxEqRel(int256 a, int256 b, uint256 maxPercentDelta, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqRel(a, b, maxPercentDelta, err); - } - - function _assertApproxEqRelDecimal(int256 a, int256 b, uint256 maxPercentDelta, uint256 decimals, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals); - } - - function _assertApproxEqRelDecimal( - int256 a, - int256 b, - uint256 maxPercentDelta, - uint256 decimals, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, err); - } - - function _assertEqCall( - address targetA, - address targetB, - bytes memory callDataA, - bytes memory callDataB, - bytes memory returnDataA, - bytes memory returnDataB, - bool strictRevertData, - bool expectFail - ) external expectFailure(expectFail) { - assertEqCall(targetA, callDataA, targetB, callDataB, strictRevertData); - } -} - -contract TestMockCall { - bytes returnData; - bool shouldRevert; - - constructor(bytes memory returnData_, bool shouldRevert_) { - returnData = returnData_; - shouldRevert = shouldRevert_; - } - - fallback() external payable { - bytes memory returnData_ = returnData; - - if (shouldRevert) { - assembly { - revert(add(returnData_, 0x20), mload(returnData_)) - } - } else { - assembly { - return(add(returnData_, 0x20), mload(returnData_)) - } - } - } -} diff --git a/contract/lib/forge-std/test/StdChains.t.sol b/contract/lib/forge-std/test/StdChains.t.sol deleted file mode 100644 index c2b215d..0000000 --- a/contract/lib/forge-std/test/StdChains.t.sol +++ /dev/null @@ -1,160 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../src/Test.sol"; - -contract StdChainsTest is Test { - function testChainRpcInitialization() public { - // RPCs specified in `foundry.toml` should be updated. - assertEq(getChain(1).rpcUrl, "https://mainnet.infura.io/v3/16a8be88795540b9b3903d8de0f7baa5"); - assertEq(getChain("optimism_goerli").rpcUrl, "https://goerli.optimism.io/"); - assertEq(getChain("arbitrum_one_goerli").rpcUrl, "https://goerli-rollup.arbitrum.io/rpc/"); - - // Environment variables should be the next fallback - assertEq(getChain("arbitrum_nova").rpcUrl, "https://nova.arbitrum.io/rpc"); - vm.setEnv("ARBITRUM_NOVA_RPC_URL", "myoverride"); - assertEq(getChain("arbitrum_nova").rpcUrl, "myoverride"); - vm.setEnv("ARBITRUM_NOVA_RPC_URL", "https://nova.arbitrum.io/rpc"); - - // Cannot override RPCs defined in `foundry.toml` - vm.setEnv("MAINNET_RPC_URL", "myoverride2"); - assertEq(getChain("mainnet").rpcUrl, "https://mainnet.infura.io/v3/16a8be88795540b9b3903d8de0f7baa5"); - - // Other RPCs should remain unchanged. - assertEq(getChain(31337).rpcUrl, "http://127.0.0.1:8545"); - assertEq(getChain("sepolia").rpcUrl, "https://sepolia.infura.io/v3/f4a0bdad42674adab5fc0ac077ffab2b"); - } - - function testRpc(string memory rpcAlias) internal { - string memory rpcUrl = getChain(rpcAlias).rpcUrl; - vm.createSelectFork(rpcUrl); - } - - // Ensure we can connect to the default RPC URL for each chain. - function testRpcs() public { - testRpc("mainnet"); - testRpc("goerli"); - testRpc("sepolia"); - testRpc("optimism"); - testRpc("optimism_goerli"); - testRpc("arbitrum_one"); - testRpc("arbitrum_one_goerli"); - testRpc("arbitrum_nova"); - testRpc("polygon"); - testRpc("polygon_mumbai"); - testRpc("avalanche"); - testRpc("avalanche_fuji"); - testRpc("bnb_smart_chain"); - testRpc("bnb_smart_chain_testnet"); - testRpc("gnosis_chain"); - } - - function testChainNoDefault() public { - vm.expectRevert("StdChains getChain(string): Chain with alias \"does_not_exist\" not found."); - getChain("does_not_exist"); - } - - function testSetChainFirstFails() public { - vm.expectRevert("StdChains setChain(string,ChainData): Chain ID 31337 already used by \"anvil\"."); - setChain("anvil2", ChainData("Anvil", 31337, "URL")); - } - - function testChainBubbleUp() public { - setChain("needs_undefined_env_var", ChainData("", 123456789, "")); - vm.expectRevert( - "Failed to resolve env var `UNDEFINED_RPC_URL_PLACEHOLDER` in `${UNDEFINED_RPC_URL_PLACEHOLDER}`: environment variable not found" - ); - getChain("needs_undefined_env_var"); - } - - function testCannotSetChain_ChainIdExists() public { - setChain("custom_chain", ChainData("Custom Chain", 123456789, "https://custom.chain/")); - - vm.expectRevert('StdChains setChain(string,ChainData): Chain ID 123456789 already used by "custom_chain".'); - - setChain("another_custom_chain", ChainData("", 123456789, "")); - } - - function testSetChain() public { - setChain("custom_chain", ChainData("Custom Chain", 123456789, "https://custom.chain/")); - Chain memory customChain = getChain("custom_chain"); - assertEq(customChain.name, "Custom Chain"); - assertEq(customChain.chainId, 123456789); - assertEq(customChain.chainAlias, "custom_chain"); - assertEq(customChain.rpcUrl, "https://custom.chain/"); - Chain memory chainById = getChain(123456789); - assertEq(chainById.name, customChain.name); - assertEq(chainById.chainId, customChain.chainId); - assertEq(chainById.chainAlias, customChain.chainAlias); - assertEq(chainById.rpcUrl, customChain.rpcUrl); - customChain.name = "Another Custom Chain"; - customChain.chainId = 987654321; - setChain("another_custom_chain", customChain); - Chain memory anotherCustomChain = getChain("another_custom_chain"); - assertEq(anotherCustomChain.name, "Another Custom Chain"); - assertEq(anotherCustomChain.chainId, 987654321); - assertEq(anotherCustomChain.chainAlias, "another_custom_chain"); - assertEq(anotherCustomChain.rpcUrl, "https://custom.chain/"); - // Verify the first chain data was not overwritten - chainById = getChain(123456789); - assertEq(chainById.name, "Custom Chain"); - assertEq(chainById.chainId, 123456789); - } - - function testSetNoEmptyAlias() public { - vm.expectRevert("StdChains setChain(string,ChainData): Chain alias cannot be the empty string."); - setChain("", ChainData("", 123456789, "")); - } - - function testSetNoChainId0() public { - vm.expectRevert("StdChains setChain(string,ChainData): Chain ID cannot be 0."); - setChain("alias", ChainData("", 0, "")); - } - - function testGetNoChainId0() public { - vm.expectRevert("StdChains getChain(uint256): Chain ID cannot be 0."); - getChain(0); - } - - function testGetNoEmptyAlias() public { - vm.expectRevert("StdChains getChain(string): Chain alias cannot be the empty string."); - getChain(""); - } - - function testChainIdNotFound() public { - vm.expectRevert("StdChains getChain(string): Chain with alias \"no_such_alias\" not found."); - getChain("no_such_alias"); - } - - function testChainAliasNotFound() public { - vm.expectRevert("StdChains getChain(uint256): Chain with ID 321 not found."); - getChain(321); - } - - function testSetChain_ExistingOne() public { - setChain("custom_chain", ChainData("Custom Chain", 123456789, "https://custom.chain/")); - assertEq(getChain(123456789).chainId, 123456789); - - setChain("custom_chain", ChainData("Modified Chain", 999999999, "https://modified.chain/")); - vm.expectRevert("StdChains getChain(uint256): Chain with ID 123456789 not found."); - getChain(123456789); - - Chain memory modifiedChain = getChain(999999999); - assertEq(modifiedChain.name, "Modified Chain"); - assertEq(modifiedChain.chainId, 999999999); - assertEq(modifiedChain.rpcUrl, "https://modified.chain/"); - } - - function testDontUseDefaultRpcUrl() public { - // Should error if default RPCs flag is set to false. - setFallbackToDefaultRpcUrls(false); - vm.expectRevert( - "Failed to get environment variable `ANVIL_RPC_URL` as type `string`: environment variable not found" - ); - getChain(31337); - vm.expectRevert( - "Failed to get environment variable `SEPOLIA_RPC_URL` as type `string`: environment variable not found" - ); - getChain("sepolia"); - } -} diff --git a/contract/lib/forge-std/test/StdCheats.t.sol b/contract/lib/forge-std/test/StdCheats.t.sol deleted file mode 100644 index 18b6ae7..0000000 --- a/contract/lib/forge-std/test/StdCheats.t.sol +++ /dev/null @@ -1,411 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../src/StdCheats.sol"; -import "../src/Test.sol"; -import "../src/StdJson.sol"; - -contract StdCheatsTest is Test { - Bar test; - - using stdJson for string; - - function setUp() public { - test = new Bar(); - } - - function testSkip() public { - vm.warp(100); - skip(25); - assertEq(block.timestamp, 125); - } - - function testRewind() public { - vm.warp(100); - rewind(25); - assertEq(block.timestamp, 75); - } - - function testHoax() public { - hoax(address(1337)); - test.bar{value: 100}(address(1337)); - } - - function testHoaxOrigin() public { - hoax(address(1337), address(1337)); - test.origin{value: 100}(address(1337)); - } - - function testHoaxDifferentAddresses() public { - hoax(address(1337), address(7331)); - test.origin{value: 100}(address(1337), address(7331)); - } - - function testStartHoax() public { - startHoax(address(1337)); - test.bar{value: 100}(address(1337)); - test.bar{value: 100}(address(1337)); - vm.stopPrank(); - test.bar(address(this)); - } - - function testStartHoaxOrigin() public { - startHoax(address(1337), address(1337)); - test.origin{value: 100}(address(1337)); - test.origin{value: 100}(address(1337)); - vm.stopPrank(); - test.bar(address(this)); - } - - function testChangePrankMsgSender() public { - vm.startPrank(address(1337)); - test.bar(address(1337)); - changePrank(address(0xdead)); - test.bar(address(0xdead)); - changePrank(address(1337)); - test.bar(address(1337)); - vm.stopPrank(); - } - - function testChangePrankMsgSenderAndTxOrigin() public { - vm.startPrank(address(1337), address(1338)); - test.origin(address(1337), address(1338)); - changePrank(address(0xdead), address(0xbeef)); - test.origin(address(0xdead), address(0xbeef)); - changePrank(address(1337), address(1338)); - test.origin(address(1337), address(1338)); - vm.stopPrank(); - } - - function testMakeAddrEquivalence() public { - (address addr,) = makeAddrAndKey("1337"); - assertEq(makeAddr("1337"), addr); - } - - function testMakeAddrSigning() public { - (address addr, uint256 key) = makeAddrAndKey("1337"); - bytes32 hash = keccak256("some_message"); - - (uint8 v, bytes32 r, bytes32 s) = vm.sign(key, hash); - assertEq(ecrecover(hash, v, r, s), addr); - } - - function testDeal() public { - deal(address(this), 1 ether); - assertEq(address(this).balance, 1 ether); - } - - function testDealToken() public { - Bar barToken = new Bar(); - address bar = address(barToken); - deal(bar, address(this), 10000e18); - assertEq(barToken.balanceOf(address(this)), 10000e18); - } - - function testDealTokenAdjustTotalSupply() public { - Bar barToken = new Bar(); - address bar = address(barToken); - deal(bar, address(this), 10000e18, true); - assertEq(barToken.balanceOf(address(this)), 10000e18); - assertEq(barToken.totalSupply(), 20000e18); - deal(bar, address(this), 0, true); - assertEq(barToken.balanceOf(address(this)), 0); - assertEq(barToken.totalSupply(), 10000e18); - } - - function testDealERC1155Token() public { - BarERC1155 barToken = new BarERC1155(); - address bar = address(barToken); - dealERC1155(bar, address(this), 0, 10000e18, false); - assertEq(barToken.balanceOf(address(this), 0), 10000e18); - } - - function testDealERC1155TokenAdjustTotalSupply() public { - BarERC1155 barToken = new BarERC1155(); - address bar = address(barToken); - dealERC1155(bar, address(this), 0, 10000e18, true); - assertEq(barToken.balanceOf(address(this), 0), 10000e18); - assertEq(barToken.totalSupply(0), 20000e18); - dealERC1155(bar, address(this), 0, 0, true); - assertEq(barToken.balanceOf(address(this), 0), 0); - assertEq(barToken.totalSupply(0), 10000e18); - } - - function testDealERC721Token() public { - BarERC721 barToken = new BarERC721(); - address bar = address(barToken); - dealERC721(bar, address(2), 1); - assertEq(barToken.balanceOf(address(2)), 1); - assertEq(barToken.balanceOf(address(1)), 0); - dealERC721(bar, address(1), 2); - assertEq(barToken.balanceOf(address(1)), 1); - assertEq(barToken.balanceOf(bar), 1); - } - - function testDeployCode() public { - address deployed = deployCode("StdCheats.t.sol:Bar", bytes("")); - assertEq(string(getCode(deployed)), string(getCode(address(test)))); - } - - function testDeployCodeNoArgs() public { - address deployed = deployCode("StdCheats.t.sol:Bar"); - assertEq(string(getCode(deployed)), string(getCode(address(test)))); - } - - function testDeployCodeVal() public { - address deployed = deployCode("StdCheats.t.sol:Bar", bytes(""), 1 ether); - assertEq(string(getCode(deployed)), string(getCode(address(test)))); - assertEq(deployed.balance, 1 ether); - } - - function testDeployCodeValNoArgs() public { - address deployed = deployCode("StdCheats.t.sol:Bar", 1 ether); - assertEq(string(getCode(deployed)), string(getCode(address(test)))); - assertEq(deployed.balance, 1 ether); - } - - // We need this so we can call "this.deployCode" rather than "deployCode" directly - function deployCodeHelper(string memory what) external { - deployCode(what); - } - - function testDeployCodeFail() public { - vm.expectRevert(bytes("StdCheats deployCode(string): Deployment failed.")); - this.deployCodeHelper("StdCheats.t.sol:RevertingContract"); - } - - function getCode(address who) internal view returns (bytes memory o_code) { - /// @solidity memory-safe-assembly - assembly { - // retrieve the size of the code, this needs assembly - let size := extcodesize(who) - // allocate output byte array - this could also be done without assembly - // by using o_code = new bytes(size) - o_code := mload(0x40) - // new "memory end" including padding - mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), not(0x1f)))) - // store length in memory - mstore(o_code, size) - // actually retrieve the code, this needs assembly - extcodecopy(who, add(o_code, 0x20), 0, size) - } - } - - function testDeriveRememberKey() public { - string memory mnemonic = "test test test test test test test test test test test junk"; - - (address deployer, uint256 privateKey) = deriveRememberKey(mnemonic, 0); - assertEq(deployer, 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266); - assertEq(privateKey, 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80); - } - - function testBytesToUint() public { - assertEq(3, bytesToUint_test(hex"03")); - assertEq(2, bytesToUint_test(hex"02")); - assertEq(255, bytesToUint_test(hex"ff")); - assertEq(29625, bytesToUint_test(hex"73b9")); - } - - function testParseJsonTxDetail() public { - string memory root = vm.projectRoot(); - string memory path = string.concat(root, "/test/fixtures/broadcast.log.json"); - string memory json = vm.readFile(path); - bytes memory transactionDetails = json.parseRaw(".transactions[0].tx"); - RawTx1559Detail memory rawTxDetail = abi.decode(transactionDetails, (RawTx1559Detail)); - Tx1559Detail memory txDetail = rawToConvertedEIP1559Detail(rawTxDetail); - assertEq(txDetail.from, 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266); - assertEq(txDetail.to, 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512); - assertEq( - txDetail.data, - hex"23e99187000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000013370000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004" - ); - assertEq(txDetail.nonce, 3); - assertEq(txDetail.txType, 2); - assertEq(txDetail.gas, 29625); - assertEq(txDetail.value, 0); - } - - function testReadEIP1559Transaction() public view { - string memory root = vm.projectRoot(); - string memory path = string.concat(root, "/test/fixtures/broadcast.log.json"); - uint256 index = 0; - Tx1559 memory transaction = readTx1559(path, index); - transaction; - } - - function testReadEIP1559Transactions() public view { - string memory root = vm.projectRoot(); - string memory path = string.concat(root, "/test/fixtures/broadcast.log.json"); - Tx1559[] memory transactions = readTx1559s(path); - transactions; - } - - function testReadReceipt() public { - string memory root = vm.projectRoot(); - string memory path = string.concat(root, "/test/fixtures/broadcast.log.json"); - uint256 index = 5; - Receipt memory receipt = readReceipt(path, index); - assertEq( - receipt.logsBloom, - hex"00000000000800000000000000000010000000000000000000000000000180000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100" - ); - } - - function testReadReceipts() public view { - string memory root = vm.projectRoot(); - string memory path = string.concat(root, "/test/fixtures/broadcast.log.json"); - Receipt[] memory receipts = readReceipts(path); - receipts; - } - - function testGasMeteringModifier() public { - uint256 gas_start_normal = gasleft(); - addInLoop(); - uint256 gas_used_normal = gas_start_normal - gasleft(); - - uint256 gas_start_single = gasleft(); - addInLoopNoGas(); - uint256 gas_used_single = gas_start_single - gasleft(); - - uint256 gas_start_double = gasleft(); - addInLoopNoGasNoGas(); - uint256 gas_used_double = gas_start_double - gasleft(); - - emit log_named_uint("Normal gas", gas_used_normal); - emit log_named_uint("Single modifier gas", gas_used_single); - emit log_named_uint("Double modifier gas", gas_used_double); - assertTrue(gas_used_double + gas_used_single < gas_used_normal); - } - - function addInLoop() internal pure returns (uint256) { - uint256 b; - for (uint256 i; i < 10000; i++) { - b += i; - } - return b; - } - - function addInLoopNoGas() internal noGasMetering returns (uint256) { - return addInLoop(); - } - - function addInLoopNoGasNoGas() internal noGasMetering returns (uint256) { - return addInLoopNoGas(); - } - - function bytesToUint_test(bytes memory b) private pure returns (uint256) { - uint256 number; - for (uint256 i = 0; i < b.length; i++) { - number = number + uint256(uint8(b[i])) * (2 ** (8 * (b.length - (i + 1)))); - } - return number; - } - - function testAssumeNoPrecompiles(address addr) external { - assumeNoPrecompiles(addr, getChain("optimism_goerli").chainId); - assertTrue( - addr < address(1) || (addr > address(9) && addr < address(0x4200000000000000000000000000000000000000)) - || addr > address(0x4200000000000000000000000000000000000800) - ); - } - - function testAssumePayable() external { - // all should revert since these addresses are not payable - - // VM address - vm.expectRevert(); - assumePayable(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D); - - // Console address - vm.expectRevert(); - assumePayable(0x000000000000000000636F6e736F6c652e6c6f67); - - // Create2Deployer - vm.expectRevert(); - assumePayable(0x4e59b44847b379578588920cA78FbF26c0B4956C); - } - - function testAssumePayable(address addr) external { - assumePayable(addr); - assertTrue( - addr != 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D && addr != 0x000000000000000000636F6e736F6c652e6c6f67 - && addr != 0x4e59b44847b379578588920cA78FbF26c0B4956C - ); - } -} - -contract Bar { - constructor() payable { - /// `DEAL` STDCHEAT - totalSupply = 10000e18; - balanceOf[address(this)] = totalSupply; - } - - /// `HOAX` and `CHANGEPRANK` STDCHEATS - function bar(address expectedSender) public payable { - require(msg.sender == expectedSender, "!prank"); - } - - function origin(address expectedSender) public payable { - require(msg.sender == expectedSender, "!prank"); - require(tx.origin == expectedSender, "!prank"); - } - - function origin(address expectedSender, address expectedOrigin) public payable { - require(msg.sender == expectedSender, "!prank"); - require(tx.origin == expectedOrigin, "!prank"); - } - - /// `DEAL` STDCHEAT - mapping(address => uint256) public balanceOf; - uint256 public totalSupply; -} - -contract BarERC1155 { - constructor() payable { - /// `DEALERC1155` STDCHEAT - _totalSupply[0] = 10000e18; - _balances[0][address(this)] = _totalSupply[0]; - } - - function balanceOf(address account, uint256 id) public view virtual returns (uint256) { - return _balances[id][account]; - } - - function totalSupply(uint256 id) public view virtual returns (uint256) { - return _totalSupply[id]; - } - - /// `DEALERC1155` STDCHEAT - mapping(uint256 => mapping(address => uint256)) private _balances; - mapping(uint256 => uint256) private _totalSupply; -} - -contract BarERC721 { - constructor() payable { - /// `DEALERC721` STDCHEAT - _owners[1] = address(1); - _balances[address(1)] = 1; - _owners[2] = address(this); - _owners[3] = address(this); - _balances[address(this)] = 2; - } - - function balanceOf(address owner) public view virtual returns (uint256) { - return _balances[owner]; - } - - function ownerOf(uint256 tokenId) public view virtual returns (address) { - address owner = _owners[tokenId]; - return owner; - } - - mapping(uint256 => address) private _owners; - mapping(address => uint256) private _balances; -} - -contract RevertingContract { - constructor() { - revert(); - } -} diff --git a/contract/lib/forge-std/test/StdError.t.sol b/contract/lib/forge-std/test/StdError.t.sol deleted file mode 100644 index ccd3efa..0000000 --- a/contract/lib/forge-std/test/StdError.t.sol +++ /dev/null @@ -1,118 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.0 <0.9.0; - -import "../src/StdError.sol"; -import "../src/Test.sol"; - -contract StdErrorsTest is Test { - ErrorsTest test; - - function setUp() public { - test = new ErrorsTest(); - } - - function testExpectAssertion() public { - vm.expectRevert(stdError.assertionError); - test.assertionError(); - } - - function testExpectArithmetic() public { - vm.expectRevert(stdError.arithmeticError); - test.arithmeticError(10); - } - - function testExpectDiv() public { - vm.expectRevert(stdError.divisionError); - test.divError(0); - } - - function testExpectMod() public { - vm.expectRevert(stdError.divisionError); - test.modError(0); - } - - function testExpectEnum() public { - vm.expectRevert(stdError.enumConversionError); - test.enumConversion(1); - } - - function testExpectEncodeStg() public { - vm.expectRevert(stdError.encodeStorageError); - test.encodeStgError(); - } - - function testExpectPop() public { - vm.expectRevert(stdError.popError); - test.pop(); - } - - function testExpectOOB() public { - vm.expectRevert(stdError.indexOOBError); - test.indexOOBError(1); - } - - function testExpectMem() public { - vm.expectRevert(stdError.memOverflowError); - test.mem(); - } - - function testExpectIntern() public { - vm.expectRevert(stdError.zeroVarError); - test.intern(); - } -} - -contract ErrorsTest { - enum T {T1} - - uint256[] public someArr; - bytes someBytes; - - function assertionError() public pure { - assert(false); - } - - function arithmeticError(uint256 a) public pure { - a -= 100; - } - - function divError(uint256 a) public pure { - 100 / a; - } - - function modError(uint256 a) public pure { - 100 % a; - } - - function enumConversion(uint256 a) public pure { - T(a); - } - - function encodeStgError() public { - /// @solidity memory-safe-assembly - assembly { - sstore(someBytes.slot, 1) - } - keccak256(someBytes); - } - - function pop() public { - someArr.pop(); - } - - function indexOOBError(uint256 a) public pure { - uint256[] memory t = new uint256[](0); - t[a]; - } - - function mem() public pure { - uint256 l = 2 ** 256 / 32; - new uint256[](l); - } - - function intern() public returns (uint256) { - function(uint256) internal returns (uint256) x; - x(2); - return 7; - } -} diff --git a/contract/lib/forge-std/test/StdMath.t.sol b/contract/lib/forge-std/test/StdMath.t.sol deleted file mode 100644 index 95037ea..0000000 --- a/contract/lib/forge-std/test/StdMath.t.sol +++ /dev/null @@ -1,197 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.0 <0.9.0; - -import "../src/StdMath.sol"; -import "../src/Test.sol"; - -contract StdMathTest is Test { - function testGetAbs() external { - assertEq(stdMath.abs(-50), 50); - assertEq(stdMath.abs(50), 50); - assertEq(stdMath.abs(-1337), 1337); - assertEq(stdMath.abs(0), 0); - - assertEq(stdMath.abs(type(int256).min), (type(uint256).max >> 1) + 1); - assertEq(stdMath.abs(type(int256).max), (type(uint256).max >> 1)); - } - - function testGetAbs_Fuzz(int256 a) external { - uint256 manualAbs = getAbs(a); - - uint256 abs = stdMath.abs(a); - - assertEq(abs, manualAbs); - } - - function testGetDelta_Uint() external { - assertEq(stdMath.delta(uint256(0), uint256(0)), 0); - assertEq(stdMath.delta(uint256(0), uint256(1337)), 1337); - assertEq(stdMath.delta(uint256(0), type(uint64).max), type(uint64).max); - assertEq(stdMath.delta(uint256(0), type(uint128).max), type(uint128).max); - assertEq(stdMath.delta(uint256(0), type(uint256).max), type(uint256).max); - - assertEq(stdMath.delta(0, uint256(0)), 0); - assertEq(stdMath.delta(1337, uint256(0)), 1337); - assertEq(stdMath.delta(type(uint64).max, uint256(0)), type(uint64).max); - assertEq(stdMath.delta(type(uint128).max, uint256(0)), type(uint128).max); - assertEq(stdMath.delta(type(uint256).max, uint256(0)), type(uint256).max); - - assertEq(stdMath.delta(1337, uint256(1337)), 0); - assertEq(stdMath.delta(type(uint256).max, type(uint256).max), 0); - assertEq(stdMath.delta(5000, uint256(1250)), 3750); - } - - function testGetDelta_Uint_Fuzz(uint256 a, uint256 b) external { - uint256 manualDelta; - if (a > b) { - manualDelta = a - b; - } else { - manualDelta = b - a; - } - - uint256 delta = stdMath.delta(a, b); - - assertEq(delta, manualDelta); - } - - function testGetDelta_Int() external { - assertEq(stdMath.delta(int256(0), int256(0)), 0); - assertEq(stdMath.delta(int256(0), int256(1337)), 1337); - assertEq(stdMath.delta(int256(0), type(int64).max), type(uint64).max >> 1); - assertEq(stdMath.delta(int256(0), type(int128).max), type(uint128).max >> 1); - assertEq(stdMath.delta(int256(0), type(int256).max), type(uint256).max >> 1); - - assertEq(stdMath.delta(0, int256(0)), 0); - assertEq(stdMath.delta(1337, int256(0)), 1337); - assertEq(stdMath.delta(type(int64).max, int256(0)), type(uint64).max >> 1); - assertEq(stdMath.delta(type(int128).max, int256(0)), type(uint128).max >> 1); - assertEq(stdMath.delta(type(int256).max, int256(0)), type(uint256).max >> 1); - - assertEq(stdMath.delta(-0, int256(0)), 0); - assertEq(stdMath.delta(-1337, int256(0)), 1337); - assertEq(stdMath.delta(type(int64).min, int256(0)), (type(uint64).max >> 1) + 1); - assertEq(stdMath.delta(type(int128).min, int256(0)), (type(uint128).max >> 1) + 1); - assertEq(stdMath.delta(type(int256).min, int256(0)), (type(uint256).max >> 1) + 1); - - assertEq(stdMath.delta(int256(0), -0), 0); - assertEq(stdMath.delta(int256(0), -1337), 1337); - assertEq(stdMath.delta(int256(0), type(int64).min), (type(uint64).max >> 1) + 1); - assertEq(stdMath.delta(int256(0), type(int128).min), (type(uint128).max >> 1) + 1); - assertEq(stdMath.delta(int256(0), type(int256).min), (type(uint256).max >> 1) + 1); - - assertEq(stdMath.delta(1337, int256(1337)), 0); - assertEq(stdMath.delta(type(int256).max, type(int256).max), 0); - assertEq(stdMath.delta(type(int256).min, type(int256).min), 0); - assertEq(stdMath.delta(type(int256).min, type(int256).max), type(uint256).max); - assertEq(stdMath.delta(5000, int256(1250)), 3750); - } - - function testGetDelta_Int_Fuzz(int256 a, int256 b) external { - uint256 absA = getAbs(a); - uint256 absB = getAbs(b); - uint256 absDelta = absA > absB ? absA - absB : absB - absA; - - uint256 manualDelta; - if ((a >= 0 && b >= 0) || (a < 0 && b < 0)) { - manualDelta = absDelta; - } - // (a < 0 && b >= 0) || (a >= 0 && b < 0) - else { - manualDelta = absA + absB; - } - - uint256 delta = stdMath.delta(a, b); - - assertEq(delta, manualDelta); - } - - function testGetPercentDelta_Uint() external { - assertEq(stdMath.percentDelta(uint256(0), uint256(1337)), 1e18); - assertEq(stdMath.percentDelta(uint256(0), type(uint64).max), 1e18); - assertEq(stdMath.percentDelta(uint256(0), type(uint128).max), 1e18); - assertEq(stdMath.percentDelta(uint256(0), type(uint192).max), 1e18); - - assertEq(stdMath.percentDelta(1337, uint256(1337)), 0); - assertEq(stdMath.percentDelta(type(uint192).max, type(uint192).max), 0); - assertEq(stdMath.percentDelta(0, uint256(2500)), 1e18); - assertEq(stdMath.percentDelta(2500, uint256(2500)), 0); - assertEq(stdMath.percentDelta(5000, uint256(2500)), 1e18); - assertEq(stdMath.percentDelta(7500, uint256(2500)), 2e18); - - vm.expectRevert(stdError.divisionError); - stdMath.percentDelta(uint256(1), 0); - } - - function testGetPercentDelta_Uint_Fuzz(uint192 a, uint192 b) external { - vm.assume(b != 0); - uint256 manualDelta; - if (a > b) { - manualDelta = a - b; - } else { - manualDelta = b - a; - } - - uint256 manualPercentDelta = manualDelta * 1e18 / b; - uint256 percentDelta = stdMath.percentDelta(a, b); - - assertEq(percentDelta, manualPercentDelta); - } - - function testGetPercentDelta_Int() external { - assertEq(stdMath.percentDelta(int256(0), int256(1337)), 1e18); - assertEq(stdMath.percentDelta(int256(0), -1337), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int64).min), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int128).min), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int192).min), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int64).max), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int128).max), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int192).max), 1e18); - - assertEq(stdMath.percentDelta(1337, int256(1337)), 0); - assertEq(stdMath.percentDelta(type(int192).max, type(int192).max), 0); - assertEq(stdMath.percentDelta(type(int192).min, type(int192).min), 0); - - assertEq(stdMath.percentDelta(type(int192).min, type(int192).max), 2e18); // rounds the 1 wei diff down - assertEq(stdMath.percentDelta(type(int192).max, type(int192).min), 2e18 - 1); // rounds the 1 wei diff down - assertEq(stdMath.percentDelta(0, int256(2500)), 1e18); - assertEq(stdMath.percentDelta(2500, int256(2500)), 0); - assertEq(stdMath.percentDelta(5000, int256(2500)), 1e18); - assertEq(stdMath.percentDelta(7500, int256(2500)), 2e18); - - vm.expectRevert(stdError.divisionError); - stdMath.percentDelta(int256(1), 0); - } - - function testGetPercentDelta_Int_Fuzz(int192 a, int192 b) external { - vm.assume(b != 0); - uint256 absA = getAbs(a); - uint256 absB = getAbs(b); - uint256 absDelta = absA > absB ? absA - absB : absB - absA; - - uint256 manualDelta; - if ((a >= 0 && b >= 0) || (a < 0 && b < 0)) { - manualDelta = absDelta; - } - // (a < 0 && b >= 0) || (a >= 0 && b < 0) - else { - manualDelta = absA + absB; - } - - uint256 manualPercentDelta = manualDelta * 1e18 / absB; - uint256 percentDelta = stdMath.percentDelta(a, b); - - assertEq(percentDelta, manualPercentDelta); - } - - /*////////////////////////////////////////////////////////////////////////// - HELPERS - //////////////////////////////////////////////////////////////////////////*/ - - function getAbs(int256 a) private pure returns (uint256) { - if (a < 0) { - return a == type(int256).min ? uint256(type(int256).max) + 1 : uint256(-a); - } - - return uint256(a); - } -} diff --git a/contract/lib/forge-std/test/StdStorage.t.sol b/contract/lib/forge-std/test/StdStorage.t.sol deleted file mode 100644 index d4c563a..0000000 --- a/contract/lib/forge-std/test/StdStorage.t.sol +++ /dev/null @@ -1,283 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../src/StdStorage.sol"; -import "../src/Test.sol"; - -contract StdStorageTest is Test { - using stdStorage for StdStorage; - - StorageTest internal test; - - function setUp() public { - test = new StorageTest(); - } - - function testStorageHidden() public { - assertEq(uint256(keccak256("my.random.var")), stdstore.target(address(test)).sig("hidden()").find()); - } - - function testStorageObvious() public { - assertEq(uint256(0), stdstore.target(address(test)).sig("exists()").find()); - } - - function testStorageCheckedWriteHidden() public { - stdstore.target(address(test)).sig(test.hidden.selector).checked_write(100); - assertEq(uint256(test.hidden()), 100); - } - - function testStorageCheckedWriteObvious() public { - stdstore.target(address(test)).sig(test.exists.selector).checked_write(100); - assertEq(test.exists(), 100); - } - - function testStorageMapStructA() public { - uint256 slot = - stdstore.target(address(test)).sig(test.map_struct.selector).with_key(address(this)).depth(0).find(); - assertEq(uint256(keccak256(abi.encode(address(this), 4))), slot); - } - - function testStorageMapStructB() public { - uint256 slot = - stdstore.target(address(test)).sig(test.map_struct.selector).with_key(address(this)).depth(1).find(); - assertEq(uint256(keccak256(abi.encode(address(this), 4))) + 1, slot); - } - - function testStorageDeepMap() public { - uint256 slot = stdstore.target(address(test)).sig(test.deep_map.selector).with_key(address(this)).with_key( - address(this) - ).find(); - assertEq(uint256(keccak256(abi.encode(address(this), keccak256(abi.encode(address(this), uint256(5)))))), slot); - } - - function testStorageCheckedWriteDeepMap() public { - stdstore.target(address(test)).sig(test.deep_map.selector).with_key(address(this)).with_key(address(this)) - .checked_write(100); - assertEq(100, test.deep_map(address(this), address(this))); - } - - function testStorageDeepMapStructA() public { - uint256 slot = stdstore.target(address(test)).sig(test.deep_map_struct.selector).with_key(address(this)) - .with_key(address(this)).depth(0).find(); - assertEq( - bytes32(uint256(keccak256(abi.encode(address(this), keccak256(abi.encode(address(this), uint256(6)))))) + 0), - bytes32(slot) - ); - } - - function testStorageDeepMapStructB() public { - uint256 slot = stdstore.target(address(test)).sig(test.deep_map_struct.selector).with_key(address(this)) - .with_key(address(this)).depth(1).find(); - assertEq( - bytes32(uint256(keccak256(abi.encode(address(this), keccak256(abi.encode(address(this), uint256(6)))))) + 1), - bytes32(slot) - ); - } - - function testStorageCheckedWriteDeepMapStructA() public { - stdstore.target(address(test)).sig(test.deep_map_struct.selector).with_key(address(this)).with_key( - address(this) - ).depth(0).checked_write(100); - (uint256 a, uint256 b) = test.deep_map_struct(address(this), address(this)); - assertEq(100, a); - assertEq(0, b); - } - - function testStorageCheckedWriteDeepMapStructB() public { - stdstore.target(address(test)).sig(test.deep_map_struct.selector).with_key(address(this)).with_key( - address(this) - ).depth(1).checked_write(100); - (uint256 a, uint256 b) = test.deep_map_struct(address(this), address(this)); - assertEq(0, a); - assertEq(100, b); - } - - function testStorageCheckedWriteMapStructA() public { - stdstore.target(address(test)).sig(test.map_struct.selector).with_key(address(this)).depth(0).checked_write(100); - (uint256 a, uint256 b) = test.map_struct(address(this)); - assertEq(a, 100); - assertEq(b, 0); - } - - function testStorageCheckedWriteMapStructB() public { - stdstore.target(address(test)).sig(test.map_struct.selector).with_key(address(this)).depth(1).checked_write(100); - (uint256 a, uint256 b) = test.map_struct(address(this)); - assertEq(a, 0); - assertEq(b, 100); - } - - function testStorageStructA() public { - uint256 slot = stdstore.target(address(test)).sig(test.basic.selector).depth(0).find(); - assertEq(uint256(7), slot); - } - - function testStorageStructB() public { - uint256 slot = stdstore.target(address(test)).sig(test.basic.selector).depth(1).find(); - assertEq(uint256(7) + 1, slot); - } - - function testStorageCheckedWriteStructA() public { - stdstore.target(address(test)).sig(test.basic.selector).depth(0).checked_write(100); - (uint256 a, uint256 b) = test.basic(); - assertEq(a, 100); - assertEq(b, 1337); - } - - function testStorageCheckedWriteStructB() public { - stdstore.target(address(test)).sig(test.basic.selector).depth(1).checked_write(100); - (uint256 a, uint256 b) = test.basic(); - assertEq(a, 1337); - assertEq(b, 100); - } - - function testStorageMapAddrFound() public { - uint256 slot = stdstore.target(address(test)).sig(test.map_addr.selector).with_key(address(this)).find(); - assertEq(uint256(keccak256(abi.encode(address(this), uint256(1)))), slot); - } - - function testStorageMapUintFound() public { - uint256 slot = stdstore.target(address(test)).sig(test.map_uint.selector).with_key(100).find(); - assertEq(uint256(keccak256(abi.encode(100, uint256(2)))), slot); - } - - function testStorageCheckedWriteMapUint() public { - stdstore.target(address(test)).sig(test.map_uint.selector).with_key(100).checked_write(100); - assertEq(100, test.map_uint(100)); - } - - function testStorageCheckedWriteMapAddr() public { - stdstore.target(address(test)).sig(test.map_addr.selector).with_key(address(this)).checked_write(100); - assertEq(100, test.map_addr(address(this))); - } - - function testStorageCheckedWriteMapBool() public { - stdstore.target(address(test)).sig(test.map_bool.selector).with_key(address(this)).checked_write(true); - assertTrue(test.map_bool(address(this))); - } - - function testFailStorageCheckedWriteMapPacked() public { - // expect PackedSlot error but not external call so cant expectRevert - stdstore.target(address(test)).sig(test.read_struct_lower.selector).with_key(address(uint160(1337))) - .checked_write(100); - } - - function testStorageCheckedWriteMapPackedSuccess() public { - uint256 full = test.map_packed(address(1337)); - // keep upper 128, set lower 128 to 1337 - full = (full & (uint256((1 << 128) - 1) << 128)) | 1337; - stdstore.target(address(test)).sig(test.map_packed.selector).with_key(address(uint160(1337))).checked_write( - full - ); - assertEq(1337, test.read_struct_lower(address(1337))); - } - - function testFailStorageConst() public { - // vm.expectRevert(abi.encodeWithSignature("NotStorage(bytes4)", bytes4(keccak256("const()")))); - stdstore.target(address(test)).sig("const()").find(); - } - - function testFailStorageNativePack() public { - stdstore.target(address(test)).sig(test.tA.selector).find(); - stdstore.target(address(test)).sig(test.tB.selector).find(); - - // these both would fail - stdstore.target(address(test)).sig(test.tC.selector).find(); - stdstore.target(address(test)).sig(test.tD.selector).find(); - } - - function testStorageReadBytes32() public { - bytes32 val = stdstore.target(address(test)).sig(test.tE.selector).read_bytes32(); - assertEq(val, hex"1337"); - } - - function testStorageReadBool_False() public { - bool val = stdstore.target(address(test)).sig(test.tB.selector).read_bool(); - assertEq(val, false); - } - - function testStorageReadBool_True() public { - bool val = stdstore.target(address(test)).sig(test.tH.selector).read_bool(); - assertEq(val, true); - } - - function testStorageReadBool_Revert() public { - vm.expectRevert("stdStorage read_bool(StdStorage): Cannot decode. Make sure you are reading a bool."); - this.readNonBoolValue(); - } - - function readNonBoolValue() public { - stdstore.target(address(test)).sig(test.tE.selector).read_bool(); - } - - function testStorageReadAddress() public { - address val = stdstore.target(address(test)).sig(test.tF.selector).read_address(); - assertEq(val, address(1337)); - } - - function testStorageReadUint() public { - uint256 val = stdstore.target(address(test)).sig(test.exists.selector).read_uint(); - assertEq(val, 1); - } - - function testStorageReadInt() public { - int256 val = stdstore.target(address(test)).sig(test.tG.selector).read_int(); - assertEq(val, type(int256).min); - } -} - -contract StorageTest { - uint256 public exists = 1; - mapping(address => uint256) public map_addr; - mapping(uint256 => uint256) public map_uint; - mapping(address => uint256) public map_packed; - mapping(address => UnpackedStruct) public map_struct; - mapping(address => mapping(address => uint256)) public deep_map; - mapping(address => mapping(address => UnpackedStruct)) public deep_map_struct; - UnpackedStruct public basic; - - uint248 public tA; - bool public tB; - - bool public tC = false; - uint248 public tD = 1; - - struct UnpackedStruct { - uint256 a; - uint256 b; - } - - mapping(address => bool) public map_bool; - - bytes32 public tE = hex"1337"; - address public tF = address(1337); - int256 public tG = type(int256).min; - bool public tH = true; - - constructor() { - basic = UnpackedStruct({a: 1337, b: 1337}); - - uint256 two = (1 << 128) | 1; - map_packed[msg.sender] = two; - map_packed[address(uint160(1337))] = 1 << 128; - } - - function read_struct_upper(address who) public view returns (uint256) { - return map_packed[who] >> 128; - } - - function read_struct_lower(address who) public view returns (uint256) { - return map_packed[who] & ((1 << 128) - 1); - } - - function hidden() public view returns (bytes32 t) { - bytes32 slot = keccak256("my.random.var"); - /// @solidity memory-safe-assembly - assembly { - t := sload(slot) - } - } - - function const() public pure returns (bytes32 t) { - t = bytes32(hex"1337"); - } -} diff --git a/contract/lib/forge-std/test/StdStyle.t.sol b/contract/lib/forge-std/test/StdStyle.t.sol deleted file mode 100644 index e63ed68..0000000 --- a/contract/lib/forge-std/test/StdStyle.t.sol +++ /dev/null @@ -1,110 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../src/Test.sol"; - -contract StdStyleTest is Test { - function testStyleColor() public view { - console2.log(StdStyle.red("StdStyle.red String Test")); - console2.log(StdStyle.red(uint256(10e18))); - console2.log(StdStyle.red(int256(-10e18))); - console2.log(StdStyle.red(true)); - console2.log(StdStyle.red(address(0))); - console2.log(StdStyle.redBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); - console2.log(StdStyle.redBytes32("StdStyle.redBytes32")); - console2.log(StdStyle.green("StdStyle.green String Test")); - console2.log(StdStyle.green(uint256(10e18))); - console2.log(StdStyle.green(int256(-10e18))); - console2.log(StdStyle.green(true)); - console2.log(StdStyle.green(address(0))); - console2.log(StdStyle.greenBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); - console2.log(StdStyle.greenBytes32("StdStyle.greenBytes32")); - console2.log(StdStyle.yellow("StdStyle.yellow String Test")); - console2.log(StdStyle.yellow(uint256(10e18))); - console2.log(StdStyle.yellow(int256(-10e18))); - console2.log(StdStyle.yellow(true)); - console2.log(StdStyle.yellow(address(0))); - console2.log(StdStyle.yellowBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); - console2.log(StdStyle.yellowBytes32("StdStyle.yellowBytes32")); - console2.log(StdStyle.blue("StdStyle.blue String Test")); - console2.log(StdStyle.blue(uint256(10e18))); - console2.log(StdStyle.blue(int256(-10e18))); - console2.log(StdStyle.blue(true)); - console2.log(StdStyle.blue(address(0))); - console2.log(StdStyle.blueBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); - console2.log(StdStyle.blueBytes32("StdStyle.blueBytes32")); - console2.log(StdStyle.magenta("StdStyle.magenta String Test")); - console2.log(StdStyle.magenta(uint256(10e18))); - console2.log(StdStyle.magenta(int256(-10e18))); - console2.log(StdStyle.magenta(true)); - console2.log(StdStyle.magenta(address(0))); - console2.log(StdStyle.magentaBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); - console2.log(StdStyle.magentaBytes32("StdStyle.magentaBytes32")); - console2.log(StdStyle.cyan("StdStyle.cyan String Test")); - console2.log(StdStyle.cyan(uint256(10e18))); - console2.log(StdStyle.cyan(int256(-10e18))); - console2.log(StdStyle.cyan(true)); - console2.log(StdStyle.cyan(address(0))); - console2.log(StdStyle.cyanBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); - console2.log(StdStyle.cyanBytes32("StdStyle.cyanBytes32")); - } - - function testStyleFontWeight() public view { - console2.log(StdStyle.bold("StdStyle.bold String Test")); - console2.log(StdStyle.bold(uint256(10e18))); - console2.log(StdStyle.bold(int256(-10e18))); - console2.log(StdStyle.bold(address(0))); - console2.log(StdStyle.bold(true)); - console2.log(StdStyle.boldBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); - console2.log(StdStyle.boldBytes32("StdStyle.boldBytes32")); - console2.log(StdStyle.dim("StdStyle.dim String Test")); - console2.log(StdStyle.dim(uint256(10e18))); - console2.log(StdStyle.dim(int256(-10e18))); - console2.log(StdStyle.dim(address(0))); - console2.log(StdStyle.dim(true)); - console2.log(StdStyle.dimBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); - console2.log(StdStyle.dimBytes32("StdStyle.dimBytes32")); - console2.log(StdStyle.italic("StdStyle.italic String Test")); - console2.log(StdStyle.italic(uint256(10e18))); - console2.log(StdStyle.italic(int256(-10e18))); - console2.log(StdStyle.italic(address(0))); - console2.log(StdStyle.italic(true)); - console2.log(StdStyle.italicBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); - console2.log(StdStyle.italicBytes32("StdStyle.italicBytes32")); - console2.log(StdStyle.underline("StdStyle.underline String Test")); - console2.log(StdStyle.underline(uint256(10e18))); - console2.log(StdStyle.underline(int256(-10e18))); - console2.log(StdStyle.underline(address(0))); - console2.log(StdStyle.underline(true)); - console2.log(StdStyle.underlineBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); - console2.log(StdStyle.underlineBytes32("StdStyle.underlineBytes32")); - console2.log(StdStyle.inverse("StdStyle.inverse String Test")); - console2.log(StdStyle.inverse(uint256(10e18))); - console2.log(StdStyle.inverse(int256(-10e18))); - console2.log(StdStyle.inverse(address(0))); - console2.log(StdStyle.inverse(true)); - console2.log(StdStyle.inverseBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); - console2.log(StdStyle.inverseBytes32("StdStyle.inverseBytes32")); - } - - function testStyleCombined() public view { - console2.log(StdStyle.red(StdStyle.bold("Red Bold String Test"))); - console2.log(StdStyle.green(StdStyle.dim(uint256(10e18)))); - console2.log(StdStyle.yellow(StdStyle.italic(int256(-10e18)))); - console2.log(StdStyle.blue(StdStyle.underline(address(0)))); - console2.log(StdStyle.magenta(StdStyle.inverse(true))); - } - - function testStyleCustom() public view { - console2.log(h1("Custom Style 1")); - console2.log(h2("Custom Style 2")); - } - - function h1(string memory a) private pure returns (string memory) { - return StdStyle.cyan(StdStyle.inverse(StdStyle.bold(a))); - } - - function h2(string memory a) private pure returns (string memory) { - return StdStyle.magenta(StdStyle.bold(StdStyle.underline(a))); - } -} diff --git a/contract/lib/forge-std/test/StdUtils.t.sol b/contract/lib/forge-std/test/StdUtils.t.sol deleted file mode 100644 index a085b19..0000000 --- a/contract/lib/forge-std/test/StdUtils.t.sol +++ /dev/null @@ -1,297 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../src/Test.sol"; - -contract StdUtilsMock is StdUtils { - // We deploy a mock version so we can properly test expected reverts. - function getTokenBalances_(address token, address[] memory addresses) - external - returns (uint256[] memory balances) - { - return getTokenBalances(token, addresses); - } -} - -contract StdUtilsTest is Test { - /*////////////////////////////////////////////////////////////////////////// - BOUND UINT - //////////////////////////////////////////////////////////////////////////*/ - - function testBound() public { - assertEq(bound(uint256(5), 0, 4), 0); - assertEq(bound(uint256(0), 69, 69), 69); - assertEq(bound(uint256(0), 68, 69), 68); - assertEq(bound(uint256(10), 150, 190), 174); - assertEq(bound(uint256(300), 2800, 3200), 3107); - assertEq(bound(uint256(9999), 1337, 6666), 4669); - } - - function testBound_WithinRange() public { - assertEq(bound(uint256(51), 50, 150), 51); - assertEq(bound(uint256(51), 50, 150), bound(bound(uint256(51), 50, 150), 50, 150)); - assertEq(bound(uint256(149), 50, 150), 149); - assertEq(bound(uint256(149), 50, 150), bound(bound(uint256(149), 50, 150), 50, 150)); - } - - function testBound_EdgeCoverage() public { - assertEq(bound(uint256(0), 50, 150), 50); - assertEq(bound(uint256(1), 50, 150), 51); - assertEq(bound(uint256(2), 50, 150), 52); - assertEq(bound(uint256(3), 50, 150), 53); - assertEq(bound(type(uint256).max, 50, 150), 150); - assertEq(bound(type(uint256).max - 1, 50, 150), 149); - assertEq(bound(type(uint256).max - 2, 50, 150), 148); - assertEq(bound(type(uint256).max - 3, 50, 150), 147); - } - - function testBound_DistributionIsEven(uint256 min, uint256 size) public { - size = size % 100 + 1; - min = bound(min, UINT256_MAX / 2, UINT256_MAX / 2 + size); - uint256 max = min + size - 1; - uint256 result; - - for (uint256 i = 1; i <= size * 4; ++i) { - // x > max - result = bound(max + i, min, max); - assertEq(result, min + (i - 1) % size); - // x < min - result = bound(min - i, min, max); - assertEq(result, max - (i - 1) % size); - } - } - - function testBound(uint256 num, uint256 min, uint256 max) public { - if (min > max) (min, max) = (max, min); - - uint256 result = bound(num, min, max); - - assertGe(result, min); - assertLe(result, max); - assertEq(result, bound(result, min, max)); - if (num >= min && num <= max) assertEq(result, num); - } - - function testBoundUint256Max() public { - assertEq(bound(0, type(uint256).max - 1, type(uint256).max), type(uint256).max - 1); - assertEq(bound(1, type(uint256).max - 1, type(uint256).max), type(uint256).max); - } - - function testCannotBoundMaxLessThanMin() public { - vm.expectRevert(bytes("StdUtils bound(uint256,uint256,uint256): Max is less than min.")); - bound(uint256(5), 100, 10); - } - - function testCannotBoundMaxLessThanMin(uint256 num, uint256 min, uint256 max) public { - vm.assume(min > max); - vm.expectRevert(bytes("StdUtils bound(uint256,uint256,uint256): Max is less than min.")); - bound(num, min, max); - } - - /*////////////////////////////////////////////////////////////////////////// - BOUND INT - //////////////////////////////////////////////////////////////////////////*/ - - function testBoundInt() public { - assertEq(bound(-3, 0, 4), 2); - assertEq(bound(0, -69, -69), -69); - assertEq(bound(0, -69, -68), -68); - assertEq(bound(-10, 150, 190), 154); - assertEq(bound(-300, 2800, 3200), 2908); - assertEq(bound(9999, -1337, 6666), 1995); - } - - function testBoundInt_WithinRange() public { - assertEq(bound(51, -50, 150), 51); - assertEq(bound(51, -50, 150), bound(bound(51, -50, 150), -50, 150)); - assertEq(bound(149, -50, 150), 149); - assertEq(bound(149, -50, 150), bound(bound(149, -50, 150), -50, 150)); - } - - function testBoundInt_EdgeCoverage() public { - assertEq(bound(type(int256).min, -50, 150), -50); - assertEq(bound(type(int256).min + 1, -50, 150), -49); - assertEq(bound(type(int256).min + 2, -50, 150), -48); - assertEq(bound(type(int256).min + 3, -50, 150), -47); - assertEq(bound(type(int256).min, 10, 150), 10); - assertEq(bound(type(int256).min + 1, 10, 150), 11); - assertEq(bound(type(int256).min + 2, 10, 150), 12); - assertEq(bound(type(int256).min + 3, 10, 150), 13); - - assertEq(bound(type(int256).max, -50, 150), 150); - assertEq(bound(type(int256).max - 1, -50, 150), 149); - assertEq(bound(type(int256).max - 2, -50, 150), 148); - assertEq(bound(type(int256).max - 3, -50, 150), 147); - assertEq(bound(type(int256).max, -50, -10), -10); - assertEq(bound(type(int256).max - 1, -50, -10), -11); - assertEq(bound(type(int256).max - 2, -50, -10), -12); - assertEq(bound(type(int256).max - 3, -50, -10), -13); - } - - function testBoundInt_DistributionIsEven(int256 min, uint256 size) public { - size = size % 100 + 1; - min = bound(min, -int256(size / 2), int256(size - size / 2)); - int256 max = min + int256(size) - 1; - int256 result; - - for (uint256 i = 1; i <= size * 4; ++i) { - // x > max - result = bound(max + int256(i), min, max); - assertEq(result, min + int256((i - 1) % size)); - // x < min - result = bound(min - int256(i), min, max); - assertEq(result, max - int256((i - 1) % size)); - } - } - - function testBoundInt(int256 num, int256 min, int256 max) public { - if (min > max) (min, max) = (max, min); - - int256 result = bound(num, min, max); - - assertGe(result, min); - assertLe(result, max); - assertEq(result, bound(result, min, max)); - if (num >= min && num <= max) assertEq(result, num); - } - - function testBoundIntInt256Max() public { - assertEq(bound(0, type(int256).max - 1, type(int256).max), type(int256).max - 1); - assertEq(bound(1, type(int256).max - 1, type(int256).max), type(int256).max); - } - - function testBoundIntInt256Min() public { - assertEq(bound(0, type(int256).min, type(int256).min + 1), type(int256).min); - assertEq(bound(1, type(int256).min, type(int256).min + 1), type(int256).min + 1); - } - - function testCannotBoundIntMaxLessThanMin() public { - vm.expectRevert(bytes("StdUtils bound(int256,int256,int256): Max is less than min.")); - bound(-5, 100, 10); - } - - function testCannotBoundIntMaxLessThanMin(int256 num, int256 min, int256 max) public { - vm.assume(min > max); - vm.expectRevert(bytes("StdUtils bound(int256,int256,int256): Max is less than min.")); - bound(num, min, max); - } - - /*////////////////////////////////////////////////////////////////////////// - BYTES TO UINT - //////////////////////////////////////////////////////////////////////////*/ - - function testBytesToUint() external { - bytes memory maxUint = hex"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"; - bytes memory two = hex"02"; - bytes memory millionEther = hex"d3c21bcecceda1000000"; - - assertEq(bytesToUint(maxUint), type(uint256).max); - assertEq(bytesToUint(two), 2); - assertEq(bytesToUint(millionEther), 1_000_000 ether); - } - - function testCannotConvertGT32Bytes() external { - bytes memory thirty3Bytes = hex"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"; - vm.expectRevert("StdUtils bytesToUint(bytes): Bytes length exceeds 32."); - bytesToUint(thirty3Bytes); - } - - /*////////////////////////////////////////////////////////////////////////// - COMPUTE CREATE ADDRESS - //////////////////////////////////////////////////////////////////////////*/ - - function testComputeCreateAddress() external { - address deployer = 0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9; - uint256 nonce = 14; - address createAddress = computeCreateAddress(deployer, nonce); - assertEq(createAddress, 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45); - } - - /*////////////////////////////////////////////////////////////////////////// - COMPUTE CREATE2 ADDRESS - //////////////////////////////////////////////////////////////////////////*/ - - function testComputeCreate2Address() external { - bytes32 salt = bytes32(uint256(31415)); - bytes32 initcodeHash = keccak256(abi.encode(0x6080)); - address deployer = 0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9; - address create2Address = computeCreate2Address(salt, initcodeHash, deployer); - assertEq(create2Address, 0xB147a5d25748fda14b463EB04B111027C290f4d3); - } - - function testComputeCreate2AddressWithDefaultDeployer() external { - bytes32 salt = 0xc290c670fde54e5ef686f9132cbc8711e76a98f0333a438a92daa442c71403c0; - bytes32 initcodeHash = hashInitCode(hex"6080", ""); - assertEq(initcodeHash, 0x1a578b7a4b0b5755db6d121b4118d4bc68fe170dca840c59bc922f14175a76b0); - address create2Address = computeCreate2Address(salt, initcodeHash); - assertEq(create2Address, 0xc0ffEe2198a06235aAbFffe5Db0CacF1717f5Ac6); - } -} - -contract StdUtilsForkTest is Test { - /*////////////////////////////////////////////////////////////////////////// - GET TOKEN BALANCES - //////////////////////////////////////////////////////////////////////////*/ - - address internal SHIB = 0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE; - address internal SHIB_HOLDER_0 = 0x855F5981e831D83e6A4b4EBFCAdAa68D92333170; - address internal SHIB_HOLDER_1 = 0x8F509A90c2e47779cA408Fe00d7A72e359229AdA; - address internal SHIB_HOLDER_2 = 0x0e3bbc0D04fF62211F71f3e4C45d82ad76224385; - - address internal USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; - address internal USDC_HOLDER_0 = 0xDa9CE944a37d218c3302F6B82a094844C6ECEb17; - address internal USDC_HOLDER_1 = 0x3e67F4721E6d1c41a015f645eFa37BEd854fcf52; - - function setUp() public { - // All tests of the `getTokenBalances` method are fork tests using live contracts. - vm.createSelectFork({urlOrAlias: "mainnet", blockNumber: 16_428_900}); - } - - function testCannotGetTokenBalances_NonTokenContract() external { - // We deploy a mock version so we can properly test the revert. - StdUtilsMock stdUtils = new StdUtilsMock(); - - // The UniswapV2Factory contract has neither a `balanceOf` function nor a fallback function, - // so the `balanceOf` call should revert. - address token = address(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); - address[] memory addresses = new address[](1); - addresses[0] = USDC_HOLDER_0; - - vm.expectRevert("Multicall3: call failed"); - stdUtils.getTokenBalances_(token, addresses); - } - - function testCannotGetTokenBalances_EOA() external { - address eoa = vm.addr({privateKey: 1}); - address[] memory addresses = new address[](1); - addresses[0] = USDC_HOLDER_0; - vm.expectRevert("StdUtils getTokenBalances(address,address[]): Token address is not a contract."); - getTokenBalances(eoa, addresses); - } - - function testGetTokenBalances_Empty() external { - address[] memory addresses = new address[](0); - uint256[] memory balances = getTokenBalances(USDC, addresses); - assertEq(balances.length, 0); - } - - function testGetTokenBalances_USDC() external { - address[] memory addresses = new address[](2); - addresses[0] = USDC_HOLDER_0; - addresses[1] = USDC_HOLDER_1; - uint256[] memory balances = getTokenBalances(USDC, addresses); - assertEq(balances[0], 159_000_000_000_000); - assertEq(balances[1], 131_350_000_000_000); - } - - function testGetTokenBalances_SHIB() external { - address[] memory addresses = new address[](3); - addresses[0] = SHIB_HOLDER_0; - addresses[1] = SHIB_HOLDER_1; - addresses[2] = SHIB_HOLDER_2; - uint256[] memory balances = getTokenBalances(SHIB, addresses); - assertEq(balances[0], 3_323_256_285_484.42e18); - assertEq(balances[1], 1_271_702_771_149.99999928e18); - assertEq(balances[2], 606_357_106_247e18); - } -} diff --git a/contract/lib/forge-std/test/compilation/CompilationScript.sol b/contract/lib/forge-std/test/compilation/CompilationScript.sol deleted file mode 100644 index e205cff..0000000 --- a/contract/lib/forge-std/test/compilation/CompilationScript.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -pragma experimental ABIEncoderV2; - -import "../../src/Script.sol"; - -// The purpose of this contract is to benchmark compilation time to avoid accidentally introducing -// a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 -contract CompilationScript is Script {} diff --git a/contract/lib/forge-std/test/compilation/CompilationScriptBase.sol b/contract/lib/forge-std/test/compilation/CompilationScriptBase.sol deleted file mode 100644 index ce8e0e9..0000000 --- a/contract/lib/forge-std/test/compilation/CompilationScriptBase.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -pragma experimental ABIEncoderV2; - -import "../../src/Script.sol"; - -// The purpose of this contract is to benchmark compilation time to avoid accidentally introducing -// a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 -contract CompilationScriptBase is ScriptBase {} diff --git a/contract/lib/forge-std/test/compilation/CompilationTest.sol b/contract/lib/forge-std/test/compilation/CompilationTest.sol deleted file mode 100644 index 9beeafe..0000000 --- a/contract/lib/forge-std/test/compilation/CompilationTest.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -pragma experimental ABIEncoderV2; - -import "../../src/Test.sol"; - -// The purpose of this contract is to benchmark compilation time to avoid accidentally introducing -// a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 -contract CompilationTest is Test {} diff --git a/contract/lib/forge-std/test/compilation/CompilationTestBase.sol b/contract/lib/forge-std/test/compilation/CompilationTestBase.sol deleted file mode 100644 index e993535..0000000 --- a/contract/lib/forge-std/test/compilation/CompilationTestBase.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; - -pragma experimental ABIEncoderV2; - -import "../../src/Test.sol"; - -// The purpose of this contract is to benchmark compilation time to avoid accidentally introducing -// a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 -contract CompilationTestBase is TestBase {} diff --git a/contract/lib/forge-std/test/fixtures/broadcast.log.json b/contract/lib/forge-std/test/fixtures/broadcast.log.json deleted file mode 100644 index 0a0200b..0000000 --- a/contract/lib/forge-std/test/fixtures/broadcast.log.json +++ /dev/null @@ -1,187 +0,0 @@ -{ - "transactions": [ - { - "hash": "0xc6006863c267735a11476b7f15b15bc718e117e2da114a2be815dd651e1a509f", - "type": "CALL", - "contractName": "Test", - "contractAddress": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "function": "multiple_arguments(uint256,address,uint256[]):(uint256)", - "arguments": ["1", "0000000000000000000000000000000000001337", "[3,4]"], - "tx": { - "type": "0x02", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "gas": "0x73b9", - "value": "0x0", - "data": "0x23e99187000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000013370000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004", - "nonce": "0x3", - "accessList": [] - } - }, - { - "hash": "0xedf2b38d8d896519a947a1acf720f859bb35c0c5ecb8dd7511995b67b9853298", - "type": "CALL", - "contractName": "Test", - "contractAddress": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "function": "inc():(uint256)", - "arguments": [], - "tx": { - "type": "0x02", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "gas": "0xdcb2", - "value": "0x0", - "data": "0x371303c0", - "nonce": "0x4", - "accessList": [] - } - }, - { - "hash": "0xa57e8e3981a6c861442e46c9471bd19cb3e21f9a8a6c63a72e7b5c47c6675a7c", - "type": "CALL", - "contractName": "Test", - "contractAddress": "0x7c6b4bbe207d642d98d5c537142d85209e585087", - "function": "t(uint256):(uint256)", - "arguments": ["1"], - "tx": { - "type": "0x02", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0x7c6b4bbe207d642d98d5c537142d85209e585087", - "gas": "0x8599", - "value": "0x0", - "data": "0xafe29f710000000000000000000000000000000000000000000000000000000000000001", - "nonce": "0x5", - "accessList": [] - } - } - ], - "receipts": [ - { - "transactionHash": "0x481dc86e40bba90403c76f8e144aa9ff04c1da2164299d0298573835f0991181", - "transactionIndex": "0x0", - "blockHash": "0xef0730448490304e5403be0fa8f8ce64f118e9adcca60c07a2ae1ab921d748af", - "blockNumber": "0x1", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": null, - "cumulativeGasUsed": "0x13f3a", - "gasUsed": "0x13f3a", - "contractAddress": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "effectiveGasPrice": "0xee6b2800" - }, - { - "transactionHash": "0x6a187183545b8a9e7f1790e847139379bf5622baff2cb43acf3f5c79470af782", - "transactionIndex": "0x0", - "blockHash": "0xf3acb96a90071640c2a8c067ae4e16aad87e634ea8d8bbbb5b352fba86ba0148", - "blockNumber": "0x2", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": null, - "cumulativeGasUsed": "0x45d80", - "gasUsed": "0x45d80", - "contractAddress": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "effectiveGasPrice": "0xee6b2800" - }, - { - "transactionHash": "0x064ad173b4867bdef2fb60060bbdaf01735fbf10414541ea857772974e74ea9d", - "transactionIndex": "0x0", - "blockHash": "0x8373d02109d3ee06a0225f23da4c161c656ccc48fe0fcee931d325508ae73e58", - "blockNumber": "0x3", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", - "cumulativeGasUsed": "0x45feb", - "gasUsed": "0x45feb", - "contractAddress": null, - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "effectiveGasPrice": "0xee6b2800" - }, - { - "transactionHash": "0xc6006863c267735a11476b7f15b15bc718e117e2da114a2be815dd651e1a509f", - "transactionIndex": "0x0", - "blockHash": "0x16712fae5c0e18f75045f84363fb6b4d9a9fe25e660c4ce286833a533c97f629", - "blockNumber": "0x4", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "cumulativeGasUsed": "0x5905", - "gasUsed": "0x5905", - "contractAddress": null, - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "effectiveGasPrice": "0xee6b2800" - }, - { - "transactionHash": "0xedf2b38d8d896519a947a1acf720f859bb35c0c5ecb8dd7511995b67b9853298", - "transactionIndex": "0x0", - "blockHash": "0x156b88c3eb9a1244ba00a1834f3f70de735b39e3e59006dd03af4fe7d5480c11", - "blockNumber": "0x5", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "cumulativeGasUsed": "0xa9c4", - "gasUsed": "0xa9c4", - "contractAddress": null, - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "effectiveGasPrice": "0xee6b2800" - }, - { - "transactionHash": "0xa57e8e3981a6c861442e46c9471bd19cb3e21f9a8a6c63a72e7b5c47c6675a7c", - "transactionIndex": "0x0", - "blockHash": "0xcf61faca67dbb2c28952b0b8a379e53b1505ae0821e84779679390cb8571cadb", - "blockNumber": "0x6", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0x7c6b4bbe207d642d98d5c537142d85209e585087", - "cumulativeGasUsed": "0x66c5", - "gasUsed": "0x66c5", - "contractAddress": null, - "logs": [ - { - "address": "0x7c6b4bbe207d642d98d5c537142d85209e585087", - "topics": [ - "0x0b2e13ff20ac7b474198655583edf70dedd2c1dc980e329c4fbb2fc0748b796b" - ], - "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000046865726500000000000000000000000000000000000000000000000000000000", - "blockHash": "0xcf61faca67dbb2c28952b0b8a379e53b1505ae0821e84779679390cb8571cadb", - "blockNumber": "0x6", - "transactionHash": "0xa57e8e3981a6c861442e46c9471bd19cb3e21f9a8a6c63a72e7b5c47c6675a7c", - "transactionIndex": "0x1", - "logIndex": "0x0", - "transactionLogIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000800000000000000000010000000000000000000000000000180000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100", - "effectiveGasPrice": "0xee6b2800" - }, - { - "transactionHash": "0x11fbb10230c168ca1e36a7e5c69a6dbcd04fd9e64ede39d10a83e36ee8065c16", - "transactionIndex": "0x0", - "blockHash": "0xf1e0ed2eda4e923626ec74621006ed50b3fc27580dc7b4cf68a07ca77420e29c", - "blockNumber": "0x7", - "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "to": "0x0000000000000000000000000000000000001337", - "cumulativeGasUsed": "0x5208", - "gasUsed": "0x5208", - "contractAddress": null, - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "effectiveGasPrice": "0xee6b2800" - } - ], - "libraries": [ - "src/Broadcast.t.sol:F:0x5fbdb2315678afecb367f032d93f642f64180aa3" - ], - "pending": [], - "path": "broadcast/Broadcast.t.sol/31337/run-latest.json", - "returns": {}, - "timestamp": 1655140035 -} diff --git a/contract/lib/foundry-huff b/contract/lib/foundry-huff new file mode 160000 index 0000000..e691315 --- /dev/null +++ b/contract/lib/foundry-huff @@ -0,0 +1 @@ +Subproject commit e691315769147cffb6245536e039e590aed78455 diff --git a/contract/lib/foundry-huff/.github/workflows/tests.yaml b/contract/lib/foundry-huff/.github/workflows/tests.yaml deleted file mode 100644 index f92f508..0000000 --- a/contract/lib/foundry-huff/.github/workflows/tests.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: Tests - -on: [push] - -jobs: - tests: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - - name: Install Huff - uses: huff-language/huff-toolchain@v2 - with: - version: nightly - - - name: Print the Bytecode for fun - run: huffc -b src/test/contracts/Number.huff - - - name: Print the Scripts - run: ls -lsa lib/foundry-huff/scripts/ - - - name: Run Tests - run: forge test -vvv diff --git a/contract/lib/foundry-huff/.gitmodules b/contract/lib/foundry-huff/.gitmodules deleted file mode 100644 index 7d10038..0000000 --- a/contract/lib/foundry-huff/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "lib/solidity-stringutils"] - path = lib/solidity-stringutils - url = https://github.com/Arachnid/solidity-stringutils -[submodule "lib/forge-std"] - path = lib/forge-std - url = https://github.com/foundry-rs/forge-std diff --git a/contract/lib/foundry-huff/LICENSE b/contract/lib/foundry-huff/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/contract/lib/foundry-huff/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/contract/lib/foundry-huff/README.md b/contract/lib/foundry-huff/README.md deleted file mode 100644 index 7a461b9..0000000 --- a/contract/lib/foundry-huff/README.md +++ /dev/null @@ -1,167 +0,0 @@ - - - -# Foundry x Huff - -[![ci](https://github.com/huff-language/huff-rs/actions/workflows/ci.yaml/badge.svg)](https://github.com/huff-language/huff-rs/actions/workflows/ci.yaml) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Discord](https://img.shields.io/discord/980519274600882306) - -A [foundry](https://github.com/foundry-rs/foundry) library for working with [huff](https://github.com/huff-language/huff-rs) contracts. Take a look at our [project template](https://github.com/huff-language/huff-project-template) to see an example project that uses this library. - - -## Installing - -First, install the [huff compiler](https://github.com/huff-language/huff-rs) by running: -``` -curl -L get.huff.sh | bash -``` - -Then, install this library with [forge](https://github.com/foundry-rs/foundry): -``` -forge install huff-language/foundry-huff -``` - - -## Usage - -The HuffDeployer is a Solidity library that takes a filename and deploys the corresponding Huff contract, returning the address that the bytecode was deployed to. To use it, simply import it into your file by doing: - -```js -import {HuffDeployer} from "foundry-huff/HuffDeployer.sol"; -``` - -To compile contracts, you can use `HuffDeployer.deploy(string fileName)`, which takes in a single string representing the filename's path relative to the `src` directory. Note that the file ending, i.e. `.huff`, must be omitted. -Here is an example deployment (where the contract is located in [`src/test/contracts/Number.huff`](./src/test/contracts/Number.huff)): - -```solidity -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.7.0 <0.9.0; - -import {HuffDeployer} from "foundry-huff/HuffDeployer"; - -interface Number { - function setNumber(uint256) external; - function getNumber() external returns (uint256); -} - -contract HuffDeployerExample { - function deploy() public { - // Deploy a new instance of src/test/contracts/Number.huff - address addr = HuffDeployer.deploy("test/contracts/Number"); - - // To call a function on the deployed contract, create an interface and wrap the address like so - Number number = Number(addr); - } -} -``` - -To deploy a Huff contract with constructor arguments, you can _chain_ commands onto the HuffDeployer. - -For example, to deploy the contract [`src/test/contracts/Constructor.huff`](src/test/contracts/Constructor.huff) with arguments `(uint256(0x420), uint256(0x420))`, you are encouraged to follow the logic defined in the `deploy` function of the `HuffDeployerArguments` contract below. - -```solidity -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.7.0 <0.9.0; - -import {HuffDeployer} from "foundry-huff/HuffDeployer"; - -interface Constructor { - function getArgOne() external returns (address); - function getArgTwo() external returns (uint256); -} - -contract HuffDeployerArguments { - function deploy() public { - // Deploy the contract with arguments - address addr = HuffDeployer - .config() - .with_args(bytes.concat(abi.encode(uint256(0x420)), abi.encode(uint256(0x420)))) - .deploy("test/contracts/Constructor"); - - // To call a function on the deployed contract, create an interface and wrap the address - Constructor construct = Constructor(addr); - - // Validate we deployed the Constructor with the correct arguments - assert(construct.getArgOne() == address(0x420)); - assert(construct.getArgTwo() == uint256(0x420)); - } - - function depreciated_deploy() public { - address addr = HuffDeployer.deploy_with_args( - "test/contracts/Constructor", - bytes.concat(abi.encode(uint256(0x420)), abi.encode(uint256(0x420))) - ); - - // ... - } -} -``` - -HuffDeployer also enables you to instantiate contracts, from the test file, even if they have _no constructor macro_! - -This is possible by using [Foundry](https://github.com/foundry-rs/foundry)'s [ffi](https://book.getfoundry.sh/cheatcodes/ffi.html) cheatcode. - -_NOTE: It is highly recommended that you read the foundry book, or at least familiarize yourself with foundry, before using this library to avoid easily susceptible footguns._ - -Let's use the huff contract [`src/test/contracts/NoConstructor.huff`](./src/test/contracts/NoConstructor.huff), which has no defined constructor macro. The inline-instantiation defined in the `deploy` function of the `HuffDeployerCode` contract below is recommended. - -```solidity -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.7.0 <0.9.0; - -import {HuffDeployer} from "foundry-huff/HuffDeployer"; - -interface Constructor { - function getArgOne() external returns (address); - function getArgTwo() external returns (uint256); -} - -contract HuffDeployerCode { - - function deploy() public { - // Define a new constructor macro as a string - string memory constructor_macro = "#define macro CONSTRUCTOR() = takes(0) returns (0) {" - " // Copy the first argument into memory \n" - " 0x20 // [size] - byte size to copy \n" - " 0x40 codesize sub // [offset, size] - offset in the code to copy from\n " - " 0x00 // [mem, offset, size] - offset in memory to copy to \n" - " codecopy // [] \n" - " // Store the first argument in storage\n" - " 0x00 mload // [arg] \n" - " [CONSTRUCTOR_ARG_ONE] // [CONSTRUCTOR_ARG_ONE, arg] \n" - " sstore // [] \n" - " // Copy the second argument into memory \n" - " 0x20 // [size] - byte size to copy \n" - " 0x20 codesize sub // [offset, size] - offset in the code to copy from \n" - " 0x00 // [mem, offset, size] - offset in memory to copy to \n" - " codecopy // [] \n" - " // Store the second argument in storage \n" - " 0x00 mload // [arg] \n" - " [CONSTRUCTOR_ARG_TWO] // [CONSTRUCTOR_ARG_TWO, arg] \n" - " sstore // [] \n" - "}"; - - // Deploy the contract with arguments - address addr = HuffDeployer - .config() - .with_args(bytes.concat(abi.encode(uint256(0x420)), abi.encode(uint256(0x420)))) - .with_code(constructor_macro) - .deploy("test/contracts/NoConstructor"); - - // To call a function on the deployed contract, create an interface and wrap the address - Constructor construct = Constructor(addr); - - // Validate we deployed the Constructor with the correct arguments - assert(construct.getArgOne() == address(0x420)); - assert(construct.getArgTwo() == uint256(0x420)); - } - - function depreciated_deploy_with_code() public { - address addr = HuffDeployer.deploy_with_code( - "test/contracts/Constructor", - constructor_macro - ); - - // ... - } -} -``` diff --git a/contract/lib/foundry-huff/assets/Group 1.png b/contract/lib/foundry-huff/assets/Group 1.png deleted file mode 100644 index 15a5d9e..0000000 Binary files a/contract/lib/foundry-huff/assets/Group 1.png and /dev/null differ diff --git a/contract/lib/foundry-huff/assets/banner.jpg b/contract/lib/foundry-huff/assets/banner.jpg deleted file mode 100644 index ce74a95..0000000 Binary files a/contract/lib/foundry-huff/assets/banner.jpg and /dev/null differ diff --git a/contract/lib/foundry-huff/assets/black_white_huff-removebg-preview.png b/contract/lib/foundry-huff/assets/black_white_huff-removebg-preview.png deleted file mode 100644 index 4118c8e..0000000 Binary files a/contract/lib/foundry-huff/assets/black_white_huff-removebg-preview.png and /dev/null differ diff --git a/contract/lib/foundry-huff/assets/black_white_huff.png b/contract/lib/foundry-huff/assets/black_white_huff.png deleted file mode 100644 index 89ecb96..0000000 Binary files a/contract/lib/foundry-huff/assets/black_white_huff.png and /dev/null differ diff --git a/contract/lib/foundry-huff/assets/foundry.png b/contract/lib/foundry-huff/assets/foundry.png deleted file mode 100644 index 8e24b87..0000000 Binary files a/contract/lib/foundry-huff/assets/foundry.png and /dev/null differ diff --git a/contract/lib/foundry-huff/assets/foundry_huff_banner.jpg b/contract/lib/foundry-huff/assets/foundry_huff_banner.jpg deleted file mode 100644 index b2b7596..0000000 Binary files a/contract/lib/foundry-huff/assets/foundry_huff_banner.jpg and /dev/null differ diff --git a/contract/lib/foundry-huff/assets/foundry_huff_banner.png b/contract/lib/foundry-huff/assets/foundry_huff_banner.png deleted file mode 100644 index 4eb243b..0000000 Binary files a/contract/lib/foundry-huff/assets/foundry_huff_banner.png and /dev/null differ diff --git a/contract/lib/foundry-huff/assets/huff.png b/contract/lib/foundry-huff/assets/huff.png deleted file mode 100644 index d572798..0000000 Binary files a/contract/lib/foundry-huff/assets/huff.png and /dev/null differ diff --git a/contract/lib/foundry-huff/assets/inverted_huff.png b/contract/lib/foundry-huff/assets/inverted_huff.png deleted file mode 100644 index e3ed658..0000000 Binary files a/contract/lib/foundry-huff/assets/inverted_huff.png and /dev/null differ diff --git a/contract/lib/foundry-huff/assets/x-removebg-preview.png b/contract/lib/foundry-huff/assets/x-removebg-preview.png deleted file mode 100644 index ab40629..0000000 Binary files a/contract/lib/foundry-huff/assets/x-removebg-preview.png and /dev/null differ diff --git a/contract/lib/foundry-huff/assets/x.jpg b/contract/lib/foundry-huff/assets/x.jpg deleted file mode 100644 index 1da702c..0000000 Binary files a/contract/lib/foundry-huff/assets/x.jpg and /dev/null differ diff --git a/contract/lib/foundry-huff/foundry.toml b/contract/lib/foundry-huff/foundry.toml deleted file mode 100644 index 8358c71..0000000 --- a/contract/lib/foundry-huff/foundry.toml +++ /dev/null @@ -1,6 +0,0 @@ -[profile.default] -src = 'src' -out = 'out' -libs = ['lib'] -ffi = true -fuzz_runs = 2_000 \ No newline at end of file diff --git a/contract/lib/foundry-huff/lib/forge-std/.github/workflows/tests.yml b/contract/lib/foundry-huff/lib/forge-std/.github/workflows/tests.yml deleted file mode 100644 index 08ab66e..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/.github/workflows/tests.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Tests -on: [push, pull_request] - -jobs: - check: - name: Foundry project - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 - with: - version: nightly - - - name: Install dependencies - run: forge install - - name: Run tests - run: forge test -vvv - - name: Build Test with older solc versions - run: | - forge build --contracts src/Test.sol --use solc:0.8.0 - forge build --contracts src/Test.sol --use solc:0.7.0 - forge build --contracts src/Test.sol --use solc:0.6.0 diff --git a/contract/lib/foundry-huff/lib/forge-std/.gitmodules b/contract/lib/foundry-huff/lib/forge-std/.gitmodules deleted file mode 100644 index e124719..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "lib/ds-test"] - path = lib/ds-test - url = https://github.com/dapphub/ds-test diff --git a/contract/lib/foundry-huff/lib/forge-std/LICENSE-APACHE b/contract/lib/foundry-huff/lib/forge-std/LICENSE-APACHE deleted file mode 100644 index 6873d54..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/LICENSE-APACHE +++ /dev/null @@ -1,203 +0,0 @@ -Copyright (c) 2022 Brock Elmore - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/contract/lib/foundry-huff/lib/forge-std/LICENSE-MIT b/contract/lib/foundry-huff/lib/forge-std/LICENSE-MIT deleted file mode 100644 index 851cd47..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/LICENSE-MIT +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2022 Brock Elmore - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE O THE USE OR OTHER -DEALINGS IN THE SOFTWARE.R diff --git a/contract/lib/foundry-huff/lib/forge-std/README.md b/contract/lib/foundry-huff/lib/forge-std/README.md deleted file mode 100644 index 67dc160..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/README.md +++ /dev/null @@ -1,246 +0,0 @@ -# Forge Standard Library • [![tests](https://github.com/brockelmore/forge-std/actions/workflows/tests.yml/badge.svg)](https://github.com/brockelmore/forge-std/actions/workflows/tests.yml) - -Forge Standard Library is a collection of helpful contracts for use with [`forge` and `foundry`](https://github.com/foundry-rs/foundry). It leverages `forge`'s cheatcodes to make writing tests easier and faster, while improving the UX of cheatcodes. - -**Learn how to use Forge Std with the [📖 Foundry Book (Forge Std Guide)](https://book.getfoundry.sh/forge/forge-std.html).** - -## Install - -```bash -forge install foundry-rs/forge-std -``` - -## Contracts -### stdError - -This is a helper contract for errors and reverts. In `forge`, this contract is particularly helpful for the `expectRevert` cheatcode, as it provides all compiler builtin errors. - -See the contract itself for all error codes. - -#### Example usage - -```solidity - -import "forge-std/Test.sol"; - -contract TestContract is Test { - ErrorsTest test; - - function setUp() public { - test = new ErrorsTest(); - } - - function testExpectArithmetic() public { - vm.expectRevert(stdError.arithmeticError); - test.arithmeticError(10); - } -} - -contract ErrorsTest { - function arithmeticError(uint256 a) public { - uint256 a = a - 100; - } -} -``` - -### stdStorage - -This is a rather large contract due to all of the overloading to make the UX decent. Primarily, it is a wrapper around the `record` and `accesses` cheatcodes. It can *always* find and write the storage slot(s) associated with a particular variable without knowing the storage layout. The one _major_ caveat to this is while a slot can be found for packed storage variables, we can't write to that variable safely. If a user tries to write to a packed slot, the execution throws an error, unless it is uninitialized (`bytes32(0)`). - -This works by recording all `SLOAD`s and `SSTORE`s during a function call. If there is a single slot read or written to, it immediately returns the slot. Otherwise, behind the scenes, we iterate through and check each one (assuming the user passed in a `depth` parameter). If the variable is a struct, you can pass in a `depth` parameter which is basically the field depth. - -I.e.: -```solidity -struct T { - // depth 0 - uint256 a; - // depth 1 - uint256 b; -} -``` - -#### Example usage - -```solidity -import "forge-std/Test.sol"; - -contract TestContract is Test { - using stdStorage for StdStorage; - - Storage test; - - function setUp() public { - test = new Storage(); - } - - function testFindExists() public { - // Lets say we want to find the slot for the public - // variable `exists`. We just pass in the function selector - // to the `find` command - uint256 slot = stdstore.target(address(test)).sig("exists()").find(); - assertEq(slot, 0); - } - - function testWriteExists() public { - // Lets say we want to write to the slot for the public - // variable `exists`. We just pass in the function selector - // to the `checked_write` command - stdstore.target(address(test)).sig("exists()").checked_write(100); - assertEq(test.exists(), 100); - } - - // It supports arbitrary storage layouts, like assembly based storage locations - function testFindHidden() public { - // `hidden` is a random hash of a bytes, iteration through slots would - // not find it. Our mechanism does - // Also, you can use the selector instead of a string - uint256 slot = stdstore.target(address(test)).sig(test.hidden.selector).find(); - assertEq(slot, uint256(keccak256("my.random.var"))); - } - - // If targeting a mapping, you have to pass in the keys necessary to perform the find - // i.e.: - function testFindMapping() public { - uint256 slot = stdstore - .target(address(test)) - .sig(test.map_addr.selector) - .with_key(address(this)) - .find(); - // in the `Storage` constructor, we wrote that this address' value was 1 in the map - // so when we load the slot, we expect it to be 1 - assertEq(uint(vm.load(address(test), bytes32(slot))), 1); - } - - // If the target is a struct, you can specify the field depth: - function testFindStruct() public { - // NOTE: see the depth parameter - 0 means 0th field, 1 means 1st field, etc. - uint256 slot_for_a_field = stdstore - .target(address(test)) - .sig(test.basicStruct.selector) - .depth(0) - .find(); - - uint256 slot_for_b_field = stdstore - .target(address(test)) - .sig(test.basicStruct.selector) - .depth(1) - .find(); - - assertEq(uint(vm.load(address(test), bytes32(slot_for_a_field))), 1); - assertEq(uint(vm.load(address(test), bytes32(slot_for_b_field))), 2); - } -} - -// A complex storage contract -contract Storage { - struct UnpackedStruct { - uint256 a; - uint256 b; - } - - constructor() { - map_addr[msg.sender] = 1; - } - - uint256 public exists = 1; - mapping(address => uint256) public map_addr; - // mapping(address => Packed) public map_packed; - mapping(address => UnpackedStruct) public map_struct; - mapping(address => mapping(address => uint256)) public deep_map; - mapping(address => mapping(address => UnpackedStruct)) public deep_map_struct; - UnpackedStruct public basicStruct = UnpackedStruct({ - a: 1, - b: 2 - }); - - function hidden() public view returns (bytes32 t) { - // an extremely hidden storage slot - bytes32 slot = keccak256("my.random.var"); - assembly { - t := sload(slot) - } - } -} -``` - -### stdCheats - -This is a wrapper over miscellaneous cheatcodes that need wrappers to be more dev friendly. Currently there are only functions related to `prank`. In general, users may expect ETH to be put into an address on `prank`, but this is not the case for safety reasons. Explicitly this `hoax` function should only be used for address that have expected balances as it will get overwritten. If an address already has ETH, you should just use `prank`. If you want to change that balance explicitly, just use `deal`. If you want to do both, `hoax` is also right for you. - - -#### Example usage: -```solidity - -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "forge-std/Test.sol"; - -// Inherit the stdCheats -contract StdCheatsTest is Test { - Bar test; - function setUp() public { - test = new Bar(); - } - - function testHoax() public { - // we call `hoax`, which gives the target address - // eth and then calls `prank` - hoax(address(1337)); - test.bar{value: 100}(address(1337)); - - // overloaded to allow you to specify how much eth to - // initialize the address with - hoax(address(1337), 1); - test.bar{value: 1}(address(1337)); - } - - function testStartHoax() public { - // we call `startHoax`, which gives the target address - // eth and then calls `startPrank` - // - // it is also overloaded so that you can specify an eth amount - startHoax(address(1337)); - test.bar{value: 100}(address(1337)); - test.bar{value: 100}(address(1337)); - vm.stopPrank(); - test.bar(address(this)); - } -} - -contract Bar { - function bar(address expectedSender) public payable { - require(msg.sender == expectedSender, "!prank"); - } -} -``` - -### Std Assertions - -Expand upon the assertion functions from the `DSTest` library. - -### `console.log` - -Usage follows the same format as [Hardhat](https://hardhat.org/hardhat-network/reference/#console-log). -It's recommended to use `console2.sol` as shown below, as this will show the decoded logs in Forge traces. - -```solidity -// import it indirectly via Test.sol -import "forge-std/Test.sol"; -// or directly import it -import "forge-std/console2.sol"; -... -console2.log(someValue); -``` - -If you need compatibility with Hardhat, you must use the standard `console.sol` instead. -Due to a bug in `console.sol`, logs that use `uint256` or `int256` types will not be properly decoded in Forge traces. - -```solidity -// import it indirectly via Test.sol -import "forge-std/Test.sol"; -// or directly import it -import "forge-std/console.sol"; -... -console.log(someValue); -``` diff --git a/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/LICENSE b/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/LICENSE deleted file mode 100644 index 94a9ed0..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/Makefile b/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/Makefile deleted file mode 100644 index 661dac4..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -all:; dapp build - -test: - -dapp --use solc:0.4.23 build - -dapp --use solc:0.4.26 build - -dapp --use solc:0.5.17 build - -dapp --use solc:0.6.12 build - -dapp --use solc:0.7.5 build - -demo: - DAPP_SRC=demo dapp --use solc:0.7.5 build - -hevm dapp-test --verbose 3 - -.PHONY: test demo diff --git a/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/default.nix b/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/default.nix deleted file mode 100644 index cf65419..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ solidityPackage, dappsys }: solidityPackage { - name = "ds-test"; - src = ./src; -} diff --git a/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/demo/demo.sol b/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/demo/demo.sol deleted file mode 100644 index f3bb48e..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/demo/demo.sol +++ /dev/null @@ -1,222 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.5.0; - -import "../src/test.sol"; - -contract DemoTest is DSTest { - function test_this() public pure { - require(true); - } - function test_logs() public { - emit log("-- log(string)"); - emit log("a string"); - - emit log("-- log_named_uint(string, uint)"); - emit log_named_uint("uint", 512); - - emit log("-- log_named_int(string, int)"); - emit log_named_int("int", -512); - - emit log("-- log_named_address(string, address)"); - emit log_named_address("address", address(this)); - - emit log("-- log_named_bytes32(string, bytes32)"); - emit log_named_bytes32("bytes32", "a string"); - - emit log("-- log_named_bytes(string, bytes)"); - emit log_named_bytes("bytes", hex"cafefe"); - - emit log("-- log_named_string(string, string)"); - emit log_named_string("string", "a string"); - - emit log("-- log_named_decimal_uint(string, uint, uint)"); - emit log_named_decimal_uint("decimal uint", 1.0e18, 18); - - emit log("-- log_named_decimal_int(string, int, uint)"); - emit log_named_decimal_int("decimal int", -1.0e18, 18); - } - event log_old_named_uint(bytes32,uint); - function test_old_logs() public { - emit log_old_named_uint("key", 500); - emit log_named_bytes32("bkey", "val"); - } - function test_trace() public view { - this.echo("string 1", "string 2"); - } - function test_multiline() public { - emit log("a multiline\\nstring"); - emit log("a multiline string"); - emit log_bytes("a string"); - emit log_bytes("a multiline\nstring"); - emit log_bytes("a multiline\\nstring"); - emit logs(hex"0000"); - emit log_named_bytes("0x0000", hex"0000"); - emit logs(hex"ff"); - } - function echo(string memory s1, string memory s2) public pure - returns (string memory, string memory) - { - return (s1, s2); - } - - function prove_this(uint x) public { - emit log_named_uint("sym x", x); - assertGt(x + 1, 0); - } - - function test_logn() public { - assembly { - log0(0x01, 0x02) - log1(0x01, 0x02, 0x03) - log2(0x01, 0x02, 0x03, 0x04) - log3(0x01, 0x02, 0x03, 0x04, 0x05) - } - } - - event MyEvent(uint, uint indexed, uint, uint indexed); - function test_events() public { - emit MyEvent(1, 2, 3, 4); - } - - function test_asserts() public { - string memory err = "this test has failed!"; - emit log("## assertTrue(bool)\n"); - assertTrue(false); - emit log("\n"); - assertTrue(false, err); - - emit log("\n## assertEq(address,address)\n"); - assertEq(address(this), msg.sender); - emit log("\n"); - assertEq(address(this), msg.sender, err); - - emit log("\n## assertEq32(bytes32,bytes32)\n"); - assertEq32("bytes 1", "bytes 2"); - emit log("\n"); - assertEq32("bytes 1", "bytes 2", err); - - emit log("\n## assertEq(bytes32,bytes32)\n"); - assertEq32("bytes 1", "bytes 2"); - emit log("\n"); - assertEq32("bytes 1", "bytes 2", err); - - emit log("\n## assertEq(uint,uint)\n"); - assertEq(uint(0), 1); - emit log("\n"); - assertEq(uint(0), 1, err); - - emit log("\n## assertEq(int,int)\n"); - assertEq(-1, -2); - emit log("\n"); - assertEq(-1, -2, err); - - emit log("\n## assertEqDecimal(int,int,uint)\n"); - assertEqDecimal(-1.0e18, -1.1e18, 18); - emit log("\n"); - assertEqDecimal(-1.0e18, -1.1e18, 18, err); - - emit log("\n## assertEqDecimal(uint,uint,uint)\n"); - assertEqDecimal(uint(1.0e18), 1.1e18, 18); - emit log("\n"); - assertEqDecimal(uint(1.0e18), 1.1e18, 18, err); - - emit log("\n## assertGt(uint,uint)\n"); - assertGt(uint(0), 0); - emit log("\n"); - assertGt(uint(0), 0, err); - - emit log("\n## assertGt(int,int)\n"); - assertGt(-1, -1); - emit log("\n"); - assertGt(-1, -1, err); - - emit log("\n## assertGtDecimal(int,int,uint)\n"); - assertGtDecimal(-2.0e18, -1.1e18, 18); - emit log("\n"); - assertGtDecimal(-2.0e18, -1.1e18, 18, err); - - emit log("\n## assertGtDecimal(uint,uint,uint)\n"); - assertGtDecimal(uint(1.0e18), 1.1e18, 18); - emit log("\n"); - assertGtDecimal(uint(1.0e18), 1.1e18, 18, err); - - emit log("\n## assertGe(uint,uint)\n"); - assertGe(uint(0), 1); - emit log("\n"); - assertGe(uint(0), 1, err); - - emit log("\n## assertGe(int,int)\n"); - assertGe(-1, 0); - emit log("\n"); - assertGe(-1, 0, err); - - emit log("\n## assertGeDecimal(int,int,uint)\n"); - assertGeDecimal(-2.0e18, -1.1e18, 18); - emit log("\n"); - assertGeDecimal(-2.0e18, -1.1e18, 18, err); - - emit log("\n## assertGeDecimal(uint,uint,uint)\n"); - assertGeDecimal(uint(1.0e18), 1.1e18, 18); - emit log("\n"); - assertGeDecimal(uint(1.0e18), 1.1e18, 18, err); - - emit log("\n## assertLt(uint,uint)\n"); - assertLt(uint(0), 0); - emit log("\n"); - assertLt(uint(0), 0, err); - - emit log("\n## assertLt(int,int)\n"); - assertLt(-1, -1); - emit log("\n"); - assertLt(-1, -1, err); - - emit log("\n## assertLtDecimal(int,int,uint)\n"); - assertLtDecimal(-1.0e18, -1.1e18, 18); - emit log("\n"); - assertLtDecimal(-1.0e18, -1.1e18, 18, err); - - emit log("\n## assertLtDecimal(uint,uint,uint)\n"); - assertLtDecimal(uint(2.0e18), 1.1e18, 18); - emit log("\n"); - assertLtDecimal(uint(2.0e18), 1.1e18, 18, err); - - emit log("\n## assertLe(uint,uint)\n"); - assertLe(uint(1), 0); - emit log("\n"); - assertLe(uint(1), 0, err); - - emit log("\n## assertLe(int,int)\n"); - assertLe(0, -1); - emit log("\n"); - assertLe(0, -1, err); - - emit log("\n## assertLeDecimal(int,int,uint)\n"); - assertLeDecimal(-1.0e18, -1.1e18, 18); - emit log("\n"); - assertLeDecimal(-1.0e18, -1.1e18, 18, err); - - emit log("\n## assertLeDecimal(uint,uint,uint)\n"); - assertLeDecimal(uint(2.0e18), 1.1e18, 18); - emit log("\n"); - assertLeDecimal(uint(2.0e18), 1.1e18, 18, err); - - emit log("\n## assertEq(string,string)\n"); - string memory s1 = "string 1"; - string memory s2 = "string 2"; - assertEq(s1, s2); - emit log("\n"); - assertEq(s1, s2, err); - - emit log("\n## assertEq0(bytes,bytes)\n"); - assertEq0(hex"abcdef01", hex"abcdef02"); - emit log("\n"); - assertEq0(hex"abcdef01", hex"abcdef02", err); - } -} - -contract DemoTestWithSetUp { - function setUp() public { - } - function test_pass() public pure { - } -} diff --git a/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/src/test.sol b/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/src/test.sol deleted file mode 100644 index 515a3bd..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/lib/ds-test/src/test.sol +++ /dev/null @@ -1,469 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity >=0.5.0; - -contract DSTest { - event log (string); - event logs (bytes); - - event log_address (address); - event log_bytes32 (bytes32); - event log_int (int); - event log_uint (uint); - event log_bytes (bytes); - event log_string (string); - - event log_named_address (string key, address val); - event log_named_bytes32 (string key, bytes32 val); - event log_named_decimal_int (string key, int val, uint decimals); - event log_named_decimal_uint (string key, uint val, uint decimals); - event log_named_int (string key, int val); - event log_named_uint (string key, uint val); - event log_named_bytes (string key, bytes val); - event log_named_string (string key, string val); - - bool public IS_TEST = true; - bool private _failed; - - address constant HEVM_ADDRESS = - address(bytes20(uint160(uint256(keccak256('hevm cheat code'))))); - - modifier mayRevert() { _; } - modifier testopts(string memory) { _; } - - function failed() public returns (bool) { - if (_failed) { - return _failed; - } else { - bool globalFailed = false; - if (hasHEVMContext()) { - (, bytes memory retdata) = HEVM_ADDRESS.call( - abi.encodePacked( - bytes4(keccak256("load(address,bytes32)")), - abi.encode(HEVM_ADDRESS, bytes32("failed")) - ) - ); - globalFailed = abi.decode(retdata, (bool)); - } - return globalFailed; - } - } - - function fail() internal { - if (hasHEVMContext()) { - (bool status, ) = HEVM_ADDRESS.call( - abi.encodePacked( - bytes4(keccak256("store(address,bytes32,bytes32)")), - abi.encode(HEVM_ADDRESS, bytes32("failed"), bytes32(uint256(0x01))) - ) - ); - status; // Silence compiler warnings - } - _failed = true; - } - - function hasHEVMContext() internal view returns (bool) { - uint256 hevmCodeSize = 0; - assembly { - hevmCodeSize := extcodesize(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D) - } - return hevmCodeSize > 0; - } - - modifier logs_gas() { - uint startGas = gasleft(); - _; - uint endGas = gasleft(); - emit log_named_uint("gas", startGas - endGas); - } - - function assertTrue(bool condition) internal { - if (!condition) { - emit log("Error: Assertion Failed"); - fail(); - } - } - - function assertTrue(bool condition, string memory err) internal { - if (!condition) { - emit log_named_string("Error", err); - assertTrue(condition); - } - } - - function assertEq(address a, address b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [address]"); - emit log_named_address(" Expected", b); - emit log_named_address(" Actual", a); - fail(); - } - } - function assertEq(address a, address b, string memory err) internal { - if (a != b) { - emit log_named_string ("Error", err); - assertEq(a, b); - } - } - - function assertEq(bytes32 a, bytes32 b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [bytes32]"); - emit log_named_bytes32(" Expected", b); - emit log_named_bytes32(" Actual", a); - fail(); - } - } - function assertEq(bytes32 a, bytes32 b, string memory err) internal { - if (a != b) { - emit log_named_string ("Error", err); - assertEq(a, b); - } - } - function assertEq32(bytes32 a, bytes32 b) internal { - assertEq(a, b); - } - function assertEq32(bytes32 a, bytes32 b, string memory err) internal { - assertEq(a, b, err); - } - - function assertEq(int a, int b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [int]"); - emit log_named_int(" Expected", b); - emit log_named_int(" Actual", a); - fail(); - } - } - function assertEq(int a, int b, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - function assertEq(uint a, uint b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [uint]"); - emit log_named_uint(" Expected", b); - emit log_named_uint(" Actual", a); - fail(); - } - } - function assertEq(uint a, uint b, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - function assertEqDecimal(int a, int b, uint decimals) internal { - if (a != b) { - emit log("Error: a == b not satisfied [decimal int]"); - emit log_named_decimal_int(" Expected", b, decimals); - emit log_named_decimal_int(" Actual", a, decimals); - fail(); - } - } - function assertEqDecimal(int a, int b, uint decimals, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEqDecimal(a, b, decimals); - } - } - function assertEqDecimal(uint a, uint b, uint decimals) internal { - if (a != b) { - emit log("Error: a == b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Expected", b, decimals); - emit log_named_decimal_uint(" Actual", a, decimals); - fail(); - } - } - function assertEqDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEqDecimal(a, b, decimals); - } - } - - function assertGt(uint a, uint b) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertGt(uint a, uint b, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGt(a, b); - } - } - function assertGt(int a, int b) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertGt(int a, int b, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGt(a, b); - } - } - function assertGtDecimal(int a, int b, uint decimals) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertGtDecimal(int a, int b, uint decimals, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGtDecimal(a, b, decimals); - } - } - function assertGtDecimal(uint a, uint b, uint decimals) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertGtDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGtDecimal(a, b, decimals); - } - } - - function assertGe(uint a, uint b) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertGe(uint a, uint b, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGe(a, b); - } - } - function assertGe(int a, int b) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertGe(int a, int b, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGe(a, b); - } - } - function assertGeDecimal(int a, int b, uint decimals) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertGeDecimal(int a, int b, uint decimals, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGeDecimal(a, b, decimals); - } - } - function assertGeDecimal(uint a, uint b, uint decimals) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertGeDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGeDecimal(a, b, decimals); - } - } - - function assertLt(uint a, uint b) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertLt(uint a, uint b, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLt(a, b); - } - } - function assertLt(int a, int b) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertLt(int a, int b, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLt(a, b); - } - } - function assertLtDecimal(int a, int b, uint decimals) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertLtDecimal(int a, int b, uint decimals, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLtDecimal(a, b, decimals); - } - } - function assertLtDecimal(uint a, uint b, uint decimals) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertLtDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLtDecimal(a, b, decimals); - } - } - - function assertLe(uint a, uint b) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertLe(uint a, uint b, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLe(a, b); - } - } - function assertLe(int a, int b) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertLe(int a, int b, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLe(a, b); - } - } - function assertLeDecimal(int a, int b, uint decimals) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertLeDecimal(int a, int b, uint decimals, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLeDecimal(a, b, decimals); - } - } - function assertLeDecimal(uint a, uint b, uint decimals) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertLeDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertGeDecimal(a, b, decimals); - } - } - - function assertEq(string memory a, string memory b) internal { - if (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b))) { - emit log("Error: a == b not satisfied [string]"); - emit log_named_string(" Expected", b); - emit log_named_string(" Actual", a); - fail(); - } - } - function assertEq(string memory a, string memory b, string memory err) internal { - if (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b))) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - - function checkEq0(bytes memory a, bytes memory b) internal pure returns (bool ok) { - ok = true; - if (a.length == b.length) { - for (uint i = 0; i < a.length; i++) { - if (a[i] != b[i]) { - ok = false; - } - } - } else { - ok = false; - } - } - function assertEq0(bytes memory a, bytes memory b) internal { - if (!checkEq0(a, b)) { - emit log("Error: a == b not satisfied [bytes]"); - emit log_named_bytes(" Expected", b); - emit log_named_bytes(" Actual", a); - fail(); - } - } - function assertEq0(bytes memory a, bytes memory b, string memory err) internal { - if (!checkEq0(a, b)) { - emit log_named_string("Error", err); - assertEq0(a, b); - } - } -} diff --git a/contract/lib/foundry-huff/lib/forge-std/src/Script.sol b/contract/lib/foundry-huff/lib/forge-std/src/Script.sol deleted file mode 100644 index 7ff79b9..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/src/Script.sol +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.9.0; - -import "./Vm.sol"; -import "./console.sol"; -import "./console2.sol"; - -abstract contract Script { - bool public IS_SCRIPT = true; - address constant private VM_ADDRESS = - address(bytes20(uint160(uint256(keccak256('hevm cheat code'))))); - - Vm public constant vm = Vm(VM_ADDRESS); - - /// @dev Compute the address a contract will be deployed at for a given deployer address and nonce - /// @notice adapated from Solmate implementation (https://github.com/Rari-Capital/solmate/blob/main/src/utils/LibRLP.sol) - function computeCreateAddress(address deployer, uint256 nonce) internal pure returns (address) { - // The integer zero is treated as an empty byte string, and as a result it only has a length prefix, 0x80, computed via 0x80 + 0. - // A one byte integer uses its own value as its length prefix, there is no additional "0x80 + length" prefix that comes before it. - if (nonce == 0x00) return addressFromLast20Bytes(keccak256(abi.encodePacked(bytes1(0xd6), bytes1(0x94), deployer, bytes1(0x80)))); - if (nonce <= 0x7f) return addressFromLast20Bytes(keccak256(abi.encodePacked(bytes1(0xd6), bytes1(0x94), deployer, uint8(nonce)))); - - // Nonces greater than 1 byte all follow a consistent encoding scheme, where each value is preceded by a prefix of 0x80 + length. - if (nonce <= 2**8 - 1) return addressFromLast20Bytes(keccak256(abi.encodePacked(bytes1(0xd7), bytes1(0x94), deployer, bytes1(0x81), uint8(nonce)))); - if (nonce <= 2**16 - 1) return addressFromLast20Bytes(keccak256(abi.encodePacked(bytes1(0xd8), bytes1(0x94), deployer, bytes1(0x82), uint16(nonce)))); - if (nonce <= 2**24 - 1) return addressFromLast20Bytes(keccak256(abi.encodePacked(bytes1(0xd9), bytes1(0x94), deployer, bytes1(0x83), uint24(nonce)))); - - // More details about RLP encoding can be found here: https://eth.wiki/fundamentals/rlp - // 0xda = 0xc0 (short RLP prefix) + 0x16 (length of: 0x94 ++ proxy ++ 0x84 ++ nonce) - // 0x94 = 0x80 + 0x14 (0x14 = the length of an address, 20 bytes, in hex) - // 0x84 = 0x80 + 0x04 (0x04 = the bytes length of the nonce, 4 bytes, in hex) - // We assume nobody can have a nonce large enough to require more than 32 bytes. - return addressFromLast20Bytes(keccak256(abi.encodePacked(bytes1(0xda), bytes1(0x94), deployer, bytes1(0x84), uint32(nonce)))); - } - - function addressFromLast20Bytes(bytes32 bytesValue) internal pure returns (address) { - return address(uint160(uint256(bytesValue))); - } -} diff --git a/contract/lib/foundry-huff/lib/forge-std/src/Test.sol b/contract/lib/foundry-huff/lib/forge-std/src/Test.sol deleted file mode 100644 index de6e2cb..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/src/Test.sol +++ /dev/null @@ -1,734 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.9.0; - -import "./Script.sol"; -import "ds-test/test.sol"; - -// Wrappers around Cheatcodes to avoid footguns -abstract contract Test is DSTest, Script { - using stdStorage for StdStorage; - - uint256 internal constant UINT256_MAX = - 115792089237316195423570985008687907853269984665640564039457584007913129639935; - - StdStorage internal stdstore; - - /*////////////////////////////////////////////////////////////////////////// - STD-LOGS - //////////////////////////////////////////////////////////////////////////*/ - - event log_array(uint256[] val); - event log_array(int256[] val); - event log_array(address[] val); - event log_named_array(string key, uint256[] val); - event log_named_array(string key, int256[] val); - event log_named_array(string key, address[] val); - - /*////////////////////////////////////////////////////////////////////////// - STD-CHEATS - //////////////////////////////////////////////////////////////////////////*/ - - // Skip forward or rewind time by the specified number of seconds - function skip(uint256 time) public { - vm.warp(block.timestamp + time); - } - - function rewind(uint256 time) public { - vm.warp(block.timestamp - time); - } - - // Setup a prank from an address that has some ether - function hoax(address who) public { - vm.deal(who, 1 << 128); - vm.prank(who); - } - - function hoax(address who, uint256 give) public { - vm.deal(who, give); - vm.prank(who); - } - - function hoax(address who, address origin) public { - vm.deal(who, 1 << 128); - vm.prank(who, origin); - } - - function hoax(address who, address origin, uint256 give) public { - vm.deal(who, give); - vm.prank(who, origin); - } - - // Start perpetual prank from an address that has some ether - function startHoax(address who) public { - vm.deal(who, 1 << 128); - vm.startPrank(who); - } - - function startHoax(address who, uint256 give) public { - vm.deal(who, give); - vm.startPrank(who); - } - - // Start perpetual prank from an address that has some ether - // tx.origin is set to the origin parameter - function startHoax(address who, address origin) public { - vm.deal(who, 1 << 128); - vm.startPrank(who, origin); - } - - function startHoax(address who, address origin, uint256 give) public { - vm.deal(who, give); - vm.startPrank(who, origin); - } - - function changePrank(address who) internal { - vm.stopPrank(); - vm.startPrank(who); - } - - // DEPRECATED: Use `deal` instead - function tip(address token, address to, uint256 give) public { - emit log_named_string("WARNING", "Test tip(address,address,uint256): The `tip` stdcheat has been deprecated. Use `deal` instead."); - stdstore - .target(token) - .sig(0x70a08231) - .with_key(to) - .checked_write(give); - } - - // The same as Vm's `deal` - // Use the alternative signature for ERC20 tokens - function deal(address to, uint256 give) public { - vm.deal(to, give); - } - - // Set the balance of an account for any ERC20 token - // Use the alternative signature to update `totalSupply` - function deal(address token, address to, uint256 give) public { - deal(token, to, give, false); - } - - function deal(address token, address to, uint256 give, bool adjust) public { - // get current balance - (, bytes memory balData) = token.call(abi.encodeWithSelector(0x70a08231, to)); - uint256 prevBal = abi.decode(balData, (uint256)); - - // update balance - stdstore - .target(token) - .sig(0x70a08231) - .with_key(to) - .checked_write(give); - - // update total supply - if(adjust){ - (, bytes memory totSupData) = token.call(abi.encodeWithSelector(0x18160ddd)); - uint256 totSup = abi.decode(totSupData, (uint256)); - if(give < prevBal) { - totSup -= (prevBal - give); - } else { - totSup += (give - prevBal); - } - stdstore - .target(token) - .sig(0x18160ddd) - .checked_write(totSup); - } - } - - function bound(uint256 x, uint256 min, uint256 max) internal virtual returns (uint256 result) { - require(min <= max, "Test bound(uint256,uint256,uint256): Max is less than min."); - - uint256 size = max - min; - - if (size == 0) - { - result = min; - } - else if (size == UINT256_MAX) - { - result = x; - } - else - { - ++size; // make `max` inclusive - uint256 mod = x % size; - result = min + mod; - } - - emit log_named_uint("Bound Result", result); - } - - // Deploy a contract by fetching the contract bytecode from - // the artifacts directory - // e.g. `deployCode(code, abi.encode(arg1,arg2,arg3))` - function deployCode(string memory what, bytes memory args) - public - returns (address addr) - { - bytes memory bytecode = abi.encodePacked(vm.getCode(what), args); - /// @solidity memory-safe-assembly - assembly { - addr := create(0, add(bytecode, 0x20), mload(bytecode)) - } - - require( - addr != address(0), - "Test deployCode(string,bytes): Deployment failed." - ); - } - - function deployCode(string memory what) - public - returns (address addr) - { - bytes memory bytecode = vm.getCode(what); - /// @solidity memory-safe-assembly - assembly { - addr := create(0, add(bytecode, 0x20), mload(bytecode)) - } - - require( - addr != address(0), - "Test deployCode(string): Deployment failed." - ); - } - - /*////////////////////////////////////////////////////////////////////////// - STD-ASSERTIONS - //////////////////////////////////////////////////////////////////////////*/ - - function fail(string memory err) internal virtual { - emit log_named_string("Error", err); - fail(); - } - - function assertFalse(bool data) internal virtual { - assertTrue(!data); - } - - function assertFalse(bool data, string memory err) internal virtual { - assertTrue(!data, err); - } - - function assertEq(bool a, bool b) internal { - if (a != b) { - emit log ("Error: a == b not satisfied [bool]"); - emit log_named_string (" Expected", b ? "true" : "false"); - emit log_named_string (" Actual", a ? "true" : "false"); - fail(); - } - } - - function assertEq(bool a, bool b, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - - function assertEq(bytes memory a, bytes memory b) internal { - assertEq0(a, b); - } - - function assertEq(bytes memory a, bytes memory b, string memory err) internal { - assertEq0(a, b, err); - } - - function assertEq(uint256[] memory a, uint256[] memory b) internal { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log("Error: a == b not satisfied [uint[]]"); - emit log_named_array(" Expected", b); - emit log_named_array(" Actual", a); - fail(); - } - } - - function assertEq(int256[] memory a, int256[] memory b) internal { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log("Error: a == b not satisfied [int[]]"); - emit log_named_array(" Expected", b); - emit log_named_array(" Actual", a); - fail(); - } - } - - function assertEq(address[] memory a, address[] memory b) internal { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log("Error: a == b not satisfied [address[]]"); - emit log_named_array(" Expected", b); - emit log_named_array(" Actual", a); - fail(); - } - } - - function assertEq(uint256[] memory a, uint256[] memory b, string memory err) internal { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - - function assertEq(int256[] memory a, int256[] memory b, string memory err) internal { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - - - function assertEq(address[] memory a, address[] memory b, string memory err) internal { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - - function assertApproxEqAbs( - uint256 a, - uint256 b, - uint256 maxDelta - ) internal virtual { - uint256 delta = stdMath.delta(a, b); - - if (delta > maxDelta) { - emit log ("Error: a ~= b not satisfied [uint]"); - emit log_named_uint (" Expected", b); - emit log_named_uint (" Actual", a); - emit log_named_uint (" Max Delta", maxDelta); - emit log_named_uint (" Delta", delta); - fail(); - } - } - - function assertApproxEqAbs( - uint256 a, - uint256 b, - uint256 maxDelta, - string memory err - ) internal virtual { - uint256 delta = stdMath.delta(a, b); - - if (delta > maxDelta) { - emit log_named_string ("Error", err); - assertApproxEqAbs(a, b, maxDelta); - } - } - - function assertApproxEqAbs( - int256 a, - int256 b, - uint256 maxDelta - ) internal virtual { - uint256 delta = stdMath.delta(a, b); - - if (delta > maxDelta) { - emit log ("Error: a ~= b not satisfied [int]"); - emit log_named_int (" Expected", b); - emit log_named_int (" Actual", a); - emit log_named_uint (" Max Delta", maxDelta); - emit log_named_uint (" Delta", delta); - fail(); - } - } - - function assertApproxEqAbs( - int256 a, - int256 b, - uint256 maxDelta, - string memory err - ) internal virtual { - uint256 delta = stdMath.delta(a, b); - - if (delta > maxDelta) { - emit log_named_string ("Error", err); - assertApproxEqAbs(a, b, maxDelta); - } - } - - function assertApproxEqRel( - uint256 a, - uint256 b, - uint256 maxPercentDelta // An 18 decimal fixed point number, where 1e18 == 100% - ) internal virtual { - if (b == 0) return assertEq(a, b); // If the expected is 0, actual must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log ("Error: a ~= b not satisfied [uint]"); - emit log_named_uint (" Expected", b); - emit log_named_uint (" Actual", a); - emit log_named_decimal_uint (" Max % Delta", maxPercentDelta, 18); - emit log_named_decimal_uint (" % Delta", percentDelta, 18); - fail(); - } - } - - function assertApproxEqRel( - uint256 a, - uint256 b, - uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100% - string memory err - ) internal virtual { - if (b == 0) return assertEq(a, b); // If the expected is 0, actual must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log_named_string ("Error", err); - assertApproxEqRel(a, b, maxPercentDelta); - } - } - - function assertApproxEqRel( - int256 a, - int256 b, - uint256 maxPercentDelta - ) internal virtual { - if (b == 0) return assertEq(a, b); // If the expected is 0, actual must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log ("Error: a ~= b not satisfied [int]"); - emit log_named_int (" Expected", b); - emit log_named_int (" Actual", a); - emit log_named_decimal_uint(" Max % Delta", maxPercentDelta, 18); - emit log_named_decimal_uint(" % Delta", percentDelta, 18); - fail(); - } - } - - function assertApproxEqRel( - int256 a, - int256 b, - uint256 maxPercentDelta, - string memory err - ) internal virtual { - if (b == 0) return assertEq(a, b); // If the expected is 0, actual must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log_named_string ("Error", err); - assertApproxEqRel(a, b, maxPercentDelta); - } - } -} - -/*////////////////////////////////////////////////////////////////////////// - STD-ERRORS -//////////////////////////////////////////////////////////////////////////*/ - -library stdError { - bytes public constant assertionError = abi.encodeWithSignature("Panic(uint256)", 0x01); - bytes public constant arithmeticError = abi.encodeWithSignature("Panic(uint256)", 0x11); - bytes public constant divisionError = abi.encodeWithSignature("Panic(uint256)", 0x12); - bytes public constant enumConversionError = abi.encodeWithSignature("Panic(uint256)", 0x21); - bytes public constant encodeStorageError = abi.encodeWithSignature("Panic(uint256)", 0x22); - bytes public constant popError = abi.encodeWithSignature("Panic(uint256)", 0x31); - bytes public constant indexOOBError = abi.encodeWithSignature("Panic(uint256)", 0x32); - bytes public constant memOverflowError = abi.encodeWithSignature("Panic(uint256)", 0x41); - bytes public constant zeroVarError = abi.encodeWithSignature("Panic(uint256)", 0x51); - // DEPRECATED: Use Vm's `expectRevert` without any arguments instead - bytes public constant lowLevelError = bytes(""); // `0x` -} - -/*////////////////////////////////////////////////////////////////////////// - STD-STORAGE -//////////////////////////////////////////////////////////////////////////*/ - -struct StdStorage { - mapping (address => mapping(bytes4 => mapping(bytes32 => uint256))) slots; - mapping (address => mapping(bytes4 => mapping(bytes32 => bool))) finds; - - bytes32[] _keys; - bytes4 _sig; - uint256 _depth; - address _target; - bytes32 _set; -} - -library stdStorage { - event SlotFound(address who, bytes4 fsig, bytes32 keysHash, uint slot); - event WARNING_UninitedSlot(address who, uint slot); - - uint256 private constant UINT256_MAX = 115792089237316195423570985008687907853269984665640564039457584007913129639935; - int256 private constant INT256_MAX = 57896044618658097711785492504343953926634992332820282019728792003956564819967; - - Vm private constant vm_std_store = Vm(address(uint160(uint256(keccak256('hevm cheat code'))))); - - function sigs( - string memory sigStr - ) - internal - pure - returns (bytes4) - { - return bytes4(keccak256(bytes(sigStr))); - } - - /// @notice find an arbitrary storage slot given a function sig, input data, address of the contract and a value to check against - // slot complexity: - // if flat, will be bytes32(uint256(uint)); - // if map, will be keccak256(abi.encode(key, uint(slot))); - // if deep map, will be keccak256(abi.encode(key1, keccak256(abi.encode(key0, uint(slot))))); - // if map struct, will be bytes32(uint256(keccak256(abi.encode(key1, keccak256(abi.encode(key0, uint(slot)))))) + structFieldDepth); - function find( - StdStorage storage self - ) - internal - returns (uint256) - { - address who = self._target; - bytes4 fsig = self._sig; - uint256 field_depth = self._depth; - bytes32[] memory ins = self._keys; - - // calldata to test against - if (self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]) { - return self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]; - } - bytes memory cald = abi.encodePacked(fsig, flatten(ins)); - vm_std_store.record(); - bytes32 fdat; - { - (, bytes memory rdat) = who.staticcall(cald); - fdat = bytesToBytes32(rdat, 32*field_depth); - } - - (bytes32[] memory reads, ) = vm_std_store.accesses(address(who)); - if (reads.length == 1) { - bytes32 curr = vm_std_store.load(who, reads[0]); - if (curr == bytes32(0)) { - emit WARNING_UninitedSlot(who, uint256(reads[0])); - } - if (fdat != curr) { - require(false, "stdStorage find(StdStorage): Packed slot. This would cause dangerous overwriting and currently isn't supported."); - } - emit SlotFound(who, fsig, keccak256(abi.encodePacked(ins, field_depth)), uint256(reads[0])); - self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = uint256(reads[0]); - self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = true; - } else if (reads.length > 1) { - for (uint256 i = 0; i < reads.length; i++) { - bytes32 prev = vm_std_store.load(who, reads[i]); - if (prev == bytes32(0)) { - emit WARNING_UninitedSlot(who, uint256(reads[i])); - } - // store - vm_std_store.store(who, reads[i], bytes32(hex"1337")); - bool success; - bytes memory rdat; - { - (success, rdat) = who.staticcall(cald); - fdat = bytesToBytes32(rdat, 32*field_depth); - } - - if (success && fdat == bytes32(hex"1337")) { - // we found which of the slots is the actual one - emit SlotFound(who, fsig, keccak256(abi.encodePacked(ins, field_depth)), uint256(reads[i])); - self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = uint256(reads[i]); - self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = true; - vm_std_store.store(who, reads[i], prev); - break; - } - vm_std_store.store(who, reads[i], prev); - } - } else { - require(false, "stdStorage find(StdStorage): No storage use detected for target."); - } - - require(self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))], "stdStorage find(StdStorage): Slot(s) not found."); - - delete self._target; - delete self._sig; - delete self._keys; - delete self._depth; - - return self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]; - } - - function target(StdStorage storage self, address _target) internal returns (StdStorage storage) { - self._target = _target; - return self; - } - - function sig(StdStorage storage self, bytes4 _sig) internal returns (StdStorage storage) { - self._sig = _sig; - return self; - } - - function sig(StdStorage storage self, string memory _sig) internal returns (StdStorage storage) { - self._sig = sigs(_sig); - return self; - } - - function with_key(StdStorage storage self, address who) internal returns (StdStorage storage) { - self._keys.push(bytes32(uint256(uint160(who)))); - return self; - } - - function with_key(StdStorage storage self, uint256 amt) internal returns (StdStorage storage) { - self._keys.push(bytes32(amt)); - return self; - } - function with_key(StdStorage storage self, bytes32 key) internal returns (StdStorage storage) { - self._keys.push(key); - return self; - } - - function depth(StdStorage storage self, uint256 _depth) internal returns (StdStorage storage) { - self._depth = _depth; - return self; - } - - function checked_write(StdStorage storage self, address who) internal { - checked_write(self, bytes32(uint256(uint160(who)))); - } - - function checked_write(StdStorage storage self, uint256 amt) internal { - checked_write(self, bytes32(amt)); - } - - function checked_write(StdStorage storage self, bool write) internal { - bytes32 t; - /// @solidity memory-safe-assembly - assembly { - t := write - } - checked_write(self, t); - } - - function checked_write( - StdStorage storage self, - bytes32 set - ) internal { - address who = self._target; - bytes4 fsig = self._sig; - uint256 field_depth = self._depth; - bytes32[] memory ins = self._keys; - - bytes memory cald = abi.encodePacked(fsig, flatten(ins)); - if (!self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]) { - find(self); - } - bytes32 slot = bytes32(self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]); - - bytes32 fdat; - { - (, bytes memory rdat) = who.staticcall(cald); - fdat = bytesToBytes32(rdat, 32*field_depth); - } - bytes32 curr = vm_std_store.load(who, slot); - - if (fdat != curr) { - require(false, "stdStorage find(StdStorage): Packed slot. This would cause dangerous overwriting and currently isn't supported."); - } - vm_std_store.store(who, slot, set); - delete self._target; - delete self._sig; - delete self._keys; - delete self._depth; - } - - function read(StdStorage storage self) private returns (bytes memory) { - address t = self._target; - uint256 s = find(self); - return abi.encode(vm_std_store.load(t, bytes32(s))); - } - - function read_bytes32(StdStorage storage self) internal returns (bytes32) { - return abi.decode(read(self), (bytes32)); - } - - - function read_bool(StdStorage storage self) internal returns (bool) { - int256 v = read_int(self); - if (v == 0) return false; - if (v == 1) return true; - revert("stdStorage read_bool(StdStorage): Cannot decode. Make sure you are reading a bool."); - } - - function read_address(StdStorage storage self) internal returns (address) { - return abi.decode(read(self), (address)); - } - - function read_uint(StdStorage storage self) internal returns (uint256) { - return abi.decode(read(self), (uint256)); - } - - function read_int(StdStorage storage self) internal returns (int256) { - return abi.decode(read(self), (int256)); - } - - function bytesToBytes32(bytes memory b, uint offset) public pure returns (bytes32) { - bytes32 out; - - uint256 max = b.length > 32 ? 32 : b.length; - for (uint i = 0; i < max; i++) { - out |= bytes32(b[offset + i] & 0xFF) >> (i * 8); - } - return out; - } - - function flatten(bytes32[] memory b) private pure returns (bytes memory) - { - bytes memory result = new bytes(b.length * 32); - for (uint256 i = 0; i < b.length; i++) { - bytes32 k = b[i]; - /// @solidity memory-safe-assembly - assembly { - mstore(add(result, add(32, mul(32, i))), k) - } - } - - return result; - } -} - -/*////////////////////////////////////////////////////////////////////////// - STD-MATH -//////////////////////////////////////////////////////////////////////////*/ - -library stdMath { - int256 private constant INT256_MIN = -57896044618658097711785492504343953926634992332820282019728792003956564819968; - - function abs(int256 a) internal pure returns (uint256) { - // Required or it will fail when `a = type(int256).min` - if (a == INT256_MIN) - return 57896044618658097711785492504343953926634992332820282019728792003956564819968; - - return uint256(a > 0 ? a : -a); - } - - function delta(uint256 a, uint256 b) internal pure returns (uint256) { - return a > b - ? a - b - : b - a; - } - - function delta(int256 a, int256 b) internal pure returns (uint256) { - // a and b are of the same sign - // this works thanks to two's complement, the left-most bit is the sign bit - if ((a ^ b) > -1) { - return delta(abs(a), abs(b)); - } - - // a and b are of opposite signs - return abs(a) + abs(b); - } - - function percentDelta(uint256 a, uint256 b) internal pure returns (uint256) { - uint256 absDelta = delta(a, b); - - return absDelta * 1e18 / b; - } - - function percentDelta(int256 a, int256 b) internal pure returns (uint256) { - uint256 absDelta = delta(a, b); - uint256 absB = abs(b); - - return absDelta * 1e18 / absB; - } -} diff --git a/contract/lib/foundry-huff/lib/forge-std/src/Vm.sol b/contract/lib/foundry-huff/lib/forge-std/src/Vm.sol deleted file mode 100644 index 3e3608e..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/src/Vm.sol +++ /dev/null @@ -1,171 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.0 <0.9.0; -pragma experimental ABIEncoderV2; - -interface Vm { - struct Log { - bytes32[] topics; - bytes data; - } - - // Sets block.timestamp (newTimestamp) - function warp(uint256) external; - // Sets block.height (newHeight) - function roll(uint256) external; - // Sets block.basefee (newBasefee) - function fee(uint256) external; - // Sets block.chainid - function chainId(uint256) external; - // Loads a storage slot from an address (who, slot) - function load(address,bytes32) external returns (bytes32); - // Stores a value to an address' storage slot, (who, slot, value) - function store(address,bytes32,bytes32) external; - // Signs data, (privateKey, digest) => (v, r, s) - function sign(uint256,bytes32) external returns (uint8,bytes32,bytes32); - // Gets the address for a given private key, (privateKey) => (address) - function addr(uint256) external returns (address); - // Gets the nonce of an account - function getNonce(address) external returns (uint64); - // Sets the nonce of an account; must be higher than the current nonce of the account - function setNonce(address, uint64) external; - // Performs a foreign function call via the terminal, (stringInputs) => (result) - function ffi(string[] calldata) external returns (bytes memory); - // Sets environment variables, (name, value) - function setEnv(string calldata, string calldata) external; - // Reads environment variables, (name) => (value) - function envBool(string calldata) external returns (bool); - function envUint(string calldata) external returns (uint256); - function envInt(string calldata) external returns (int256); - function envAddress(string calldata) external returns (address); - function envBytes32(string calldata) external returns (bytes32); - function envString(string calldata) external returns (string memory); - function envBytes(string calldata) external returns (bytes memory); - // Reads environment variables as arrays, (name, delim) => (value[]) - function envBool(string calldata, string calldata) external returns (bool[] memory); - function envUint(string calldata, string calldata) external returns (uint256[] memory); - function envInt(string calldata, string calldata) external returns (int256[] memory); - function envAddress(string calldata, string calldata) external returns (address[] memory); - function envBytes32(string calldata, string calldata) external returns (bytes32[] memory); - function envString(string calldata, string calldata) external returns (string[] memory); - function envBytes(string calldata, string calldata) external returns (bytes[] memory); - // Sets the *next* call's msg.sender to be the input address - function prank(address) external; - // Sets all subsequent calls' msg.sender to be the input address until `stopPrank` is called - function startPrank(address) external; - // Sets the *next* call's msg.sender to be the input address, and the tx.origin to be the second input - function prank(address,address) external; - // Sets all subsequent calls' msg.sender to be the input address until `stopPrank` is called, and the tx.origin to be the second input - function startPrank(address,address) external; - // Resets subsequent calls' msg.sender to be `address(this)` - function stopPrank() external; - // Sets an address' balance, (who, newBalance) - function deal(address, uint256) external; - // Sets an address' code, (who, newCode) - function etch(address, bytes calldata) external; - // Expects an error on next call - function expectRevert(bytes calldata) external; - function expectRevert(bytes4) external; - function expectRevert() external; - // Records all storage reads and writes - function record() external; - // Gets all accessed reads and write slot from a recording session, for a given address - function accesses(address) external returns (bytes32[] memory reads, bytes32[] memory writes); - // Prepare an expected log with (bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData). - // Call this function, then emit an event, then call a function. Internally after the call, we check if - // logs were emitted in the expected order with the expected topics and data (as specified by the booleans) - function expectEmit(bool,bool,bool,bool) external; - function expectEmit(bool,bool,bool,bool,address) external; - // Mocks a call to an address, returning specified data. - // Calldata can either be strict or a partial match, e.g. if you only - // pass a Solidity selector to the expected calldata, then the entire Solidity - // function will be mocked. - function mockCall(address,bytes calldata,bytes calldata) external; - // Mocks a call to an address with a specific msg.value, returning specified data. - // Calldata match takes precedence over msg.value in case of ambiguity. - function mockCall(address,uint256,bytes calldata,bytes calldata) external; - // Clears all mocked calls - function clearMockedCalls() external; - // Expects a call to an address with the specified calldata. - // Calldata can either be a strict or a partial match - function expectCall(address,bytes calldata) external; - // Expects a call to an address with the specified msg.value and calldata - function expectCall(address,uint256,bytes calldata) external; - // Gets the code from an artifact file. Takes in the relative path to the json file - function getCode(string calldata) external returns (bytes memory); - // Labels an address in call traces - function label(address, string calldata) external; - // If the condition is false, discard this run's fuzz inputs and generate new ones - function assume(bool) external; - // Sets block.coinbase (who) - function coinbase(address) external; - // Using the address that calls the test contract, has the next call (at this call depth only) create a transaction that can later be signed and sent onchain - function broadcast() external; - // Has the next call (at this call depth only) create a transaction with the address provided as the sender that can later be signed and sent onchain - function broadcast(address) external; - // Using the address that calls the test contract, has all subsequent calls (at this call depth only) create transactions that can later be signed and sent onchain - function startBroadcast() external; - // Has all subsequent calls (at this call depth only) create transactions that can later be signed and sent onchain - function startBroadcast(address) external; - // Stops collecting onchain transactions - function stopBroadcast() external; - // Reads the entire content of file to string, (path) => (data) - function readFile(string calldata) external returns (string memory); - // Reads next line of file to string, (path) => (line) - function readLine(string calldata) external returns (string memory); - // Writes data to file, creating a file if it does not exist, and entirely replacing its contents if it does. - // (path, data) => () - function writeFile(string calldata, string calldata) external; - // Writes line to file, creating a file if it does not exist. - // (path, data) => () - function writeLine(string calldata, string calldata) external; - // Closes file for reading, resetting the offset and allowing to read it from beginning with readLine. - // (path) => () - function closeFile(string calldata) external; - // Removes file. This cheatcode will revert in the following situations, but is not limited to just these cases: - // - Path points to a directory. - // - The file doesn't exist. - // - The user lacks permissions to remove the file. - // (path) => () - function removeFile(string calldata) external; - // Convert values to a string, (value) => (stringified value) - function toString(address) external returns(string memory); - function toString(bytes calldata) external returns(string memory); - function toString(bytes32) external returns(string memory); - function toString(bool) external returns(string memory); - function toString(uint256) external returns(string memory); - function toString(int256) external returns(string memory); - // Record all the transaction logs - function recordLogs() external; - // Gets all the recorded logs, () => (logs) - function getRecordedLogs() external returns (Log[] memory); - // Snapshot the current state of the evm. - // Returns the id of the snapshot that was created. - // To revert a snapshot use `revertTo` - function snapshot() external returns(uint256); - // Revert the state of the evm to a previous snapshot - // Takes the snapshot id to revert to. - // This deletes the snapshot and all snapshots taken after the given snapshot id. - function revertTo(uint256) external returns(bool); - // Creates a new fork with the given endpoint and block and returns the identifier of the fork - function createFork(string calldata,uint256) external returns(uint256); - // Creates a new fork with the given endpoint and the _latest_ block and returns the identifier of the fork - function createFork(string calldata) external returns(uint256); - // Creates _and_ also selects a new fork with the given endpoint and block and returns the identifier of the fork - function createSelectFork(string calldata,uint256) external returns(uint256); - // Creates _and_ also selects a new fork with the given endpoint and the latest block and returns the identifier of the fork - function createSelectFork(string calldata) external returns(uint256); - // Takes a fork identifier created by `createFork` and sets the corresponding forked state as active. - function selectFork(uint256) external; - /// Returns the currently active fork - /// Reverts if no fork is currently active - function activeFork() external returns(uint256); - // Updates the currently active fork to given block number - // This is similar to `roll` but for the currently active fork - function rollFork(uint256) external; - // Updates the given fork to given block number - function rollFork(uint256 forkId, uint256 blockNumber) external; - /// Returns the RPC url for the given alias - function rpcUrl(string calldata) external returns(string memory); - /// Returns all rpc urls and their aliases `[alias, url][]` - function rpcUrls() external returns(string[2][] memory); -} diff --git a/contract/lib/foundry-huff/lib/forge-std/src/console.sol b/contract/lib/foundry-huff/lib/forge-std/src/console.sol deleted file mode 100644 index ad57e53..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/src/console.sol +++ /dev/null @@ -1,1533 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.4.22 <0.9.0; - -library console { - address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); - - function _sendLogPayload(bytes memory payload) private view { - uint256 payloadLength = payload.length; - address consoleAddress = CONSOLE_ADDRESS; - /// @solidity memory-safe-assembly - assembly { - let payloadStart := add(payload, 32) - let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) - } - } - - function log() internal view { - _sendLogPayload(abi.encodeWithSignature("log()")); - } - - function logInt(int p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(int)", p0)); - } - - function logUint(uint p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); - } - - function logString(string memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); - } - - function logBool(bool p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); - } - - function logAddress(address p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); - } - - function logBytes(bytes memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); - } - - function logBytes1(bytes1 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); - } - - function logBytes2(bytes2 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); - } - - function logBytes3(bytes3 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); - } - - function logBytes4(bytes4 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); - } - - function logBytes5(bytes5 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); - } - - function logBytes6(bytes6 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); - } - - function logBytes7(bytes7 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); - } - - function logBytes8(bytes8 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); - } - - function logBytes9(bytes9 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); - } - - function logBytes10(bytes10 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); - } - - function logBytes11(bytes11 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); - } - - function logBytes12(bytes12 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); - } - - function logBytes13(bytes13 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); - } - - function logBytes14(bytes14 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); - } - - function logBytes15(bytes15 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); - } - - function logBytes16(bytes16 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); - } - - function logBytes17(bytes17 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); - } - - function logBytes18(bytes18 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); - } - - function logBytes19(bytes19 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); - } - - function logBytes20(bytes20 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); - } - - function logBytes21(bytes21 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); - } - - function logBytes22(bytes22 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); - } - - function logBytes23(bytes23 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); - } - - function logBytes24(bytes24 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); - } - - function logBytes25(bytes25 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); - } - - function logBytes26(bytes26 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); - } - - function logBytes27(bytes27 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); - } - - function logBytes28(bytes28 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); - } - - function logBytes29(bytes29 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); - } - - function logBytes30(bytes30 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); - } - - function logBytes31(bytes31 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); - } - - function logBytes32(bytes32 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); - } - - function log(uint p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); - } - - function log(string memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); - } - - function log(bool p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); - } - - function log(address p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); - } - - function log(uint p0, uint p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint)", p0, p1)); - } - - function log(uint p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string)", p0, p1)); - } - - function log(uint p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool)", p0, p1)); - } - - function log(uint p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address)", p0, p1)); - } - - function log(string memory p0, uint p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint)", p0, p1)); - } - - function log(string memory p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); - } - - function log(string memory p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); - } - - function log(string memory p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); - } - - function log(bool p0, uint p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint)", p0, p1)); - } - - function log(bool p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); - } - - function log(bool p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); - } - - function log(bool p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); - } - - function log(address p0, uint p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint)", p0, p1)); - } - - function log(address p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); - } - - function log(address p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); - } - - function log(address p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); - } - - function log(uint p0, uint p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint)", p0, p1, p2)); - } - - function log(uint p0, uint p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string)", p0, p1, p2)); - } - - function log(uint p0, uint p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool)", p0, p1, p2)); - } - - function log(uint p0, uint p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address)", p0, p1, p2)); - } - - function log(uint p0, string memory p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint)", p0, p1, p2)); - } - - function log(uint p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string)", p0, p1, p2)); - } - - function log(uint p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool)", p0, p1, p2)); - } - - function log(uint p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address)", p0, p1, p2)); - } - - function log(uint p0, bool p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint)", p0, p1, p2)); - } - - function log(uint p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string)", p0, p1, p2)); - } - - function log(uint p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool)", p0, p1, p2)); - } - - function log(uint p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address)", p0, p1, p2)); - } - - function log(uint p0, address p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint)", p0, p1, p2)); - } - - function log(uint p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string)", p0, p1, p2)); - } - - function log(uint p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool)", p0, p1, p2)); - } - - function log(uint p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address)", p0, p1, p2)); - } - - function log(string memory p0, uint p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint)", p0, p1, p2)); - } - - function log(string memory p0, uint p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string)", p0, p1, p2)); - } - - function log(string memory p0, uint p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool)", p0, p1, p2)); - } - - function log(string memory p0, uint p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); - } - - function log(string memory p0, address p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint)", p0, p1, p2)); - } - - function log(string memory p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); - } - - function log(string memory p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); - } - - function log(string memory p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); - } - - function log(bool p0, uint p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint)", p0, p1, p2)); - } - - function log(bool p0, uint p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string)", p0, p1, p2)); - } - - function log(bool p0, uint p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool)", p0, p1, p2)); - } - - function log(bool p0, uint p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); - } - - function log(bool p0, bool p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint)", p0, p1, p2)); - } - - function log(bool p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); - } - - function log(bool p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); - } - - function log(bool p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); - } - - function log(bool p0, address p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint)", p0, p1, p2)); - } - - function log(bool p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); - } - - function log(bool p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); - } - - function log(bool p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); - } - - function log(address p0, uint p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint)", p0, p1, p2)); - } - - function log(address p0, uint p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string)", p0, p1, p2)); - } - - function log(address p0, uint p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool)", p0, p1, p2)); - } - - function log(address p0, uint p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address)", p0, p1, p2)); - } - - function log(address p0, string memory p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint)", p0, p1, p2)); - } - - function log(address p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); - } - - function log(address p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); - } - - function log(address p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); - } - - function log(address p0, bool p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint)", p0, p1, p2)); - } - - function log(address p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); - } - - function log(address p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); - } - - function log(address p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); - } - - function log(address p0, address p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint)", p0, p1, p2)); - } - - function log(address p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); - } - - function log(address p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); - } - - function log(address p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); - } - - function log(uint p0, uint p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,string)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,address)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,string)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,address)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,string)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,address)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,string)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,address)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,string)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,address)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,string)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,address)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,string)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,address)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,string)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,address)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,string)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,address)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,string)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,address)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,string)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,address)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,string)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,address)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,string)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,address)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,string)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,address)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,string)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,uint)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,uint)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,uint)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,uint)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,uint)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,uint)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,uint)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); - } - -} \ No newline at end of file diff --git a/contract/lib/foundry-huff/lib/forge-std/src/console2.sol b/contract/lib/foundry-huff/lib/forge-std/src/console2.sol deleted file mode 100644 index 2edfda5..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/src/console2.sol +++ /dev/null @@ -1,1538 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.4.22 <0.9.0; - -// The orignal console.sol uses `int` and `uint` for computing function selectors, but it should -// use `int256` and `uint256`. This modified version fixes that. This version is recommended -// over `console.sol` if you don't need compatibility with Hardhat as the logs will show up in -// forge stack traces. If you do need compatibility with Hardhat, you must use `console.sol`. -// Reference: https://github.com/NomicFoundation/hardhat/issues/2178 - -library console2 { - address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); - - function _sendLogPayload(bytes memory payload) private view { - uint256 payloadLength = payload.length; - address consoleAddress = CONSOLE_ADDRESS; - assembly { - let payloadStart := add(payload, 32) - let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) - } - } - - function log() internal view { - _sendLogPayload(abi.encodeWithSignature("log()")); - } - - function logInt(int256 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(int256)", p0)); - } - - function logUint(uint256 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256)", p0)); - } - - function logString(string memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); - } - - function logBool(bool p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); - } - - function logAddress(address p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); - } - - function logBytes(bytes memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); - } - - function logBytes1(bytes1 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); - } - - function logBytes2(bytes2 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); - } - - function logBytes3(bytes3 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); - } - - function logBytes4(bytes4 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); - } - - function logBytes5(bytes5 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); - } - - function logBytes6(bytes6 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); - } - - function logBytes7(bytes7 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); - } - - function logBytes8(bytes8 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); - } - - function logBytes9(bytes9 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); - } - - function logBytes10(bytes10 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); - } - - function logBytes11(bytes11 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); - } - - function logBytes12(bytes12 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); - } - - function logBytes13(bytes13 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); - } - - function logBytes14(bytes14 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); - } - - function logBytes15(bytes15 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); - } - - function logBytes16(bytes16 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); - } - - function logBytes17(bytes17 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); - } - - function logBytes18(bytes18 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); - } - - function logBytes19(bytes19 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); - } - - function logBytes20(bytes20 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); - } - - function logBytes21(bytes21 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); - } - - function logBytes22(bytes22 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); - } - - function logBytes23(bytes23 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); - } - - function logBytes24(bytes24 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); - } - - function logBytes25(bytes25 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); - } - - function logBytes26(bytes26 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); - } - - function logBytes27(bytes27 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); - } - - function logBytes28(bytes28 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); - } - - function logBytes29(bytes29 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); - } - - function logBytes30(bytes30 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); - } - - function logBytes31(bytes31 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); - } - - function logBytes32(bytes32 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); - } - - function log(uint256 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256)", p0)); - } - - function log(string memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); - } - - function log(bool p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); - } - - function log(address p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); - } - - function log(uint256 p0, uint256 p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256)", p0, p1)); - } - - function log(uint256 p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string)", p0, p1)); - } - - function log(uint256 p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool)", p0, p1)); - } - - function log(uint256 p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address)", p0, p1)); - } - - function log(string memory p0, uint256 p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256)", p0, p1)); - } - - function log(string memory p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); - } - - function log(string memory p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); - } - - function log(string memory p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); - } - - function log(bool p0, uint256 p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256)", p0, p1)); - } - - function log(bool p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); - } - - function log(bool p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); - } - - function log(bool p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); - } - - function log(address p0, uint256 p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256)", p0, p1)); - } - - function log(address p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); - } - - function log(address p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); - } - - function log(address p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); - } - - function log(uint256 p0, uint256 p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256)", p0, p1, p2)); - } - - function log(uint256 p0, uint256 p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string)", p0, p1, p2)); - } - - function log(uint256 p0, uint256 p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool)", p0, p1, p2)); - } - - function log(uint256 p0, uint256 p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address)", p0, p1, p2)); - } - - function log(uint256 p0, string memory p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256)", p0, p1, p2)); - } - - function log(uint256 p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string)", p0, p1, p2)); - } - - function log(uint256 p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool)", p0, p1, p2)); - } - - function log(uint256 p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address)", p0, p1, p2)); - } - - function log(uint256 p0, bool p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256)", p0, p1, p2)); - } - - function log(uint256 p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string)", p0, p1, p2)); - } - - function log(uint256 p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool)", p0, p1, p2)); - } - - function log(uint256 p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address)", p0, p1, p2)); - } - - function log(uint256 p0, address p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256)", p0, p1, p2)); - } - - function log(uint256 p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string)", p0, p1, p2)); - } - - function log(uint256 p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool)", p0, p1, p2)); - } - - function log(uint256 p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address)", p0, p1, p2)); - } - - function log(string memory p0, uint256 p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256)", p0, p1, p2)); - } - - function log(string memory p0, uint256 p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string)", p0, p1, p2)); - } - - function log(string memory p0, uint256 p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool)", p0, p1, p2)); - } - - function log(string memory p0, uint256 p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); - } - - function log(string memory p0, address p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256)", p0, p1, p2)); - } - - function log(string memory p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); - } - - function log(string memory p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); - } - - function log(string memory p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); - } - - function log(bool p0, uint256 p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256)", p0, p1, p2)); - } - - function log(bool p0, uint256 p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string)", p0, p1, p2)); - } - - function log(bool p0, uint256 p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool)", p0, p1, p2)); - } - - function log(bool p0, uint256 p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); - } - - function log(bool p0, bool p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256)", p0, p1, p2)); - } - - function log(bool p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); - } - - function log(bool p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); - } - - function log(bool p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); - } - - function log(bool p0, address p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256)", p0, p1, p2)); - } - - function log(bool p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); - } - - function log(bool p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); - } - - function log(bool p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); - } - - function log(address p0, uint256 p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256)", p0, p1, p2)); - } - - function log(address p0, uint256 p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string)", p0, p1, p2)); - } - - function log(address p0, uint256 p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool)", p0, p1, p2)); - } - - function log(address p0, uint256 p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address)", p0, p1, p2)); - } - - function log(address p0, string memory p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256)", p0, p1, p2)); - } - - function log(address p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); - } - - function log(address p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); - } - - function log(address p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); - } - - function log(address p0, bool p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256)", p0, p1, p2)); - } - - function log(address p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); - } - - function log(address p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); - } - - function log(address p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); - } - - function log(address p0, address p1, uint256 p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256)", p0, p1, p2)); - } - - function log(address p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); - } - - function log(address p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); - } - - function log(address p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); - } - - function log(uint256 p0, uint256 p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, uint256 p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,address)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,uint256)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,string)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,bool)", p0, p1, p2, p3)); - } - - function log(uint256 p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint256 p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint256)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint256 p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint256)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint256 p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint256 p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint256 p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint256 p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint256 p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, uint256 p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint256)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); - } - -} \ No newline at end of file diff --git a/contract/lib/foundry-huff/lib/forge-std/src/test/Script.t.sol b/contract/lib/foundry-huff/lib/forge-std/src/test/Script.t.sol deleted file mode 100644 index 595df7b..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/src/test/Script.t.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../Test.sol"; - -contract ScriptTest is Test -{ - function testGenerateCorrectAddress() external { - address creation = computeCreateAddress(0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9, 14); - assertEq(creation, 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45); - } -} \ No newline at end of file diff --git a/contract/lib/foundry-huff/lib/forge-std/src/test/StdAssertions.t.sol b/contract/lib/foundry-huff/lib/forge-std/src/test/StdAssertions.t.sol deleted file mode 100644 index db90720..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/src/test/StdAssertions.t.sol +++ /dev/null @@ -1,599 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../Test.sol"; - -contract StdAssertionsTest is Test -{ - string constant CUSTOM_ERROR = "guh!"; - - bool constant EXPECT_PASS = false; - bool constant EXPECT_FAIL = true; - - TestTest t = new TestTest(); - - /*////////////////////////////////////////////////////////////////////////// - FAIL(STRING) - //////////////////////////////////////////////////////////////////////////*/ - - function testShouldFail() external { - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._fail(CUSTOM_ERROR); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_FALSE - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertFalse_Pass() external { - t._assertFalse(false, EXPECT_PASS); - } - - function testAssertFalse_Fail() external { - vm.expectEmit(false, false, false, true); - emit log("Error: Assertion Failed"); - t._assertFalse(true, EXPECT_FAIL); - } - - function testAssertFalse_Err_Pass() external { - t._assertFalse(false, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertFalse_Err_Fail() external { - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertFalse(true, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(BOOL) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertEq_Bool_Pass(bool a, bool b) external { - vm.assume(a == b); - - t._assertEq(a, b, EXPECT_PASS); - } - - function testAssertEq_Bool_Fail(bool a, bool b) external { - vm.assume(a != b); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [bool]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_BoolErr_Pass(bool a, bool b) external { - vm.assume(a == b); - - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertEq_BoolErr_Fail(bool a, bool b) external { - vm.assume(a != b); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(BYTES) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertEq_Bytes_Pass(bytes calldata a, bytes calldata b) external { - vm.assume(keccak256(a) == keccak256(b)); - - t._assertEq(a, b, EXPECT_PASS); - } - - function testAssertEq_Bytes_Fail(bytes calldata a, bytes calldata b) external { - vm.assume(keccak256(a) != keccak256(b)); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [bytes]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_BytesErr_Pass(bytes calldata a, bytes calldata b) external { - vm.assume(keccak256(a) == keccak256(b)); - - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertEq_BytesErr_Fail(bytes calldata a, bytes calldata b) external { - vm.assume(keccak256(a) != keccak256(b)); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(ARRAY) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertEq_UintArr_Pass(uint256 e0, uint256 e1, uint256 e2) public { - uint256[] memory a = new uint256[](3); - a[0] = e0; - a[1] = e1; - a[2] = e2; - uint256[] memory b = new uint256[](3); - b[0] = e0; - b[1] = e1; - b[2] = e2; - - t._assertEq(a, b, EXPECT_PASS); - } - - function testAssertEq_IntArr_Pass(int256 e0, int256 e1, int256 e2) public { - int256[] memory a = new int256[](3); - a[0] = e0; - a[1] = e1; - a[2] = e2; - int256[] memory b = new int256[](3); - b[0] = e0; - b[1] = e1; - b[2] = e2; - - t._assertEq(a, b, EXPECT_PASS); - } - - function testAssertEq_AddressArr_Pass(address e0, address e1, address e2) public { - address[] memory a = new address[](3); - a[0] = e0; - a[1] = e1; - a[2] = e2; - address[] memory b = new address[](3); - b[0] = e0; - b[1] = e1; - b[2] = e2; - - t._assertEq(a, b, EXPECT_PASS); - } - - function testAssertEq_UintArr_FailEl(uint256 e1) public { - vm.assume(e1 != 0); - uint256[] memory a = new uint256[](3); - uint256[] memory b = new uint256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_IntArr_FailEl(int256 e1) public { - vm.assume(e1 != 0); - int256[] memory a = new int256[](3); - int256[] memory b = new int256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - - function testAssertEq_AddressArr_FailEl(address e1) public { - vm.assume(e1 != address(0)); - address[] memory a = new address[](3); - address[] memory b = new address[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_UintArrErr_FailEl(uint256 e1) public { - vm.assume(e1 != 0); - uint256[] memory a = new uint256[](3); - uint256[] memory b = new uint256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testAssertEq_IntArrErr_FailEl(int256 e1) public { - vm.assume(e1 != 0); - int256[] memory a = new int256[](3); - int256[] memory b = new int256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - - function testAssertEq_AddressArrErr_FailEl(address e1) public { - vm.assume(e1 != address(0)); - address[] memory a = new address[](3); - address[] memory b = new address[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testAssertEq_UintArr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - uint256[] memory a = new uint256[](lenA); - uint256[] memory b = new uint256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_IntArr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - int256[] memory a = new int256[](lenA); - int256[] memory b = new int256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_AddressArr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - address[] memory a = new address[](lenA); - address[] memory b = new address[](lenB); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testAssertEq_UintArrErr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - uint256[] memory a = new uint256[](lenA); - uint256[] memory b = new uint256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testAssertEq_IntArrErr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - int256[] memory a = new int256[](lenA); - int256[] memory b = new int256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testAssertEq_AddressArrErr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - address[] memory a = new address[](lenA); - address[] memory b = new address[](lenB); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_ABS(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqAbs_Uint_Pass(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_PASS); - } - - function testAssertApproxEqAbs_Uint_Fail(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [uint]"); - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_FAIL); - } - - function testAssertApproxEqAbs_UintErr_Pass(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqAbs_UintErr_Fail(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_ABS(INT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqAbs_Int_Pass(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_PASS); - } - - function testAssertApproxEqAbs_Int_Fail(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [int]"); - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_FAIL); - } - - function testAssertApproxEqAbs_IntErr_Pass(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqAbs_IntErr_Fail(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_REL(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqRel_Uint_Pass(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_PASS); - } - - function testAssertApproxEqRel_Uint_Fail(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [uint]"); - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_FAIL); - } - - function testAssertApproxEqRel_UintErr_Pass(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqRel_UintErr_Fail(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_REL(INT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqRel_Int_Pass(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_PASS); - } - - function testAssertApproxEqRel_Int_Fail(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [int]"); - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_FAIL); - } - - function testAssertApproxEqRel_IntErr_Pass(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqRel_IntErr_Fail(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_FAIL); - } -} - - -contract TestTest is Test -{ - modifier expectFailure(bool expectFail) { - bool preState = vm.load(HEVM_ADDRESS, bytes32("failed")) != bytes32(0x00); - _; - bool postState = vm.load(HEVM_ADDRESS, bytes32("failed")) != bytes32(0x00); - - if (preState == true) { - return; - } - - if (expectFail) { - require(postState == true, "expected failure not triggered"); - - // unwind the expected failure - vm.store(HEVM_ADDRESS, bytes32("failed"), bytes32(uint256(0x00))); - } else { - require(postState == false, "unexpected failure was triggered"); - } - } - - function _fail(string memory err) external expectFailure(true) { - fail(err); - } - - function _assertFalse(bool data, bool expectFail) external expectFailure(expectFail) { - assertFalse(data); - } - - function _assertFalse(bool data, string memory err, bool expectFail) external expectFailure(expectFail) { - assertFalse(data, err); - } - - function _assertEq(bool a, bool b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(bool a, bool b, string memory err, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b, err); - } - - function _assertEq(bytes memory a, bytes memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(bytes memory a, - bytes memory b, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertEq(a, b, err); - } - - function _assertEq(uint256[] memory a, uint256[] memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(int256[] memory a, int256[] memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(address[] memory a, address[] memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(uint256[] memory a, uint256[] memory b, string memory err, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b, err); - } - - function _assertEq(int256[] memory a, int256[] memory b, string memory err, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b, err); - } - - function _assertEq(address[] memory a, address[] memory b, string memory err, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b, err); - } - - - function _assertApproxEqAbs( - uint256 a, - uint256 b, - uint256 maxDelta, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqAbs(a, b, maxDelta); - } - - function _assertApproxEqAbs( - uint256 a, - uint256 b, - uint256 maxDelta, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqAbs(a, b, maxDelta, err); - } - - function _assertApproxEqAbs( - int256 a, - int256 b, - uint256 maxDelta, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqAbs(a, b, maxDelta); - } - - function _assertApproxEqAbs( - int256 a, - int256 b, - uint256 maxDelta, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqAbs(a, b, maxDelta, err); - } - - function _assertApproxEqRel( - uint256 a, - uint256 b, - uint256 maxPercentDelta, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqRel(a, b, maxPercentDelta); - } - - function _assertApproxEqRel( - uint256 a, - uint256 b, - uint256 maxPercentDelta, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqRel(a, b, maxPercentDelta, err); - } - - function _assertApproxEqRel( - int256 a, - int256 b, - uint256 maxPercentDelta, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqRel(a, b, maxPercentDelta); - } - - function _assertApproxEqRel( - int256 a, - int256 b, - uint256 maxPercentDelta, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqRel(a, b, maxPercentDelta, err); - } -} diff --git a/contract/lib/foundry-huff/lib/forge-std/src/test/StdCheats.t.sol b/contract/lib/foundry-huff/lib/forge-std/src/test/StdCheats.t.sol deleted file mode 100644 index d73e3f5..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/src/test/StdCheats.t.sol +++ /dev/null @@ -1,193 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../Test.sol"; - -contract StdCheatsTest is Test { - Bar test; - - function setUp() public { - test = new Bar(); - } - - function testSkip() public { - vm.warp(100); - skip(25); - assertEq(block.timestamp, 125); - } - - function testRewind() public { - vm.warp(100); - rewind(25); - assertEq(block.timestamp, 75); - } - - function testHoax() public { - hoax(address(1337)); - test.bar{value: 100}(address(1337)); - } - - function testHoaxOrigin() public { - hoax(address(1337), address(1337)); - test.origin{value: 100}(address(1337)); - } - - function testHoaxDifferentAddresses() public { - hoax(address(1337), address(7331)); - test.origin{value: 100}(address(1337), address(7331)); - } - - function testStartHoax() public { - startHoax(address(1337)); - test.bar{value: 100}(address(1337)); - test.bar{value: 100}(address(1337)); - vm.stopPrank(); - test.bar(address(this)); - } - - function testStartHoaxOrigin() public { - startHoax(address(1337), address(1337)); - test.origin{value: 100}(address(1337)); - test.origin{value: 100}(address(1337)); - vm.stopPrank(); - test.bar(address(this)); - } - - function testChangePrank() public { - vm.startPrank(address(1337)); - test.bar(address(1337)); - changePrank(address(0xdead)); - test.bar(address(0xdead)); - changePrank(address(1337)); - test.bar(address(1337)); - vm.stopPrank(); - } - - function testDeal() public { - deal(address(this), 1 ether); - assertEq(address(this).balance, 1 ether); - } - - function testDealToken() public { - Bar barToken = new Bar(); - address bar = address(barToken); - deal(bar, address(this), 10000e18); - assertEq(barToken.balanceOf(address(this)), 10000e18); - } - - function testDealTokenAdjustTS() public { - Bar barToken = new Bar(); - address bar = address(barToken); - deal(bar, address(this), 10000e18, true); - assertEq(barToken.balanceOf(address(this)), 10000e18); - assertEq(barToken.totalSupply(), 20000e18); - deal(bar, address(this), 0, true); - assertEq(barToken.balanceOf(address(this)), 0); - assertEq(barToken.totalSupply(), 10000e18); - } - - function testBound() public { - assertEq(bound(5, 0, 4), 0); - assertEq(bound(0, 69, 69), 69); - assertEq(bound(0, 68, 69), 68); - assertEq(bound(10, 150, 190), 160); - assertEq(bound(300, 2800, 3200), 3100); - assertEq(bound(9999, 1337, 6666), 6006); - } - - function testCannotBoundMaxLessThanMin() public { - vm.expectRevert(bytes("Test bound(uint256,uint256,uint256): Max is less than min.")); - bound(5, 100, 10); - } - - function testBound( - uint256 num, - uint256 min, - uint256 max - ) public { - if (min > max) (min, max) = (max, min); - - uint256 bounded = bound(num, min, max); - - assertGe(bounded, min); - assertLe(bounded, max); - } - - function testBoundUint256Max() public { - assertEq(bound(0, type(uint256).max - 1, type(uint256).max), type(uint256).max - 1); - assertEq(bound(1, type(uint256).max - 1, type(uint256).max), type(uint256).max); - } - - function testCannotBoundMaxLessThanMin( - uint256 num, - uint256 min, - uint256 max - ) public { - vm.assume(min > max); - vm.expectRevert(bytes("Test bound(uint256,uint256,uint256): Max is less than min.")); - bound(num, min, max); - } - - function testDeployCode() public { - address deployed = deployCode("StdCheats.t.sol:StdCheatsTest", bytes("")); - assertEq(string(getCode(deployed)), string(getCode(address(this)))); - } - - function testDeployCodeNoArgs() public { - address deployed = deployCode("StdCheats.t.sol:StdCheatsTest"); - assertEq(string(getCode(deployed)), string(getCode(address(this)))); - } - - function testDeployCodeFail() public { - vm.expectRevert(bytes("Test deployCode(string): Deployment failed.")); - this.deployCode("StdCheats.t.sol:RevertingContract"); - } - - function getCode(address who) internal view returns (bytes memory o_code) { - /// @solidity memory-safe-assembly - assembly { - // retrieve the size of the code, this needs assembly - let size := extcodesize(who) - // allocate output byte array - this could also be done without assembly - // by using o_code = new bytes(size) - o_code := mload(0x40) - // new "memory end" including padding - mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), not(0x1f)))) - // store length in memory - mstore(o_code, size) - // actually retrieve the code, this needs assembly - extcodecopy(who, add(o_code, 0x20), 0, size) - } - } -} - -contract Bar { - constructor() { - /// `DEAL` STDCHEAT - totalSupply = 10000e18; - balanceOf[address(this)] = totalSupply; - } - - /// `HOAX` STDCHEATS - function bar(address expectedSender) public payable { - require(msg.sender == expectedSender, "!prank"); - } - function origin(address expectedSender) public payable { - require(msg.sender == expectedSender, "!prank"); - require(tx.origin == expectedSender, "!prank"); - } - function origin(address expectedSender, address expectedOrigin) public payable { - require(msg.sender == expectedSender, "!prank"); - require(tx.origin == expectedOrigin, "!prank"); - } - - /// `DEAL` STDCHEAT - mapping (address => uint256) public balanceOf; - uint256 public totalSupply; -} - -contract RevertingContract { - constructor() { - revert(); - } -} \ No newline at end of file diff --git a/contract/lib/foundry-huff/lib/forge-std/src/test/StdError.t.sol b/contract/lib/foundry-huff/lib/forge-std/src/test/StdError.t.sol deleted file mode 100644 index 0d6601e..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/src/test/StdError.t.sol +++ /dev/null @@ -1,124 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.10 <0.9.0; - -import "../Test.sol"; - -contract StdErrorsTest is Test { - ErrorsTest test; - - function setUp() public { - test = new ErrorsTest(); - } - - function testExpectAssertion() public { - vm.expectRevert(stdError.assertionError); - test.assertionError(); - } - - function testExpectArithmetic() public { - vm.expectRevert(stdError.arithmeticError); - test.arithmeticError(10); - } - - function testExpectDiv() public { - vm.expectRevert(stdError.divisionError); - test.divError(0); - } - - function testExpectMod() public { - vm.expectRevert(stdError.divisionError); - test.modError(0); - } - - function testExpectEnum() public { - vm.expectRevert(stdError.enumConversionError); - test.enumConversion(1); - } - - function testExpectEncodeStg() public { - vm.expectRevert(stdError.encodeStorageError); - test.encodeStgError(); - } - - function testExpectPop() public { - vm.expectRevert(stdError.popError); - test.pop(); - } - - function testExpectOOB() public { - vm.expectRevert(stdError.indexOOBError); - test.indexOOBError(1); - } - - function testExpectMem() public { - vm.expectRevert(stdError.memOverflowError); - test.mem(); - } - - function testExpectIntern() public { - vm.expectRevert(stdError.zeroVarError); - test.intern(); - } - - function testExpectLowLvl() public { - vm.expectRevert(stdError.lowLevelError); - test.someArr(0); - } -} - -contract ErrorsTest { - enum T { - T1 - } - - uint256[] public someArr; - bytes someBytes; - - function assertionError() public pure { - assert(false); - } - - function arithmeticError(uint256 a) public pure { - a -= 100; - } - - function divError(uint256 a) public pure { - 100 / a; - } - - function modError(uint256 a) public pure { - 100 % a; - } - - function enumConversion(uint256 a) public pure { - T(a); - } - - function encodeStgError() public { - /// @solidity memory-safe-assembly - assembly { - sstore(someBytes.slot, 1) - } - keccak256(someBytes); - } - - function pop() public { - someArr.pop(); - } - - function indexOOBError(uint256 a) public pure { - uint256[] memory t = new uint256[](0); - t[a]; - } - - function mem() public pure { - uint256 l = 2**256 / 32; - new uint256[](l); - } - - function intern() public returns (uint256) { - function(uint256) internal returns (uint256) x; - x(2); - return 7; - } -} diff --git a/contract/lib/foundry-huff/lib/forge-std/src/test/StdMath.t.sol b/contract/lib/foundry-huff/lib/forge-std/src/test/StdMath.t.sol deleted file mode 100644 index 9d09b81..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/src/test/StdMath.t.sol +++ /dev/null @@ -1,200 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.0 <0.9.0; - -import "../Test.sol"; - -contract StdMathTest is Test -{ - function testGetAbs() external { - assertEq(stdMath.abs(-50), 50); - assertEq(stdMath.abs(50), 50); - assertEq(stdMath.abs(-1337), 1337); - assertEq(stdMath.abs(0), 0); - - assertEq(stdMath.abs(type(int256).min), (type(uint256).max >> 1) + 1); - assertEq(stdMath.abs(type(int256).max), (type(uint256).max >> 1)); - } - - function testGetAbs_Fuzz(int256 a) external { - uint256 manualAbs = getAbs(a); - - uint256 abs = stdMath.abs(a); - - assertEq(abs, manualAbs); - } - - function testGetDelta_Uint() external { - assertEq(stdMath.delta(uint256(0), uint256(0)), 0); - assertEq(stdMath.delta(uint256(0), uint256(1337)), 1337); - assertEq(stdMath.delta(uint256(0), type(uint64).max), type(uint64).max); - assertEq(stdMath.delta(uint256(0), type(uint128).max), type(uint128).max); - assertEq(stdMath.delta(uint256(0), type(uint256).max), type(uint256).max); - - assertEq(stdMath.delta(0, uint256(0)), 0); - assertEq(stdMath.delta(1337, uint256(0)), 1337); - assertEq(stdMath.delta(type(uint64).max, uint256(0)), type(uint64).max); - assertEq(stdMath.delta(type(uint128).max, uint256(0)), type(uint128).max); - assertEq(stdMath.delta(type(uint256).max, uint256(0)), type(uint256).max); - - assertEq(stdMath.delta(1337, uint256(1337)), 0); - assertEq(stdMath.delta(type(uint256).max, type(uint256).max), 0); - assertEq(stdMath.delta(5000, uint256(1250)), 3750); - } - - function testGetDelta_Uint_Fuzz(uint256 a, uint256 b) external { - uint256 manualDelta; - if (a > b) { - manualDelta = a - b; - } else { - manualDelta = b - a; - } - - uint256 delta = stdMath.delta(a, b); - - assertEq(delta, manualDelta); - } - - function testGetDelta_Int() external { - assertEq(stdMath.delta(int256(0), int256(0)), 0); - assertEq(stdMath.delta(int256(0), int256(1337)), 1337); - assertEq(stdMath.delta(int256(0), type(int64).max), type(uint64).max >> 1); - assertEq(stdMath.delta(int256(0), type(int128).max), type(uint128).max >> 1); - assertEq(stdMath.delta(int256(0), type(int256).max), type(uint256).max >> 1); - - assertEq(stdMath.delta(0, int256(0)), 0); - assertEq(stdMath.delta(1337, int256(0)), 1337); - assertEq(stdMath.delta(type(int64).max, int256(0)), type(uint64).max >> 1); - assertEq(stdMath.delta(type(int128).max, int256(0)), type(uint128).max >> 1); - assertEq(stdMath.delta(type(int256).max, int256(0)), type(uint256).max >> 1); - - assertEq(stdMath.delta(-0, int256(0)), 0); - assertEq(stdMath.delta(-1337, int256(0)), 1337); - assertEq(stdMath.delta(type(int64).min, int256(0)), (type(uint64).max >> 1) + 1); - assertEq(stdMath.delta(type(int128).min, int256(0)), (type(uint128).max >> 1) + 1); - assertEq(stdMath.delta(type(int256).min, int256(0)), (type(uint256).max >> 1) + 1); - - assertEq(stdMath.delta(int256(0), -0), 0); - assertEq(stdMath.delta(int256(0), -1337), 1337); - assertEq(stdMath.delta(int256(0), type(int64).min), (type(uint64).max >> 1) + 1); - assertEq(stdMath.delta(int256(0), type(int128).min), (type(uint128).max >> 1) + 1); - assertEq(stdMath.delta(int256(0), type(int256).min), (type(uint256).max >> 1) + 1); - - assertEq(stdMath.delta(1337, int256(1337)), 0); - assertEq(stdMath.delta(type(int256).max, type(int256).max), 0); - assertEq(stdMath.delta(type(int256).min, type(int256).min), 0); - assertEq(stdMath.delta(type(int256).min, type(int256).max), type(uint256).max); - assertEq(stdMath.delta(5000, int256(1250)), 3750); - } - - function testGetDelta_Int_Fuzz(int256 a, int256 b) external { - uint256 absA = getAbs(a); - uint256 absB = getAbs(b); - uint256 absDelta = absA > absB - ? absA - absB - : absB - absA; - - uint256 manualDelta; - if ((a >= 0 && b >= 0) || (a < 0 && b < 0)) { - manualDelta = absDelta; - } - // (a < 0 && b >= 0) || (a >= 0 && b < 0) - else { - manualDelta = absA + absB; - } - - uint256 delta = stdMath.delta(a, b); - - assertEq(delta, manualDelta); - } - - function testGetPercentDelta_Uint() external { - assertEq(stdMath.percentDelta(uint256(0), uint256(1337)), 1e18); - assertEq(stdMath.percentDelta(uint256(0), type(uint64).max), 1e18); - assertEq(stdMath.percentDelta(uint256(0), type(uint128).max), 1e18); - assertEq(stdMath.percentDelta(uint256(0), type(uint192).max), 1e18); - - assertEq(stdMath.percentDelta(1337, uint256(1337)), 0); - assertEq(stdMath.percentDelta(type(uint192).max, type(uint192).max), 0); - assertEq(stdMath.percentDelta(0, uint256(2500)), 1e18); - assertEq(stdMath.percentDelta(2500, uint256(2500)), 0); - assertEq(stdMath.percentDelta(5000, uint256(2500)), 1e18); - assertEq(stdMath.percentDelta(7500, uint256(2500)), 2e18); - - vm.expectRevert(stdError.divisionError); - stdMath.percentDelta(uint256(1), 0); - } - - function testGetPercentDelta_Uint_Fuzz(uint192 a, uint192 b) external { - vm.assume(b != 0); - uint256 manualDelta; - if (a > b) { - manualDelta = a - b; - } else { - manualDelta = b - a; - } - - uint256 manualPercentDelta = manualDelta * 1e18 / b; - uint256 percentDelta = stdMath.percentDelta(a, b); - - assertEq(percentDelta, manualPercentDelta); - } - - function testGetPercentDelta_Int() external { - assertEq(stdMath.percentDelta(int256(0), int256(1337)), 1e18); - assertEq(stdMath.percentDelta(int256(0), -1337), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int64).min), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int128).min), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int192).min), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int64).max), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int128).max), 1e18); - assertEq(stdMath.percentDelta(int256(0), type(int192).max), 1e18); - - assertEq(stdMath.percentDelta(1337, int256(1337)), 0); - assertEq(stdMath.percentDelta(type(int192).max, type(int192).max), 0); - assertEq(stdMath.percentDelta(type(int192).min, type(int192).min), 0); - - assertEq(stdMath.percentDelta(type(int192).min, type(int192).max), 2e18); // rounds the 1 wei diff down - assertEq(stdMath.percentDelta(type(int192).max, type(int192).min), 2e18 - 1); // rounds the 1 wei diff down - assertEq(stdMath.percentDelta(0, int256(2500)), 1e18); - assertEq(stdMath.percentDelta(2500, int256(2500)), 0); - assertEq(stdMath.percentDelta(5000, int256(2500)), 1e18); - assertEq(stdMath.percentDelta(7500, int256(2500)), 2e18); - - vm.expectRevert(stdError.divisionError); - stdMath.percentDelta(int256(1), 0); - } - - function testGetPercentDelta_Int_Fuzz(int192 a, int192 b) external { - vm.assume(b != 0); - uint256 absA = getAbs(a); - uint256 absB = getAbs(b); - uint256 absDelta = absA > absB - ? absA - absB - : absB - absA; - - uint256 manualDelta; - if ((a >= 0 && b >= 0) || (a < 0 && b < 0)) { - manualDelta = absDelta; - } - // (a < 0 && b >= 0) || (a >= 0 && b < 0) - else { - manualDelta = absA + absB; - } - - uint256 manualPercentDelta = manualDelta * 1e18 / absB; - uint256 percentDelta = stdMath.percentDelta(a, b); - - assertEq(percentDelta, manualPercentDelta); - } - - /*////////////////////////////////////////////////////////////////////////// - HELPERS - //////////////////////////////////////////////////////////////////////////*/ - - function getAbs(int256 a) private pure returns (uint256) { - if (a < 0) - return a == type(int256).min ? uint256(type(int256).max) + 1 : uint256(-a); - - return uint256(a); - } -} diff --git a/contract/lib/foundry-huff/lib/forge-std/src/test/StdStorage.t.sol b/contract/lib/foundry-huff/lib/forge-std/src/test/StdStorage.t.sol deleted file mode 100644 index 6e238d0..0000000 --- a/contract/lib/foundry-huff/lib/forge-std/src/test/StdStorage.t.sol +++ /dev/null @@ -1,321 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -import "../Test.sol"; - -contract StdStorageTest is Test { - using stdStorage for StdStorage; - - StorageTest test; - - function setUp() public { - test = new StorageTest(); - } - - function testStorageHidden() public { - assertEq(uint256(keccak256("my.random.var")), stdstore.target(address(test)).sig("hidden()").find()); - } - - function testStorageObvious() public { - assertEq(uint256(0), stdstore.target(address(test)).sig("exists()").find()); - } - - function testStorageCheckedWriteHidden() public { - stdstore.target(address(test)).sig(test.hidden.selector).checked_write(100); - assertEq(uint256(test.hidden()), 100); - } - - function testStorageCheckedWriteObvious() public { - stdstore.target(address(test)).sig(test.exists.selector).checked_write(100); - assertEq(test.exists(), 100); - } - - function testStorageMapStructA() public { - uint256 slot = stdstore - .target(address(test)) - .sig(test.map_struct.selector) - .with_key(address(this)) - .depth(0) - .find(); - assertEq(uint256(keccak256(abi.encode(address(this), 4))), slot); - } - - function testStorageMapStructB() public { - uint256 slot = stdstore - .target(address(test)) - .sig(test.map_struct.selector) - .with_key(address(this)) - .depth(1) - .find(); - assertEq(uint256(keccak256(abi.encode(address(this), 4))) + 1, slot); - } - - function testStorageDeepMap() public { - uint256 slot = stdstore - .target(address(test)) - .sig(test.deep_map.selector) - .with_key(address(this)) - .with_key(address(this)) - .find(); - assertEq(uint256(keccak256(abi.encode(address(this), keccak256(abi.encode(address(this), uint(5)))))), slot); - } - - function testStorageCheckedWriteDeepMap() public { - stdstore - .target(address(test)) - .sig(test.deep_map.selector) - .with_key(address(this)) - .with_key(address(this)) - .checked_write(100); - assertEq(100, test.deep_map(address(this), address(this))); - } - - function testStorageDeepMapStructA() public { - uint256 slot = stdstore - .target(address(test)) - .sig(test.deep_map_struct.selector) - .with_key(address(this)) - .with_key(address(this)) - .depth(0) - .find(); - assertEq(bytes32(uint256(keccak256(abi.encode(address(this), keccak256(abi.encode(address(this), uint(6)))))) + 0), bytes32(slot)); - } - - function testStorageDeepMapStructB() public { - uint256 slot = stdstore - .target(address(test)) - .sig(test.deep_map_struct.selector) - .with_key(address(this)) - .with_key(address(this)) - .depth(1) - .find(); - assertEq(bytes32(uint256(keccak256(abi.encode(address(this), keccak256(abi.encode(address(this), uint(6)))))) + 1), bytes32(slot)); - } - - function testStorageCheckedWriteDeepMapStructA() public { - stdstore - .target(address(test)) - .sig(test.deep_map_struct.selector) - .with_key(address(this)) - .with_key(address(this)) - .depth(0) - .checked_write(100); - (uint256 a, uint256 b) = test.deep_map_struct(address(this), address(this)); - assertEq(100, a); - assertEq(0, b); - } - - function testStorageCheckedWriteDeepMapStructB() public { - stdstore - .target(address(test)) - .sig(test.deep_map_struct.selector) - .with_key(address(this)) - .with_key(address(this)) - .depth(1) - .checked_write(100); - (uint256 a, uint256 b) = test.deep_map_struct(address(this), address(this)); - assertEq(0, a); - assertEq(100, b); - } - - function testStorageCheckedWriteMapStructA() public { - stdstore - .target(address(test)) - .sig(test.map_struct.selector) - .with_key(address(this)) - .depth(0) - .checked_write(100); - (uint256 a, uint256 b) = test.map_struct(address(this)); - assertEq(a, 100); - assertEq(b, 0); - } - - function testStorageCheckedWriteMapStructB() public { - stdstore - .target(address(test)) - .sig(test.map_struct.selector) - .with_key(address(this)) - .depth(1) - .checked_write(100); - (uint256 a, uint256 b) = test.map_struct(address(this)); - assertEq(a, 0); - assertEq(b, 100); - } - - function testStorageStructA() public { - uint256 slot = stdstore.target(address(test)).sig(test.basic.selector).depth(0).find(); - assertEq(uint256(7), slot); - } - - function testStorageStructB() public { - uint256 slot = stdstore.target(address(test)).sig(test.basic.selector).depth(1).find(); - assertEq(uint256(7) + 1, slot); - } - - function testStorageCheckedWriteStructA() public { - stdstore.target(address(test)).sig(test.basic.selector).depth(0).checked_write(100); - (uint256 a, uint256 b) = test.basic(); - assertEq(a, 100); - assertEq(b, 1337); - } - - function testStorageCheckedWriteStructB() public { - stdstore.target(address(test)).sig(test.basic.selector).depth(1).checked_write(100); - (uint256 a, uint256 b) = test.basic(); - assertEq(a, 1337); - assertEq(b, 100); - } - - function testStorageMapAddrFound() public { - uint256 slot = stdstore.target(address(test)).sig(test.map_addr.selector).with_key(address(this)).find(); - assertEq(uint256(keccak256(abi.encode(address(this), uint(1)))), slot); - } - - function testStorageMapUintFound() public { - uint256 slot = stdstore.target(address(test)).sig(test.map_uint.selector).with_key(100).find(); - assertEq(uint256(keccak256(abi.encode(100, uint(2)))), slot); - } - - function testStorageCheckedWriteMapUint() public { - stdstore.target(address(test)).sig(test.map_uint.selector).with_key(100).checked_write(100); - assertEq(100, test.map_uint(100)); - } - - function testStorageCheckedWriteMapAddr() public { - stdstore.target(address(test)).sig(test.map_addr.selector).with_key(address(this)).checked_write(100); - assertEq(100, test.map_addr(address(this))); - } - - function testStorageCheckedWriteMapBool() public { - stdstore.target(address(test)).sig(test.map_bool.selector).with_key(address(this)).checked_write(true); - assertTrue(test.map_bool(address(this))); - } - - function testFailStorageCheckedWriteMapPacked() public { - // expect PackedSlot error but not external call so cant expectRevert - stdstore.target(address(test)).sig(test.read_struct_lower.selector).with_key(address(uint160(1337))).checked_write(100); - } - - function testStorageCheckedWriteMapPackedSuccess() public { - uint256 full = test.map_packed(address(1337)); - // keep upper 128, set lower 128 to 1337 - full = (full & (uint256((1 << 128) - 1) << 128)) | 1337; - stdstore.target(address(test)).sig(test.map_packed.selector).with_key(address(uint160(1337))).checked_write(full); - assertEq(1337, test.read_struct_lower(address(1337))); - } - - function testFailStorageConst() public { - // vm.expectRevert(abi.encodeWithSignature("NotStorage(bytes4)", bytes4(keccak256("const()")))); - stdstore.target(address(test)).sig("const()").find(); - } - - function testFailStorageNativePack() public { - stdstore.target(address(test)).sig(test.tA.selector).find(); - stdstore.target(address(test)).sig(test.tB.selector).find(); - - // these both would fail - stdstore.target(address(test)).sig(test.tC.selector).find(); - stdstore.target(address(test)).sig(test.tD.selector).find(); - } - - function testStorageReadBytes32() public { - bytes32 val = stdstore.target(address(test)).sig(test.tE.selector).read_bytes32(); - assertEq(val, hex"1337"); - } - - function testStorageReadBool_False() public { - bool val = stdstore.target(address(test)).sig(test.tB.selector).read_bool(); - assertEq(val, false); - } - - function testStorageReadBool_True() public { - bool val = stdstore.target(address(test)).sig(test.tH.selector).read_bool(); - assertEq(val, true); - } - - function testStorageReadBool_Revert() public { - vm.expectRevert("stdStorage read_bool(StdStorage): Cannot decode. Make sure you are reading a bool."); - this.readNonBoolValue(); - } - - function readNonBoolValue() public { - stdstore.target(address(test)).sig(test.tE.selector).read_bool(); - } - - function testStorageReadAddress() public { - address val = stdstore.target(address(test)).sig(test.tF.selector).read_address(); - assertEq(val, address(1337)); - } - - function testStorageReadUint() public { - uint256 val = stdstore.target(address(test)).sig(test.exists.selector).read_uint(); - assertEq(val, 1); - } - - function testStorageReadInt() public { - int256 val = stdstore.target(address(test)).sig(test.tG.selector).read_int(); - assertEq(val, type(int256).min); - } -} - -contract StorageTest { - uint256 public exists = 1; - mapping(address => uint256) public map_addr; - mapping(uint256 => uint256) public map_uint; - mapping(address => uint256) public map_packed; - mapping(address => UnpackedStruct) public map_struct; - mapping(address => mapping(address => uint256)) public deep_map; - mapping(address => mapping(address => UnpackedStruct)) public deep_map_struct; - UnpackedStruct public basic; - - uint248 public tA; - bool public tB; - - - bool public tC = false; - uint248 public tD = 1; - - - struct UnpackedStruct { - uint256 a; - uint256 b; - } - - mapping(address => bool) public map_bool; - - bytes32 public tE = hex"1337"; - address public tF = address(1337); - int256 public tG = type(int256).min; - bool public tH = true; - - constructor() { - basic = UnpackedStruct({ - a: 1337, - b: 1337 - }); - - uint256 two = (1<<128) | 1; - map_packed[msg.sender] = two; - map_packed[address(bytes20(uint160(1337)))] = 1<<128; - } - - function read_struct_upper(address who) public view returns (uint256) { - return map_packed[who] >> 128; - } - - function read_struct_lower(address who) public view returns (uint256) { - return map_packed[who] & ((1 << 128) - 1); - } - - function hidden() public view returns (bytes32 t) { - bytes32 slot = keccak256("my.random.var"); - /// @solidity memory-safe-assembly - assembly { - t := sload(slot) - } - } - - function const() public pure returns (bytes32 t) { - t = bytes32(hex"1337"); - } -} diff --git a/contract/lib/foundry-huff/lib/foundry-huff/scripts/binary_check.sh b/contract/lib/foundry-huff/lib/foundry-huff/scripts/binary_check.sh deleted file mode 100755 index 725a058..0000000 --- a/contract/lib/foundry-huff/lib/foundry-huff/scripts/binary_check.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/bash - -if ! [[ "$(npm list -g huffc)" =~ "empty" ]]; then - # huffc was installed via npm, return 0x00 - echo -n 0x00 -elif [[ "$(yarn global list)" =~ "huffc" ]]; then - # huffc was installed via yarn, return 0x00 - echo -n 0x00 -else - echo -n 0x01 -fi diff --git a/contract/lib/foundry-huff/lib/foundry-huff/scripts/file_writer.sh b/contract/lib/foundry-huff/lib/foundry-huff/scripts/file_writer.sh deleted file mode 100755 index 93e3a8d..0000000 --- a/contract/lib/foundry-huff/lib/foundry-huff/scripts/file_writer.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -echo "$2" > $1 diff --git a/contract/lib/foundry-huff/lib/foundry-huff/scripts/rand_bytes.sh b/contract/lib/foundry-huff/lib/foundry-huff/scripts/rand_bytes.sh deleted file mode 100755 index fdd9921..0000000 --- a/contract/lib/foundry-huff/lib/foundry-huff/scripts/rand_bytes.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -echo -n $(hexdump -n 16 -v -e '"0x" 32/1 "%02x" "\n"' /dev/urandom) \ No newline at end of file diff --git a/contract/lib/foundry-huff/lib/foundry-huff/scripts/read_and_append.sh b/contract/lib/foundry-huff/lib/foundry-huff/scripts/read_and_append.sh deleted file mode 100755 index a143365..0000000 --- a/contract/lib/foundry-huff/lib/foundry-huff/scripts/read_and_append.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -cat $2 >> $1 diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/.gitattributes b/contract/lib/foundry-huff/lib/solidity-stringutils/.gitattributes deleted file mode 100644 index 52031de..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.sol linguist-language=Solidity diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/.github/workflows/ci.yml b/contract/lib/foundry-huff/lib/solidity-stringutils/.github/workflows/ci.yml deleted file mode 100644 index 2f339b2..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/.github/workflows/ci.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: "CI" -on: "push" -jobs: - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.3.4 - - uses: cachix/install-nix-action@v13 - - name: Install dapp - run: nix-env -iA dapp -f $(curl -sS https://api.github.com/repos/dapphub/dapptools/releases/latest | jq -r .tarball_url) - - name: Fetch submodules - run: git submodule update --init - - name: Run tests - run: make test diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/.gitmodules b/contract/lib/foundry-huff/lib/solidity-stringutils/.gitmodules deleted file mode 100644 index e124719..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "lib/ds-test"] - path = lib/ds-test - url = https://github.com/dapphub/ds-test diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/LICENSE b/contract/lib/foundry-huff/lib/solidity-stringutils/LICENSE deleted file mode 100644 index 769c240..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016 Nick Johnson - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/Makefile b/contract/lib/foundry-huff/lib/solidity-stringutils/Makefile deleted file mode 100644 index 31975ee..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -all :; dapp build -clean :; dapp clean -test :; dapp test -deploy :; dapp create SolidityStringutils diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/README b/contract/lib/foundry-huff/lib/solidity-stringutils/README deleted file mode 100644 index ad344af..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/README +++ /dev/null @@ -1 +0,0 @@ -Basic string utilities for Solidity, optimized for low gas usage. diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/README.md b/contract/lib/foundry-huff/lib/solidity-stringutils/README.md deleted file mode 100644 index 4586341..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/README.md +++ /dev/null @@ -1,357 +0,0 @@ - -# String & slice utility library for Solidity -## Overview -Functionality in this library is largely implemented using an abstraction called a 'slice'. A slice represents a part of a string - anything from the entire string to a single character, or even no characters at all (a 0-length slice). Since a slice only has to specify an offset and a length, copying and manipulating slices is a lot less expensive than copying and manipulating the strings they reference. - -To further reduce gas costs, most functions on slice that need to return a slice modify the original one instead of allocating a new one; for instance, `s.split(".")` will return the text up to the first '.', modifying s to only contain the remainder of the string after the '.'. In situations where you do not want to modify the original slice, you can make a copy first with `.copy()`, for example: `s.copy().split(".")`. Try and avoid using this idiom in loops; since Solidity has no memory management, it will result in allocating many short-lived slices that are later discarded. - -Functions that return two slices come in two versions: a non-allocating version that takes the second slice as an argument, modifying it in place, and an allocating version that allocates and returns the second slice; see `nextRune` for example. - -Functions that have to copy string data will return strings rather than slices; these can be cast back to slices for further processing if required. - -## Examples -### Basic usage - import "github.com/Arachnid/solidity-stringutils/strings.sol"; - - contract Contract { - using strings for *; - - // ... - } - -### Getting the character length of a string - var len = "Unicode snowman ☃".toSlice().len(); // 17 - -### Splitting a string around a delimiter - var s = "foo bar baz".toSlice(); - var foo = s.split(" ".toSlice()); - -After the above code executes, `s` is now "bar baz", and `foo` is now "foo". - -### Splitting a string into an array - var s = "www.google.com".toSlice(); - var delim = ".".toSlice(); - var parts = new string[](s.count(delim) + 1); - for(uint i = 0; i < parts.length; i++) { - parts[i] = s.split(delim).toString(); - } - -### Extracting the middle part of a string - var s = "www.google.com".toSlice(); - strings.slice memory part; - s.split(".".toSlice(), part); // part and return value is "www" - s.split(".".toSlice(), part); // part and return value is "google" - -This approach uses less memory than the above, by reusing the slice `part` for each section of string extracted. - -### Converting a slice back to a string - var myString = mySlice.toString(); - -### Finding and returning the first occurrence of a substring - var s = "A B C B D".toSlice(); - s.find("B".toSlice()); // "B C B D" - -`find` modifies `s` to contain the part of the string from the first match onwards. - -### Finding and returning the last occurrence of a substring - var s = "A B C B D".toSlice(); - s.rfind("B".toSlice()); // "A B C B" - -`rfind` modifies `s` to contain the part of the string from the last match back to the start. - -### Finding without modifying the original slice. - var s = "A B C B D".toSlice(); - var substring = s.copy().rfind("B".toSlice()); // "A B C B" - -`copy` lets you cheaply duplicate a slice so you don't modify the original. - -### Prefix and suffix matching - var s = "A B C B D".toSlice(); - s.startsWith("A".toSlice()); // True - s.endsWith("D".toSlice()); // True - s.startsWith("B".toSlice()); // False - -### Removing a prefix or suffix - var s = "A B C B D".toSlice(); - s.beyond("A ".toSlice()).until(" D".toSlice()); // "B C B" - -`beyond` modifies `s` to contain the text after its argument; `until` modifies `s` to contain the text up to its argument. If the argument isn't found, `s` is unmodified. - -### Finding and returning the string up to the first match - var s = "A B C B D".toSlice(); - var needle = "B".toSlice(); - var substring = s.until(s.copy().find(needle).beyond(needle)); - -Calling `find` on a copy of `s` returns the part of the string from `needle` onwards; calling `.beyond(needle)` removes `needle` as a prefix, and finally calling `s.until()` removes the entire end of the string, leaving everything up to and including the first match. - -### Concatenating strings - var s = "abc".toSlice().concat("def".toSlice()); // "abcdef" - -## Reference - -### toSlice(string self) internal returns (slice) -Returns a slice containing the entire string. - -Arguments: - - - self The string to make a slice from. - -Returns A newly allocated slice containing the entire string. - -### copy(slice self) internal returns (slice) -Returns a new slice containing the same data as the current slice. - -Arguments: - - - self The slice to copy. - -Returns A new slice containing the same data as `self`. - -### toString(slice self) internal returns (string) - -Copies a slice to a new string. - -Arguments: - - - self The slice to copy. - -Returns A newly allocated string containing the slice's text. - -### len(slice self) internal returns (uint) - -Returns the length in runes of the slice. Note that this operation takes time proportional to the length of the slice; avoid using it in loops, and call `slice.empty()` if you only need to know whether the slice is empty or not. - -Arguments: - - - self The slice to operate on. - -Returns The length of the slice in runes. - -### empty(slice self) internal returns (bool) - -Returns true if the slice is empty (has a length of 0). - -Arguments: - - - self The slice to operate on. - -Returns True if the slice is empty, False otherwise. - -### compare(slice self, slice other) internal returns (int) - -Returns a positive number if `other` comes lexicographically after `self`, a negative number if it comes before, or zero if the contents of the two slices are equal. Comparison is done per-rune, on unicode codepoints. - -Arguments: - - - self The first slice to compare. - - other The second slice to compare. - -Returns The result of the comparison. - -### equals(slice self, slice other) internal returns (bool) - -Returns true if the two slices contain the same text. - -Arguments: - - - self The first slice to compare. - - self The second slice to compare. - -Returns True if the slices are equal, false otherwise. - -### nextRune(slice self, slice rune) internal returns (slice) - -Extracts the first rune in the slice into `rune`, advancing the slice to point to the next rune and returning `self`. - -Arguments: - - - self The slice to operate on. - - rune The slice that will contain the first rune. - -Returns `rune`. - -### nextRune(slice self) internal returns (slice ret) - -Returns the first rune in the slice, advancing the slice to point to the next rune. - -Arguments: - - - self The slice to operate on. - -Returns A slice containing only the first rune from `self`. - -### ord(slice self) internal returns (uint ret) - -Returns the number of the first codepoint in the slice. - -Arguments: - - - self The slice to operate on. - -Returns The number of the first codepoint in the slice. - -### keccak(slice self) internal returns (bytes32 ret) - -Returns the keccak-256 hash of the slice. - -Arguments: - - - self The slice to hash. - -Returns The hash of the slice. - -### startsWith(slice self, slice needle) internal returns (bool) - -Returns true if `self` starts with `needle`. - -Arguments: - - - self The slice to operate on. - - needle The slice to search for. - -Returns True if the slice starts with the provided text, false otherwise. - -### beyond(slice self, slice needle) internal returns (slice) - -If `self` starts with `needle`, `needle` is removed from the beginning of `self`. Otherwise, `self` is unmodified. - -Arguments: - - - self The slice to operate on. - - needle The slice to search for. - -Returns `self` - -### endsWith(slice self, slice needle) internal returns (bool) - -Returns true if the slice ends with `needle`. - -Arguments: - - - self The slice to operate on. - - needle The slice to search for. - -Returns True if the slice starts with the provided text, false otherwise. - -### until(slice self, slice needle) internal returns (slice) - -If `self` ends with `needle`, `needle` is removed from the end of `self`. Otherwise, `self` is unmodified. - -Arguments: - - - self The slice to operate on. - - needle The slice to search for. - -Returns `self` - -### find(slice self, slice needle) internal returns (slice) - -Modifies `self` to contain everything from the first occurrence of `needle` to the end of the slice. `self` is set to the empty slice if `needle` is not found. - -Arguments: - - - self The slice to search and modify. - - needle The text to search for. - -Returns `self`. - -### rfind(slice self, slice needle) internal returns (slice) - -Modifies `self` to contain the part of the string from the start of `self` to the end of the first occurrence of `needle`. If `needle` is not found, `self` is set to the empty slice. - -Arguments: - - - self The slice to search and modify. - - needle The text to search for. - -Returns `self`. - -### split(slice self, slice needle, slice token) internal returns (slice) - -Splits the slice, setting `self` to everything after the first occurrence of `needle`, and `token` to everything before it. If `needle` does not occur in `self`, `self` is set to the empty slice, and `token` is set to the entirety of `self`. - -Arguments: - - - self The slice to split. - - needle The text to search for in `self`. - - token An output parameter to which the first token is written. - -Returns `token`. - -### split(slice self, slice needle) internal returns (slice token) - -Splits the slice, setting `self` to everything after the first occurrence of `needle`, and returning everything before it. If `needle` does not occur in `self`, `self` is set to the empty slice, and the entirety of `self` is returned. - -Arguments: - - - self The slice to split. - - needle The text to search for in `self`. - -Returns The part of `self` up to the first occurrence of `delim`. - -### rsplit(slice self, slice needle, slice token) internal returns (slice) - -Splits the slice, setting `self` to everything before the last occurrence of `needle`, and `token` to everything after it. If `needle` does not occur in `self`, `self` is set to the empty slice, and `token` is set to the entirety of `self`. - -Arguments: - - - self The slice to split. - - needle The text to search for in `self`. - - token An output parameter to which the first token is written. - -Returns `token`. - -### rsplit(slice self, slice needle) internal returns (slice token) - -Splits the slice, setting `self` to everything before the last occurrence of `needle`, and returning everything after it. If `needle` does not occur in `self`, `self` is set to the empty slice, and the entirety of `self` is returned. - -Arguments: - - - self The slice to split. - - needle The text to search for in `self`. - -Returns The part of `self` after the last occurrence of `delim`. - -### count(slice self, slice needle) internal returns (uint count) - -Counts the number of nonoverlapping occurrences of `needle` in `self`. - -Arguments: - - - self The slice to search. - - needle The text to search for in `self`. - -Returns The number of occurrences of `needle` found in `self`. - -### contains(slice self, slice needle) internal returns (bool) - -Returns True if `self` contains `needle`. - -Arguments: - - - self The slice to search. - - needle The text to search for in `self`. - -Returns True if `needle` is found in `self`, false otherwise. - -### concat(slice self, slice other) internal returns (string) - -Returns a newly allocated string containing the concatenation of `self` and `other`. - -Arguments: - - - self The first slice to concatenate. - - other The second slice to concatenate. - -Returns The concatenation of the two strings. - -### join(slice self, slice[] parts) internal returns (string) - -Joins an array of slices, using `self` as a delimiter, returning a newly allocated string. - -Arguments: - - - self The delimiter to use. - - parts A list of slices to join. - -Returns A newly allocated string containing all the slices in `parts`, joined with `self`. diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/dappfile b/contract/lib/foundry-huff/lib/solidity-stringutils/dappfile deleted file mode 100644 index 8772d97..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/dappfile +++ /dev/null @@ -1,8 +0,0 @@ -version: 2.0.0 -tags: [] -layout: - sol_sources: . - build_dir: build -dependencies: {} -ignore: [] -name: ethereum-stringutils diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/LICENSE b/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/LICENSE deleted file mode 100644 index 94a9ed0..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/Makefile b/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/Makefile deleted file mode 100644 index 661dac4..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -all:; dapp build - -test: - -dapp --use solc:0.4.23 build - -dapp --use solc:0.4.26 build - -dapp --use solc:0.5.17 build - -dapp --use solc:0.6.12 build - -dapp --use solc:0.7.5 build - -demo: - DAPP_SRC=demo dapp --use solc:0.7.5 build - -hevm dapp-test --verbose 3 - -.PHONY: test demo diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/default.nix b/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/default.nix deleted file mode 100644 index cf65419..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ solidityPackage, dappsys }: solidityPackage { - name = "ds-test"; - src = ./src; -} diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/demo/demo.sol b/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/demo/demo.sol deleted file mode 100644 index d3a7d81..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/demo/demo.sol +++ /dev/null @@ -1,223 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.4.23; - -import "../src/test.sol"; - -contract DemoTest is DSTest { - function test_this() public pure { - require(true); - } - function test_logs() public { - emit log("-- log(string)"); - emit log("a string"); - - emit log("-- log_named_uint(string, uint)"); - log_named_uint("uint", 512); - - emit log("-- log_named_int(string, int)"); - log_named_int("int", -512); - - emit log("-- log_named_address(string, address)"); - log_named_address("address", address(this)); - - emit log("-- log_named_bytes32(string, bytes32)"); - log_named_bytes32("bytes32", "a string"); - - emit log("-- log_named_bytes(string, bytes)"); - log_named_bytes("bytes", hex"cafefe"); - - emit log("-- log_named_string(string, string)"); - log_named_string("string", "a string"); - - emit log("-- log_named_decimal_uint(string, uint, uint)"); - log_named_decimal_uint("decimal uint", 1.0e18, 18); - - emit log("-- log_named_decimal_int(string, int, uint)"); - log_named_decimal_int("decimal int", -1.0e18, 18); - } - event log_old_named_uint(bytes32,uint); - function test_old_logs() public { - log_old_named_uint("key", 500); - log_named_bytes32("bkey", "val"); - } - function test_trace() public view { - this.echo("string 1", "string 2"); - } - function test_multiline() public { - emit log("a multiline\\n" "string"); - emit log("a multiline " "string"); - log_bytes("a string"); - log_bytes("a multiline\n" "string"); - log_bytes("a multiline\\n" "string"); - emit log(unicode"Ώ"); - logs(hex"0000"); - log_named_bytes("0x0000", hex"0000"); - logs(hex"ff"); - } - function echo(string memory s1, string memory s2) public pure - returns (string memory, string memory) - { - return (s1, s2); - } - - function prove_this(uint x) public { - log_named_uint("sym x", x); - assertGt(x + 1, 0); - } - - function test_logn() public { - assembly { - log0(0x01, 0x02) - log1(0x01, 0x02, 0x03) - log2(0x01, 0x02, 0x03, 0x04) - log3(0x01, 0x02, 0x03, 0x04, 0x05) - } - } - - event MyEvent(uint, uint indexed, uint, uint indexed); - function test_events() public { - emit MyEvent(1, 2, 3, 4); - } - - function test_asserts() public { - string memory err = "this test has failed!"; - emit log("## assertTrue(bool)\n"); - assertTrue(false); - emit log("\n"); - assertTrue(false, err); - - emit log("\n## assertEq(address,address)\n"); - assertEq(address(this), msg.sender); - emit log("\n"); - assertEq(address(this), msg.sender, err); - - emit log("\n## assertEq32(bytes32,bytes32)\n"); - assertEq32("bytes 1", "bytes 2"); - emit log("\n"); - assertEq32("bytes 1", "bytes 2", err); - - emit log("\n## assertEq(bytes32,bytes32)\n"); - assertEq32("bytes 1", "bytes 2"); - emit log("\n"); - assertEq32("bytes 1", "bytes 2", err); - - emit log("\n## assertEq(uint,uint)\n"); - assertEq(uint(0), 1); - emit log("\n"); - assertEq(uint(0), 1, err); - - emit log("\n## assertEq(int,int)\n"); - assertEq(-1, -2); - emit log("\n"); - assertEq(-1, -2, err); - - emit log("\n## assertEqDecimal(int,int,uint)\n"); - assertEqDecimal(-1.0e18, -1.1e18, 18); - emit log("\n"); - assertEqDecimal(-1.0e18, -1.1e18, 18, err); - - emit log("\n## assertEqDecimal(uint,uint,uint)\n"); - assertEqDecimal(uint(1.0e18), 1.1e18, 18); - emit log("\n"); - assertEqDecimal(uint(1.0e18), 1.1e18, 18, err); - - emit log("\n## assertGt(uint,uint)\n"); - assertGt(uint(0), 0); - emit log("\n"); - assertGt(uint(0), 0, err); - - emit log("\n## assertGt(int,int)\n"); - assertGt(-1, -1); - emit log("\n"); - assertGt(-1, -1, err); - - emit log("\n## assertGtDecimal(int,int,uint)\n"); - assertGtDecimal(-2.0e18, -1.1e18, 18); - emit log("\n"); - assertGtDecimal(-2.0e18, -1.1e18, 18, err); - - emit log("\n## assertGtDecimal(uint,uint,uint)\n"); - assertGtDecimal(uint(1.0e18), 1.1e18, 18); - emit log("\n"); - assertGtDecimal(uint(1.0e18), 1.1e18, 18, err); - - emit log("\n## assertGe(uint,uint)\n"); - assertGe(uint(0), 1); - emit log("\n"); - assertGe(uint(0), 1, err); - - emit log("\n## assertGe(int,int)\n"); - assertGe(-1, 0); - emit log("\n"); - assertGe(-1, 0, err); - - emit log("\n## assertGeDecimal(int,int,uint)\n"); - assertGeDecimal(-2.0e18, -1.1e18, 18); - emit log("\n"); - assertGeDecimal(-2.0e18, -1.1e18, 18, err); - - emit log("\n## assertGeDecimal(uint,uint,uint)\n"); - assertGeDecimal(uint(1.0e18), 1.1e18, 18); - emit log("\n"); - assertGeDecimal(uint(1.0e18), 1.1e18, 18, err); - - emit log("\n## assertLt(uint,uint)\n"); - assertLt(uint(0), 0); - emit log("\n"); - assertLt(uint(0), 0, err); - - emit log("\n## assertLt(int,int)\n"); - assertLt(-1, -1); - emit log("\n"); - assertLt(-1, -1, err); - - emit log("\n## assertLtDecimal(int,int,uint)\n"); - assertLtDecimal(-1.0e18, -1.1e18, 18); - emit log("\n"); - assertLtDecimal(-1.0e18, -1.1e18, 18, err); - - emit log("\n## assertLtDecimal(uint,uint,uint)\n"); - assertLtDecimal(uint(2.0e18), 1.1e18, 18); - emit log("\n"); - assertLtDecimal(uint(2.0e18), 1.1e18, 18, err); - - emit log("\n## assertLe(uint,uint)\n"); - assertLe(uint(1), 0); - emit log("\n"); - assertLe(uint(1), 0, err); - - emit log("\n## assertLe(int,int)\n"); - assertLe(0, -1); - emit log("\n"); - assertLe(0, -1, err); - - emit log("\n## assertLeDecimal(int,int,uint)\n"); - assertLeDecimal(-1.0e18, -1.1e18, 18); - emit log("\n"); - assertLeDecimal(-1.0e18, -1.1e18, 18, err); - - emit log("\n## assertLeDecimal(uint,uint,uint)\n"); - assertLeDecimal(uint(2.0e18), 1.1e18, 18); - emit log("\n"); - assertLeDecimal(uint(2.0e18), 1.1e18, 18, err); - - emit log("\n## assertEq(string,string)\n"); - string memory s1 = "string 1"; - string memory s2 = "string 2"; - assertEq(s1, s2); - emit log("\n"); - assertEq(s1, s2, err); - - emit log("\n## assertEq0(bytes,bytes)\n"); - assertEq0(hex"abcdef01", hex"abcdef02"); - log("\n"); - assertEq0(hex"abcdef01", hex"abcdef02", err); - } -} - -contract DemoTestWithSetUp { - function setUp() public { - } - function test_pass() public pure { - } -} diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/src/test.sol b/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/src/test.sol deleted file mode 100644 index 96d3c15..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/lib/ds-test/src/test.sol +++ /dev/null @@ -1,434 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity >=0.4.23; - -contract DSTest { - event log (string); - event logs (bytes); - - event log_address (address); - event log_bytes32 (bytes32); - event log_int (int); - event log_uint (uint); - event log_bytes (bytes); - event log_string (string); - - event log_named_address (string key, address val); - event log_named_bytes32 (string key, bytes32 val); - event log_named_decimal_int (string key, int val, uint decimals); - event log_named_decimal_uint (string key, uint val, uint decimals); - event log_named_int (string key, int val); - event log_named_uint (string key, uint val); - event log_named_bytes (string key, bytes val); - event log_named_string (string key, string val); - - bool public IS_TEST = true; - bool public failed; - - address constant HEVM_ADDRESS = - address(bytes20(uint160(uint256(keccak256('hevm cheat code'))))); - - modifier mayRevert() { _; } - modifier testopts(string memory) { _; } - - function fail() internal { - failed = true; - } - - modifier logs_gas() { - uint startGas = gasleft(); - _; - uint endGas = gasleft(); - emit log_named_uint("gas", startGas - endGas); - } - - function assertTrue(bool condition) internal { - if (!condition) { - emit log("Error: Assertion Failed"); - fail(); - } - } - - function assertTrue(bool condition, string memory err) internal { - if (!condition) { - emit log_named_string("Error", err); - assertTrue(condition); - } - } - - function assertEq(address a, address b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [address]"); - emit log_named_address(" Expected", b); - emit log_named_address(" Actual", a); - fail(); - } - } - function assertEq(address a, address b, string memory err) internal { - if (a != b) { - emit log_named_string ("Error", err); - assertEq(a, b); - } - } - - function assertEq(bytes32 a, bytes32 b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [bytes32]"); - emit log_named_bytes32(" Expected", b); - emit log_named_bytes32(" Actual", a); - fail(); - } - } - function assertEq(bytes32 a, bytes32 b, string memory err) internal { - if (a != b) { - emit log_named_string ("Error", err); - assertEq(a, b); - } - } - function assertEq32(bytes32 a, bytes32 b) internal { - assertEq(a, b); - } - function assertEq32(bytes32 a, bytes32 b, string memory err) internal { - assertEq(a, b, err); - } - - function assertEq(int a, int b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [int]"); - emit log_named_int(" Expected", b); - emit log_named_int(" Actual", a); - fail(); - } - } - function assertEq(int a, int b, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - function assertEq(uint a, uint b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [uint]"); - emit log_named_uint(" Expected", b); - emit log_named_uint(" Actual", a); - fail(); - } - } - function assertEq(uint a, uint b, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - function assertEqDecimal(int a, int b, uint decimals) internal { - if (a != b) { - emit log("Error: a == b not satisfied [decimal int]"); - emit log_named_decimal_int(" Expected", b, decimals); - emit log_named_decimal_int(" Actual", a, decimals); - fail(); - } - } - function assertEqDecimal(int a, int b, uint decimals, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEqDecimal(a, b, decimals); - } - } - function assertEqDecimal(uint a, uint b, uint decimals) internal { - if (a != b) { - emit log("Error: a == b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Expected", b, decimals); - emit log_named_decimal_uint(" Actual", a, decimals); - fail(); - } - } - function assertEqDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEqDecimal(a, b, decimals); - } - } - - function assertGt(uint a, uint b) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertGt(uint a, uint b, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGt(a, b); - } - } - function assertGt(int a, int b) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertGt(int a, int b, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGt(a, b); - } - } - function assertGtDecimal(int a, int b, uint decimals) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertGtDecimal(int a, int b, uint decimals, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGtDecimal(a, b, decimals); - } - } - function assertGtDecimal(uint a, uint b, uint decimals) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertGtDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGtDecimal(a, b, decimals); - } - } - - function assertGe(uint a, uint b) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertGe(uint a, uint b, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGe(a, b); - } - } - function assertGe(int a, int b) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertGe(int a, int b, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGe(a, b); - } - } - function assertGeDecimal(int a, int b, uint decimals) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertGeDecimal(int a, int b, uint decimals, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGeDecimal(a, b, decimals); - } - } - function assertGeDecimal(uint a, uint b, uint decimals) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertGeDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGeDecimal(a, b, decimals); - } - } - - function assertLt(uint a, uint b) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertLt(uint a, uint b, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLt(a, b); - } - } - function assertLt(int a, int b) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertLt(int a, int b, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLt(a, b); - } - } - function assertLtDecimal(int a, int b, uint decimals) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertLtDecimal(int a, int b, uint decimals, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLtDecimal(a, b, decimals); - } - } - function assertLtDecimal(uint a, uint b, uint decimals) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertLtDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLtDecimal(a, b, decimals); - } - } - - function assertLe(uint a, uint b) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertLe(uint a, uint b, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLe(a, b); - } - } - function assertLe(int a, int b) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertLe(int a, int b, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLe(a, b); - } - } - function assertLeDecimal(int a, int b, uint decimals) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertLeDecimal(int a, int b, uint decimals, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLeDecimal(a, b, decimals); - } - } - function assertLeDecimal(uint a, uint b, uint decimals) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertLeDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertGeDecimal(a, b, decimals); - } - } - - function assertEq(string memory a, string memory b) internal { - if (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b))) { - emit log("Error: a == b not satisfied [string]"); - emit log_named_string(" Value a", a); - emit log_named_string(" Value b", b); - fail(); - } - } - function assertEq(string memory a, string memory b, string memory err) internal { - if (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b))) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - - function checkEq0(bytes memory a, bytes memory b) internal pure returns (bool ok) { - ok = true; - if (a.length == b.length) { - for (uint i = 0; i < a.length; i++) { - if (a[i] != b[i]) { - ok = false; - } - } - } else { - ok = false; - } - } - function assertEq0(bytes memory a, bytes memory b) internal { - if (!checkEq0(a, b)) { - emit log("Error: a == b not satisfied [bytes]"); - emit log_named_bytes(" Expected", a); - emit log_named_bytes(" Actual", b); - fail(); - } - } - function assertEq0(bytes memory a, bytes memory b, string memory err) internal { - if (!checkEq0(a, b)) { - emit log_named_string("Error", err); - assertEq0(a, b); - } - } -} diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/src/strings.sol b/contract/lib/foundry-huff/lib/solidity-stringutils/src/strings.sol deleted file mode 100644 index f7ae13a..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/src/strings.sol +++ /dev/null @@ -1,727 +0,0 @@ -/* - * @title String & slice utility library for Solidity contracts. - * @author Nick Johnson - * - * @dev Functionality in this library is largely implemented using an - * abstraction called a 'slice'. A slice represents a part of a string - - * anything from the entire string to a single character, or even no - * characters at all (a 0-length slice). Since a slice only has to specify - * an offset and a length, copying and manipulating slices is a lot less - * expensive than copying and manipulating the strings they reference. - * - * To further reduce gas costs, most functions on slice that need to return - * a slice modify the original one instead of allocating a new one; for - * instance, `s.split(".")` will return the text up to the first '.', - * modifying s to only contain the remainder of the string after the '.'. - * In situations where you do not want to modify the original slice, you - * can make a copy first with `.copy()`, for example: - * `s.copy().split(".")`. Try and avoid using this idiom in loops; since - * Solidity has no memory management, it will result in allocating many - * short-lived slices that are later discarded. - * - * Functions that return two slices come in two versions: a non-allocating - * version that takes the second slice as an argument, modifying it in - * place, and an allocating version that allocates and returns the second - * slice; see `nextRune` for example. - * - * Functions that have to copy string data will return strings rather than - * slices; these can be cast back to slices for further processing if - * required. - * - * For convenience, some functions are provided with non-modifying - * variants that create a new slice and return both; for instance, - * `s.splitNew('.')` leaves s unmodified, and returns two values - * corresponding to the left and right parts of the string. - */ - -pragma solidity ^0.8.0; - -library strings { - struct slice { - uint _len; - uint _ptr; - } - - function memcpy(uint dest, uint src, uint len) private pure { - // Copy word-length chunks while possible - for(; len >= 32; len -= 32) { - assembly { - mstore(dest, mload(src)) - } - dest += 32; - src += 32; - } - - // Copy remaining bytes - uint mask = type(uint).max; - if (len > 0) { - mask = 256 ** (32 - len) - 1; - } - assembly { - let srcpart := and(mload(src), not(mask)) - let destpart := and(mload(dest), mask) - mstore(dest, or(destpart, srcpart)) - } - } - - /* - * @dev Returns a slice containing the entire string. - * @param self The string to make a slice from. - * @return A newly allocated slice containing the entire string. - */ - function toSlice(string memory self) internal pure returns (slice memory) { - uint ptr; - assembly { - ptr := add(self, 0x20) - } - return slice(bytes(self).length, ptr); - } - - /* - * @dev Returns the length of a null-terminated bytes32 string. - * @param self The value to find the length of. - * @return The length of the string, from 0 to 32. - */ - function len(bytes32 self) internal pure returns (uint) { - uint ret; - if (self == 0) - return 0; - if (uint(self) & type(uint128).max == 0) { - ret += 16; - self = bytes32(uint(self) / 0x100000000000000000000000000000000); - } - if (uint(self) & type(uint64).max == 0) { - ret += 8; - self = bytes32(uint(self) / 0x10000000000000000); - } - if (uint(self) & type(uint32).max == 0) { - ret += 4; - self = bytes32(uint(self) / 0x100000000); - } - if (uint(self) & type(uint16).max == 0) { - ret += 2; - self = bytes32(uint(self) / 0x10000); - } - if (uint(self) & type(uint8).max == 0) { - ret += 1; - } - return 32 - ret; - } - - /* - * @dev Returns a slice containing the entire bytes32, interpreted as a - * null-terminated utf-8 string. - * @param self The bytes32 value to convert to a slice. - * @return A new slice containing the value of the input argument up to the - * first null. - */ - function toSliceB32(bytes32 self) internal pure returns (slice memory ret) { - // Allocate space for `self` in memory, copy it there, and point ret at it - assembly { - let ptr := mload(0x40) - mstore(0x40, add(ptr, 0x20)) - mstore(ptr, self) - mstore(add(ret, 0x20), ptr) - } - ret._len = len(self); - } - - /* - * @dev Returns a new slice containing the same data as the current slice. - * @param self The slice to copy. - * @return A new slice containing the same data as `self`. - */ - function copy(slice memory self) internal pure returns (slice memory) { - return slice(self._len, self._ptr); - } - - /* - * @dev Copies a slice to a new string. - * @param self The slice to copy. - * @return A newly allocated string containing the slice's text. - */ - function toString(slice memory self) internal pure returns (string memory) { - string memory ret = new string(self._len); - uint retptr; - assembly { retptr := add(ret, 32) } - - memcpy(retptr, self._ptr, self._len); - return ret; - } - - /* - * @dev Returns the length in runes of the slice. Note that this operation - * takes time proportional to the length of the slice; avoid using it - * in loops, and call `slice.empty()` if you only need to know whether - * the slice is empty or not. - * @param self The slice to operate on. - * @return The length of the slice in runes. - */ - function len(slice memory self) internal pure returns (uint l) { - // Starting at ptr-31 means the LSB will be the byte we care about - uint ptr = self._ptr - 31; - uint end = ptr + self._len; - for (l = 0; ptr < end; l++) { - uint8 b; - assembly { b := and(mload(ptr), 0xFF) } - if (b < 0x80) { - ptr += 1; - } else if(b < 0xE0) { - ptr += 2; - } else if(b < 0xF0) { - ptr += 3; - } else if(b < 0xF8) { - ptr += 4; - } else if(b < 0xFC) { - ptr += 5; - } else { - ptr += 6; - } - } - } - - /* - * @dev Returns true if the slice is empty (has a length of 0). - * @param self The slice to operate on. - * @return True if the slice is empty, False otherwise. - */ - function empty(slice memory self) internal pure returns (bool) { - return self._len == 0; - } - - /* - * @dev Returns a positive number if `other` comes lexicographically after - * `self`, a negative number if it comes before, or zero if the - * contents of the two slices are equal. Comparison is done per-rune, - * on unicode codepoints. - * @param self The first slice to compare. - * @param other The second slice to compare. - * @return The result of the comparison. - */ - function compare(slice memory self, slice memory other) internal pure returns (int) { - uint shortest = self._len; - if (other._len < self._len) - shortest = other._len; - - uint selfptr = self._ptr; - uint otherptr = other._ptr; - for (uint idx = 0; idx < shortest; idx += 32) { - uint a; - uint b; - assembly { - a := mload(selfptr) - b := mload(otherptr) - } - if (a != b) { - // Mask out irrelevant bytes and check again - uint mask = type(uint).max; // 0xffff... - if(shortest < 32) { - mask = ~(2 ** (8 * (32 - shortest + idx)) - 1); - } - unchecked { - uint diff = (a & mask) - (b & mask); - if (diff != 0) - return int(diff); - } - } - selfptr += 32; - otherptr += 32; - } - return int(self._len) - int(other._len); - } - - /* - * @dev Returns true if the two slices contain the same text. - * @param self The first slice to compare. - * @param self The second slice to compare. - * @return True if the slices are equal, false otherwise. - */ - function equals(slice memory self, slice memory other) internal pure returns (bool) { - return compare(self, other) == 0; - } - - /* - * @dev Extracts the first rune in the slice into `rune`, advancing the - * slice to point to the next rune and returning `self`. - * @param self The slice to operate on. - * @param rune The slice that will contain the first rune. - * @return `rune`. - */ - function nextRune(slice memory self, slice memory rune) internal pure returns (slice memory) { - rune._ptr = self._ptr; - - if (self._len == 0) { - rune._len = 0; - return rune; - } - - uint l; - uint b; - // Load the first byte of the rune into the LSBs of b - assembly { b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF) } - if (b < 0x80) { - l = 1; - } else if(b < 0xE0) { - l = 2; - } else if(b < 0xF0) { - l = 3; - } else { - l = 4; - } - - // Check for truncated codepoints - if (l > self._len) { - rune._len = self._len; - self._ptr += self._len; - self._len = 0; - return rune; - } - - self._ptr += l; - self._len -= l; - rune._len = l; - return rune; - } - - /* - * @dev Returns the first rune in the slice, advancing the slice to point - * to the next rune. - * @param self The slice to operate on. - * @return A slice containing only the first rune from `self`. - */ - function nextRune(slice memory self) internal pure returns (slice memory ret) { - nextRune(self, ret); - } - - /* - * @dev Returns the number of the first codepoint in the slice. - * @param self The slice to operate on. - * @return The number of the first codepoint in the slice. - */ - function ord(slice memory self) internal pure returns (uint ret) { - if (self._len == 0) { - return 0; - } - - uint word; - uint length; - uint divisor = 2 ** 248; - - // Load the rune into the MSBs of b - assembly { word:= mload(mload(add(self, 32))) } - uint b = word / divisor; - if (b < 0x80) { - ret = b; - length = 1; - } else if(b < 0xE0) { - ret = b & 0x1F; - length = 2; - } else if(b < 0xF0) { - ret = b & 0x0F; - length = 3; - } else { - ret = b & 0x07; - length = 4; - } - - // Check for truncated codepoints - if (length > self._len) { - return 0; - } - - for (uint i = 1; i < length; i++) { - divisor = divisor / 256; - b = (word / divisor) & 0xFF; - if (b & 0xC0 != 0x80) { - // Invalid UTF-8 sequence - return 0; - } - ret = (ret * 64) | (b & 0x3F); - } - - return ret; - } - - /* - * @dev Returns the keccak-256 hash of the slice. - * @param self The slice to hash. - * @return The hash of the slice. - */ - function keccak(slice memory self) internal pure returns (bytes32 ret) { - assembly { - ret := keccak256(mload(add(self, 32)), mload(self)) - } - } - - /* - * @dev Returns true if `self` starts with `needle`. - * @param self The slice to operate on. - * @param needle The slice to search for. - * @return True if the slice starts with the provided text, false otherwise. - */ - function startsWith(slice memory self, slice memory needle) internal pure returns (bool) { - if (self._len < needle._len) { - return false; - } - - if (self._ptr == needle._ptr) { - return true; - } - - bool equal; - assembly { - let length := mload(needle) - let selfptr := mload(add(self, 0x20)) - let needleptr := mload(add(needle, 0x20)) - equal := eq(keccak256(selfptr, length), keccak256(needleptr, length)) - } - return equal; - } - - /* - * @dev If `self` starts with `needle`, `needle` is removed from the - * beginning of `self`. Otherwise, `self` is unmodified. - * @param self The slice to operate on. - * @param needle The slice to search for. - * @return `self` - */ - function beyond(slice memory self, slice memory needle) internal pure returns (slice memory) { - if (self._len < needle._len) { - return self; - } - - bool equal = true; - if (self._ptr != needle._ptr) { - assembly { - let length := mload(needle) - let selfptr := mload(add(self, 0x20)) - let needleptr := mload(add(needle, 0x20)) - equal := eq(keccak256(selfptr, length), keccak256(needleptr, length)) - } - } - - if (equal) { - self._len -= needle._len; - self._ptr += needle._len; - } - - return self; - } - - /* - * @dev Returns true if the slice ends with `needle`. - * @param self The slice to operate on. - * @param needle The slice to search for. - * @return True if the slice starts with the provided text, false otherwise. - */ - function endsWith(slice memory self, slice memory needle) internal pure returns (bool) { - if (self._len < needle._len) { - return false; - } - - uint selfptr = self._ptr + self._len - needle._len; - - if (selfptr == needle._ptr) { - return true; - } - - bool equal; - assembly { - let length := mload(needle) - let needleptr := mload(add(needle, 0x20)) - equal := eq(keccak256(selfptr, length), keccak256(needleptr, length)) - } - - return equal; - } - - /* - * @dev If `self` ends with `needle`, `needle` is removed from the - * end of `self`. Otherwise, `self` is unmodified. - * @param self The slice to operate on. - * @param needle The slice to search for. - * @return `self` - */ - function until(slice memory self, slice memory needle) internal pure returns (slice memory) { - if (self._len < needle._len) { - return self; - } - - uint selfptr = self._ptr + self._len - needle._len; - bool equal = true; - if (selfptr != needle._ptr) { - assembly { - let length := mload(needle) - let needleptr := mload(add(needle, 0x20)) - equal := eq(keccak256(selfptr, length), keccak256(needleptr, length)) - } - } - - if (equal) { - self._len -= needle._len; - } - - return self; - } - - // Returns the memory address of the first byte of the first occurrence of - // `needle` in `self`, or the first byte after `self` if not found. - function findPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) { - uint ptr = selfptr; - uint idx; - - if (needlelen <= selflen) { - if (needlelen <= 32) { - bytes32 mask; - if (needlelen > 0) { - mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1)); - } - - bytes32 needledata; - assembly { needledata := and(mload(needleptr), mask) } - - uint end = selfptr + selflen - needlelen; - bytes32 ptrdata; - assembly { ptrdata := and(mload(ptr), mask) } - - while (ptrdata != needledata) { - if (ptr >= end) - return selfptr + selflen; - ptr++; - assembly { ptrdata := and(mload(ptr), mask) } - } - return ptr; - } else { - // For long needles, use hashing - bytes32 hash; - assembly { hash := keccak256(needleptr, needlelen) } - - for (idx = 0; idx <= selflen - needlelen; idx++) { - bytes32 testHash; - assembly { testHash := keccak256(ptr, needlelen) } - if (hash == testHash) - return ptr; - ptr += 1; - } - } - } - return selfptr + selflen; - } - - // Returns the memory address of the first byte after the last occurrence of - // `needle` in `self`, or the address of `self` if not found. - function rfindPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) { - uint ptr; - - if (needlelen <= selflen) { - if (needlelen <= 32) { - bytes32 mask; - if (needlelen > 0) { - mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1)); - } - - bytes32 needledata; - assembly { needledata := and(mload(needleptr), mask) } - - ptr = selfptr + selflen - needlelen; - bytes32 ptrdata; - assembly { ptrdata := and(mload(ptr), mask) } - - while (ptrdata != needledata) { - if (ptr <= selfptr) - return selfptr; - ptr--; - assembly { ptrdata := and(mload(ptr), mask) } - } - return ptr + needlelen; - } else { - // For long needles, use hashing - bytes32 hash; - assembly { hash := keccak256(needleptr, needlelen) } - ptr = selfptr + (selflen - needlelen); - while (ptr >= selfptr) { - bytes32 testHash; - assembly { testHash := keccak256(ptr, needlelen) } - if (hash == testHash) - return ptr + needlelen; - ptr -= 1; - } - } - } - return selfptr; - } - - /* - * @dev Modifies `self` to contain everything from the first occurrence of - * `needle` to the end of the slice. `self` is set to the empty slice - * if `needle` is not found. - * @param self The slice to search and modify. - * @param needle The text to search for. - * @return `self`. - */ - function find(slice memory self, slice memory needle) internal pure returns (slice memory) { - uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr); - self._len -= ptr - self._ptr; - self._ptr = ptr; - return self; - } - - /* - * @dev Modifies `self` to contain the part of the string from the start of - * `self` to the end of the first occurrence of `needle`. If `needle` - * is not found, `self` is set to the empty slice. - * @param self The slice to search and modify. - * @param needle The text to search for. - * @return `self`. - */ - function rfind(slice memory self, slice memory needle) internal pure returns (slice memory) { - uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr); - self._len = ptr - self._ptr; - return self; - } - - /* - * @dev Splits the slice, setting `self` to everything after the first - * occurrence of `needle`, and `token` to everything before it. If - * `needle` does not occur in `self`, `self` is set to the empty slice, - * and `token` is set to the entirety of `self`. - * @param self The slice to split. - * @param needle The text to search for in `self`. - * @param token An output parameter to which the first token is written. - * @return `token`. - */ - function split(slice memory self, slice memory needle, slice memory token) internal pure returns (slice memory) { - uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr); - token._ptr = self._ptr; - token._len = ptr - self._ptr; - if (ptr == self._ptr + self._len) { - // Not found - self._len = 0; - } else { - self._len -= token._len + needle._len; - self._ptr = ptr + needle._len; - } - return token; - } - - /* - * @dev Splits the slice, setting `self` to everything after the first - * occurrence of `needle`, and returning everything before it. If - * `needle` does not occur in `self`, `self` is set to the empty slice, - * and the entirety of `self` is returned. - * @param self The slice to split. - * @param needle The text to search for in `self`. - * @return The part of `self` up to the first occurrence of `delim`. - */ - function split(slice memory self, slice memory needle) internal pure returns (slice memory token) { - split(self, needle, token); - } - - /* - * @dev Splits the slice, setting `self` to everything before the last - * occurrence of `needle`, and `token` to everything after it. If - * `needle` does not occur in `self`, `self` is set to the empty slice, - * and `token` is set to the entirety of `self`. - * @param self The slice to split. - * @param needle The text to search for in `self`. - * @param token An output parameter to which the first token is written. - * @return `token`. - */ - function rsplit(slice memory self, slice memory needle, slice memory token) internal pure returns (slice memory) { - uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr); - token._ptr = ptr; - token._len = self._len - (ptr - self._ptr); - if (ptr == self._ptr) { - // Not found - self._len = 0; - } else { - self._len -= token._len + needle._len; - } - return token; - } - - /* - * @dev Splits the slice, setting `self` to everything before the last - * occurrence of `needle`, and returning everything after it. If - * `needle` does not occur in `self`, `self` is set to the empty slice, - * and the entirety of `self` is returned. - * @param self The slice to split. - * @param needle The text to search for in `self`. - * @return The part of `self` after the last occurrence of `delim`. - */ - function rsplit(slice memory self, slice memory needle) internal pure returns (slice memory token) { - rsplit(self, needle, token); - } - - /* - * @dev Counts the number of nonoverlapping occurrences of `needle` in `self`. - * @param self The slice to search. - * @param needle The text to search for in `self`. - * @return The number of occurrences of `needle` found in `self`. - */ - function count(slice memory self, slice memory needle) internal pure returns (uint cnt) { - uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr) + needle._len; - while (ptr <= self._ptr + self._len) { - cnt++; - ptr = findPtr(self._len - (ptr - self._ptr), ptr, needle._len, needle._ptr) + needle._len; - } - } - - /* - * @dev Returns True if `self` contains `needle`. - * @param self The slice to search. - * @param needle The text to search for in `self`. - * @return True if `needle` is found in `self`, false otherwise. - */ - function contains(slice memory self, slice memory needle) internal pure returns (bool) { - return rfindPtr(self._len, self._ptr, needle._len, needle._ptr) != self._ptr; - } - - /* - * @dev Returns a newly allocated string containing the concatenation of - * `self` and `other`. - * @param self The first slice to concatenate. - * @param other The second slice to concatenate. - * @return The concatenation of the two strings. - */ - function concat(slice memory self, slice memory other) internal pure returns (string memory) { - string memory ret = new string(self._len + other._len); - uint retptr; - assembly { retptr := add(ret, 32) } - memcpy(retptr, self._ptr, self._len); - memcpy(retptr + self._len, other._ptr, other._len); - return ret; - } - - /* - * @dev Joins an array of slices, using `self` as a delimiter, returning a - * newly allocated string. - * @param self The delimiter to use. - * @param parts A list of slices to join. - * @return A newly allocated string containing all the slices in `parts`, - * joined with `self`. - */ - function join(slice memory self, slice[] memory parts) internal pure returns (string memory) { - if (parts.length == 0) - return ""; - - uint length = self._len * (parts.length - 1); - for(uint i = 0; i < parts.length; i++) - length += parts[i]._len; - - string memory ret = new string(length); - uint retptr; - assembly { retptr := add(ret, 32) } - - for(uint i = 0; i < parts.length; i++) { - memcpy(retptr, parts[i]._ptr, parts[i]._len); - retptr += parts[i]._len; - if (i < parts.length - 1) { - memcpy(retptr, self._ptr, self._len); - retptr += self._len; - } - } - - return ret; - } -} diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/src/strings.t.sol b/contract/lib/foundry-huff/lib/solidity-stringutils/src/strings.t.sol deleted file mode 100644 index bc3581c..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/src/strings.t.sol +++ /dev/null @@ -1,216 +0,0 @@ -pragma solidity ^0.8.0; - -import 'ds-test/test.sol'; -import './strings.sol'; - -contract StringsTest is DSTest { - using strings for *; - - - function abs(int x) private pure returns (int) { - if(x < 0) - return -x; - return x; - } - - function sign(int x) private pure returns (int) { - return x == 0 ? int(0) : (x < 0 ? -1 : int(1)); - } - - function assertEq0(string memory a, string memory b) internal { - assertEq0(bytes(a), bytes(b)); - } - - function assertEq0(strings.slice memory a, strings.slice memory b) internal { - assertEq0(a.toString(), b.toString()); - } - - function assertEq0(strings.slice memory a, string memory b) internal { - assertEq0(a.toString(), b); - } - - function testSliceToString() public { - string memory test = "Hello, world!"; - assertEq0(test, test.toSlice().toString()); - } - - function testBytes32Len() public { - bytes32 test; - for(uint i = 0; i <= 32; i++) { - assertEq(i, test.len()); - test = bytes32((uint(test) / 0x100) | 0x2000000000000000000000000000000000000000000000000000000000000000); - } - } - - - function testToSliceB32() public { - assertEq0(bytes32("foobar").toSliceB32(), "foobar".toSlice()); - } - - function testCopy() public { - string memory test = "Hello, world!"; - strings.slice memory s1 = test.toSlice(); - strings.slice memory s2 = s1.copy(); - s1._len = 0; - assertEq(s2._len, bytes(test).length); - } - - function testLen() public { - assertEq("".toSlice().len(), 0); - assertEq("Hello, world!".toSlice().len(), 13); - assertEq(unicode"naïve".toSlice().len(), 5); - assertEq(unicode"こんにちは".toSlice().len(), 5); - } - - function testEmpty() public { - assertTrue("".toSlice().empty()); - assertTrue(!"x".toSlice().empty()); - } - - function testEquals() public { - assertTrue("".toSlice().equals("".toSlice())); - assertTrue("foo".toSlice().equals("foo".toSlice())); - assertTrue(!"foo".toSlice().equals("bar".toSlice())); - } - - function testNextRune() public { - strings.slice memory s = unicode"a¡ࠀ𐀡".toSlice(); - assertEq0(s.nextRune(), "a"); - assertEq0(s, unicode"¡ࠀ𐀡"); - assertEq0(s.nextRune(), unicode"¡"); - assertEq0(s, unicode"ࠀ𐀡"); - assertEq0(s.nextRune(), unicode"ࠀ"); - assertEq0(s, unicode"𐀡"); - assertEq0(s.nextRune(), unicode"𐀡"); - assertEq0(s, ""); - assertEq0(s.nextRune(), ""); - } - - function testOrd() public { - assertEq("a".toSlice().ord(), 0x61); - assertEq(unicode"¡".toSlice().ord(), 0xA1); - assertEq(unicode"ࠀ".toSlice().ord(), 0x800); - assertEq(unicode"𐀡".toSlice().ord(), 0x10021); - } - - function testCompare() public { - - assertEq(sign("foobie".toSlice().compare("foobie".toSlice())), 0); - assertEq(sign("foobie".toSlice().compare("foobif".toSlice())), -1); - assertEq(sign("foobie".toSlice().compare("foobid".toSlice())), 1); - assertEq(sign("foobie".toSlice().compare("foobies".toSlice())), -1); - assertEq(sign("foobie".toSlice().compare("foobi".toSlice())), 1); - assertEq(sign("foobie".toSlice().compare("doobie".toSlice())), 1); - assertEq(sign("01234567890123456789012345678901".toSlice().compare("012345678901234567890123456789012".toSlice())), -1); - assertEq(sign("0123456789012345678901234567890123".toSlice().compare("1123456789012345678901234567890123".toSlice())), -1); - assertEq(sign("foo.bar".toSlice().split(".".toSlice()).compare("foo".toSlice())), 0); - } - - function testStartsWith() public { - strings.slice memory s = "foobar".toSlice(); - assertTrue(s.startsWith("foo".toSlice())); - assertTrue(!s.startsWith("oob".toSlice())); - assertTrue(s.startsWith("".toSlice())); - assertTrue(s.startsWith(s.copy().rfind("foo".toSlice()))); - } - - function testBeyond() public { - strings.slice memory s = "foobar".toSlice(); - assertEq0(s.beyond("foo".toSlice()), "bar"); - assertEq0(s, "bar"); - assertEq0(s.beyond("foo".toSlice()), "bar"); - assertEq0(s.beyond("bar".toSlice()), ""); - assertEq0(s, ""); - } - - function testEndsWith() public { - strings.slice memory s = "foobar".toSlice(); - assertTrue(s.endsWith("bar".toSlice())); - assertTrue(!s.endsWith("oba".toSlice())); - assertTrue(s.endsWith("".toSlice())); - assertTrue(s.endsWith(s.copy().find("bar".toSlice()))); - } - - function testUntil() public { - strings.slice memory s = "foobar".toSlice(); - assertEq0(s.until("bar".toSlice()), "foo"); - assertEq0(s, "foo"); - assertEq0(s.until("bar".toSlice()), "foo"); - assertEq0(s.until("foo".toSlice()), ""); - assertEq0(s, ""); - } - - function testFind() public { - assertEq0("abracadabra".toSlice().find("abracadabra".toSlice()), "abracadabra"); - assertEq0("abracadabra".toSlice().find("bra".toSlice()), "bracadabra"); - assertTrue("abracadabra".toSlice().find("rab".toSlice()).empty()); - assertTrue("12345".toSlice().find("123456".toSlice()).empty()); - assertEq0("12345".toSlice().find("".toSlice()), "12345"); - assertEq0("12345".toSlice().find("5".toSlice()), "5"); - } - - function testRfind() public { - assertEq0("abracadabra".toSlice().rfind("bra".toSlice()), "abracadabra"); - assertEq0("abracadabra".toSlice().rfind("cad".toSlice()), "abracad"); - assertTrue("12345".toSlice().rfind("123456".toSlice()).empty()); - assertEq0("12345".toSlice().rfind("".toSlice()), "12345"); - assertEq0("12345".toSlice().rfind("1".toSlice()), "1"); - } - - function testSplit() public { - strings.slice memory s = "foo->bar->baz".toSlice(); - strings.slice memory delim = "->".toSlice(); - assertEq0(s.split(delim), "foo"); - assertEq0(s, "bar->baz"); - assertEq0(s.split(delim), "bar"); - assertEq0(s.split(delim), "baz"); - assertTrue(s.empty()); - assertEq0(s.split(delim), ""); - assertEq0(".".toSlice().split(".".toSlice()), ""); - } - - function testRsplit() public { - strings.slice memory s = "foo->bar->baz".toSlice(); - strings.slice memory delim = "->".toSlice(); - assertEq0(s.rsplit(delim), "baz"); - assertEq0(s.rsplit(delim), "bar"); - assertEq0(s.rsplit(delim), "foo"); - assertTrue(s.empty()); - assertEq0(s.rsplit(delim), ""); - } - - function testCount() public { - assertEq("1121123211234321".toSlice().count("1".toSlice()), 7); - assertEq("ababababa".toSlice().count("aba".toSlice()), 2); - } - - function testContains() public { - assertTrue("foobar".toSlice().contains("f".toSlice())); - assertTrue("foobar".toSlice().contains("o".toSlice())); - assertTrue("foobar".toSlice().contains("r".toSlice())); - assertTrue("foobar".toSlice().contains("".toSlice())); - assertTrue("foobar".toSlice().contains("foobar".toSlice())); - assertTrue(!"foobar".toSlice().contains("s".toSlice())); - } - - function testConcat() public { - assertEq0("foo".toSlice().concat("bar".toSlice()), "foobar"); - assertEq0("".toSlice().concat("bar".toSlice()), "bar"); - assertEq0("foo".toSlice().concat("".toSlice()), "foo"); - } - - function testJoin() public { - strings.slice[] memory parts = new strings.slice[](4); - parts[0] = "zero".toSlice(); - parts[1] = "one".toSlice(); - parts[2] = "".toSlice(); - parts[3] = "two".toSlice(); - - assertEq0(" ".toSlice().join(parts), "zero one two"); - assertEq0("".toSlice().join(parts), "zeroonetwo"); - - parts = new strings.slice[](1); - parts[0] = "zero".toSlice(); - assertEq0(" ".toSlice().join(parts), "zero"); - } -} diff --git a/contract/lib/foundry-huff/lib/solidity-stringutils/strings.sol b/contract/lib/foundry-huff/lib/solidity-stringutils/strings.sol deleted file mode 120000 index 6894cfb..0000000 --- a/contract/lib/foundry-huff/lib/solidity-stringutils/strings.sol +++ /dev/null @@ -1 +0,0 @@ -./src/strings.sol \ No newline at end of file diff --git a/contract/lib/foundry-huff/remappings.txt b/contract/lib/foundry-huff/remappings.txt deleted file mode 100644 index 1722d90..0000000 --- a/contract/lib/foundry-huff/remappings.txt +++ /dev/null @@ -1,2 +0,0 @@ -forge-std/=lib/forge-std/src/ -stringutils/=lib/solidity-stringutils/ \ No newline at end of file diff --git a/contract/lib/foundry-huff/scripts/binary_check.sh b/contract/lib/foundry-huff/scripts/binary_check.sh deleted file mode 100755 index 725a058..0000000 --- a/contract/lib/foundry-huff/scripts/binary_check.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/bash - -if ! [[ "$(npm list -g huffc)" =~ "empty" ]]; then - # huffc was installed via npm, return 0x00 - echo -n 0x00 -elif [[ "$(yarn global list)" =~ "huffc" ]]; then - # huffc was installed via yarn, return 0x00 - echo -n 0x00 -else - echo -n 0x01 -fi diff --git a/contract/lib/foundry-huff/scripts/file_writer.sh b/contract/lib/foundry-huff/scripts/file_writer.sh deleted file mode 100755 index 93e3a8d..0000000 --- a/contract/lib/foundry-huff/scripts/file_writer.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -echo "$2" > $1 diff --git a/contract/lib/foundry-huff/scripts/rand_bytes.sh b/contract/lib/foundry-huff/scripts/rand_bytes.sh deleted file mode 100755 index fdd9921..0000000 --- a/contract/lib/foundry-huff/scripts/rand_bytes.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -echo -n $(hexdump -n 16 -v -e '"0x" 32/1 "%02x" "\n"' /dev/urandom) \ No newline at end of file diff --git a/contract/lib/foundry-huff/scripts/read_and_append.sh b/contract/lib/foundry-huff/scripts/read_and_append.sh deleted file mode 100755 index a143365..0000000 --- a/contract/lib/foundry-huff/scripts/read_and_append.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -cat $2 >> $1 diff --git a/contract/lib/foundry-huff/src/HuffConfig.sol b/contract/lib/foundry-huff/src/HuffConfig.sol deleted file mode 100644 index 4bfe27b..0000000 --- a/contract/lib/foundry-huff/src/HuffConfig.sol +++ /dev/null @@ -1,222 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.8.13 <0.9.0; - -import {Vm} from "forge-std/Vm.sol"; -import {strings} from "stringutils/strings.sol"; - -contract HuffConfig { - using strings for *; - - /// @notice Initializes cheat codes in order to use ffi to compile Huff contracts - Vm public constant vm = Vm(address(bytes20(uint160(uint256(keccak256("hevm cheat code")))))); - - /// @notice Struct that represents a constant to be passed to the `-c` flag - struct Constant { - string key; - string value; - } - - /// @notice additional code to append to the source file - string public code; - - /// @notice arguments to append to the bytecode - bytes public args; - - /// @notice value to deploy the contract with - uint256 public value; - - /// @notice whether to broadcast the deployment tx - bool public should_broadcast; - - /// @notice constant overrides for the current compilation environment - Constant[] public const_overrides; - - /// @notice sets the code to be appended to the source file - function with_code(string memory code_) public returns (HuffConfig) { - code = code_; - return this; - } - - /// @notice sets the arguments to be appended to the bytecode - function with_args(bytes memory args_) public returns (HuffConfig) { - args = args_; - return this; - } - - /// @notice sets the amount of wei to deploy the contract with - function with_value(uint256 value_) public returns (HuffConfig) { - value = value_; - return this; - } - - /// @notice sets a constant to a bytes memory value in the current compilation environment - /// @dev The `value` string must contain a valid hex number that is <= 32 bytes - /// i.e. "0x01", "0xa57b", "0x0de0b6b3a7640000", etc. - function with_constant( - string memory key, - string memory value_ - ) public returns (HuffConfig) { - const_overrides.push(Constant(key, value_)); - return this; - } - - /// @notice sets a constant to an address value in the current compilation environment - function with_addr_constant( - string memory key, - address value_ - ) public returns (HuffConfig) { - const_overrides.push(Constant(key, bytesToString(abi.encodePacked(value_)))); - return this; - } - - /// @notice sets a constant to a bytes32 value in the current compilation environment - function with_bytes32_constant( - string memory key, - bytes32 value_ - ) public returns (HuffConfig) { - const_overrides.push(Constant(key, bytesToString(abi.encodePacked(value_)))); - return this; - } - - /// @notice sets a constant to a uint256 value in the current compilation environment - function with_uint_constant( - string memory key, - uint256 value_ - ) public returns (HuffConfig) { - const_overrides.push(Constant(key, bytesToString(abi.encodePacked(value_)))); - return this; - } - - /// @notice sets whether to broadcast the deployment - function set_broadcast(bool broadcast) public returns (HuffConfig) { - should_broadcast = broadcast; - return this; - } - - /// @notice Checks for huffc binary conflicts - function binary_check() public { - string[] memory bincheck = new string[](1); - bincheck[0] = "./lib/foundry-huff/scripts/binary_check.sh"; - bytes memory retData = vm.ffi(bincheck); - bytes8 first_bytes = retData[0]; - bool decoded = first_bytes == bytes8(hex"01"); - require( - decoded, - "Invalid huffc binary. Run `curl -L get.huff.sh | bash` and `huffup` to fix." - ); - } - - function bytes32ToString(bytes32 x) internal pure returns (string memory) { - string memory result; - for (uint256 j = 0; j < x.length; j++) { - result = string.concat( - result, string(abi.encodePacked(uint8(x[j]) % 26 + 97)) - ); - } - return result; - } - - function bytesToString(bytes memory data) public pure returns(string memory) { - bytes memory alphabet = "0123456789abcdef"; - - bytes memory str = new bytes(2 + data.length * 2); - str[0] = "0"; - str[1] = "x"; - for (uint i = 0; i < data.length; i++) { - str[2+i*2] = alphabet[uint(uint8(data[i] >> 4))]; - str[3+i*2] = alphabet[uint(uint8(data[i] & 0x0f))]; - } - return string(str); - } - - /// @notice Deploy the Contract - function deploy(string memory file) public payable returns (address) { - binary_check(); - - // Split the file into it's parts - strings.slice memory s = file.toSlice(); - strings.slice memory delim = "/".toSlice(); - string[] memory parts = new string[](s.count(delim) + 1); - for (uint256 i = 0; i < parts.length; i++) { - parts[i] = s.split(delim).toString(); - } - - // Get the system time with our script - string[] memory time = new string[](1); - time[0] = "./lib/foundry-huff/scripts/rand_bytes.sh"; - bytes memory retData = vm.ffi(time); - string memory rand_bytes = - bytes32ToString(keccak256(abi.encode(bytes32(retData)))); - - // Re-concatenate the file with a "__TEMP__" prefix - string memory tempFile = parts[0]; - if (parts.length <= 1) { - tempFile = string.concat("__TEMP__", rand_bytes, tempFile); - } else { - for (uint256 i = 1; i < parts.length - 1; i++) { - tempFile = string.concat(tempFile, "/", parts[i]); - } - tempFile = string.concat( - tempFile, "/", "__TEMP__", rand_bytes, parts[parts.length - 1] - ); - } - - // Paste the code in a new temp file - string[] memory create_cmds = new string[](3); - // TODO: create_cmds[0] = "$(find . -name \"file_writer.sh\")"; - create_cmds[0] = "./lib/foundry-huff/scripts/file_writer.sh"; - create_cmds[1] = string.concat("src/", tempFile, ".huff"); - create_cmds[2] = string.concat(code, "\n"); - vm.ffi(create_cmds); - - // Append the real code to the temp file - string[] memory append_cmds = new string[](3); - append_cmds[0] = "./lib/foundry-huff/scripts/read_and_append.sh"; - append_cmds[1] = string.concat("src/", tempFile, ".huff"); - append_cmds[2] = string.concat("src/", file, ".huff"); - vm.ffi(append_cmds); - - /// Create a list of strings with the commands necessary to compile Huff contracts - string[] memory cmds = new string[](3); - if (const_overrides.length > 0) { - cmds = new string[](4 + const_overrides.length); - cmds[3] = "-c"; - - Constant memory cur_const; - for (uint256 i; i < const_overrides.length; i++) { - cur_const = const_overrides[i]; - cmds[4 + i] = string.concat(cur_const.key, "=", cur_const.value); - } - } - - cmds[0] = "huffc"; - cmds[1] = string(string.concat("src/", tempFile, ".huff")); - cmds[2] = "-b"; - - /// @notice compile the Huff contract and return the bytecode - bytes memory bytecode = vm.ffi(cmds); - bytes memory concatenated = bytes.concat(bytecode, args); - - // Clean up temp files - string[] memory cleanup = new string[](2); - cleanup[0] = "rm"; - cleanup[1] = string.concat("src/", tempFile, ".huff"); - vm.ffi(cleanup); - - /// @notice deploy the bytecode with the create instruction - address deployedAddress; - if (should_broadcast) vm.broadcast(); - assembly { - let val := sload(value.slot) - deployedAddress := create(val, add(concatenated, 0x20), mload(concatenated)) - } - - /// @notice check that the deployment was successful - require( - deployedAddress != address(0), "HuffDeployer could not deploy contract" - ); - - /// @notice return the address that the contract was deployed to - return deployedAddress; - } -} diff --git a/contract/lib/foundry-huff/src/HuffDeployer.sol b/contract/lib/foundry-huff/src/HuffDeployer.sol deleted file mode 100755 index a4eacb3..0000000 --- a/contract/lib/foundry-huff/src/HuffDeployer.sol +++ /dev/null @@ -1,119 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.8.13 <0.9.0; - -import {Vm} from "forge-std/Vm.sol"; -import {HuffConfig} from "./HuffConfig.sol"; - -library HuffDeployer { - - /// @notice Create a new huff config - function config() public returns (HuffConfig) { - return new HuffConfig(); - } - - /// @notice Compiles a Huff contract and returns the address that the contract was deployeod to - /// @param fileName - The file name of the Huff contract. For example, the file name for "SimpleStore.huff" is "SimpleStore" - /// @return The address that the contract was deployed to - function deploy(string memory fileName) internal returns (address) { - return config().deploy(fileName); - } - - /// @notice Compiles a Huff contract and returns the address that the contract was deployeod to - /// @param fileName - The file name of the Huff contract. For example, the file name for "SimpleStore.huff" is "SimpleStore" - /// @return The address that the contract was deployed to - function broadcast(string memory fileName) internal returns (address) { - return config().set_broadcast(true).deploy(fileName); - } - - /// @notice Compiles a Huff contract and returns the address that the contract was deployeod to - /// @param fileName - The file name of the Huff contract. For example, the file name for "SimpleStore.huff" is "SimpleStore" - /// @param value - Value to deploy with - /// @return The address that the contract was deployed to - function deploy_with_value( - string memory fileName, - uint256 value - ) internal returns (address) { - return config().with_value(value).deploy(fileName); - } - - /// @notice Compiles a Huff contract and returns the address that the contract was deployeod to - /// @param fileName - The file name of the Huff contract. For example, the file name for "SimpleStore.huff" is "SimpleStore" - /// @param value - Value to deploy with - /// @return The address that the contract was deployed to - function broadcast_with_value( - string memory fileName, - uint256 value - ) internal returns (address) { - return config().set_broadcast(true).with_value(value).deploy(fileName); - } - - /// @notice Compiles a Huff contract and returns the address that the contract was deployeod to - /// @param fileName - The file name of the Huff contract. For example, the file name for "SimpleStore.huff" is "SimpleStore" - /// @param args - Constructor Args to append to the bytecode - /// @return The address that the contract was deployed to - function deploy_with_args( - string memory fileName, - bytes memory args - ) internal returns (address) { - return config().with_args(args).deploy(fileName); - } - - /// @notice Compiles a Huff contract and returns the address that the contract was deployeod to - /// @param fileName - The file name of the Huff contract. For example, the file name for "SimpleStore.huff" is "SimpleStore" - /// @param args - Constructor Args to append to the bytecode - /// @return The address that the contract was deployed to - function broadcast_with_args( - string memory fileName, - bytes memory args - ) internal returns (address) { - return config().set_broadcast(true).with_args(args).deploy(fileName); - } - - /// @notice Compiles a Huff contract and returns the address that the contract was deployeod to - /// @param fileName - The file name of the Huff contract. For example, the file name for "SimpleStore.huff" is "SimpleStore" - /// @param code - Code to append to the file source code (e.g. a constructor macro to make the contract instantiable) - /// @return The address that the contract was deployed to - function deploy_with_code( - string memory fileName, - string memory code - ) internal returns (address) { - return config().with_code(code).deploy(fileName); - } - - /// @notice Compiles a Huff contract and returns the address that the contract was deployeod to - /// @param fileName - The file name of the Huff contract. For example, the file name for "SimpleStore.huff" is "SimpleStore" - /// @param code - Code to append to the file source code (e.g. a constructor macro to make the contract instantiable) - /// @return The address that the contract was deployed to - function broadcast_with_code( - string memory fileName, - string memory code - ) internal returns (address) { - return config().set_broadcast(true).with_code(code).deploy(fileName); - } - - /// @notice Compiles a Huff contract and returns the address that the contract was deployeod to - /// @param fileName - The file name of the Huff contract. For example, the file name for "SimpleStore.huff" is "SimpleStore" - /// @param code - Code to append to the file source code (e.g. a constructor macro to make the contract instantiable) - /// @param args - Constructor Args to append to the bytecode - /// @return The address that the contract was deployed to - function deploy_with_code_args( - string memory fileName, - string memory code, - bytes memory args - ) internal returns (address) { - return config().with_code(code).with_args(args).deploy(fileName); - } - - /// @notice Compiles a Huff contract and returns the address that the contract was deployeod to - /// @param fileName - The file name of the Huff contract. For example, the file name for "SimpleStore.huff" is "SimpleStore" - /// @param code - Code to append to the file source code (e.g. a constructor macro to make the contract instantiable) - /// @param args - Constructor Args to append to the bytecode - /// @return The address that the contract was deployed to - function broadcast_with_code_args( - string memory fileName, - string memory code, - bytes memory args - ) internal returns (address) { - return config().set_broadcast(true).with_code(code).with_args(args).deploy(fileName); - } -} diff --git a/contract/lib/foundry-huff/src/depreciated/StatefulDeployer.sol b/contract/lib/foundry-huff/src/depreciated/StatefulDeployer.sol deleted file mode 100755 index bb3d4fc..0000000 --- a/contract/lib/foundry-huff/src/depreciated/StatefulDeployer.sol +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.8.13 <0.9.0; - -import {Vm} from "forge-std/Vm.sol"; -import {strings} from "stringutils/strings.sol"; -import {HuffDeployer} from "../HuffDeployer.sol"; - -contract StatefulDeployer { - using strings for *; - - /// @notice Initializes cheat codes in order to use ffi to compile Huff contracts - Vm public constant vm = - Vm(address(bytes20(uint160(uint256(keccak256("hevm cheat code")))))); - - /// @notice additional code to append to the source file - string public code; - - /// @notice arguments to append to the bytecode - bytes public args; - - /// @notice sets the code to be appended to the source file - function setCode(string memory acode) public { - code = acode; - } - - /// @notice sets the arguments to be appended to the bytecode - function setArgs(bytes memory aargs) public { - args = aargs; - } - - /// @notice Deployment wrapper - function deploy(string memory file) public returns (address) { - // Split the file into it's parts - strings.slice memory s = file.toSlice(); - strings.slice memory delim = "/".toSlice(); - string[] memory parts = new string[](s.count(delim) + 1); - for (uint256 i = 0; i < parts.length; i++) { - parts[i] = s.split(delim).toString(); - } - - // Re-concatenate the file with a "__TEMP__" prefix - string memory tempFile = parts[0]; - for (uint256 i = 1; i < parts.length - 1; i++) { - tempFile = string.concat(tempFile, "/", parts[i]); - } - tempFile = - string.concat(tempFile, "/", "__TEMP__", parts[parts.length - 1]); - - // Paste the code in a new temp file - string[] memory create_cmds = new string[](3); - create_cmds[0] = "./scripts/file_writer.sh"; - create_cmds[1] = string.concat("src/", tempFile, ".huff"); - create_cmds[2] = string.concat(code, "\n"); - vm.ffi(create_cmds); - - // Append the real code to the temp file - string[] memory append_cmds = new string[](3); - append_cmds[0] = "./scripts/read_and_append.sh"; - append_cmds[1] = string.concat("src/", tempFile, ".huff"); - append_cmds[2] = string.concat("src/", file, ".huff"); - vm.ffi(append_cmds); - - // Deploy with args the temp file - address deployed = HuffDeployer.deploy_with_args(tempFile, args); - - // Clean up temp files - string[] memory cleanup = new string[](2); - cleanup[0] = "rm"; - cleanup[1] = string.concat("src/", tempFile, ".huff"); - vm.ffi(cleanup); - - // Return the deployed address - return deployed; - } -} diff --git a/contract/lib/foundry-huff/src/depreciated/StatefulDeployer.t.sol b/contract/lib/foundry-huff/src/depreciated/StatefulDeployer.t.sol deleted file mode 100644 index f0609ea..0000000 --- a/contract/lib/foundry-huff/src/depreciated/StatefulDeployer.t.sol +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.7.0 <0.9.0; - -import "forge-std/Test.sol"; - -import {INumber} from "../test/interfaces/INumber.sol"; -import {IConstructor} from "../test/interfaces/IConstructor.sol"; -import {StatefulDeployer} from "./StatefulDeployer.sol"; - -contract StatefulDeployerTest is Test { - StatefulDeployer public deployer; - IConstructor public construct; - - function setUp() public { - deployer = new StatefulDeployer(); - } - - function testSetArgs(bytes memory some) public { - deployer.setArgs(some); - assertEq(deployer.args(), some); - } - - function testSetCode(string memory code) public { - deployer.setCode(code); - assertEq(deployer.code(), code); - } - - function testDeployWithArgsAndCode() public { - deployer.setArgs( - bytes.concat(abi.encode(uint256(0x420)), abi.encode(uint256(0x420))) - ); - deployer.setCode( - "" "#define macro CONSTRUCTOR() = takes(0) returns (0) { \n" - " // Copy the first argument into memory \n" - " 0x20 // [size] - byte size to copy \n" - " 0x40 codesize sub // [offset, size] - offset in the code to copy from \n" - " 0x00 // [mem, offset, size] - offset in memory to copy to \n" - " codecopy // [] \n" - " // Store the first argument in storage \n" - " 0x00 mload // [arg] \n" - " [CONSTRUCTOR_ARG_ONE] // [CONSTRUCTOR_ARG_ONE, arg] \n" - " sstore // [] \n" - " // Copy the second argument into memory \n" - " 0x20 // [size] - byte size to copy \n" - " 0x20 codesize sub // [offset, size] - offset in the code to copy from \n" - " 0x00 // [mem, offset, size] - offset in memory to copy to \n" - " codecopy // [] \n" - " // Store the second argument in storage \n" - " 0x00 mload // [arg] \n" - " [CONSTRUCTOR_ARG_TWO] // [CONSTRUCTOR_ARG_TWO, arg] \n" - " sstore // [] \n" "}" - ); - - construct = - IConstructor(deployer.deploy("test/contracts/NoConstructor")); - assertEq(address(0x420), construct.getArgOne()); - assertEq(uint256(0x420), construct.getArgTwo()); - } -} diff --git a/contract/lib/foundry-huff/src/test/HuffConfig.t.sol b/contract/lib/foundry-huff/src/test/HuffConfig.t.sol deleted file mode 100644 index fbcaa2f..0000000 --- a/contract/lib/foundry-huff/src/test/HuffConfig.t.sol +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.7.0 <0.9.0; - -import "forge-std/Test.sol"; - -import {INumber} from "./interfaces/INumber.sol"; -import {IConstructor} from "./interfaces/IConstructor.sol"; -import {HuffConfig} from "../HuffConfig.sol"; - -contract HuffConfigTest is Test { - HuffConfig public config; - INumber public number; - - function setUp() public { - config = new HuffConfig(); - } - - function testWithArgs(bytes memory some) public { - config.with_args(some); - assertEq(config.args(), some); - } - - function testWithValue(uint256 value) public { - config.with_value(value); - assertEq(config.value(), value); - } - - function testWithCode(string memory code) public { - config.with_code(code); - assertEq(config.code(), code); - } - - function testWithConstantOverrides( - string memory key, - string memory value - ) public { - config.with_constant(key, value); - (string memory k, string memory v) = config.const_overrides(0); - assertEq(key, k); - assertEq(value, v); - } - - function testSetBroadcast(bool broadcast) public { - config.set_broadcast(broadcast); - bool b = config.should_broadcast(); - assertEq(b, broadcast); - } -} diff --git a/contract/lib/foundry-huff/src/test/HuffDeployer.t.sol b/contract/lib/foundry-huff/src/test/HuffDeployer.t.sol deleted file mode 100644 index 972e386..0000000 --- a/contract/lib/foundry-huff/src/test/HuffDeployer.t.sol +++ /dev/null @@ -1,145 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.7.0 <0.9.0; - -import "forge-std/Test.sol"; - -import {HuffConfig} from "../HuffConfig.sol"; -import {HuffDeployer} from "../HuffDeployer.sol"; -import {INumber} from "./interfaces/INumber.sol"; -import {IConstructor} from "./interfaces/IConstructor.sol"; - -contract HuffDeployerTest is Test { - INumber number; - IConstructor structor; - - event ArgumentsUpdated(address indexed one, uint256 indexed two); - - function setUp() public { - number = INumber(HuffDeployer.deploy("test/contracts/Number")); - - // Backwards-compatible Constructor creation - vm.expectEmit(true, true, true, true); - emit ArgumentsUpdated(address(0x420), uint256(0x420)); - structor = IConstructor( - HuffDeployer.deploy_with_args( - "test/contracts/Constructor", - bytes.concat(abi.encode(address(0x420)), abi.encode(uint256(0x420))) - ) - ); - } - - function testChaining() public { - // Defined Constructor - string memory constructor_macro = - "#define macro CONSTRUCTOR() = takes(0) returns (0) {" - " // Copy the first argument into memory \n" - " 0x20 // [size] - byte size to copy \n" - " 0x40 codesize sub // [offset, size] - offset in the code to copy from\n " - " 0x00 // [mem, offset, size] - offset in memory to copy to \n" - " codecopy // [] \n" - " // Store the first argument in storage\n" - " 0x00 mload dup1 // [arg1, arg1] \n" - " [CONSTRUCTOR_ARG_ONE] // [CONSTRUCTOR_ARG_ONE, arg1, arg1] \n" - " sstore // [arg1] \n" - " // Copy the second argument into memory \n" - " 0x20 // [size, arg1] - byte size to copy \n" - " 0x20 codesize sub // [offset, size, arg1] - offset in the code to copy from \n" - " 0x00 // [mem, offset, size, arg1] - offset in memory to copy to \n" - " codecopy // [arg1] \n" - " // Store the second argument in storage \n" - " 0x00 mload dup1 // [arg2, arg2, arg1] \n" - " [CONSTRUCTOR_ARG_TWO] // [CONSTRUCTOR_ARG_TWO, arg2, arg2, arg1] \n" - " sstore // [arg2, arg1] \n" - " // Emit the owner updated event \n" - " swap1 // [arg1, arg2] \n" - " [ARGUMENTS_TOPIC] // [sig, arg1, arg2] \n" - " 0x00 0x00 // [0, 0, sig, arg1, arg2] \n" - " log3 // [] \n" "}"; - - // New pattern - vm.expectEmit(true, true, true, true); - emit ArgumentsUpdated(address(0x420), uint256(0x420)); - IConstructor chained = IConstructor( - HuffDeployer.config().with_args( - bytes.concat(abi.encode(address(0x420)), abi.encode(uint256(0x420))) - ).with_code(constructor_macro).deploy("test/contracts/NoConstructor") - ); - - assertEq(address(0x420), chained.getArgOne()); - assertEq(uint256(0x420), chained.getArgTwo()); - } - - function testArgOne() public { - assertEq(address(0x420), structor.getArgOne()); - } - - function testArgTwo() public { - assertEq(uint256(0x420), structor.getArgTwo()); - } - - function testBytecode() public { - bytes memory b = bytes( - hex"60003560e01c80633fb5c1cb1461001c578063f2c9ecd814610023575b6004356000555b60005460005260206000f3" - ); - assertEq(getCode(address(number)), b); - } - - function testWithValueDeployment() public { - uint256 value = 1 ether; - HuffDeployer.config() - .with_value(value) - .deploy{value: value}("test/contracts/ConstructorNeedsValue"); - } - - function testConstantOverride() public { - // Test address constant - address a = 0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF; - address deployed = HuffDeployer.config() - .with_addr_constant("a", a) - .with_constant("b", "0x420") - .deploy("test/contracts/ConstOverride"); - assertEq(getCode(deployed), hex"73DeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF610420"); - - // Test uint constant - address deployed_2 = HuffDeployer.config() - .with_uint_constant("a", 32) - .with_constant("b", "0x420") - .deploy("test/contracts/ConstOverride"); - assertEq(getCode(deployed_2), hex"6020610420"); - - // Test bytes32 constant - address deployed_3 = HuffDeployer.config() - .with_bytes32_constant("a", bytes32(hex"01")) - .with_constant("b", "0x420") - .deploy("test/contracts/ConstOverride"); - assertEq(getCode(deployed_3), hex"7f0100000000000000000000000000000000000000000000000000000000000000610420"); - - // Keep default "a" value and assign "b", which is unassigned in "ConstOverride.huff" - address deployed_4 = HuffDeployer.config() - .with_constant("b", "0x420") - .deploy("test/contracts/ConstOverride"); - assertEq(getCode(deployed_4), hex"6001610420"); - } - - function getCode(address who) internal view returns (bytes memory o_code) { - /// @solidity memory-safe-assembly - assembly { - // retrieve the size of the code, this needs assembly - let size := extcodesize(who) - // allocate output byte array - this could also be done without assembly - // by using o_code = new bytes(size) - o_code := mload(0x40) - // new "memory end" including padding - mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), not(0x1f)))) - // store length in memory - mstore(o_code, size) - // actually retrieve the code, this needs assembly - extcodecopy(who, add(o_code, 0x20), 0, size) - } - } - - function testSet(uint256 num) public { - number.setNumber(num); - assertEq(num, number.getNumber()); - } -} diff --git a/contract/lib/foundry-huff/src/test/Logging.t.sol b/contract/lib/foundry-huff/src/test/Logging.t.sol deleted file mode 100644 index 0648eac..0000000 --- a/contract/lib/foundry-huff/src/test/Logging.t.sol +++ /dev/null @@ -1,77 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.7.0 <0.9.0; - -import "forge-std/Test.sol"; - -import {HuffConfig} from "../HuffConfig.sol"; -import {HuffDeployer} from "../HuffDeployer.sol"; -import {INumber} from "./interfaces/INumber.sol"; -import {IConstructor} from "./interfaces/IConstructor.sol"; - -contract LoggingTest is Test { - event LogOne(); - event LogTwo(address indexed a); - event LogThree(address indexed a, uint256 indexed b); - event LogFour(address indexed a, uint256 indexed b, bytes32 indexed c); - event Extended( - address indexed a, - uint256 indexed b, - bytes32 indexed h1, - bytes32 h2, - bytes32 two - ); - - function testLoggingWithArgs() public { - // Ignore the second topic (address) since the internal HuffConfig is the msg.sender - vm.expectEmit(false, true, true, true); - emit LogOne(); - emit LogTwo(address(0)); - emit LogThree(address(0), 0); - emit LogFour(address(0), 0, keccak256(abi.encode(1))); - emit Extended( - address(0), - 0, - keccak256(abi.encode(1)), - keccak256(abi.encode(2)), - keccak256(abi.encode(3)) - ); - HuffDeployer.deploy_with_args( - "test/contracts/LotsOfLogging", - bytes.concat(abi.encode(address(0x420)), abi.encode(uint256(0x420))) - ); - } - - function testLoggingWithDeploy() public { - vm.expectEmit(false, true, true, true); - emit LogOne(); - emit LogTwo(address(0)); - emit LogThree(address(0), 0); - emit LogFour(address(0), 0, keccak256(abi.encode(1))); - emit Extended( - address(0), - 0, - keccak256(abi.encode(1)), - keccak256(abi.encode(2)), - keccak256(abi.encode(3)) - ); - HuffDeployer.deploy("test/contracts/LotsOfLogging"); - } - - function testConfigLogging() public { - HuffConfig config = - HuffDeployer.config().with_args(abi.encode(address(0x420))); - vm.expectEmit(true, true, true, true); - emit LogOne(); - emit LogTwo(address(config)); - emit LogThree(address(config), 0); - emit LogFour(address(config), 0, keccak256(abi.encode(1))); - emit Extended( - address(config), - 0, - keccak256(abi.encode(1)), - keccak256(abi.encode(2)), - keccak256(abi.encode(3)) - ); - config.deploy("test/contracts/LotsOfLogging"); - } -} diff --git a/contract/lib/foundry-huff/src/test/contracts/ConstOverride.huff b/contract/lib/foundry-huff/src/test/contracts/ConstOverride.huff deleted file mode 100644 index ce80a69..0000000 --- a/contract/lib/foundry-huff/src/test/contracts/ConstOverride.huff +++ /dev/null @@ -1,6 +0,0 @@ -#define constant a = 0x01 - -#define macro MAIN() = takes (0) returns (0) { - [a] - [b] -} \ No newline at end of file diff --git a/contract/lib/foundry-huff/src/test/contracts/Constructor.huff b/contract/lib/foundry-huff/src/test/contracts/Constructor.huff deleted file mode 100644 index ce3a0bc..0000000 --- a/contract/lib/foundry-huff/src/test/contracts/Constructor.huff +++ /dev/null @@ -1,69 +0,0 @@ -/* Interface */ -#define function getArgOne() view returns (address) -#define function getArgTwo() view returns (uint256) - -/* Storage Slots */ -#define constant CONSTRUCTOR_ARG_ONE = FREE_STORAGE_POINTER() -#define constant CONSTRUCTOR_ARG_TWO = FREE_STORAGE_POINTER() - -/* Events */ -#define event ArgumentsUpdated(address indexed one, uint256 indexed two) - -#define constant ARGUMENTS_TOPIC = 0xd0a6a6b9636b3b1e85120bfc8c36f7bc862769b48e0854deaf8780636a71ce7d - -/* Constructor */ -#define macro CONSTRUCTOR() = takes(0) returns (0) { - // Copy the first argument into memory - 0x20 // [size] - byte size to copy - 0x40 codesize sub // [offset, size] - offset in the code to copy from - 0x00 // [mem, offset, size] - offset in memory to copy to - codecopy // [] - - // Store the first argument in storage - 0x00 mload dup1 // [arg1, arg1] - [CONSTRUCTOR_ARG_ONE] // [CONSTRUCTOR_ARG_ONE, arg1, arg1] - sstore // [arg1] - - // Copy the second argument into memory - 0x20 // [size, arg1] - byte size to copy - 0x20 codesize sub // [offset, size, arg1] - offset in the code to copy from - 0x00 // [mem, offset, size, arg1] - offset in memory to copy to - codecopy // [arg1] - - // Store the second argument in storage - 0x00 mload dup1 // [arg2, arg2, arg1] - [CONSTRUCTOR_ARG_TWO] // [CONSTRUCTOR_ARG_TWO, arg2, arg2, arg1] - sstore // [arg2, arg1] - - // Emit the owner updated event - swap1 // [arg1, arg2] - [ARGUMENTS_TOPIC] // [sig, arg1, arg2] - 0x00 0x00 // [0, 0, sig, arg1, arg2] - log3 // [] -} - -/* First Argument Accessor */ -#define macro GET_ARG_ONE() = takes (0) returns (0) { - [CONSTRUCTOR_ARG_ONE] sload - 0x00 mstore - 0x20 0x00 return -} - -/* Second Argument Accessor */ -#define macro GET_ARG_TWO() = takes (0) returns (0) { - [CONSTRUCTOR_ARG_TWO] sload - 0x00 mstore - 0x20 0x00 return -} - -/* Main Macro */ -#define macro MAIN() = takes (0) returns (0) { - 0x00 calldataload 0xE0 shr - dup1 0xbb01e52d eq arg_one jumpi - dup1 0x98e45be4 eq arg_two jumpi - - arg_one: - GET_ARG_ONE() - arg_two: - GET_ARG_TWO() -} diff --git a/contract/lib/foundry-huff/src/test/contracts/ConstructorNeedsValue.huff b/contract/lib/foundry-huff/src/test/contracts/ConstructorNeedsValue.huff deleted file mode 100644 index 27da3e7..0000000 --- a/contract/lib/foundry-huff/src/test/contracts/ConstructorNeedsValue.huff +++ /dev/null @@ -1,16 +0,0 @@ - -#define macro CONSTRUCTOR() = takes (0) returns (0) { - callvalue // [msg.value] - iszero // [is_msg_value_zero] - iszero // [is_msg_value_non_zero] - deposited // [deposited_jumpdest, is_msg_value_non_zero] - jumpi // [] - 0x00 0x00 revert - deposited: -} - -#define macro MAIN() = takes (0) returns (0) { - 0x00 calldataload 0xE0 shr - 0x00 mstore - 0x20 0x00 return -} \ No newline at end of file diff --git a/contract/lib/foundry-huff/src/test/contracts/LotsOfLogging.huff b/contract/lib/foundry-huff/src/test/contracts/LotsOfLogging.huff deleted file mode 100644 index f2bfe6c..0000000 --- a/contract/lib/foundry-huff/src/test/contracts/LotsOfLogging.huff +++ /dev/null @@ -1,56 +0,0 @@ -/* Events */ -#define event LogOne() -#define event LogTwo(address indexed a) -#define event LogThree(address indexed a, uint256 indexed b) -#define event LogFour(address indexed a, uint256 indexed b, bytes32 indexed c) -#define event Extended(address indexed a, uint256 indexed b, bytes32 indexed h1, bytes32 h2, bytes32 two) - -/* Constructor */ -#define macro CONSTRUCTOR() = takes(0) returns (0) { - // Empty Anonymous Log - // 0x00 0x00 log0 - - // LogOne - __EVENT_HASH(LogOne) // [hash] - 0x00 0x00 log1 // [] - - // LogTwo - caller // [address] - __EVENT_HASH(LogTwo) // [hash, address] - 0x00 0x00 log2 // [] - - // LogThree - selfbalance // [balance] - caller // [address, balance] - __EVENT_HASH(LogThree) // [hash, address, balance] - 0x00 0x00 log3 // [] - - // LogFour - 0x01 0x00 mstore // [] - 0x20 0x00 sha3 // [bytes32_hash] - selfbalance // [balance, bytes32_hash] - caller // [address, balance, bytes32_hash] - __EVENT_HASH(LogFour) // [hash, address, balance, bytes32_hash] - 0x00 0x00 log4 // [] - - // Evented Log - 0x01 0x00 mstore // [] - 0x20 0x00 sha3 // [hash1] - 0x02 0x00 mstore // [hash1] - 0x20 0x00 sha3 // [hash2, hash1] - 0x00 mstore // [hash1] - 0x03 0x20 mstore // [hash1] - 0x20 0x20 sha3 // [two, hash1] - 0x20 mstore // [hash1] - selfbalance // [balance, hash1] - caller // [address, balance, hash1] - __EVENT_HASH(Extended) // [hash, address, balance, hash1] - 0x40 0x00 log4 // [] -} - -/* Main Macro - Does Nothing */ -#define macro MAIN() = takes (0) returns (0) { - 0x00 calldataload 0xE0 shr - 0x00 mstore - 0x20 0x00 return -} diff --git a/contract/lib/foundry-huff/src/test/contracts/NoConstructor.huff b/contract/lib/foundry-huff/src/test/contracts/NoConstructor.huff deleted file mode 100644 index 4bf49c8..0000000 --- a/contract/lib/foundry-huff/src/test/contracts/NoConstructor.huff +++ /dev/null @@ -1,38 +0,0 @@ -/* Interface */ -#define function getArgOne() view returns (address) -#define function getArgTwo() view returns (uint256) - -/* Storage Slots */ -#define constant CONSTRUCTOR_ARG_ONE = FREE_STORAGE_POINTER() -#define constant CONSTRUCTOR_ARG_TWO = FREE_STORAGE_POINTER() - -/* Events */ -#define event ArgumentsUpdated(address indexed one, uint256 indexed two) - -#define constant ARGUMENTS_TOPIC = 0xd0a6a6b9636b3b1e85120bfc8c36f7bc862769b48e0854deaf8780636a71ce7d - -/* First Argument Accessor */ -#define macro GET_ARG_ONE() = takes (0) returns (0) { - [CONSTRUCTOR_ARG_ONE] sload - 0x00 mstore - 0x20 0x00 return -} - -/* Second Argument Accessor */ -#define macro GET_ARG_TWO() = takes (0) returns (0) { - [CONSTRUCTOR_ARG_TWO] sload - 0x00 mstore - 0x20 0x00 return -} - -/* Main Macro */ -#define macro MAIN() = takes (0) returns (0) { - 0x00 calldataload 0xE0 shr - dup1 0xbb01e52d eq arg_one jumpi - dup1 0x98e45be4 eq arg_two jumpi - - arg_one: - GET_ARG_ONE() - arg_two: - GET_ARG_TWO() -} diff --git a/contract/lib/foundry-huff/src/test/contracts/Number.huff b/contract/lib/foundry-huff/src/test/contracts/Number.huff deleted file mode 100644 index d6813e4..0000000 --- a/contract/lib/foundry-huff/src/test/contracts/Number.huff +++ /dev/null @@ -1,38 +0,0 @@ -/* Interface */ -#define function setNumber(uint256) nonpayable returns () -#define function getNumber() view returns (uint256) - -/* Storage Slots */ -#define constant NUMBER_LOCATION = FREE_STORAGE_POINTER() - -/* Methods */ -#define macro SET_NUMBER() = takes (0) returns (0) { - 0x04 calldataload // [number] - [NUMBER_LOCATION] // [ptr, number] - sstore // [] -} - -#define macro GET_NUMBER() = takes (0) returns (0) { - // Load number from storage. - [NUMBER_LOCATION] // [ptr] - sload // [number] - - // Store number in memory. - 0x00 mstore - - // Return number - 0x20 0x00 return -} - -#define macro MAIN() = takes (0) returns (0) { - // Identify which function is being called. - 0x00 calldataload 0xE0 shr - dup1 0x3fb5c1cb eq set jumpi - dup1 0xf2c9ecd8 eq get jumpi - - set: - SET_NUMBER() - get: - GET_NUMBER() - -} \ No newline at end of file diff --git a/contract/lib/foundry-huff/src/test/interfaces/IConstructor.sol b/contract/lib/foundry-huff/src/test/interfaces/IConstructor.sol deleted file mode 100644 index c63d409..0000000 --- a/contract/lib/foundry-huff/src/test/interfaces/IConstructor.sol +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.7.0 <0.9.0; - -interface IConstructor { - function getArgOne() external returns (address); - function getArgTwo() external returns (uint256); -} diff --git a/contract/lib/foundry-huff/src/test/interfaces/INumber.sol b/contract/lib/foundry-huff/src/test/interfaces/INumber.sol deleted file mode 100644 index 5fabb79..0000000 --- a/contract/lib/foundry-huff/src/test/interfaces/INumber.sol +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.7.0 <0.9.0; - -interface INumber { - function setNumber(uint256) external; - function getNumber() external returns (uint256); -} diff --git a/contract/lib/solmate b/contract/lib/solmate new file mode 160000 index 0000000..bfc9c25 --- /dev/null +++ b/contract/lib/solmate @@ -0,0 +1 @@ +Subproject commit bfc9c25865a274a7827fea5abf6e4fb64fc64e6c diff --git a/contract/lib/v2-core b/contract/lib/v2-core new file mode 160000 index 0000000..4dd5906 --- /dev/null +++ b/contract/lib/v2-core @@ -0,0 +1 @@ +Subproject commit 4dd59067c76dea4a0e8e4bfdda41877a6b16dedc diff --git a/contract/lib/v2-core/.gitattributes b/contract/lib/v2-core/.gitattributes deleted file mode 100644 index 7cc88f0..0000000 --- a/contract/lib/v2-core/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.sol linguist-language=Solidity \ No newline at end of file diff --git a/contract/lib/v2-core/.github/workflows/CI.yml b/contract/lib/v2-core/.github/workflows/CI.yml deleted file mode 100644 index 2e62171..0000000 --- a/contract/lib/v2-core/.github/workflows/CI.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: CI - -on: - push: - branches: - - master - pull_request: - -jobs: - test: - strategy: - matrix: - node: ['10.x', '12.x'] - os: [ubuntu-latest] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - - run: npm install -g yarn - - - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v1 - with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: ${{ matrix.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ matrix.os }}-yarn- - - - run: yarn - - run: yarn lint - - run: yarn test diff --git a/contract/lib/v2-core/.mocharc.json b/contract/lib/v2-core/.mocharc.json deleted file mode 100644 index 1a5fee6..0000000 --- a/contract/lib/v2-core/.mocharc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extension": ["ts"], - "spec": "./test/**/*.spec.ts", - "require": "ts-node/register", - "timeout": 12000 -} diff --git a/contract/lib/v2-core/.prettierrc b/contract/lib/v2-core/.prettierrc deleted file mode 100644 index 31ba22d..0000000 --- a/contract/lib/v2-core/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "semi": false, - "singleQuote": true, - "printWidth": 120 -} diff --git a/contract/lib/v2-core/.waffle.json b/contract/lib/v2-core/.waffle.json deleted file mode 100644 index 29868df..0000000 --- a/contract/lib/v2-core/.waffle.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerVersion": "./node_modules/solc", - "outputType": "all", - "compilerOptions": { - "outputSelection": { - "*": { - "*": [ - "evm.bytecode.object", - "evm.deployedBytecode.object", - "abi", - "evm.bytecode.sourceMap", - "evm.deployedBytecode.sourceMap", - "metadata" - ], - "": ["ast"] - } - }, - "evmVersion": "istanbul", - "optimizer": { - "enabled": true, - "runs": 999999 - } - } -} diff --git a/contract/lib/v2-core/LICENSE b/contract/lib/v2-core/LICENSE deleted file mode 100644 index f288702..0000000 --- a/contract/lib/v2-core/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/contract/lib/v2-core/README.md b/contract/lib/v2-core/README.md deleted file mode 100644 index 1d72187..0000000 --- a/contract/lib/v2-core/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Uniswap V2 - -[![Actions Status](https://github.com/Uniswap/uniswap-v2-core/workflows/CI/badge.svg)](https://github.com/Uniswap/uniswap-v2-core/actions) -[![Version](https://img.shields.io/npm/v/@uniswap/v2-core)](https://www.npmjs.com/package/@uniswap/v2-core) - -In-depth documentation on Uniswap V2 is available at [uniswap.org](https://uniswap.org/docs). - -The built contract artifacts can be browsed via [unpkg.com](https://unpkg.com/browse/@uniswap/v2-core@latest/). - -# Local Development - -The following assumes the use of `node@>=10`. - -## Install Dependencies - -`yarn` - -## Compile Contracts - -`yarn compile` - -## Run Tests - -`yarn test` diff --git a/contract/lib/v2-core/contracts/UniswapV2ERC20.sol b/contract/lib/v2-core/contracts/UniswapV2ERC20.sol deleted file mode 100644 index 404a8be..0000000 --- a/contract/lib/v2-core/contracts/UniswapV2ERC20.sol +++ /dev/null @@ -1,94 +0,0 @@ -pragma solidity =0.5.16; - -import './interfaces/IUniswapV2ERC20.sol'; -import './libraries/SafeMath.sol'; - -contract UniswapV2ERC20 is IUniswapV2ERC20 { - using SafeMath for uint; - - string public constant name = 'Uniswap V2'; - string public constant symbol = 'UNI-V2'; - uint8 public constant decimals = 18; - uint public totalSupply; - mapping(address => uint) public balanceOf; - mapping(address => mapping(address => uint)) public allowance; - - bytes32 public DOMAIN_SEPARATOR; - // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); - bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; - mapping(address => uint) public nonces; - - event Approval(address indexed owner, address indexed spender, uint value); - event Transfer(address indexed from, address indexed to, uint value); - - constructor() public { - uint chainId; - assembly { - chainId := chainid - } - DOMAIN_SEPARATOR = keccak256( - abi.encode( - keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'), - keccak256(bytes(name)), - keccak256(bytes('1')), - chainId, - address(this) - ) - ); - } - - function _mint(address to, uint value) internal { - totalSupply = totalSupply.add(value); - balanceOf[to] = balanceOf[to].add(value); - emit Transfer(address(0), to, value); - } - - function _burn(address from, uint value) internal { - balanceOf[from] = balanceOf[from].sub(value); - totalSupply = totalSupply.sub(value); - emit Transfer(from, address(0), value); - } - - function _approve(address owner, address spender, uint value) private { - allowance[owner][spender] = value; - emit Approval(owner, spender, value); - } - - function _transfer(address from, address to, uint value) private { - balanceOf[from] = balanceOf[from].sub(value); - balanceOf[to] = balanceOf[to].add(value); - emit Transfer(from, to, value); - } - - function approve(address spender, uint value) external returns (bool) { - _approve(msg.sender, spender, value); - return true; - } - - function transfer(address to, uint value) external returns (bool) { - _transfer(msg.sender, to, value); - return true; - } - - function transferFrom(address from, address to, uint value) external returns (bool) { - if (allowance[from][msg.sender] != uint(-1)) { - allowance[from][msg.sender] = allowance[from][msg.sender].sub(value); - } - _transfer(from, to, value); - return true; - } - - function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external { - require(deadline >= block.timestamp, 'UniswapV2: EXPIRED'); - bytes32 digest = keccak256( - abi.encodePacked( - '\x19\x01', - DOMAIN_SEPARATOR, - keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)) - ) - ); - address recoveredAddress = ecrecover(digest, v, r, s); - require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE'); - _approve(owner, spender, value); - } -} diff --git a/contract/lib/v2-core/contracts/UniswapV2Factory.sol b/contract/lib/v2-core/contracts/UniswapV2Factory.sol deleted file mode 100644 index a66ad82..0000000 --- a/contract/lib/v2-core/contracts/UniswapV2Factory.sol +++ /dev/null @@ -1,49 +0,0 @@ -pragma solidity =0.5.16; - -import './interfaces/IUniswapV2Factory.sol'; -import './UniswapV2Pair.sol'; - -contract UniswapV2Factory is IUniswapV2Factory { - address public feeTo; - address public feeToSetter; - - mapping(address => mapping(address => address)) public getPair; - address[] public allPairs; - - event PairCreated(address indexed token0, address indexed token1, address pair, uint); - - constructor(address _feeToSetter) public { - feeToSetter = _feeToSetter; - } - - function allPairsLength() external view returns (uint) { - return allPairs.length; - } - - function createPair(address tokenA, address tokenB) external returns (address pair) { - require(tokenA != tokenB, 'UniswapV2: IDENTICAL_ADDRESSES'); - (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); - require(token0 != address(0), 'UniswapV2: ZERO_ADDRESS'); - require(getPair[token0][token1] == address(0), 'UniswapV2: PAIR_EXISTS'); // single check is sufficient - bytes memory bytecode = type(UniswapV2Pair).creationCode; - bytes32 salt = keccak256(abi.encodePacked(token0, token1)); - assembly { - pair := create2(0, add(bytecode, 32), mload(bytecode), salt) - } - IUniswapV2Pair(pair).initialize(token0, token1); - getPair[token0][token1] = pair; - getPair[token1][token0] = pair; // populate mapping in the reverse direction - allPairs.push(pair); - emit PairCreated(token0, token1, pair, allPairs.length); - } - - function setFeeTo(address _feeTo) external { - require(msg.sender == feeToSetter, 'UniswapV2: FORBIDDEN'); - feeTo = _feeTo; - } - - function setFeeToSetter(address _feeToSetter) external { - require(msg.sender == feeToSetter, 'UniswapV2: FORBIDDEN'); - feeToSetter = _feeToSetter; - } -} diff --git a/contract/lib/v2-core/contracts/UniswapV2Pair.sol b/contract/lib/v2-core/contracts/UniswapV2Pair.sol deleted file mode 100644 index f87a1db..0000000 --- a/contract/lib/v2-core/contracts/UniswapV2Pair.sol +++ /dev/null @@ -1,201 +0,0 @@ -pragma solidity =0.5.16; - -import './interfaces/IUniswapV2Pair.sol'; -import './UniswapV2ERC20.sol'; -import './libraries/Math.sol'; -import './libraries/UQ112x112.sol'; -import './interfaces/IERC20.sol'; -import './interfaces/IUniswapV2Factory.sol'; -import './interfaces/IUniswapV2Callee.sol'; - -contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 { - using SafeMath for uint; - using UQ112x112 for uint224; - - uint public constant MINIMUM_LIQUIDITY = 10**3; - bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)'))); - - address public factory; - address public token0; - address public token1; - - uint112 private reserve0; // uses single storage slot, accessible via getReserves - uint112 private reserve1; // uses single storage slot, accessible via getReserves - uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves - - uint public price0CumulativeLast; - uint public price1CumulativeLast; - uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event - - uint private unlocked = 1; - modifier lock() { - require(unlocked == 1, 'UniswapV2: LOCKED'); - unlocked = 0; - _; - unlocked = 1; - } - - function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) { - _reserve0 = reserve0; - _reserve1 = reserve1; - _blockTimestampLast = blockTimestampLast; - } - - function _safeTransfer(address token, address to, uint value) private { - (bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value)); - require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED'); - } - - event Mint(address indexed sender, uint amount0, uint amount1); - event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); - event Swap( - address indexed sender, - uint amount0In, - uint amount1In, - uint amount0Out, - uint amount1Out, - address indexed to - ); - event Sync(uint112 reserve0, uint112 reserve1); - - constructor() public { - factory = msg.sender; - } - - // called once by the factory at time of deployment - function initialize(address _token0, address _token1) external { - require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check - token0 = _token0; - token1 = _token1; - } - - // update reserves and, on the first call per block, price accumulators - function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private { - require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW'); - uint32 blockTimestamp = uint32(block.timestamp % 2**32); - uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired - if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) { - // * never overflows, and + overflow is desired - price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed; - price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed; - } - reserve0 = uint112(balance0); - reserve1 = uint112(balance1); - blockTimestampLast = blockTimestamp; - emit Sync(reserve0, reserve1); - } - - // if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k) - function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) { - address feeTo = IUniswapV2Factory(factory).feeTo(); - feeOn = feeTo != address(0); - uint _kLast = kLast; // gas savings - if (feeOn) { - if (_kLast != 0) { - uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1)); - uint rootKLast = Math.sqrt(_kLast); - if (rootK > rootKLast) { - uint numerator = totalSupply.mul(rootK.sub(rootKLast)); - uint denominator = rootK.mul(5).add(rootKLast); - uint liquidity = numerator / denominator; - if (liquidity > 0) _mint(feeTo, liquidity); - } - } - } else if (_kLast != 0) { - kLast = 0; - } - } - - // this low-level function should be called from a contract which performs important safety checks - function mint(address to) external lock returns (uint liquidity) { - (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings - uint balance0 = IERC20(token0).balanceOf(address(this)); - uint balance1 = IERC20(token1).balanceOf(address(this)); - uint amount0 = balance0.sub(_reserve0); - uint amount1 = balance1.sub(_reserve1); - - bool feeOn = _mintFee(_reserve0, _reserve1); - uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee - if (_totalSupply == 0) { - liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY); - _mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens - } else { - liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1); - } - require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED'); - _mint(to, liquidity); - - _update(balance0, balance1, _reserve0, _reserve1); - if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date - emit Mint(msg.sender, amount0, amount1); - } - - // this low-level function should be called from a contract which performs important safety checks - function burn(address to) external lock returns (uint amount0, uint amount1) { - (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings - address _token0 = token0; // gas savings - address _token1 = token1; // gas savings - uint balance0 = IERC20(_token0).balanceOf(address(this)); - uint balance1 = IERC20(_token1).balanceOf(address(this)); - uint liquidity = balanceOf[address(this)]; - - bool feeOn = _mintFee(_reserve0, _reserve1); - uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee - amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution - amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution - require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED'); - _burn(address(this), liquidity); - _safeTransfer(_token0, to, amount0); - _safeTransfer(_token1, to, amount1); - balance0 = IERC20(_token0).balanceOf(address(this)); - balance1 = IERC20(_token1).balanceOf(address(this)); - - _update(balance0, balance1, _reserve0, _reserve1); - if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date - emit Burn(msg.sender, amount0, amount1, to); - } - - // this low-level function should be called from a contract which performs important safety checks - function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock { - require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT'); - (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings - require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY'); - - uint balance0; - uint balance1; - { // scope for _token{0,1}, avoids stack too deep errors - address _token0 = token0; - address _token1 = token1; - require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO'); - if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens - if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens - if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data); - balance0 = IERC20(_token0).balanceOf(address(this)); - balance1 = IERC20(_token1).balanceOf(address(this)); - } - uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0; - uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0; - require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT'); - { // scope for reserve{0,1}Adjusted, avoids stack too deep errors - uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3)); - uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3)); - require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K'); - } - - _update(balance0, balance1, _reserve0, _reserve1); - emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to); - } - - // force balances to match reserves - function skim(address to) external lock { - address _token0 = token0; // gas savings - address _token1 = token1; // gas savings - _safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0)); - _safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1)); - } - - // force reserves to match balances - function sync() external lock { - _update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1); - } -} diff --git a/contract/lib/v2-core/contracts/interfaces/IERC20.sol b/contract/lib/v2-core/contracts/interfaces/IERC20.sol deleted file mode 100644 index c1e8c3e..0000000 --- a/contract/lib/v2-core/contracts/interfaces/IERC20.sol +++ /dev/null @@ -1,17 +0,0 @@ -pragma solidity >=0.5.0; - -interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint value); - event Transfer(address indexed from, address indexed to, uint value); - - function name() external view returns (string memory); - function symbol() external view returns (string memory); - function decimals() external view returns (uint8); - function totalSupply() external view returns (uint); - function balanceOf(address owner) external view returns (uint); - function allowance(address owner, address spender) external view returns (uint); - - function approve(address spender, uint value) external returns (bool); - function transfer(address to, uint value) external returns (bool); - function transferFrom(address from, address to, uint value) external returns (bool); -} diff --git a/contract/lib/v2-core/contracts/interfaces/IUniswapV2Callee.sol b/contract/lib/v2-core/contracts/interfaces/IUniswapV2Callee.sol deleted file mode 100644 index f3910ab..0000000 --- a/contract/lib/v2-core/contracts/interfaces/IUniswapV2Callee.sol +++ /dev/null @@ -1,5 +0,0 @@ -pragma solidity >=0.5.0; - -interface IUniswapV2Callee { - function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external; -} diff --git a/contract/lib/v2-core/contracts/interfaces/IUniswapV2ERC20.sol b/contract/lib/v2-core/contracts/interfaces/IUniswapV2ERC20.sol deleted file mode 100644 index 8718931..0000000 --- a/contract/lib/v2-core/contracts/interfaces/IUniswapV2ERC20.sol +++ /dev/null @@ -1,23 +0,0 @@ -pragma solidity >=0.5.0; - -interface IUniswapV2ERC20 { - event Approval(address indexed owner, address indexed spender, uint value); - event Transfer(address indexed from, address indexed to, uint value); - - function name() external pure returns (string memory); - function symbol() external pure returns (string memory); - function decimals() external pure returns (uint8); - function totalSupply() external view returns (uint); - function balanceOf(address owner) external view returns (uint); - function allowance(address owner, address spender) external view returns (uint); - - function approve(address spender, uint value) external returns (bool); - function transfer(address to, uint value) external returns (bool); - function transferFrom(address from, address to, uint value) external returns (bool); - - function DOMAIN_SEPARATOR() external view returns (bytes32); - function PERMIT_TYPEHASH() external pure returns (bytes32); - function nonces(address owner) external view returns (uint); - - function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; -} diff --git a/contract/lib/v2-core/contracts/interfaces/IUniswapV2Factory.sol b/contract/lib/v2-core/contracts/interfaces/IUniswapV2Factory.sol deleted file mode 100644 index e73dc59..0000000 --- a/contract/lib/v2-core/contracts/interfaces/IUniswapV2Factory.sol +++ /dev/null @@ -1,17 +0,0 @@ -pragma solidity >=0.5.0; - -interface IUniswapV2Factory { - event PairCreated(address indexed token0, address indexed token1, address pair, uint); - - function feeTo() external view returns (address); - function feeToSetter() external view returns (address); - - function getPair(address tokenA, address tokenB) external view returns (address pair); - function allPairs(uint) external view returns (address pair); - function allPairsLength() external view returns (uint); - - function createPair(address tokenA, address tokenB) external returns (address pair); - - function setFeeTo(address) external; - function setFeeToSetter(address) external; -} diff --git a/contract/lib/v2-core/contracts/interfaces/IUniswapV2Pair.sol b/contract/lib/v2-core/contracts/interfaces/IUniswapV2Pair.sol deleted file mode 100644 index 762dd4d..0000000 --- a/contract/lib/v2-core/contracts/interfaces/IUniswapV2Pair.sol +++ /dev/null @@ -1,52 +0,0 @@ -pragma solidity >=0.5.0; - -interface IUniswapV2Pair { - event Approval(address indexed owner, address indexed spender, uint value); - event Transfer(address indexed from, address indexed to, uint value); - - function name() external pure returns (string memory); - function symbol() external pure returns (string memory); - function decimals() external pure returns (uint8); - function totalSupply() external view returns (uint); - function balanceOf(address owner) external view returns (uint); - function allowance(address owner, address spender) external view returns (uint); - - function approve(address spender, uint value) external returns (bool); - function transfer(address to, uint value) external returns (bool); - function transferFrom(address from, address to, uint value) external returns (bool); - - function DOMAIN_SEPARATOR() external view returns (bytes32); - function PERMIT_TYPEHASH() external pure returns (bytes32); - function nonces(address owner) external view returns (uint); - - function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; - - event Mint(address indexed sender, uint amount0, uint amount1); - event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); - event Swap( - address indexed sender, - uint amount0In, - uint amount1In, - uint amount0Out, - uint amount1Out, - address indexed to - ); - event Sync(uint112 reserve0, uint112 reserve1); - - function MINIMUM_LIQUIDITY() external pure returns (uint); - function factory() external view returns (address); - function token0() external view returns (address); - function token1() external view returns (address); - function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); - function price0CumulativeLast() external view returns (uint); - function price1CumulativeLast() external view returns (uint); - function kLast() external view returns (uint); - - function mint(address to) external returns (uint liquidity); - function burn(address to) external returns (uint amount0, uint amount1); - function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; - function skim(address to) external; - function sync() external; - - function initialize(address, address) external; -} diff --git a/contract/lib/v2-core/contracts/libraries/Math.sol b/contract/lib/v2-core/contracts/libraries/Math.sol deleted file mode 100644 index 1cab10d..0000000 --- a/contract/lib/v2-core/contracts/libraries/Math.sol +++ /dev/null @@ -1,23 +0,0 @@ -pragma solidity =0.5.16; - -// a library for performing various math operations - -library Math { - function min(uint x, uint y) internal pure returns (uint z) { - z = x < y ? x : y; - } - - // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) - function sqrt(uint y) internal pure returns (uint z) { - if (y > 3) { - z = y; - uint x = y / 2 + 1; - while (x < z) { - z = x; - x = (y / x + x) / 2; - } - } else if (y != 0) { - z = 1; - } - } -} diff --git a/contract/lib/v2-core/contracts/libraries/SafeMath.sol b/contract/lib/v2-core/contracts/libraries/SafeMath.sol deleted file mode 100644 index f2fbe16..0000000 --- a/contract/lib/v2-core/contracts/libraries/SafeMath.sol +++ /dev/null @@ -1,17 +0,0 @@ -pragma solidity =0.5.16; - -// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) - -library SafeMath { - function add(uint x, uint y) internal pure returns (uint z) { - require((z = x + y) >= x, 'ds-math-add-overflow'); - } - - function sub(uint x, uint y) internal pure returns (uint z) { - require((z = x - y) <= x, 'ds-math-sub-underflow'); - } - - function mul(uint x, uint y) internal pure returns (uint z) { - require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow'); - } -} diff --git a/contract/lib/v2-core/contracts/libraries/UQ112x112.sol b/contract/lib/v2-core/contracts/libraries/UQ112x112.sol deleted file mode 100644 index a453f72..0000000 --- a/contract/lib/v2-core/contracts/libraries/UQ112x112.sol +++ /dev/null @@ -1,20 +0,0 @@ -pragma solidity =0.5.16; - -// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format)) - -// range: [0, 2**112 - 1] -// resolution: 1 / 2**112 - -library UQ112x112 { - uint224 constant Q112 = 2**112; - - // encode a uint112 as a UQ112x112 - function encode(uint112 y) internal pure returns (uint224 z) { - z = uint224(y) * Q112; // never overflows - } - - // divide a UQ112x112 by a uint112, returning a UQ112x112 - function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) { - z = x / uint224(y); - } -} diff --git a/contract/lib/v2-core/contracts/test/ERC20.sol b/contract/lib/v2-core/contracts/test/ERC20.sol deleted file mode 100644 index 74f0777..0000000 --- a/contract/lib/v2-core/contracts/test/ERC20.sol +++ /dev/null @@ -1,9 +0,0 @@ -pragma solidity =0.5.16; - -import '../UniswapV2ERC20.sol'; - -contract ERC20 is UniswapV2ERC20 { - constructor(uint _totalSupply) public { - _mint(msg.sender, _totalSupply); - } -} diff --git a/contract/lib/v2-core/package.json b/contract/lib/v2-core/package.json deleted file mode 100644 index 10c7b6f..0000000 --- a/contract/lib/v2-core/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "@uniswap/v2-core", - "description": "🎛 Core contracts for the UniswapV2 protocol", - "version": "1.0.1", - "homepage": "https://uniswap.org", - "repository": { - "type": "git", - "url": "https://github.com/Uniswap/uniswap-v2-core" - }, - "keywords": [ - "uniswap", - "ethereum", - "v2", - "core", - "uniswap-v2" - ], - "files": [ - "contracts", - "build" - ], - "engines": { - "node": ">=10" - }, - "devDependencies": { - "@types/chai": "^4.2.6", - "@types/mocha": "^5.2.7", - "chai": "^4.2.0", - "ethereum-waffle": "^2.4.1", - "ethereumjs-util": "^6.2.0", - "mocha": "^6.2.2", - "prettier": "^1.19.1", - "rimraf": "^3.0.0", - "solc": "0.5.16", - "ts-node": "^8.5.4", - "typescript": "^3.7.3" - }, - "scripts": { - "lint": "yarn prettier ./test/*.ts --check", - "lint:fix": "yarn prettier ./test/*.ts --write", - "clean": "rimraf ./build/", - "precompile": "yarn clean", - "compile": "waffle .waffle.json", - "pretest": "yarn compile", - "test": "mocha", - "prepublishOnly": "yarn test" - }, - "license": "GPL-3.0-or-later" -} diff --git a/contract/lib/v2-core/test/UniswapV2ERC20.spec.ts b/contract/lib/v2-core/test/UniswapV2ERC20.spec.ts deleted file mode 100644 index ec57312..0000000 --- a/contract/lib/v2-core/test/UniswapV2ERC20.spec.ts +++ /dev/null @@ -1,116 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { MaxUint256 } from 'ethers/constants' -import { bigNumberify, hexlify, keccak256, defaultAbiCoder, toUtf8Bytes } from 'ethers/utils' -import { solidity, MockProvider, deployContract } from 'ethereum-waffle' -import { ecsign } from 'ethereumjs-util' - -import { expandTo18Decimals, getApprovalDigest } from './shared/utilities' - -import ERC20 from '../build/ERC20.json' - -chai.use(solidity) - -const TOTAL_SUPPLY = expandTo18Decimals(10000) -const TEST_AMOUNT = expandTo18Decimals(10) - -describe('UniswapV2ERC20', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet, other] = provider.getWallets() - - let token: Contract - beforeEach(async () => { - token = await deployContract(wallet, ERC20, [TOTAL_SUPPLY]) - }) - - it('name, symbol, decimals, totalSupply, balanceOf, DOMAIN_SEPARATOR, PERMIT_TYPEHASH', async () => { - const name = await token.name() - expect(name).to.eq('Uniswap V2') - expect(await token.symbol()).to.eq('UNI-V2') - expect(await token.decimals()).to.eq(18) - expect(await token.totalSupply()).to.eq(TOTAL_SUPPLY) - expect(await token.balanceOf(wallet.address)).to.eq(TOTAL_SUPPLY) - expect(await token.DOMAIN_SEPARATOR()).to.eq( - keccak256( - defaultAbiCoder.encode( - ['bytes32', 'bytes32', 'bytes32', 'uint256', 'address'], - [ - keccak256( - toUtf8Bytes('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)') - ), - keccak256(toUtf8Bytes(name)), - keccak256(toUtf8Bytes('1')), - 1, - token.address - ] - ) - ) - ) - expect(await token.PERMIT_TYPEHASH()).to.eq( - keccak256(toUtf8Bytes('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)')) - ) - }) - - it('approve', async () => { - await expect(token.approve(other.address, TEST_AMOUNT)) - .to.emit(token, 'Approval') - .withArgs(wallet.address, other.address, TEST_AMOUNT) - expect(await token.allowance(wallet.address, other.address)).to.eq(TEST_AMOUNT) - }) - - it('transfer', async () => { - await expect(token.transfer(other.address, TEST_AMOUNT)) - .to.emit(token, 'Transfer') - .withArgs(wallet.address, other.address, TEST_AMOUNT) - expect(await token.balanceOf(wallet.address)).to.eq(TOTAL_SUPPLY.sub(TEST_AMOUNT)) - expect(await token.balanceOf(other.address)).to.eq(TEST_AMOUNT) - }) - - it('transfer:fail', async () => { - await expect(token.transfer(other.address, TOTAL_SUPPLY.add(1))).to.be.reverted // ds-math-sub-underflow - await expect(token.connect(other).transfer(wallet.address, 1)).to.be.reverted // ds-math-sub-underflow - }) - - it('transferFrom', async () => { - await token.approve(other.address, TEST_AMOUNT) - await expect(token.connect(other).transferFrom(wallet.address, other.address, TEST_AMOUNT)) - .to.emit(token, 'Transfer') - .withArgs(wallet.address, other.address, TEST_AMOUNT) - expect(await token.allowance(wallet.address, other.address)).to.eq(0) - expect(await token.balanceOf(wallet.address)).to.eq(TOTAL_SUPPLY.sub(TEST_AMOUNT)) - expect(await token.balanceOf(other.address)).to.eq(TEST_AMOUNT) - }) - - it('transferFrom:max', async () => { - await token.approve(other.address, MaxUint256) - await expect(token.connect(other).transferFrom(wallet.address, other.address, TEST_AMOUNT)) - .to.emit(token, 'Transfer') - .withArgs(wallet.address, other.address, TEST_AMOUNT) - expect(await token.allowance(wallet.address, other.address)).to.eq(MaxUint256) - expect(await token.balanceOf(wallet.address)).to.eq(TOTAL_SUPPLY.sub(TEST_AMOUNT)) - expect(await token.balanceOf(other.address)).to.eq(TEST_AMOUNT) - }) - - it('permit', async () => { - const nonce = await token.nonces(wallet.address) - const deadline = MaxUint256 - const digest = await getApprovalDigest( - token, - { owner: wallet.address, spender: other.address, value: TEST_AMOUNT }, - nonce, - deadline - ) - - const { v, r, s } = ecsign(Buffer.from(digest.slice(2), 'hex'), Buffer.from(wallet.privateKey.slice(2), 'hex')) - - await expect(token.permit(wallet.address, other.address, TEST_AMOUNT, deadline, v, hexlify(r), hexlify(s))) - .to.emit(token, 'Approval') - .withArgs(wallet.address, other.address, TEST_AMOUNT) - expect(await token.allowance(wallet.address, other.address)).to.eq(TEST_AMOUNT) - expect(await token.nonces(wallet.address)).to.eq(bigNumberify(1)) - }) -}) diff --git a/contract/lib/v2-core/test/UniswapV2Factory.spec.ts b/contract/lib/v2-core/test/UniswapV2Factory.spec.ts deleted file mode 100644 index 432aac3..0000000 --- a/contract/lib/v2-core/test/UniswapV2Factory.spec.ts +++ /dev/null @@ -1,86 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { AddressZero } from 'ethers/constants' -import { bigNumberify } from 'ethers/utils' -import { solidity, MockProvider, createFixtureLoader } from 'ethereum-waffle' - -import { getCreate2Address } from './shared/utilities' -import { factoryFixture } from './shared/fixtures' - -import UniswapV2Pair from '../build/UniswapV2Pair.json' - -chai.use(solidity) - -const TEST_ADDRESSES: [string, string] = [ - '0x1000000000000000000000000000000000000000', - '0x2000000000000000000000000000000000000000' -] - -describe('UniswapV2Factory', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet, other] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet, other]) - - let factory: Contract - beforeEach(async () => { - const fixture = await loadFixture(factoryFixture) - factory = fixture.factory - }) - - it('feeTo, feeToSetter, allPairsLength', async () => { - expect(await factory.feeTo()).to.eq(AddressZero) - expect(await factory.feeToSetter()).to.eq(wallet.address) - expect(await factory.allPairsLength()).to.eq(0) - }) - - async function createPair(tokens: [string, string]) { - const bytecode = `0x${UniswapV2Pair.evm.bytecode.object}` - const create2Address = getCreate2Address(factory.address, tokens, bytecode) - await expect(factory.createPair(...tokens)) - .to.emit(factory, 'PairCreated') - .withArgs(TEST_ADDRESSES[0], TEST_ADDRESSES[1], create2Address, bigNumberify(1)) - - await expect(factory.createPair(...tokens)).to.be.reverted // UniswapV2: PAIR_EXISTS - await expect(factory.createPair(...tokens.slice().reverse())).to.be.reverted // UniswapV2: PAIR_EXISTS - expect(await factory.getPair(...tokens)).to.eq(create2Address) - expect(await factory.getPair(...tokens.slice().reverse())).to.eq(create2Address) - expect(await factory.allPairs(0)).to.eq(create2Address) - expect(await factory.allPairsLength()).to.eq(1) - - const pair = new Contract(create2Address, JSON.stringify(UniswapV2Pair.abi), provider) - expect(await pair.factory()).to.eq(factory.address) - expect(await pair.token0()).to.eq(TEST_ADDRESSES[0]) - expect(await pair.token1()).to.eq(TEST_ADDRESSES[1]) - } - - it('createPair', async () => { - await createPair(TEST_ADDRESSES) - }) - - it('createPair:reverse', async () => { - await createPair(TEST_ADDRESSES.slice().reverse() as [string, string]) - }) - - it('createPair:gas', async () => { - const tx = await factory.createPair(...TEST_ADDRESSES) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq(2512920) - }) - - it('setFeeTo', async () => { - await expect(factory.connect(other).setFeeTo(other.address)).to.be.revertedWith('UniswapV2: FORBIDDEN') - await factory.setFeeTo(wallet.address) - expect(await factory.feeTo()).to.eq(wallet.address) - }) - - it('setFeeToSetter', async () => { - await expect(factory.connect(other).setFeeToSetter(other.address)).to.be.revertedWith('UniswapV2: FORBIDDEN') - await factory.setFeeToSetter(other.address) - expect(await factory.feeToSetter()).to.eq(other.address) - await expect(factory.setFeeToSetter(wallet.address)).to.be.revertedWith('UniswapV2: FORBIDDEN') - }) -}) diff --git a/contract/lib/v2-core/test/UniswapV2Pair.spec.ts b/contract/lib/v2-core/test/UniswapV2Pair.spec.ts deleted file mode 100644 index 93179d1..0000000 --- a/contract/lib/v2-core/test/UniswapV2Pair.spec.ts +++ /dev/null @@ -1,284 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { solidity, MockProvider, createFixtureLoader } from 'ethereum-waffle' -import { BigNumber, bigNumberify } from 'ethers/utils' - -import { expandTo18Decimals, mineBlock, encodePrice } from './shared/utilities' -import { pairFixture } from './shared/fixtures' -import { AddressZero } from 'ethers/constants' - -const MINIMUM_LIQUIDITY = bigNumberify(10).pow(3) - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -describe('UniswapV2Pair', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet, other] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let factory: Contract - let token0: Contract - let token1: Contract - let pair: Contract - beforeEach(async () => { - const fixture = await loadFixture(pairFixture) - factory = fixture.factory - token0 = fixture.token0 - token1 = fixture.token1 - pair = fixture.pair - }) - - it('mint', async () => { - const token0Amount = expandTo18Decimals(1) - const token1Amount = expandTo18Decimals(4) - await token0.transfer(pair.address, token0Amount) - await token1.transfer(pair.address, token1Amount) - - const expectedLiquidity = expandTo18Decimals(2) - await expect(pair.mint(wallet.address, overrides)) - .to.emit(pair, 'Transfer') - .withArgs(AddressZero, AddressZero, MINIMUM_LIQUIDITY) - .to.emit(pair, 'Transfer') - .withArgs(AddressZero, wallet.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(pair, 'Sync') - .withArgs(token0Amount, token1Amount) - .to.emit(pair, 'Mint') - .withArgs(wallet.address, token0Amount, token1Amount) - - expect(await pair.totalSupply()).to.eq(expectedLiquidity) - expect(await pair.balanceOf(wallet.address)).to.eq(expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - expect(await token0.balanceOf(pair.address)).to.eq(token0Amount) - expect(await token1.balanceOf(pair.address)).to.eq(token1Amount) - const reserves = await pair.getReserves() - expect(reserves[0]).to.eq(token0Amount) - expect(reserves[1]).to.eq(token1Amount) - }) - - async function addLiquidity(token0Amount: BigNumber, token1Amount: BigNumber) { - await token0.transfer(pair.address, token0Amount) - await token1.transfer(pair.address, token1Amount) - await pair.mint(wallet.address, overrides) - } - const swapTestCases: BigNumber[][] = [ - [1, 5, 10, '1662497915624478906'], - [1, 10, 5, '453305446940074565'], - - [2, 5, 10, '2851015155847869602'], - [2, 10, 5, '831248957812239453'], - - [1, 10, 10, '906610893880149131'], - [1, 100, 100, '987158034397061298'], - [1, 1000, 1000, '996006981039903216'] - ].map(a => a.map(n => (typeof n === 'string' ? bigNumberify(n) : expandTo18Decimals(n)))) - swapTestCases.forEach((swapTestCase, i) => { - it(`getInputPrice:${i}`, async () => { - const [swapAmount, token0Amount, token1Amount, expectedOutputAmount] = swapTestCase - await addLiquidity(token0Amount, token1Amount) - await token0.transfer(pair.address, swapAmount) - await expect(pair.swap(0, expectedOutputAmount.add(1), wallet.address, '0x', overrides)).to.be.revertedWith( - 'UniswapV2: K' - ) - await pair.swap(0, expectedOutputAmount, wallet.address, '0x', overrides) - }) - }) - - const optimisticTestCases: BigNumber[][] = [ - ['997000000000000000', 5, 10, 1], // given amountIn, amountOut = floor(amountIn * .997) - ['997000000000000000', 10, 5, 1], - ['997000000000000000', 5, 5, 1], - [1, 5, 5, '1003009027081243732'] // given amountOut, amountIn = ceiling(amountOut / .997) - ].map(a => a.map(n => (typeof n === 'string' ? bigNumberify(n) : expandTo18Decimals(n)))) - optimisticTestCases.forEach((optimisticTestCase, i) => { - it(`optimistic:${i}`, async () => { - const [outputAmount, token0Amount, token1Amount, inputAmount] = optimisticTestCase - await addLiquidity(token0Amount, token1Amount) - await token0.transfer(pair.address, inputAmount) - await expect(pair.swap(outputAmount.add(1), 0, wallet.address, '0x', overrides)).to.be.revertedWith( - 'UniswapV2: K' - ) - await pair.swap(outputAmount, 0, wallet.address, '0x', overrides) - }) - }) - - it('swap:token0', async () => { - const token0Amount = expandTo18Decimals(5) - const token1Amount = expandTo18Decimals(10) - await addLiquidity(token0Amount, token1Amount) - - const swapAmount = expandTo18Decimals(1) - const expectedOutputAmount = bigNumberify('1662497915624478906') - await token0.transfer(pair.address, swapAmount) - await expect(pair.swap(0, expectedOutputAmount, wallet.address, '0x', overrides)) - .to.emit(token1, 'Transfer') - .withArgs(pair.address, wallet.address, expectedOutputAmount) - .to.emit(pair, 'Sync') - .withArgs(token0Amount.add(swapAmount), token1Amount.sub(expectedOutputAmount)) - .to.emit(pair, 'Swap') - .withArgs(wallet.address, swapAmount, 0, 0, expectedOutputAmount, wallet.address) - - const reserves = await pair.getReserves() - expect(reserves[0]).to.eq(token0Amount.add(swapAmount)) - expect(reserves[1]).to.eq(token1Amount.sub(expectedOutputAmount)) - expect(await token0.balanceOf(pair.address)).to.eq(token0Amount.add(swapAmount)) - expect(await token1.balanceOf(pair.address)).to.eq(token1Amount.sub(expectedOutputAmount)) - const totalSupplyToken0 = await token0.totalSupply() - const totalSupplyToken1 = await token1.totalSupply() - expect(await token0.balanceOf(wallet.address)).to.eq(totalSupplyToken0.sub(token0Amount).sub(swapAmount)) - expect(await token1.balanceOf(wallet.address)).to.eq(totalSupplyToken1.sub(token1Amount).add(expectedOutputAmount)) - }) - - it('swap:token1', async () => { - const token0Amount = expandTo18Decimals(5) - const token1Amount = expandTo18Decimals(10) - await addLiquidity(token0Amount, token1Amount) - - const swapAmount = expandTo18Decimals(1) - const expectedOutputAmount = bigNumberify('453305446940074565') - await token1.transfer(pair.address, swapAmount) - await expect(pair.swap(expectedOutputAmount, 0, wallet.address, '0x', overrides)) - .to.emit(token0, 'Transfer') - .withArgs(pair.address, wallet.address, expectedOutputAmount) - .to.emit(pair, 'Sync') - .withArgs(token0Amount.sub(expectedOutputAmount), token1Amount.add(swapAmount)) - .to.emit(pair, 'Swap') - .withArgs(wallet.address, 0, swapAmount, expectedOutputAmount, 0, wallet.address) - - const reserves = await pair.getReserves() - expect(reserves[0]).to.eq(token0Amount.sub(expectedOutputAmount)) - expect(reserves[1]).to.eq(token1Amount.add(swapAmount)) - expect(await token0.balanceOf(pair.address)).to.eq(token0Amount.sub(expectedOutputAmount)) - expect(await token1.balanceOf(pair.address)).to.eq(token1Amount.add(swapAmount)) - const totalSupplyToken0 = await token0.totalSupply() - const totalSupplyToken1 = await token1.totalSupply() - expect(await token0.balanceOf(wallet.address)).to.eq(totalSupplyToken0.sub(token0Amount).add(expectedOutputAmount)) - expect(await token1.balanceOf(wallet.address)).to.eq(totalSupplyToken1.sub(token1Amount).sub(swapAmount)) - }) - - it('swap:gas', async () => { - const token0Amount = expandTo18Decimals(5) - const token1Amount = expandTo18Decimals(10) - await addLiquidity(token0Amount, token1Amount) - - // ensure that setting price{0,1}CumulativeLast for the first time doesn't affect our gas math - await mineBlock(provider, (await provider.getBlock('latest')).timestamp + 1) - await pair.sync(overrides) - - const swapAmount = expandTo18Decimals(1) - const expectedOutputAmount = bigNumberify('453305446940074565') - await token1.transfer(pair.address, swapAmount) - await mineBlock(provider, (await provider.getBlock('latest')).timestamp + 1) - const tx = await pair.swap(expectedOutputAmount, 0, wallet.address, '0x', overrides) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq(73462) - }) - - it('burn', async () => { - const token0Amount = expandTo18Decimals(3) - const token1Amount = expandTo18Decimals(3) - await addLiquidity(token0Amount, token1Amount) - - const expectedLiquidity = expandTo18Decimals(3) - await pair.transfer(pair.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - await expect(pair.burn(wallet.address, overrides)) - .to.emit(pair, 'Transfer') - .withArgs(pair.address, AddressZero, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(token0, 'Transfer') - .withArgs(pair.address, wallet.address, token0Amount.sub(1000)) - .to.emit(token1, 'Transfer') - .withArgs(pair.address, wallet.address, token1Amount.sub(1000)) - .to.emit(pair, 'Sync') - .withArgs(1000, 1000) - .to.emit(pair, 'Burn') - .withArgs(wallet.address, token0Amount.sub(1000), token1Amount.sub(1000), wallet.address) - - expect(await pair.balanceOf(wallet.address)).to.eq(0) - expect(await pair.totalSupply()).to.eq(MINIMUM_LIQUIDITY) - expect(await token0.balanceOf(pair.address)).to.eq(1000) - expect(await token1.balanceOf(pair.address)).to.eq(1000) - const totalSupplyToken0 = await token0.totalSupply() - const totalSupplyToken1 = await token1.totalSupply() - expect(await token0.balanceOf(wallet.address)).to.eq(totalSupplyToken0.sub(1000)) - expect(await token1.balanceOf(wallet.address)).to.eq(totalSupplyToken1.sub(1000)) - }) - - it('price{0,1}CumulativeLast', async () => { - const token0Amount = expandTo18Decimals(3) - const token1Amount = expandTo18Decimals(3) - await addLiquidity(token0Amount, token1Amount) - - const blockTimestamp = (await pair.getReserves())[2] - await mineBlock(provider, blockTimestamp + 1) - await pair.sync(overrides) - - const initialPrice = encodePrice(token0Amount, token1Amount) - expect(await pair.price0CumulativeLast()).to.eq(initialPrice[0]) - expect(await pair.price1CumulativeLast()).to.eq(initialPrice[1]) - expect((await pair.getReserves())[2]).to.eq(blockTimestamp + 1) - - const swapAmount = expandTo18Decimals(3) - await token0.transfer(pair.address, swapAmount) - await mineBlock(provider, blockTimestamp + 10) - // swap to a new price eagerly instead of syncing - await pair.swap(0, expandTo18Decimals(1), wallet.address, '0x', overrides) // make the price nice - - expect(await pair.price0CumulativeLast()).to.eq(initialPrice[0].mul(10)) - expect(await pair.price1CumulativeLast()).to.eq(initialPrice[1].mul(10)) - expect((await pair.getReserves())[2]).to.eq(blockTimestamp + 10) - - await mineBlock(provider, blockTimestamp + 20) - await pair.sync(overrides) - - const newPrice = encodePrice(expandTo18Decimals(6), expandTo18Decimals(2)) - expect(await pair.price0CumulativeLast()).to.eq(initialPrice[0].mul(10).add(newPrice[0].mul(10))) - expect(await pair.price1CumulativeLast()).to.eq(initialPrice[1].mul(10).add(newPrice[1].mul(10))) - expect((await pair.getReserves())[2]).to.eq(blockTimestamp + 20) - }) - - it('feeTo:off', async () => { - const token0Amount = expandTo18Decimals(1000) - const token1Amount = expandTo18Decimals(1000) - await addLiquidity(token0Amount, token1Amount) - - const swapAmount = expandTo18Decimals(1) - const expectedOutputAmount = bigNumberify('996006981039903216') - await token1.transfer(pair.address, swapAmount) - await pair.swap(expectedOutputAmount, 0, wallet.address, '0x', overrides) - - const expectedLiquidity = expandTo18Decimals(1000) - await pair.transfer(pair.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - await pair.burn(wallet.address, overrides) - expect(await pair.totalSupply()).to.eq(MINIMUM_LIQUIDITY) - }) - - it('feeTo:on', async () => { - await factory.setFeeTo(other.address) - - const token0Amount = expandTo18Decimals(1000) - const token1Amount = expandTo18Decimals(1000) - await addLiquidity(token0Amount, token1Amount) - - const swapAmount = expandTo18Decimals(1) - const expectedOutputAmount = bigNumberify('996006981039903216') - await token1.transfer(pair.address, swapAmount) - await pair.swap(expectedOutputAmount, 0, wallet.address, '0x', overrides) - - const expectedLiquidity = expandTo18Decimals(1000) - await pair.transfer(pair.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - await pair.burn(wallet.address, overrides) - expect(await pair.totalSupply()).to.eq(MINIMUM_LIQUIDITY.add('249750499251388')) - expect(await pair.balanceOf(other.address)).to.eq('249750499251388') - - // using 1000 here instead of the symbolic MINIMUM_LIQUIDITY because the amounts only happen to be equal... - // ...because the initial liquidity amounts were equal - expect(await token0.balanceOf(pair.address)).to.eq(bigNumberify(1000).add('249501683697445')) - expect(await token1.balanceOf(pair.address)).to.eq(bigNumberify(1000).add('250000187312969')) - }) -}) diff --git a/contract/lib/v2-core/test/shared/fixtures.ts b/contract/lib/v2-core/test/shared/fixtures.ts deleted file mode 100644 index 8cca572..0000000 --- a/contract/lib/v2-core/test/shared/fixtures.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Contract, Wallet } from 'ethers' -import { Web3Provider } from 'ethers/providers' -import { deployContract } from 'ethereum-waffle' - -import { expandTo18Decimals } from './utilities' - -import ERC20 from '../../build/ERC20.json' -import UniswapV2Factory from '../../build/UniswapV2Factory.json' -import UniswapV2Pair from '../../build/UniswapV2Pair.json' - -interface FactoryFixture { - factory: Contract -} - -const overrides = { - gasLimit: 9999999 -} - -export async function factoryFixture(_: Web3Provider, [wallet]: Wallet[]): Promise { - const factory = await deployContract(wallet, UniswapV2Factory, [wallet.address], overrides) - return { factory } -} - -interface PairFixture extends FactoryFixture { - token0: Contract - token1: Contract - pair: Contract -} - -export async function pairFixture(provider: Web3Provider, [wallet]: Wallet[]): Promise { - const { factory } = await factoryFixture(provider, [wallet]) - - const tokenA = await deployContract(wallet, ERC20, [expandTo18Decimals(10000)], overrides) - const tokenB = await deployContract(wallet, ERC20, [expandTo18Decimals(10000)], overrides) - - await factory.createPair(tokenA.address, tokenB.address, overrides) - const pairAddress = await factory.getPair(tokenA.address, tokenB.address) - const pair = new Contract(pairAddress, JSON.stringify(UniswapV2Pair.abi), provider).connect(wallet) - - const token0Address = (await pair.token0()).address - const token0 = tokenA.address === token0Address ? tokenA : tokenB - const token1 = tokenA.address === token0Address ? tokenB : tokenA - - return { factory, token0, token1, pair } -} diff --git a/contract/lib/v2-core/test/shared/utilities.ts b/contract/lib/v2-core/test/shared/utilities.ts deleted file mode 100644 index 8111516..0000000 --- a/contract/lib/v2-core/test/shared/utilities.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { Contract } from 'ethers' -import { Web3Provider } from 'ethers/providers' -import { - BigNumber, - bigNumberify, - getAddress, - keccak256, - defaultAbiCoder, - toUtf8Bytes, - solidityPack -} from 'ethers/utils' - -const PERMIT_TYPEHASH = keccak256( - toUtf8Bytes('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)') -) - -export function expandTo18Decimals(n: number): BigNumber { - return bigNumberify(n).mul(bigNumberify(10).pow(18)) -} - -function getDomainSeparator(name: string, tokenAddress: string) { - return keccak256( - defaultAbiCoder.encode( - ['bytes32', 'bytes32', 'bytes32', 'uint256', 'address'], - [ - keccak256(toUtf8Bytes('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)')), - keccak256(toUtf8Bytes(name)), - keccak256(toUtf8Bytes('1')), - 1, - tokenAddress - ] - ) - ) -} - -export function getCreate2Address( - factoryAddress: string, - [tokenA, tokenB]: [string, string], - bytecode: string -): string { - const [token0, token1] = tokenA < tokenB ? [tokenA, tokenB] : [tokenB, tokenA] - const create2Inputs = [ - '0xff', - factoryAddress, - keccak256(solidityPack(['address', 'address'], [token0, token1])), - keccak256(bytecode) - ] - const sanitizedInputs = `0x${create2Inputs.map(i => i.slice(2)).join('')}` - return getAddress(`0x${keccak256(sanitizedInputs).slice(-40)}`) -} - -export async function getApprovalDigest( - token: Contract, - approve: { - owner: string - spender: string - value: BigNumber - }, - nonce: BigNumber, - deadline: BigNumber -): Promise { - const name = await token.name() - const DOMAIN_SEPARATOR = getDomainSeparator(name, token.address) - return keccak256( - solidityPack( - ['bytes1', 'bytes1', 'bytes32', 'bytes32'], - [ - '0x19', - '0x01', - DOMAIN_SEPARATOR, - keccak256( - defaultAbiCoder.encode( - ['bytes32', 'address', 'address', 'uint256', 'uint256', 'uint256'], - [PERMIT_TYPEHASH, approve.owner, approve.spender, approve.value, nonce, deadline] - ) - ) - ] - ) - ) -} - -export async function mineBlock(provider: Web3Provider, timestamp: number): Promise { - await new Promise(async (resolve, reject) => { - ;(provider._web3Provider.sendAsync as any)( - { jsonrpc: '2.0', method: 'evm_mine', params: [timestamp] }, - (error: any, result: any): void => { - if (error) { - reject(error) - } else { - resolve(result) - } - } - ) - }) -} - -export function encodePrice(reserve0: BigNumber, reserve1: BigNumber) { - return [reserve1.mul(bigNumberify(2).pow(112)).div(reserve0), reserve0.mul(bigNumberify(2).pow(112)).div(reserve1)] -} diff --git a/contract/lib/v2-core/tsconfig.json b/contract/lib/v2-core/tsconfig.json deleted file mode 100644 index 13ad6fe..0000000 --- a/contract/lib/v2-core/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "module": "commonjs", - "strict": true, - "esModuleInterop": true, - "resolveJsonModule": true - } -} diff --git a/contract/lib/v2-core/yarn.lock b/contract/lib/v2-core/yarn.lock deleted file mode 100644 index 479002b..0000000 --- a/contract/lib/v2-core/yarn.lock +++ /dev/null @@ -1,7195 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@ethereum-waffle/chai@^2.4.1": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/chai/-/chai-2.4.1.tgz#47a6cc2eebaca775b169b524a6dc0cfcf3d3c22d" - integrity sha512-EMH8UtwhsSaCeUIlH72JPaUGhYTIeHJW0aVSM9EXKh0SMNJpptaHCz5dFpjoRwvhtVwOynuCc7SpFXMq7p8T0A== - dependencies: - ethers "^4.0.45" - -"@ethereum-waffle/compiler@^2.4.1": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/compiler/-/compiler-2.4.1.tgz#8a1f0b4c5be8e22408a391944d3ecc7fc92e49a5" - integrity sha512-f+o79gKFzXaan2IOvjYRFlnR2ae3bzDET6otiH9N27hYUx5w0AQRNDkQEpVcS+sjUL9WV6ZzcFlXcVsM6144fg== - dependencies: - "@resolver-engine/imports" "^0.3.3" - "@resolver-engine/imports-fs" "^0.3.3" - "@types/mkdirp" "^0.5.2" - "@types/node-fetch" "^2.5.5" - mkdirp "^0.5.1" - node-fetch "^2.6.0" - solc "^0.6.3" - -"@ethereum-waffle/provider@^2.4.1": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/provider/-/provider-2.4.1.tgz#5480be31f9c655864e3eede374759973d20947ef" - integrity sha512-OhRQfQlR6BsgGUEaeeaQXztbRQ0v/AmwEdmWHmBwJN6NX/FjLmOTIyF3LBWBFHH4K5GgSCDhFs6w5Khz+ojRKg== - dependencies: - ethers "^4.0.45" - ganache-core "^2.10.2" - -"@resolver-engine/core@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967" - integrity sha512-eB8nEbKDJJBi5p5SrvrvILn4a0h42bKtbCTri3ZxCGt6UvoQyp7HnGOfki944bUjBSHKK3RvgfViHn+kqdXtnQ== - dependencies: - debug "^3.1.0" - is-url "^1.2.4" - request "^2.85.0" - -"@resolver-engine/fs@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/fs/-/fs-0.3.3.tgz#fbf83fa0c4f60154a82c817d2fe3f3b0c049a973" - integrity sha512-wQ9RhPUcny02Wm0IuJwYMyAG8fXVeKdmhm8xizNByD4ryZlx6PP6kRen+t/haF43cMfmaV7T3Cx6ChOdHEhFUQ== - dependencies: - "@resolver-engine/core" "^0.3.3" - debug "^3.1.0" - -"@resolver-engine/imports-fs@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/imports-fs/-/imports-fs-0.3.3.tgz#4085db4b8d3c03feb7a425fbfcf5325c0d1e6c1b" - integrity sha512-7Pjg/ZAZtxpeyCFlZR5zqYkz+Wdo84ugB5LApwriT8XFeQoLwGUj4tZFFvvCuxaNCcqZzCYbonJgmGObYBzyCA== - dependencies: - "@resolver-engine/fs" "^0.3.3" - "@resolver-engine/imports" "^0.3.3" - debug "^3.1.0" - -"@resolver-engine/imports@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/imports/-/imports-0.3.3.tgz#badfb513bb3ff3c1ee9fd56073e3144245588bcc" - integrity sha512-anHpS4wN4sRMwsAbMXhMfOD/y4a4Oo0Cw/5+rue7hSwGWsDOQaAU1ClK1OxjUC35/peazxEl8JaSRRS+Xb8t3Q== - dependencies: - "@resolver-engine/core" "^0.3.3" - debug "^3.1.0" - hosted-git-info "^2.6.0" - path-browserify "^1.0.0" - url "^0.11.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" - -"@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": - 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.6": - version "4.2.7" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.7.tgz#1c8c25cbf6e59ffa7d6b9652c78e547d9a41692d" - integrity sha512-luq8meHGYwvky0O7u0eQZdA7B4Wd9owUCqvbw2m3XCrCU8mplYOujMBbvyS547AxJkC+pGnd0Cm15eNxEUNU8g== - -"@types/mkdirp@^0.5.2": - version "0.5.2" - resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" - integrity sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg== - dependencies: - "@types/node" "*" - -"@types/mocha@^5.2.7": - version "5.2.7" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea" - integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ== - -"@types/node-fetch@^2.5.5": - version "2.5.6" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.6.tgz#df8377a66e64ddf75b65b072e37b3c5c5425a96f" - integrity sha512-2w0NTwMWF1d3NJMK0Uiq2UNN8htVCyOWOD0jIPjPgC5Ph/YP4dVhs9YxxcMcuLuwAslz0dVEcZQUaqkLs3IzOQ== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - -"@types/node@*": - version "13.11.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.11.1.tgz#49a2a83df9d26daacead30d0ccc8762b128d53c7" - integrity sha512-eWQGP3qtxwL8FGneRrC5DwrJLGN4/dH1clNTuLfN81HCrxVtxRjygDTUoZJ5ASlDEeo0ppYFQjQIlXhtXpOn6g== - -"@types/node@^10.12.18", "@types/node@^10.3.2": - version "10.17.19" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.19.tgz#1d31ddd5503dba2af7a901aafef3392e4955620e" - integrity sha512-46/xThm3zvvc9t9/7M3AaLEqtOpqlYYYcCZbpYVAQHG20+oMZBkae/VMrn4BTi6AJ8cpack0mEXhGiKmDNbLrQ== - -"@types/node@^12.6.1": - version "12.12.35" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.35.tgz#1e61b226c14380f4384f70cfe49a65c2c553ad2b" - integrity sha512-ASYsaKecA7TUsDrqIGPNk3JeEox0z/0XR/WsJJ8BIX/9+SkMSImQXKWfU/yBrSyc7ZSE/NPqLu36Nur0miCFfQ== - -"@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" - -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.5.5: - version "6.12.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" - integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== - 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-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-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" - -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.2" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.2.tgz#e70c90579e02c63d80e3ad4e31d8bfdb8bd50064" - integrity sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg== - -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@^4.0.0: - version "4.10.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" - integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.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.9.1" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e" - integrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug== - -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: - 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.0.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" - integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== - -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@*: - version "9.0.0" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.0.tgz#805880f84a329b5eac6e7cb6f8274b6d82bdf075" - integrity sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A== - -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== - -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" - -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.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" - integrity sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA== - dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" - -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, bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, 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.4.0, bn.js@^4.8.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== - -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" - -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: - 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: - version "4.0.1" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" - integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= - dependencies: - bn.js "^4.1.0" - randombytes "^2.0.1" - -browserify-sha3@^0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/browserify-sha3/-/browserify-sha3-0.0.4.tgz#086c47b8c82316c9d47022c26185954576dd8e26" - integrity sha1-CGxHuMgjFsnUcCLCYYWVRXbdjiY= - dependencies: - js-sha3 "^0.6.1" - safe-buffer "^5.1.1" - -browserify-sign@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" - integrity sha1-qk62jl17ZYuqa/alfmMMvXqT0pg= - dependencies: - bn.js "^4.1.1" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.2" - elliptic "^6.0.0" - inherits "^2.0.1" - parse-asn1 "^5.0.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@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/bs58/-/bs58-2.0.1.tgz#55908d58f1982aba2008fa1bed8f91998a29bf8d" - integrity sha1-VZCNWPGYKrogCPob7Y+RmYopv40= - -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@^5.0.5, buffer@^5.2.1: - version "5.6.0" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.0.tgz#a31749dc7d81d84db08abf937b6b8c4033f62786" - integrity sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - -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" - -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.30001041" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001041.tgz#c2ea138dafc6fe03877921ddcddd4a02a14daf76" - integrity sha512-fqDtRCApddNrQuBxBS7kEiSGdBsgO4wiVw4G/IClfqzfhW45MbTumfN4cuUJGTM0YGFNn97DCXPJ683PS6zwvA== - -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.1: - 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" - -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@^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== - -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-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= - -coinstring@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/coinstring/-/coinstring-2.3.0.tgz#cdb63363a961502404a25afb82c2e26d5ff627a4" - integrity sha1-zbYzY6lhUCQEolr7gsLibV/2J6Q= - dependencies: - bs58 "^2.0.1" - create-hash "^1.1.1" - -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-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-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" - -command-exists@^1.2.8: - version "1.2.8" - resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.8.tgz#715acefdd1223b9c9b37110a149c6392c2852291" - integrity sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw== - -commander@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" - integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== - -commander@~2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4" - integrity sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ= - dependencies: - graceful-readlink ">= 1.0.0" - -component-emitter@^1.2.1: - 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-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: - 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.6.5" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.6.5.tgz#c79e75f5e38dbc85a662d91eea52b8256d53b813" - integrity sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA== - -core-js@^2.4.0, core-js@^2.5.0: - version "2.6.11" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" - integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== - -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.3" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" - integrity sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw== - dependencies: - bn.js "^4.1.0" - elliptic "^6.0.0" - -create-hash@^1.1.0, create-hash@^1.1.1, 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.2, create-hmac@^1.1.4: - 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" - -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" - -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" - -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.2.6, debug@^3.1.0: - 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" - -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@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== - -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.406" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.406.tgz#d4b8f8c9f7405dddbbb646d6b15042cd7c1e6e61" - integrity sha512-bx8vBZoEbhsMmwEZIj2twzfhFoKKZlSLQiENhqgc5/FdAj4/UHEzAri42OTSFA5+0agLR03ReTvIms2dfZ7/Ew== - -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.2, elliptic@^6.0.0, elliptic@^6.4.0, elliptic@^6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762" - integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw== - 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.12" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" - integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s= - dependencies: - iconv-lite "~0.4.13" - -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, es-abstract@^1.17.5: - version "1.17.5" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.5.tgz#d8c9d1d66c8981fb9200e2251d799eee92774ae9" - integrity sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.1.5" - is-regex "^1.0.5" - object-inspect "^1.7.0" - object-keys "^1.1.1" - object.assign "^4.1.0" - string.prototype.trimleft "^2.1.1" - string.prototype.trimright "^2.1.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= - -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.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-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.7" - resolved "https://registry.yarnpkg.com/ethashjs/-/ethashjs-0.0.7.tgz#30bfe4196726690a0c59d3b8272e70d4d0c34bae" - integrity sha1-ML/kGWcmaQoMWdO4Jy5w1NDDS64= - dependencies: - async "^1.4.2" - buffer-xor "^1.0.3" - ethereumjs-util "^4.0.1" - 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-waffle@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-2.4.1.tgz#db13376d5d366a0b3e8813cb64956a4682cbe144" - integrity sha512-52HOubO/V80LDGN+N3FVb6yBq8L5vV2+kP7wjR5AgDoEeQHIrwqumcjJ22tE+FvzR8+eHTh3ItXjQPqJrMp+Mw== - dependencies: - "@ethereum-waffle/chai" "^2.4.1" - "@ethereum-waffle/compiler" "^2.4.1" - "@ethereum-waffle/provider" "^2.4.1" - ethers "^4.0.45" - -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@git+https://github.com/ethereumjs/ethereumjs-abi.git": - version "0.6.8" - resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#1cfbb13862f90f0b391d8a699544d5fe4dfb8c7b" - 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.3" - resolved "https://registry.yarnpkg.com/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.3.tgz#e013034633a30ad2006728e8e2b21956b267b773" - integrity sha512-0nJWbyA+Gu0ZKZr/cywMtB/77aS/4lOVsIKbgUN2sFQYscXO5rPbUfrEe7G2Zhjp86/a0VqLllemDSTHvx3vZA== - 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, ethereumjs-common@^1.1.0, ethereumjs-common@^1.3.2, 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-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.2.0, ethereumjs-util@^6.0.0, 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@^4.0.1, ethereumjs-util@^4.3.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz#3e9428b317eebda3d7260d854fddda954b1f1bc6" - integrity sha1-PpQosxfuvaPXJg2FT93alUsfG8Y= - dependencies: - bn.js "^4.8.0" - create-hash "^1.1.2" - keccakjs "^0.2.0" - rlp "^2.0.0" - secp256k1 "^3.0.1" - -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: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz#3e0c0d1741471acf1036052d048623dee54ad642" - integrity sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA== - dependencies: - bn.js "^4.11.0" - create-hash "^1.1.2" - ethjs-util "^0.1.3" - keccak "^1.0.2" - rlp "^2.0.0" - safe-buffer "^5.1.1" - secp256k1 "^3.0.1" - -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-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@^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" - -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" - -ethers@^4.0.45: - version "4.0.46" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.46.tgz#13cd3ed099487f43ece00194b89a8a8781f71507" - integrity sha512-/dPMzzpInhtiip4hKFvsDiJKeRk64IhyA+Po7CtNXneQFSOCYXg8eBFt+jXbxUQyApgWnWOtYxWdfn9+CvvxDA== - dependencies: - aes-js "3.0.0" - bn.js "^4.4.0" - elliptic "6.5.2" - hash.js "1.1.3" - js-sha3 "0.5.7" - scrypt-js "2.0.4" - 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== - -events@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.1.0.tgz#84279af1b34cb75aa88bf5ff291f6d0bd9b31a59" - integrity sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg== - -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" - -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" - -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.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" - integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== - -fast-json-stable-stringify@^2.0.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== - -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" - -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" - -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.0" - resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.0.tgz#090bec8b05e39cba309747f1d588f04dbaf98db2" - integrity sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw== - 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" - -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@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - path-is-absolute "^1.0.0" - rimraf "^2.2.8" - -fs-extra@^4.0.2: - 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-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.12" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.12.tgz#db7e0d8ec3b0b45724fd4d83d43554a8f1f0de5c" - integrity sha512-Ggd/Ktt7E7I8pxZRbGIs7vwqAPscSESMrCSkx2FtWeqmheJgCo2R74fTsZFCifr0VTPwqRpPv17+6b8Zp7th0Q== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" - -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-core@^2.10.2: - version "2.10.2" - resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.10.2.tgz#17c171c6c0195b6734a0dd741a9d2afd4f74e292" - integrity sha512-4XEO0VsqQ1+OW7Za5fQs9/Kk7o8M0T1sRfFSF8h9NeJ2ABaqMO5waqxf567ZMcSkRKaTjUucBSz83xNfZv1HDg== - 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.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" - lodash "4.17.14" - merkle-patricia-tree "2.3.2" - seedrandom "3.0.1" - source-map-support "0.5.12" - tmp "0.1.0" - web3-provider-engine "14.2.1" - websocket "1.0.29" - optionalDependencies: - ethereumjs-wallet "0.6.3" - web3 "1.2.4" - -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-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.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.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9" - integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw== - 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-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.3" - resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-5.0.3.tgz#88a8abf1c4d131eb93928994bc4a593c2e5dd626" - integrity sha512-8tWsULNEPHKQ2MR4zXuzSmqbdyV5PtwwCaWSGQ1WwHsJ07ilNeN1JB8ntxhckbnpSHaf9dXFUHzIWvm1I13dsg== - 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" - object.defaults "^1.1.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.3.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" - integrity sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8= - dependencies: - min-document "^2.19.0" - process "~0.5.1" - -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.1.9: - version "4.2.3" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" - integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== - -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU= - -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.2.0" - resolved "https://registry.yarnpkg.com/gulp-cli/-/gulp-cli-2.2.0.tgz#5533126eeb7fe415a7e3e84a297d334d5cf70ebc" - integrity sha512-rGs3bVYHdyJpLqR0TUBnlcZ1O5O++Zs4bA0ajm+zr3WFCfiSLjGwoCBqFs18wzN+ZxahT9DkOK5nDf26iDsWjA== - 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.1.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.0.1" - 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.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" - integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== - dependencies: - ajv "^6.5.5" - 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-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.0.4" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" - integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -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: - 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.1" - resolved "https://registry.yarnpkg.com/hdkey/-/hdkey-1.1.1.tgz#c2b3bfd5883ff9529b72f2f08b28be0972a9f64a" - integrity sha512-DvHZ5OuavsfWs5yfVJZestsnc3wzPvLWNk6c2nRUfo6X+OtxypGt20vDDf7Ba+MJzjL3KS1og2nw2eBbLCOUTA== - dependencies: - coinstring "^2.0.0" - safe-buffer "^5.1.1" - secp256k1 "^3.0.1" - -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, hosted-git-info@^2.6.0: - 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, iconv-lite@~0.4.13: - 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" - -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.4: - version "1.1.13" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" - integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== - -immediate@^3.2.3, 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.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== - -interpret@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" - integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== - -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= - -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.0.4" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.0.4.tgz#3faf966c7cba0ff437fb31f6250082fcf0448cf3" - integrity sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA== - -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-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.4" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.4.tgz#3e572f23c8411a5cfd9557c849e3665e0b290623" - integrity sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A== - -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" - integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== - -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.1" - resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" - integrity sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU= - -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: - 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-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-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" - integrity sha1-iVJojF7C/9awPsyF52ngKQMINHA= - -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.0.5, 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-url@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" - integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww== - -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" - -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, 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-sha3@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.6.1.tgz#5b89f77a7477679877f58c4a075240934b1f95c0" - integrity sha1-W4n3enR3Z5h39YxKB1JAk0sflcA= - -"js-tokens@^3.0.0 || ^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@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= - optionalDependencies: - graceful-fs "^4.1.6" - -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@^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" - -keccakjs@^0.2.0: - version "0.2.3" - resolved "https://registry.yarnpkg.com/keccakjs/-/keccakjs-0.2.3.tgz#5e4e969ce39689a3861f445d7752ee3477f9fe72" - integrity sha512-BjLkNDcfaZ6l8HBG9tH0tpmDv3sS2mA7FNQxFHpCdzP3Gb2MVruXBSuoM66SnVxKJpAr5dKGdkHD+bDokt8fTg== - dependencies: - browserify-sha3 "^0.0.4" - sha3 "^1.2.2" - -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@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= - optionalDependencies: - graceful-fs "^4.1.9" - -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" - -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.1" - resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-9.0.1.tgz#042f4aa85e56d4328ace368c950811ba802b7247" - integrity sha512-ajFP0kJ+nyq4i6kptSM+mAvJKLOg1X5FiFPtLG9M5gCEZyBmgDi3FkDrvlMkEzrUn1cWxtvVmrvoS4ASyO/q+Q== - -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" - -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" - -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.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== - -log-symbols@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== - dependencies: - chalk "^2.0.1" - -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@^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" - -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" - -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.5" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" - integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== - -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-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= - -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" - -memorystream@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" - integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= - -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" - -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" - -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.43.0: - version "1.43.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" - integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ== - -mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.26" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06" - integrity sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ== - dependencies: - mime-db "1.43.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== - -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.5, minimist@~1.2.0: - 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.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@^6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.2.2.tgz#5d8987e28940caf8957a7d7664b910dc5b2fea20" - integrity sha512-FgDS9Re79yU1xz5d+C4rv1G7QagNGHZ+iXF81hO8zY35YZZcLEsJVfFolfsqKFWunATEvNzMK0r/CwWd/szO9A== - dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - 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 "2.2.0" - minimatch "3.0.4" - mkdirp "0.5.1" - ms "2.1.1" - node-environment-flags "1.0.5" - 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.0" - yargs-parser "13.1.1" - yargs-unparser "1.6.0" - -mock-fs@^4.1.0: - version "4.11.0" - resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.11.0.tgz#0828107e4b843a6ba855ecebfe3c6e073b69db92" - integrity sha512-Yp4o3/ZA15wsXqJTT+R+9w2AYIkD1i80Lds47wDbuUhOvQvm+O2EfjFZSz0pMgZZSPHRhGxgcd2+GL4+jZMtdw== - -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.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -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.13.2: - version "2.13.2" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7" - integrity sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw== - -nan@^2.0.8, nan@^2.11.0, nan@^2.12.1, nan@^2.14.0, nan@^2.2.1: - version "2.14.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" - integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== - -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= - -node-environment-flags@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.5.tgz#fa930275f5bf5dae188d6192b24b4c8bbac3d76a" - integrity sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ== - 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@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" - integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== - -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" - -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: - 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" - -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.7.0, 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.2" - resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.2.tgz#c5d2e87ff9e119f78b7a088441519e2eec1573b6" - integrity sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" - -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, object.assign@^4.0.4, 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.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.0" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" - integrity sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.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" - -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-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-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-limit@^2.0.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.2.tgz#61279b67721f5287aa1c13a9a7fbbc48c9291b1e" - integrity sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ== - 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: - version "5.1.5" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.5.tgz#003271343da58dc94cace494faef3d2147ecea0e" - integrity sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ== - dependencies: - asn1.js "^4.0.0" - browserify-aes "^1.0.0" - create-hash "^1.1.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= - -path-browserify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - -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-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.3, pbkdf2@^3.0.9: - version "3.0.17" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" - integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== - 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= - -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= - -prettier@^1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== - -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.5.1: - version "0.5.2" - resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" - integrity sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8= - -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@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= - -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.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" - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= - -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" - -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.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@~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" - -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.0" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" - integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== - -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.0" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" - integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= - -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-from-string@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -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, resolve@~1.15.1: - version "1.15.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" - integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== - 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.2.8, 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" - -rimraf@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.0.tgz#614176d4b3010b75e5c390eb0ee96f6dc0cebb9b" - integrity sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg== - 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: - version "2.2.4" - resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.4.tgz#d6b0e1659e9285fc509a5d169a9bd06f704951c1" - integrity sha512-fdq2yYCWpAQBhwkZv+Z8o/Z4sPmYm1CUq6P7n6lVTOdb949CnqA0sndXal5C1NleSVSZm6q5F3iEbauyVln/iw== - 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== - -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: - version "5.2.0" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" - integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== - -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.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@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16" - integrity sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw== - -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" - -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.5" - resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc" - integrity sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w= - 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.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" - -sha3@^1.2.2: - version "1.2.6" - resolved "https://registry.yarnpkg.com/sha3/-/sha3-1.2.6.tgz#102aa3e47dc793e2357902c3cce8760822f9e905" - integrity sha512-KgLGmJGrmNB4JWVsAV11Yk6KbvsAiygWJc7t5IebWva/0NukNrjJqhtKhzy3Eiv2AKuGvhZZt7dt1mDo7HkoiQ== - dependencies: - nan "2.13.2" - -simple-concat@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" - integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY= - -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= - -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" - -solc@0.5.16: - version "0.5.16" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.5.16.tgz#6c8d710a3792ccc79db924606b558a1149b1c603" - integrity sha512-weEtRtisJyf+8UjELs7S4ST1KK7UIq6SRB7tpprfJBL9b5mTrZAT7m4gJKi2h6MiBpuSWfnraK8BnkyWzuTMRA== - dependencies: - command-exists "^1.2.8" - commander "3.0.2" - fs-extra "^0.30.0" - js-sha3 "0.8.0" - memorystream "^0.3.1" - require-from-string "^2.0.0" - semver "^5.5.0" - tmp "0.0.33" - -solc@^0.6.3: - version "0.6.6" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.6.6.tgz#0d4b9c2e7105dd6015583f5e1c5ba6a35861ea71" - integrity sha512-p0IO/1fRaHWKN+qR+mUivpwnBpFYD8EoFAzT8VL4lmllNwsyEO7TJJAc2QK0XUeWOYOT92NWKhDNNNLTVbHShA== - dependencies: - command-exists "^1.2.8" - commander "3.0.2" - fs-extra "^0.30.0" - js-sha3 "0.8.0" - memorystream "^0.3.1" - require-from-string "^2.0.0" - semver "^5.5.0" - tmp "0.0.33" - -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.6: - version "0.5.16" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" - integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== - 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.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" - integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" - integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== - -spdx-expression-parse@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.5" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" - integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== - -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= - -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.1" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.1.tgz#141233dff32c82bfad80684d7e5f0869ee0fb782" - integrity sha512-MjGFEeqixw47dAMFMtgUro/I0+wNqZB5GKXGt1fFr24u3TzDXCPu7J9Buppzoe3r/LqkSDLDDJzE15RGWDGAVw== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - function-bind "^1.1.1" - -string.prototype.trimend@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz#85812a6b847ac002270f5808146064c995fb6913" - integrity sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" - -string.prototype.trimleft@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz#4408aa2e5d6ddd0c9a80739b087fbc067c03b3cc" - integrity sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" - string.prototype.trimstart "^1.0.0" - -string.prototype.trimright@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz#c76f1cef30f21bbad8afeb8db1511496cfb0f2a3" - integrity sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" - string.prototype.trimend "^1.0.0" - -string.prototype.trimstart@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz#14af6d9f34b053f7cfc89b72f8f2ee14b9039a54" - integrity sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" - -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-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= - -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" - -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" - -tape@^4.6.3: - version "4.13.2" - resolved "https://registry.yarnpkg.com/tape/-/tape-4.13.2.tgz#eb419b9d9bc004025b1a81a5b63093e07f425629" - integrity sha512-waWwC/OqYVE9TS6r1IynlP2sEdk4Lfo6jazlgkuNkPTHIbuG2BTABIaKdlQWwPeB6Oo4ksZ1j33Yt0NTOAlYMQ== - 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.0" - object-inspect "~1.7.0" - resolve "~1.15.1" - 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.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" - -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" - -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@^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= - -ts-node@^8.5.4: - version "8.6.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.6.2.tgz#7419a01391a818fbafa6f826a33c1a13e9464e35" - integrity sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg== - dependencies: - arg "^4.1.0" - diff "^4.0.1" - make-error "^1.1.1" - source-map-support "^0.5.6" - yn "3.1.1" - -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.0.0" - resolved "https://registry.yarnpkg.com/type/-/type-2.0.0.tgz#5f16ff6ef2eb44f260494dae271033b29c09a9c3" - integrity sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow== - -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@^3.7.3: - version "3.7.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" - integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== - -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.1" - resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.4.1.tgz#151b104af853df3efdaa135d8b1eca850a44b426" - integrity sha512-sgDYfSDPMsA4Hr2/w7vOlrJBlwzmyakk1+hW8ObLvxSp0LA36LcL2XItGvOT3OSblohSdevMuT8FQjLsqyy4sA== - 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.2.1" - resolved "https://registry.yarnpkg.com/undertaker/-/undertaker-1.2.1.tgz#701662ff8ce358715324dfd492a4f036055dfe4b" - integrity sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA== - 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" - 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.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== - 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= - -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= - dependencies: - punycode "1.3.2" - querystring "0.2.0" - -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== - -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: - 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.0.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.1.3.tgz#fc9dc23521ca20c5433f81cc4eb9b3033bb105d8" - integrity sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w== - 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= - -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.0" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.2.0.tgz#d85b07da96e458d25b2ffe19fece9f2caa13ed86" - integrity sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg== - 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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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" - -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: - 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.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: - 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.5.0" - resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.5.0.tgz#bed8d1676d5ca36108667692b74b316c496e49dd" - integrity sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ== - dependencies: - global "~4.3.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.0" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" - integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== - -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.1, yargs-parser@^13.1.1: - version "13.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" - integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-parser@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" - integrity sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo= - dependencies: - camelcase "^3.0.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.3.0, yargs@^13.3.0: - version "13.3.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" - integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== - 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.1" - -yargs@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" - integrity sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg= - 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" - -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== diff --git a/contract/lib/v2-periphery b/contract/lib/v2-periphery new file mode 160000 index 0000000..0335e8f --- /dev/null +++ b/contract/lib/v2-periphery @@ -0,0 +1 @@ +Subproject commit 0335e8f7e1bd1e8d8329fd300aea2ef2f36dd19f diff --git a/contract/lib/v2-periphery/.gitattributes b/contract/lib/v2-periphery/.gitattributes deleted file mode 100644 index 7cc88f0..0000000 --- a/contract/lib/v2-periphery/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.sol linguist-language=Solidity \ No newline at end of file diff --git a/contract/lib/v2-periphery/.github/stale.yml b/contract/lib/v2-periphery/.github/stale.yml deleted file mode 100644 index 91b9bf5..0000000 --- a/contract/lib/v2-periphery/.github/stale.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -issues: - # Number of days of inactivity before an Issue or Pull Request becomes stale - daysUntilStale: 7 - - # Number of days of inactivity before an Issue or Pull Request with the stale label is closed. - # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. - daysUntilClose: 7 - - # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) - onlyLabels: - - question - - autoclose - - # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable - exemptLabels: - - p0 - - bug - - # Comment to post when marking as stale. Set to `false` to disable - markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. diff --git a/contract/lib/v2-periphery/.github/workflows/CI.yml b/contract/lib/v2-periphery/.github/workflows/CI.yml deleted file mode 100644 index c57b2ec..0000000 --- a/contract/lib/v2-periphery/.github/workflows/CI.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: CI - -on: - push: - branches: - - master - pull_request: - -jobs: - test: - strategy: - matrix: - node: ['10.x', '12.x'] - os: [ubuntu-latest] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - - run: npm install -g yarn - - - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v1 - with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: ${{ matrix.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ matrix.os }}-yarn- - - - run: yarn - - - run: yarn lint - - run: yarn test diff --git a/contract/lib/v2-periphery/.mocharc.json b/contract/lib/v2-periphery/.mocharc.json deleted file mode 100644 index 1a5fee6..0000000 --- a/contract/lib/v2-periphery/.mocharc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extension": ["ts"], - "spec": "./test/**/*.spec.ts", - "require": "ts-node/register", - "timeout": 12000 -} diff --git a/contract/lib/v2-periphery/.prettierrc b/contract/lib/v2-periphery/.prettierrc deleted file mode 100644 index 31ba22d..0000000 --- a/contract/lib/v2-periphery/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "semi": false, - "singleQuote": true, - "printWidth": 120 -} diff --git a/contract/lib/v2-periphery/.waffle.json b/contract/lib/v2-periphery/.waffle.json deleted file mode 100644 index 29868df..0000000 --- a/contract/lib/v2-periphery/.waffle.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerVersion": "./node_modules/solc", - "outputType": "all", - "compilerOptions": { - "outputSelection": { - "*": { - "*": [ - "evm.bytecode.object", - "evm.deployedBytecode.object", - "abi", - "evm.bytecode.sourceMap", - "evm.deployedBytecode.sourceMap", - "metadata" - ], - "": ["ast"] - } - }, - "evmVersion": "istanbul", - "optimizer": { - "enabled": true, - "runs": 999999 - } - } -} diff --git a/contract/lib/v2-periphery/.yarnrc b/contract/lib/v2-periphery/.yarnrc deleted file mode 100644 index 5455c6c..0000000 --- a/contract/lib/v2-periphery/.yarnrc +++ /dev/null @@ -1 +0,0 @@ -ignore-scripts true diff --git a/contract/lib/v2-periphery/LICENSE b/contract/lib/v2-periphery/LICENSE deleted file mode 100644 index f288702..0000000 --- a/contract/lib/v2-periphery/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/contract/lib/v2-periphery/README.md b/contract/lib/v2-periphery/README.md deleted file mode 100644 index f60505c..0000000 --- a/contract/lib/v2-periphery/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Uniswap V2 - -[![Actions Status](https://github.com/Uniswap/uniswap-v2-periphery/workflows/CI/badge.svg)](https://github.com/Uniswap/uniswap-v2-periphery/actions) -[![npm](https://img.shields.io/npm/v/@uniswap/v2-periphery?style=flat-square)](https://npmjs.com/package/@uniswap/v2-periphery) - -In-depth documentation on Uniswap V2 is available at [uniswap.org](https://uniswap.org/docs). - -The built contract artifacts can be browsed via [unpkg.com](https://unpkg.com/browse/@uniswap/v2-periphery@latest/). - -# Local Development - -The following assumes the use of `node@>=10`. - -## Install Dependencies - -`yarn` - -## Compile Contracts - -`yarn compile` - -## Run Tests - -`yarn test` diff --git a/contract/lib/v2-periphery/buildV1/UniswapV1Exchange.json b/contract/lib/v2-periphery/buildV1/UniswapV1Exchange.json deleted file mode 100644 index c2cab73..0000000 --- a/contract/lib/v2-periphery/buildV1/UniswapV1Exchange.json +++ /dev/null @@ -1,485 +0,0 @@ -{ - "abi": [ - { - "name": "TokenPurchase", - "inputs": [ - { "type": "address", "name": "buyer", "indexed": true }, - { "type": "uint256", "name": "eth_sold", "indexed": true }, - { "type": "uint256", "name": "tokens_bought", "indexed": true } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "EthPurchase", - "inputs": [ - { "type": "address", "name": "buyer", "indexed": true }, - { "type": "uint256", "name": "tokens_sold", "indexed": true }, - { "type": "uint256", "name": "eth_bought", "indexed": true } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "AddLiquidity", - "inputs": [ - { "type": "address", "name": "provider", "indexed": true }, - { "type": "uint256", "name": "eth_amount", "indexed": true }, - { "type": "uint256", "name": "token_amount", "indexed": true } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "RemoveLiquidity", - "inputs": [ - { "type": "address", "name": "provider", "indexed": true }, - { "type": "uint256", "name": "eth_amount", "indexed": true }, - { "type": "uint256", "name": "token_amount", "indexed": true } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "Transfer", - "inputs": [ - { "type": "address", "name": "_from", "indexed": true }, - { "type": "address", "name": "_to", "indexed": true }, - { "type": "uint256", "name": "_value", "indexed": false } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "Approval", - "inputs": [ - { "type": "address", "name": "_owner", "indexed": true }, - { "type": "address", "name": "_spender", "indexed": true }, - { "type": "uint256", "name": "_value", "indexed": false } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "setup", - "outputs": [], - "inputs": [{ "type": "address", "name": "token_addr" }], - "constant": false, - "payable": false, - "type": "function", - "gas": 175875 - }, - { - "name": "addLiquidity", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "min_liquidity" }, - { "type": "uint256", "name": "max_tokens" }, - { "type": "uint256", "name": "deadline" } - ], - "constant": false, - "payable": true, - "type": "function", - "gas": 82605 - }, - { - "name": "removeLiquidity", - "outputs": [ - { "type": "uint256", "name": "out" }, - { "type": "uint256", "name": "out" } - ], - "inputs": [ - { "type": "uint256", "name": "amount" }, - { "type": "uint256", "name": "min_eth" }, - { "type": "uint256", "name": "min_tokens" }, - { "type": "uint256", "name": "deadline" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 116814 - }, - { "name": "__default__", "outputs": [], "inputs": [], "constant": false, "payable": true, "type": "function" }, - { - "name": "ethToTokenSwapInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "min_tokens" }, - { "type": "uint256", "name": "deadline" } - ], - "constant": false, - "payable": true, - "type": "function", - "gas": 12757 - }, - { - "name": "ethToTokenTransferInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "min_tokens" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" } - ], - "constant": false, - "payable": true, - "type": "function", - "gas": 12965 - }, - { - "name": "ethToTokenSwapOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_bought" }, - { "type": "uint256", "name": "deadline" } - ], - "constant": false, - "payable": true, - "type": "function", - "gas": 50455 - }, - { - "name": "ethToTokenTransferOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_bought" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" } - ], - "constant": false, - "payable": true, - "type": "function", - "gas": 50663 - }, - { - "name": "tokenToEthSwapInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_sold" }, - { "type": "uint256", "name": "min_eth" }, - { "type": "uint256", "name": "deadline" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 47503 - }, - { - "name": "tokenToEthTransferInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_sold" }, - { "type": "uint256", "name": "min_eth" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 47712 - }, - { - "name": "tokenToEthSwapOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "eth_bought" }, - { "type": "uint256", "name": "max_tokens" }, - { "type": "uint256", "name": "deadline" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 50175 - }, - { - "name": "tokenToEthTransferOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "eth_bought" }, - { "type": "uint256", "name": "max_tokens" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 50384 - }, - { - "name": "tokenToTokenSwapInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_sold" }, - { "type": "uint256", "name": "min_tokens_bought" }, - { "type": "uint256", "name": "min_eth_bought" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "token_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 51007 - }, - { - "name": "tokenToTokenTransferInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_sold" }, - { "type": "uint256", "name": "min_tokens_bought" }, - { "type": "uint256", "name": "min_eth_bought" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" }, - { "type": "address", "name": "token_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 51098 - }, - { - "name": "tokenToTokenSwapOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_bought" }, - { "type": "uint256", "name": "max_tokens_sold" }, - { "type": "uint256", "name": "max_eth_sold" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "token_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 54928 - }, - { - "name": "tokenToTokenTransferOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_bought" }, - { "type": "uint256", "name": "max_tokens_sold" }, - { "type": "uint256", "name": "max_eth_sold" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" }, - { "type": "address", "name": "token_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 55019 - }, - { - "name": "tokenToExchangeSwapInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_sold" }, - { "type": "uint256", "name": "min_tokens_bought" }, - { "type": "uint256", "name": "min_eth_bought" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "exchange_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 49342 - }, - { - "name": "tokenToExchangeTransferInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_sold" }, - { "type": "uint256", "name": "min_tokens_bought" }, - { "type": "uint256", "name": "min_eth_bought" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" }, - { "type": "address", "name": "exchange_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 49532 - }, - { - "name": "tokenToExchangeSwapOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_bought" }, - { "type": "uint256", "name": "max_tokens_sold" }, - { "type": "uint256", "name": "max_eth_sold" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "exchange_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 53233 - }, - { - "name": "tokenToExchangeTransferOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_bought" }, - { "type": "uint256", "name": "max_tokens_sold" }, - { "type": "uint256", "name": "max_eth_sold" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" }, - { "type": "address", "name": "exchange_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 53423 - }, - { - "name": "getEthToTokenInputPrice", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [{ "type": "uint256", "name": "eth_sold" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 5542 - }, - { - "name": "getEthToTokenOutputPrice", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [{ "type": "uint256", "name": "tokens_bought" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 6872 - }, - { - "name": "getTokenToEthInputPrice", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [{ "type": "uint256", "name": "tokens_sold" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 5637 - }, - { - "name": "getTokenToEthOutputPrice", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [{ "type": "uint256", "name": "eth_bought" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 6897 - }, - { - "name": "tokenAddress", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 1413 - }, - { - "name": "factoryAddress", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 1443 - }, - { - "name": "balanceOf", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [{ "type": "address", "name": "_owner" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 1645 - }, - { - "name": "transfer", - "outputs": [{ "type": "bool", "name": "out" }], - "inputs": [ - { "type": "address", "name": "_to" }, - { "type": "uint256", "name": "_value" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 75034 - }, - { - "name": "transferFrom", - "outputs": [{ "type": "bool", "name": "out" }], - "inputs": [ - { "type": "address", "name": "_from" }, - { "type": "address", "name": "_to" }, - { "type": "uint256", "name": "_value" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 110907 - }, - { - "name": "approve", - "outputs": [{ "type": "bool", "name": "out" }], - "inputs": [ - { "type": "address", "name": "_spender" }, - { "type": "uint256", "name": "_value" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 38769 - }, - { - "name": "allowance", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "address", "name": "_owner" }, - { "type": "address", "name": "_spender" } - ], - "constant": true, - "payable": false, - "type": "function", - "gas": 1925 - }, - { - "name": "name", - "outputs": [{ "type": "bytes32", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 1623 - }, - { - "name": "symbol", - "outputs": [{ "type": "bytes32", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 1653 - }, - { - "name": "decimals", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 1683 - }, - { - "name": "totalSupply", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 1713 - } - ], - "evm": { - "bytecode": { - "object": "61309c56600035601c52740100000000000000000000000000000000000000006020526f7fffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff8000000000000000000000000000000060605274012a05f1fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffed5fa0e000000000000000000000000000000000060a0526366d38203600051141561013b57602060046101403734156100b457600080fd5b60043560205181106100c557600080fd5b506000610140511415600654156007541516166100e157600080fd5b33600755610140516006557f556e6973776170205631000000000000000000000000000000000000000000006000557f554e492d563100000000000000000000000000000000000000000000000000006001556012600255005b63422f104360005114156105ab5760606004610140376000341160006101605111164261018051111661016d57600080fd5b6003546101a05260006101a051111561043e576000610140511161019057600080fd5b343031101561019e57600080fd5b343031036103a0526006543b6101b357600080fd5b6006543014156101c257600080fd5b602061046060246370a082316103e05230610400526103fc6006545afa6101e857600080fd5b600050610460516103c0526103a05161020057600080fd5b6103a05134151561021257600061022f565b6103c051346103c0513402041461022857600080fd5b6103c05134025b0460016103a05161023f57600080fd5b6103a05134151561025157600061026e565b6103c051346103c0513402041461026757600080fd5b6103c05134025b0401101561027b57600080fd5b60016103a05161028a57600080fd5b6103a05134151561029c5760006102b9565b6103c051346103c051340204146102b257600080fd5b6103c05134025b0401610480526103a0516102cc57600080fd5b6103a0513415156102de5760006102fb565b6101a051346101a051340204146102f457600080fd5b6101a05134025b046104a052610140516104a0511015610480516101605110151661031e57600080fd5b60043360e05260c052604060c02080546104a051825401101561034057600080fd5b6104a0518154018155506101a0516104a0516101a05101101561036257600080fd5b6104a0516101a051016003556006543b61037b57600080fd5b60065430141561038a57600080fd5b602061058060646323b872dd6104c052336104e052306105005261048051610520526104dc60006006545af16103bf57600080fd5b600050610580516103cf57600080fd5b6104805134337f06239653922ac7bea6aa2b19dc486b9361821d37712eb796adfd38d81de278ca60006000a46104a0516105a0523360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206105a0a36104a05160005260206000f36105a9565b633b9aca003410156000600654141560006007541415161661045f57600080fd5b306007543b61046d57600080fd5b60075430141561047c57600080fd5b602061024060246306f2bf626101c0526006546101e0526101dc6007545afa6104a457600080fd5b60005061024051146104b557600080fd5b6101605161026052303161028052610280516003556102805160043360e05260c052604060c020556006543b6104ea57600080fd5b6006543014156104f957600080fd5b602061036060646323b872dd6102a052336102c052306102e05261026051610300526102bc60006006545af161052e57600080fd5b6000506103605161053e57600080fd5b6102605134337f06239653922ac7bea6aa2b19dc486b9361821d37712eb796adfd38d81de278ca60006000a461028051610380523360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020610380a36102805160005260206000f35b005b63f88bf15a600051141561084a57608060046101403734156105cc57600080fd5b600061018051116000610160511116426101a051116000610140511116166105f357600080fd5b6003546101c05260006101c0511161060a57600080fd5b6006543b61061757600080fd5b60065430141561062657600080fd5b602061028060246370a0823161020052306102205261021c6006545afa61064c57600080fd5b600050610280516101e0526101c05161066457600080fd5b6101c051610140511515610679576000610699565b30316101405130316101405102041461069157600080fd5b303161014051025b046102a0526101c0516106ab57600080fd5b6101c0516101405115156106c05760006106e6565b6101e051610140516101e051610140510204146106dc57600080fd5b6101e05161014051025b046102c052610180516102c0511015610160516102a05110151661070957600080fd5b60043360e05260c052604060c020610140518154101561072857600080fd5b61014051815403815550610140516101c051101561074557600080fd5b610140516101c0510360035560006000600060006102a051336000f161076a57600080fd5b6006543b61077757600080fd5b60065430141561078657600080fd5b6020610380604463a9059cbb6102e05233610300526102c051610320526102fc60006006545af16107b657600080fd5b600050610380516107c657600080fd5b6102c0516102a051337f0fbf06c058b90cb038a618f8c2acbf6145f8b3570fd1fa56abb8f0f3f05b36e860006000a4610140516103a0526000337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206103a0a360406103c0526103e06102a05181526102c0518160200152506103c0516103e0f3005b6000156109c6575b6101a05261014052610160526101805260006101805111600061016051111661087a57600080fd5b61014051151561088b5760006108ae565b6103e5610140516103e5610140510204146108a557600080fd5b6103e561014051025b6101c0526101c05115156108c35760006108e9565b610180516101c051610180516101c0510204146108df57600080fd5b610180516101c051025b6101e0526101605115156108fe576000610921565b6103e8610160516103e86101605102041461091857600080fd5b6103e861016051025b6101c051610160511515610936576000610959565b6103e8610160516103e86101605102041461095057600080fd5b6103e861016051025b01101561096557600080fd5b6101c05161016051151561097a57600061099d565b6103e8610160516103e86101605102041461099457600080fd5b6103e861016051025b0161020052610200516109af57600080fd5b610200516101e051046000526000516101a0515650005b600015610bf3575b6101a0526101405261016052610180526000610180511160006101605111166109f657600080fd5b610160511515610a07576000610a2d565b61014051610160516101405161016051020414610a2357600080fd5b6101405161016051025b1515610a3a576000610af6565b6103e8610160511515610a4e576000610a74565b61014051610160516101405161016051020414610a6a57600080fd5b6101405161016051025b6103e8610160511515610a88576000610aae565b61014051610160516101405161016051020414610aa457600080fd5b6101405161016051025b020414610aba57600080fd5b6103e8610160511515610ace576000610af4565b61014051610160516101405161016051020414610aea57600080fd5b6101405161016051025b025b6101c05261014051610180511015610b0d57600080fd5b6101405161018051031515610b23576000610b8e565b6103e561014051610180511015610b3957600080fd5b6101405161018051036103e561014051610180511015610b5857600080fd5b610140516101805103020414610b6d57600080fd5b6103e561014051610180511015610b8357600080fd5b610140516101805103025b6101e0526101e051610b9f57600080fd5b6101e0516101c0510460016101e051610bb757600080fd5b6101e0516101c05104011015610bcc57600080fd5b60016101e051610bdb57600080fd5b6101e0516101c05104016000526000516101a0515650005b600015610df4575b6101e0526101405261016052610180526101a0526101c0526000610160511160006101405111164261018051101516610c3357600080fd5b6006543b610c4057600080fd5b600654301415610c4f57600080fd5b60206102a060246370a0823161022052306102405261023c6006545afa610c7557600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516389f2a8716102e05261014051610300526101405130311015610cd657600080fd5b6101405130310361032052610200516103405261034051610320516103005160065801610852565b6103a0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103a0516102c052610160516102c0511015610d5157600080fd5b6006543b610d5e57600080fd5b600654301415610d6d57600080fd5b6020610460604463a9059cbb6103c0526101c0516103e0526102c051610400526103dc60006006545af1610da057600080fd5b60005061046051610db057600080fd5b6102c051610140516101a0517fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f60006000a46102c0516000526000516101e0515650005b63f39b5b9b6000511415610e715760406004610140376101405161016051638c717a3361018052346101a052610140516101c052610160516101e0523361020052336102205261022051610200516101e0516101c0516101a05160065801610bfb565b6102805261016052610140526102805160005260206000f3005b63ad65d76d6000511415610f245760606004610140376044356020518110610e9857600080fd5b5060006101805114153061018051141516610eb257600080fd5b610140516101605161018051638c717a336101a052346101c052610140516101e0526101605161020052336102205261018051610240526102405161022051610200516101e0516101c05160065801610bfb565b6102a0526101805261016052610140526102a05160005260206000f3005b60001561116c575b6101e0526101405261016052610180526101a0526101c0526000610160511160006101405111164261018051101516610f6457600080fd5b6006543b610f7157600080fd5b600654301415610f8057600080fd5b60206102a060246370a0823161022052306102405261023c6006545afa610fa657600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c05163fd11c2236102e0526101405161030052610160513031101561100757600080fd5b61016051303103610320526102005161034052610340516103205161030051600658016109ce565b6103a0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103a0516102c05260016102c051026103e0526103e05161016051101561108d57600080fd5b6103e05161016051036103c05260006103c05111156110c35760006000600060006103c0516101a0516000f16110c257600080fd5b5b6006543b6110d057600080fd5b6006543014156110df57600080fd5b60206104a0604463a9059cbb610400526101c05161042052610140516104405261041c60006006545af161111257600080fd5b6000506104a05161112257600080fd5b6101405160016102c051026101a0517fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f60006000a460016102c051026000526000516101e0515650005b636b1d4db760005114156111e95760406004610140376101405161016051632dff394e61018052610140516101a052346101c052610160516101e0523361020052336102205261022051610200516101e0516101c0516101a05160065801610f2c565b6102805261016052610140526102805160005260206000f3005b630b573638600051141561129c576060600461014037604435602051811061121057600080fd5b506000610180511415306101805114151661122a57600080fd5b610140516101605161018051632dff394e6101a052610140516101c052346101e0526101605161020052336102205261018051610240526102405161022051610200516101e0516101c05160065801610f2c565b6102a0526101805261016052610140526102a05160005260206000f3005b6000156114b3575b6101e0526101405261016052610180526101a0526101c05260006101605111600061014051111642610180511015166112dc57600080fd5b6006543b6112e957600080fd5b6006543014156112f857600080fd5b60206102a060246370a0823161022052306102405261023c6006545afa61131e57600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516389f2a8716102e0526101405161030052610200516103205230316103405261034051610320516103005160065801610852565b6103a0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103a0516102c05260016102c051026103c052610160516103c05110156113ef57600080fd5b60006000600060006103c0516101c0516000f161140b57600080fd5b6006543b61141857600080fd5b60065430141561142757600080fd5b60206104a060646323b872dd6103e0526101a05161040052306104205261014051610440526103fc60006006545af161145f57600080fd5b6000506104a05161146f57600080fd5b6103c051610140516101a0517f7f4091b46c33e918a0f3aa42307641d17bb67029427a5369e54b35398423870560006000a46103c0516000526000516101e0515650005b6395e3c50b600051141561154657606060046101403734156114d457600080fd5b61014051610160516101805163fa1bb7be6101a052610140516101c052610160516101e0526101805161020052336102205233610240526102405161022051610200516101e0516101c051600658016112a4565b6102a0526101805261016052610140526102a05160005260206000f3005b637237e031600051141561160f576080600461014037341561156757600080fd5b606435602051811061157857600080fd5b5060006101a0511415306101a05114151661159257600080fd5b6101405161016051610180516101a05163fa1bb7be6101c052610140516101e0526101605161020052610180516102205233610240526101a05161026052610260516102405161022051610200516101e051600658016112a4565b6102c0526101a0526101805261016052610140526102c05160005260206000f3005b600015611813575b6101e0526101405261016052610180526101a0526101c05260006101405111426101805110151661164757600080fd5b6006543b61165457600080fd5b60065430141561166357600080fd5b60206102a060246370a0823161022052306102405261023c6006545afa61168957600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c05163fd11c2236102e05261014051610300526102005161032052303161034052610340516103205161030051600658016109ce565b6103a0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103a0516102c0526102c05161016051101561174f57600080fd5b6000600060006000610140516101c0516000f161176b57600080fd5b6006543b61177857600080fd5b60065430141561178757600080fd5b602061048060646323b872dd6103c0526101a0516103e05230610400526102c051610420526103dc60006006545af16117bf57600080fd5b600050610480516117cf57600080fd5b610140516102c0516101a0517f7f4091b46c33e918a0f3aa42307641d17bb67029427a5369e54b35398423870560006000a46102c0516000526000516101e0515650005b63013efd8b60005114156118a6576060600461014037341561183457600080fd5b61014051610160516101805163984fe8f66101a052610140516101c052610160516101e0526101805161020052336102205233610240526102405161022051610200516101e0516101c05160065801611617565b6102a0526101805261016052610140526102a05160005260206000f3005b63d4e4841d600051141561196f57608060046101403734156118c757600080fd5b60643560205181106118d857600080fd5b5060006101a0511415306101a0511415166118f257600080fd5b6101405161016051610180516101a05163984fe8f66101c052610140516101e0526101605161020052610180516102205233610240526101a05161026052610260516102405161022051610200516101e05160065801611617565b6102c0526101a0526101805261016052610140526102c05160005260206000f3005b600015611c0a575b610220526101405261016052610180526101a0526101c0526101e0526102005260006101805111600061016051111660006101405111426101a051101516166119bf57600080fd5b600061020051141530610200511415166119d857600080fd5b6006543b6119e557600080fd5b6006543014156119f457600080fd5b60206102e060246370a0823161026052306102805261027c6006545afa611a1a57600080fd5b6000506102e051610240526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516102e051610300516389f2a871610320526101405161034052610240516103605230316103805261038051610360516103405160065801610852565b6103e052610300526102e0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103e05161030052600161030051026104005261018051610400511015611afb57600080fd5b6006543b611b0857600080fd5b600654301415611b1757600080fd5b60206104e060646323b872dd610420526101c051610440523061046052610140516104805261043c60006006545af1611b4f57600080fd5b6000506104e051611b5f57600080fd5b610200513b611b6d57600080fd5b61020051301415611b7d57600080fd5b60206105e0606463ad65d76d6105205261016051610540526101a051610560526101e0516105805261053c61040051610200515af1611bbb57600080fd5b6000506105e0516105005261040051610140516101c0517f7f4091b46c33e918a0f3aa42307641d17bb67029427a5369e54b35398423870560006000a461050051600052600051610220515650005b63ddf7e1a76000511415611d575760a06004610140373415611c2b57600080fd5b6084356020518110611c3c57600080fd5b506007543b611c4a57600080fd5b600754301415611c5957600080fd5b602061028060246306f2bf62610200526101c0516102205261021c6007545afa611c8257600080fd5b600050610280516101e0526101405161016051610180516101a0516101c0516101e051610200516102205161024051610260516102805163204ea33b6102a052610140516102c052610160516102e05261018051610300526101a05161032052336103405233610360526101e0516103805261038051610360516103405161032051610300516102e0516102c05160065801611977565b6103e05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103e05160005260206000f3005b63f552d91b6000511415611ec15760c06004610140373415611d7857600080fd5b6084356020518110611d8957600080fd5b5060a4356020518110611d9b57600080fd5b506007543b611da957600080fd5b600754301415611db857600080fd5b60206102a060246306f2bf62610220526101e0516102405261023c6007545afa611de157600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a05163204ea33b6102c052610140516102e052610160516103005261018051610320526101a0516103405233610360526101c05161038052610200516103a0526103a05161038051610360516103405161032051610300516102e05160065801611977565b610400526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526104005160005260206000f3005b6000156121d7575b610220526101405261016052610180526101a0526101c0526101e05261020052600061018051116000610140511116426101a051101516611f0957600080fd5b60006102005114153061020051141516611f2257600080fd5b610200513b611f3057600080fd5b61020051301415611f4057600080fd5b60206102e060246359e9486261026052610140516102805261027c610200515afa611f6a57600080fd5b6000506102e051610240526006543b611f8257600080fd5b600654301415611f9157600080fd5b60206103a060246370a0823161032052306103405261033c6006545afa611fb757600080fd5b6000506103a051610300526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516102e05161030051610320516103405161036051610380516103a0516103c05163fd11c2236103e05261024051610400526103005161042052303161044052610440516104205161040051600658016109ce565b6104a0526103c0526103a05261038052610360526103405261032052610300526102e0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526104a0516103c052610240516101805110156103c051610160511015166120c857600080fd5b6006543b6120d557600080fd5b6006543014156120e457600080fd5b602061058060646323b872dd6104c0526101c0516104e05230610500526103c051610520526104dc60006006545af161211c57600080fd5b6000506105805161212c57600080fd5b610200513b61213a57600080fd5b6102005130141561214a57600080fd5b60206106806064630b5736386105c052610140516105e0526101a051610600526101e051610620526105dc61024051610200515af161218857600080fd5b600050610680516105a052610240516103c0516101c0517f7f4091b46c33e918a0f3aa42307641d17bb67029427a5369e54b35398423870560006000a46103c051600052600051610220515650005b63b040d54560005114156123245760a060046101403734156121f857600080fd5b608435602051811061220957600080fd5b506007543b61221757600080fd5b60075430141561222657600080fd5b602061028060246306f2bf62610200526101c0516102205261021c6007545afa61224f57600080fd5b600050610280516101e0526101405161016051610180516101a0516101c0516101e0516102005161022051610240516102605161028051631a7b28f26102a052610140516102c052610160516102e05261018051610300526101a05161032052336103405233610360526101e0516103805261038051610360516103405161032051610300516102e0516102c05160065801611ec9565b6103e05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103e05160005260206000f3005b63f3c0efe9600051141561248e5760c0600461014037341561234557600080fd5b608435602051811061235657600080fd5b5060a435602051811061236857600080fd5b506007543b61237657600080fd5b60075430141561238557600080fd5b60206102a060246306f2bf62610220526101e0516102405261023c6007545afa6123ae57600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a051631a7b28f26102c052610140516102e052610160516103005261018051610320526101a0516103405233610360526101c05161038052610200516103a0526103a05161038051610360516103405161032051610300516102e05160065801611ec9565b610400526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526104005160005260206000f3005b63b1cb43bf600051141561255b5760a060046101403734156124af57600080fd5b60843560205181106124c057600080fd5b506101405161016051610180516101a0516101c05163204ea33b6101e0526101405161020052610160516102205261018051610240526101a051610260523361028052336102a0526101c0516102c0526102c0516102a051610280516102605161024051610220516102005160065801611977565b610320526101c0526101a0526101805261016052610140526103205160005260206000f3005b63ec384a3e60005114156126555760c0600461014037341561257c57600080fd5b608435602051811061258d57600080fd5b5060a435602051811061259f57600080fd5b50306101c05114156125b057600080fd5b6101405161016051610180516101a0516101c0516101e05163204ea33b610200526101405161022052610160516102405261018051610260526101a05161028052336102a0526101c0516102c0526101e0516102e0526102e0516102c0516102a0516102805161026051610240516102205160065801611977565b610340526101e0526101c0526101a0526101805261016052610140526103405160005260206000f3005b63ea650c7d60005114156127225760a0600461014037341561267657600080fd5b608435602051811061268757600080fd5b506101405161016051610180516101a0516101c051631a7b28f26101e0526101405161020052610160516102205261018051610240526101a051610260523361028052336102a0526101c0516102c0526102c0516102a051610280516102605161024051610220516102005160065801611ec9565b610320526101c0526101a0526101805261016052610140526103205160005260206000f3005b63981a1327600051141561281c5760c0600461014037341561274357600080fd5b608435602051811061275457600080fd5b5060a435602051811061276657600080fd5b50306101c051141561277757600080fd5b6101405161016051610180516101a0516101c0516101e051631a7b28f2610200526101405161022052610160516102405261018051610260526101a05161028052336102a0526101c0516102c0526101e0516102e0526102e0516102c0516102a0516102805161026051610240516102205160065801611ec9565b610340526101e0526101c0526101a0526101805261016052610140526103405160005260206000f3005b63cd7724c36000511415612918576020600461014037341561283d57600080fd5b6000610140511161284d57600080fd5b6006543b61285a57600080fd5b60065430141561286957600080fd5b602061020060246370a0823161018052306101a05261019c6006545afa61288f57600080fd5b60005061020051610160526101405161016051610180516101a0516101c0516101e051610200516389f2a871610220526101405161024052303161026052610160516102805261028051610260516102405160065801610852565b6102e052610200526101e0526101c0526101a0526101805261016052610140526102e05160005260206000f3005b6359e948626000511415612a27576020600461014037341561293957600080fd5b6000610140511161294957600080fd5b6006543b61295657600080fd5b60065430141561296557600080fd5b602061020060246370a0823161018052306101a05261019c6006545afa61298b57600080fd5b60005061020051610160526101405161016051610180516101a0516101c0516101e051610200516102205163fd11c223610240526101405161026052303161028052610160516102a0526102a0516102805161026051600658016109ce565b6103005261022052610200526101e0526101c0526101a05261018052610160526101405261030051610220526001610220510260005260206000f3005b6395b68fe76000511415612b365760206004610140373415612a4857600080fd5b60006101405111612a5857600080fd5b6006543b612a6557600080fd5b600654301415612a7457600080fd5b602061020060246370a0823161018052306101a05261019c6006545afa612a9a57600080fd5b60005061020051610160526101405161016051610180516101a0516101c0516101e05161020051610220516389f2a871610240526101405161026052610160516102805230316102a0526102a051610280516102605160065801610852565b6103005261022052610200526101e0526101c0526101a05261018052610160526101405261030051610220526001610220510260005260206000f3005b632640f62c6000511415612c325760206004610140373415612b5757600080fd5b60006101405111612b6757600080fd5b6006543b612b7457600080fd5b600654301415612b8357600080fd5b602061020060246370a0823161018052306101a05261019c6006545afa612ba957600080fd5b60005061020051610160526101405161016051610180516101a0516101c0516101e0516102005163fd11c2236102205261014051610240526101605161026052303161028052610280516102605161024051600658016109ce565b6102e052610200526101e0526101c0526101a0526101805261016052610140526102e05160005260206000f3005b639d76ea586000511415612c58573415612c4b57600080fd5b60065460005260206000f3005b63966dae0e6000511415612c7e573415612c7157600080fd5b60075460005260206000f3005b6370a082316000511415612ccd5760206004610140373415612c9f57600080fd5b6004356020518110612cb057600080fd5b5060046101405160e05260c052604060c0205460005260206000f3005b63a9059cbb6000511415612d985760406004610140373415612cee57600080fd5b6004356020518110612cff57600080fd5b5060043360e05260c052604060c0206101605181541015612d1f57600080fd5b6101605181540381555060046101405160e05260c052604060c0208054610160518254011015612d4e57600080fd5b61016051815401815550610160516101805261014051337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020610180a3600160005260206000f3005b6323b872dd6000511415612eb35760606004610140373415612db957600080fd5b6004356020518110612dca57600080fd5b506024356020518110612ddc57600080fd5b5060046101405160e05260c052604060c0206101805181541015612dff57600080fd5b6101805181540381555060046101605160e05260c052604060c0208054610180518254011015612e2e57600080fd5b6101805181540181555060056101405160e05260c052604060c0203360e05260c052604060c0206101805181541015612e6657600080fd5b61018051815403815550610180516101a05261016051610140517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206101a0a3600160005260206000f3005b63095ea7b36000511415612f485760406004610140373415612ed457600080fd5b6004356020518110612ee557600080fd5b506101605160053360e05260c052604060c0206101405160e05260c052604060c02055610160516101805261014051337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256020610180a3600160005260206000f3005b63dd62ed3e6000511415612fb85760406004610140373415612f6957600080fd5b6004356020518110612f7a57600080fd5b506024356020518110612f8c57600080fd5b5060056101405160e05260c052604060c0206101605160e05260c052604060c0205460005260206000f3005b6306fdde036000511415612fde573415612fd157600080fd5b60005460005260206000f3005b6395d89b416000511415613004573415612ff757600080fd5b60015460005260206000f3005b63313ce567600051141561302a57341561301d57600080fd5b60025460005260206000f3005b6318160ddd600051141561305057341561304357600080fd5b60035460005260206000f3005b638c717a33610140523461016052600161018052426101a052336101c052336101e0526101e0516101c0516101a051610180516101605160065801610bfb565b610240526102405b61000461309c0361000460003961000461309c036000f3" - } - } -} diff --git a/contract/lib/v2-periphery/buildV1/UniswapV1Factory.json b/contract/lib/v2-periphery/buildV1/UniswapV1Factory.json deleted file mode 100644 index 4529b3d..0000000 --- a/contract/lib/v2-periphery/buildV1/UniswapV1Factory.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "abi": [ - { - "name": "NewExchange", - "inputs": [ - { "type": "address", "name": "token", "indexed": true }, - { "type": "address", "name": "exchange", "indexed": true } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "initializeFactory", - "outputs": [], - "inputs": [{ "type": "address", "name": "template" }], - "constant": false, - "payable": false, - "type": "function", - "gas": 35725 - }, - { - "name": "createExchange", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [{ "type": "address", "name": "token" }], - "constant": false, - "payable": false, - "type": "function", - "gas": 187911 - }, - { - "name": "getExchange", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [{ "type": "address", "name": "token" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 715 - }, - { - "name": "getToken", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [{ "type": "address", "name": "exchange" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 745 - }, - { - "name": "getTokenWithId", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [{ "type": "uint256", "name": "token_id" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 736 - }, - { - "name": "exchangeTemplate", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 633 - }, - { - "name": "tokenCount", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 663 - } - ], - "evm": { - "bytecode": { - "object": "6103f056600035601c52740100000000000000000000000000000000000000006020526f7fffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff8000000000000000000000000000000060605274012a05f1fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffed5fa0e000000000000000000000000000000000060a05263538a3f0e60005114156100ed57602060046101403734156100b457600080fd5b60043560205181106100c557600080fd5b50600054156100d357600080fd5b60006101405114156100e457600080fd5b61014051600055005b631648f38e60005114156102bf576020600461014037341561010e57600080fd5b600435602051811061011f57600080fd5b50600061014051141561013157600080fd5b6000600054141561014157600080fd5b60026101405160e05260c052604060c020541561015d57600080fd5b7f602e600c600039602e6000f33660006000376110006000366000730000000000610180526c010000000000000000000000006000540261019b527f5af41558576110006000f30000000000000000000000000000000000000000006101af5260406101806000f0806101cf57600080fd5b61016052610160513b6101e157600080fd5b610160513014156101f157600080fd5b6000600060246366d3820361022052610140516102405261023c6000610160515af161021c57600080fd5b6101605160026101405160e05260c052604060c020556101405160036101605160e05260c052604060c02055600154600160015401101561025c57600080fd5b6001600154016102a0526102a0516001556101405160046102a05160e05260c052604060c0205561016051610140517f9d42cb017eb05bd8944ab536a8b35bc68085931dd5f4356489801453923953f960006000a36101605160005260206000f3005b6306f2bf62600051141561030e57602060046101403734156102e057600080fd5b60043560205181106102f157600080fd5b5060026101405160e05260c052604060c0205460005260206000f3005b6359770438600051141561035d576020600461014037341561032f57600080fd5b600435602051811061034057600080fd5b5060036101405160e05260c052604060c0205460005260206000f3005b63aa65a6c0600051141561039a576020600461014037341561037e57600080fd5b60046101405160e05260c052604060c0205460005260206000f3005b631c2bbd1860005114156103c05734156103b357600080fd5b60005460005260206000f3005b639f181b5e60005114156103e65734156103d957600080fd5b60015460005260206000f3005b60006000fd5b6100046103f0036100046000396100046103f0036000f3" - } - } -} diff --git a/contract/lib/v2-periphery/contracts/UniswapV2Migrator.sol b/contract/lib/v2-periphery/contracts/UniswapV2Migrator.sol deleted file mode 100644 index fcd6354..0000000 --- a/contract/lib/v2-periphery/contracts/UniswapV2Migrator.sol +++ /dev/null @@ -1,49 +0,0 @@ -pragma solidity =0.6.6; - -import '@uniswap/lib/contracts/libraries/TransferHelper.sol'; - -import './interfaces/IUniswapV2Migrator.sol'; -import './interfaces/V1/IUniswapV1Factory.sol'; -import './interfaces/V1/IUniswapV1Exchange.sol'; -import './interfaces/IUniswapV2Router01.sol'; -import './interfaces/IERC20.sol'; - -contract UniswapV2Migrator is IUniswapV2Migrator { - IUniswapV1Factory immutable factoryV1; - IUniswapV2Router01 immutable router; - - constructor(address _factoryV1, address _router) public { - factoryV1 = IUniswapV1Factory(_factoryV1); - router = IUniswapV2Router01(_router); - } - - // needs to accept ETH from any v1 exchange and the router. ideally this could be enforced, as in the router, - // but it's not possible because it requires a call to the v1 factory, which takes too much gas - receive() external payable {} - - function migrate(address token, uint amountTokenMin, uint amountETHMin, address to, uint deadline) - external - override - { - IUniswapV1Exchange exchangeV1 = IUniswapV1Exchange(factoryV1.getExchange(token)); - uint liquidityV1 = exchangeV1.balanceOf(msg.sender); - require(exchangeV1.transferFrom(msg.sender, address(this), liquidityV1), 'TRANSFER_FROM_FAILED'); - (uint amountETHV1, uint amountTokenV1) = exchangeV1.removeLiquidity(liquidityV1, 1, 1, uint(-1)); - TransferHelper.safeApprove(token, address(router), amountTokenV1); - (uint amountTokenV2, uint amountETHV2,) = router.addLiquidityETH{value: amountETHV1}( - token, - amountTokenV1, - amountTokenMin, - amountETHMin, - to, - deadline - ); - if (amountTokenV1 > amountTokenV2) { - TransferHelper.safeApprove(token, address(router), 0); // be a good blockchain citizen, reset allowance to 0 - TransferHelper.safeTransfer(token, msg.sender, amountTokenV1 - amountTokenV2); - } else if (amountETHV1 > amountETHV2) { - // addLiquidityETH guarantees that all of amountETHV1 or amountTokenV1 will be used, hence this else is safe - TransferHelper.safeTransferETH(msg.sender, amountETHV1 - amountETHV2); - } - } -} diff --git a/contract/lib/v2-periphery/contracts/UniswapV2Router01.sol b/contract/lib/v2-periphery/contracts/UniswapV2Router01.sol deleted file mode 100644 index 74a4035..0000000 --- a/contract/lib/v2-periphery/contracts/UniswapV2Router01.sol +++ /dev/null @@ -1,280 +0,0 @@ -pragma solidity =0.6.6; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol'; -import '@uniswap/lib/contracts/libraries/TransferHelper.sol'; - -import './libraries/UniswapV2Library.sol'; -import './interfaces/IUniswapV2Router01.sol'; -import './interfaces/IERC20.sol'; -import './interfaces/IWETH.sol'; - -contract UniswapV2Router01 is IUniswapV2Router01 { - address public immutable override factory; - address public immutable override WETH; - - modifier ensure(uint deadline) { - require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED'); - _; - } - - constructor(address _factory, address _WETH) public { - factory = _factory; - WETH = _WETH; - } - - receive() external payable { - assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract - } - - // **** ADD LIQUIDITY **** - function _addLiquidity( - address tokenA, - address tokenB, - uint amountADesired, - uint amountBDesired, - uint amountAMin, - uint amountBMin - ) private returns (uint amountA, uint amountB) { - // create the pair if it doesn't exist yet - if (IUniswapV2Factory(factory).getPair(tokenA, tokenB) == address(0)) { - IUniswapV2Factory(factory).createPair(tokenA, tokenB); - } - (uint reserveA, uint reserveB) = UniswapV2Library.getReserves(factory, tokenA, tokenB); - if (reserveA == 0 && reserveB == 0) { - (amountA, amountB) = (amountADesired, amountBDesired); - } else { - uint amountBOptimal = UniswapV2Library.quote(amountADesired, reserveA, reserveB); - if (amountBOptimal <= amountBDesired) { - require(amountBOptimal >= amountBMin, 'UniswapV2Router: INSUFFICIENT_B_AMOUNT'); - (amountA, amountB) = (amountADesired, amountBOptimal); - } else { - uint amountAOptimal = UniswapV2Library.quote(amountBDesired, reserveB, reserveA); - assert(amountAOptimal <= amountADesired); - require(amountAOptimal >= amountAMin, 'UniswapV2Router: INSUFFICIENT_A_AMOUNT'); - (amountA, amountB) = (amountAOptimal, amountBDesired); - } - } - } - function addLiquidity( - address tokenA, - address tokenB, - uint amountADesired, - uint amountBDesired, - uint amountAMin, - uint amountBMin, - address to, - uint deadline - ) external override ensure(deadline) returns (uint amountA, uint amountB, uint liquidity) { - (amountA, amountB) = _addLiquidity(tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin); - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - TransferHelper.safeTransferFrom(tokenA, msg.sender, pair, amountA); - TransferHelper.safeTransferFrom(tokenB, msg.sender, pair, amountB); - liquidity = IUniswapV2Pair(pair).mint(to); - } - function addLiquidityETH( - address token, - uint amountTokenDesired, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) external override payable ensure(deadline) returns (uint amountToken, uint amountETH, uint liquidity) { - (amountToken, amountETH) = _addLiquidity( - token, - WETH, - amountTokenDesired, - msg.value, - amountTokenMin, - amountETHMin - ); - address pair = UniswapV2Library.pairFor(factory, token, WETH); - TransferHelper.safeTransferFrom(token, msg.sender, pair, amountToken); - IWETH(WETH).deposit{value: amountETH}(); - assert(IWETH(WETH).transfer(pair, amountETH)); - liquidity = IUniswapV2Pair(pair).mint(to); - if (msg.value > amountETH) TransferHelper.safeTransferETH(msg.sender, msg.value - amountETH); // refund dust eth, if any - } - - // **** REMOVE LIQUIDITY **** - function removeLiquidity( - address tokenA, - address tokenB, - uint liquidity, - uint amountAMin, - uint amountBMin, - address to, - uint deadline - ) public override ensure(deadline) returns (uint amountA, uint amountB) { - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - IUniswapV2Pair(pair).transferFrom(msg.sender, pair, liquidity); // send liquidity to pair - (uint amount0, uint amount1) = IUniswapV2Pair(pair).burn(to); - (address token0,) = UniswapV2Library.sortTokens(tokenA, tokenB); - (amountA, amountB) = tokenA == token0 ? (amount0, amount1) : (amount1, amount0); - require(amountA >= amountAMin, 'UniswapV2Router: INSUFFICIENT_A_AMOUNT'); - require(amountB >= amountBMin, 'UniswapV2Router: INSUFFICIENT_B_AMOUNT'); - } - function removeLiquidityETH( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) public override ensure(deadline) returns (uint amountToken, uint amountETH) { - (amountToken, amountETH) = removeLiquidity( - token, - WETH, - liquidity, - amountTokenMin, - amountETHMin, - address(this), - deadline - ); - TransferHelper.safeTransfer(token, to, amountToken); - IWETH(WETH).withdraw(amountETH); - TransferHelper.safeTransferETH(to, amountETH); - } - function removeLiquidityWithPermit( - address tokenA, - address tokenB, - uint liquidity, - uint amountAMin, - uint amountBMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external override returns (uint amountA, uint amountB) { - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - uint value = approveMax ? uint(-1) : liquidity; - IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); - (amountA, amountB) = removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline); - } - function removeLiquidityETHWithPermit( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external override returns (uint amountToken, uint amountETH) { - address pair = UniswapV2Library.pairFor(factory, token, WETH); - uint value = approveMax ? uint(-1) : liquidity; - IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); - (amountToken, amountETH) = removeLiquidityETH(token, liquidity, amountTokenMin, amountETHMin, to, deadline); - } - - // **** SWAP **** - // requires the initial amount to have already been sent to the first pair - function _swap(uint[] memory amounts, address[] memory path, address _to) private { - for (uint i; i < path.length - 1; i++) { - (address input, address output) = (path[i], path[i + 1]); - (address token0,) = UniswapV2Library.sortTokens(input, output); - uint amountOut = amounts[i + 1]; - (uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOut) : (amountOut, uint(0)); - address to = i < path.length - 2 ? UniswapV2Library.pairFor(factory, output, path[i + 2]) : _to; - IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output)).swap(amount0Out, amount1Out, to, new bytes(0)); - } - } - function swapExactTokensForTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external override ensure(deadline) returns (uint[] memory amounts) { - amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path); - require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - TransferHelper.safeTransferFrom(path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]); - _swap(amounts, path, to); - } - function swapTokensForExactTokens( - uint amountOut, - uint amountInMax, - address[] calldata path, - address to, - uint deadline - ) external override ensure(deadline) returns (uint[] memory amounts) { - amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); - require(amounts[0] <= amountInMax, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'); - TransferHelper.safeTransferFrom(path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]); - _swap(amounts, path, to); - } - function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) - external - override - payable - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsOut(factory, msg.value, path); - require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - IWETH(WETH).deposit{value: amounts[0]}(); - assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0])); - _swap(amounts, path, to); - } - function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) - external - override - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); - require(amounts[0] <= amountInMax, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'); - TransferHelper.safeTransferFrom(path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]); - _swap(amounts, path, address(this)); - IWETH(WETH).withdraw(amounts[amounts.length - 1]); - TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]); - } - function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) - external - override - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path); - require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - TransferHelper.safeTransferFrom(path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]); - _swap(amounts, path, address(this)); - IWETH(WETH).withdraw(amounts[amounts.length - 1]); - TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]); - } - function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) - external - override - payable - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); - require(amounts[0] <= msg.value, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'); - IWETH(WETH).deposit{value: amounts[0]}(); - assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0])); - _swap(amounts, path, to); - if (msg.value > amounts[0]) TransferHelper.safeTransferETH(msg.sender, msg.value - amounts[0]); // refund dust eth, if any - } - - function quote(uint amountA, uint reserveA, uint reserveB) public pure override returns (uint amountB) { - return UniswapV2Library.quote(amountA, reserveA, reserveB); - } - - function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) public pure override returns (uint amountOut) { - return UniswapV2Library.getAmountOut(amountIn, reserveIn, reserveOut); - } - - function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) public pure override returns (uint amountIn) { - return UniswapV2Library.getAmountOut(amountOut, reserveIn, reserveOut); - } - - function getAmountsOut(uint amountIn, address[] memory path) public view override returns (uint[] memory amounts) { - return UniswapV2Library.getAmountsOut(factory, amountIn, path); - } - - function getAmountsIn(uint amountOut, address[] memory path) public view override returns (uint[] memory amounts) { - return UniswapV2Library.getAmountsIn(factory, amountOut, path); - } -} diff --git a/contract/lib/v2-periphery/contracts/UniswapV2Router02.sol b/contract/lib/v2-periphery/contracts/UniswapV2Router02.sol deleted file mode 100644 index c57d4e6..0000000 --- a/contract/lib/v2-periphery/contracts/UniswapV2Router02.sol +++ /dev/null @@ -1,446 +0,0 @@ -pragma solidity =0.6.6; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol'; -import '@uniswap/lib/contracts/libraries/TransferHelper.sol'; - -import './interfaces/IUniswapV2Router02.sol'; -import './libraries/UniswapV2Library.sol'; -import './libraries/SafeMath.sol'; -import './interfaces/IERC20.sol'; -import './interfaces/IWETH.sol'; - -contract UniswapV2Router02 is IUniswapV2Router02 { - using SafeMath for uint; - - address public immutable override factory; - address public immutable override WETH; - - modifier ensure(uint deadline) { - require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED'); - _; - } - - constructor(address _factory, address _WETH) public { - factory = _factory; - WETH = _WETH; - } - - receive() external payable { - assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract - } - - // **** ADD LIQUIDITY **** - function _addLiquidity( - address tokenA, - address tokenB, - uint amountADesired, - uint amountBDesired, - uint amountAMin, - uint amountBMin - ) internal virtual returns (uint amountA, uint amountB) { - // create the pair if it doesn't exist yet - if (IUniswapV2Factory(factory).getPair(tokenA, tokenB) == address(0)) { - IUniswapV2Factory(factory).createPair(tokenA, tokenB); - } - (uint reserveA, uint reserveB) = UniswapV2Library.getReserves(factory, tokenA, tokenB); - if (reserveA == 0 && reserveB == 0) { - (amountA, amountB) = (amountADesired, amountBDesired); - } else { - uint amountBOptimal = UniswapV2Library.quote(amountADesired, reserveA, reserveB); - if (amountBOptimal <= amountBDesired) { - require(amountBOptimal >= amountBMin, 'UniswapV2Router: INSUFFICIENT_B_AMOUNT'); - (amountA, amountB) = (amountADesired, amountBOptimal); - } else { - uint amountAOptimal = UniswapV2Library.quote(amountBDesired, reserveB, reserveA); - assert(amountAOptimal <= amountADesired); - require(amountAOptimal >= amountAMin, 'UniswapV2Router: INSUFFICIENT_A_AMOUNT'); - (amountA, amountB) = (amountAOptimal, amountBDesired); - } - } - } - function addLiquidity( - address tokenA, - address tokenB, - uint amountADesired, - uint amountBDesired, - uint amountAMin, - uint amountBMin, - address to, - uint deadline - ) external virtual override ensure(deadline) returns (uint amountA, uint amountB, uint liquidity) { - (amountA, amountB) = _addLiquidity(tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin); - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - TransferHelper.safeTransferFrom(tokenA, msg.sender, pair, amountA); - TransferHelper.safeTransferFrom(tokenB, msg.sender, pair, amountB); - liquidity = IUniswapV2Pair(pair).mint(to); - } - function addLiquidityETH( - address token, - uint amountTokenDesired, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) external virtual override payable ensure(deadline) returns (uint amountToken, uint amountETH, uint liquidity) { - (amountToken, amountETH) = _addLiquidity( - token, - WETH, - amountTokenDesired, - msg.value, - amountTokenMin, - amountETHMin - ); - address pair = UniswapV2Library.pairFor(factory, token, WETH); - TransferHelper.safeTransferFrom(token, msg.sender, pair, amountToken); - IWETH(WETH).deposit{value: amountETH}(); - assert(IWETH(WETH).transfer(pair, amountETH)); - liquidity = IUniswapV2Pair(pair).mint(to); - // refund dust eth, if any - if (msg.value > amountETH) TransferHelper.safeTransferETH(msg.sender, msg.value - amountETH); - } - - // **** REMOVE LIQUIDITY **** - function removeLiquidity( - address tokenA, - address tokenB, - uint liquidity, - uint amountAMin, - uint amountBMin, - address to, - uint deadline - ) public virtual override ensure(deadline) returns (uint amountA, uint amountB) { - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - IUniswapV2Pair(pair).transferFrom(msg.sender, pair, liquidity); // send liquidity to pair - (uint amount0, uint amount1) = IUniswapV2Pair(pair).burn(to); - (address token0,) = UniswapV2Library.sortTokens(tokenA, tokenB); - (amountA, amountB) = tokenA == token0 ? (amount0, amount1) : (amount1, amount0); - require(amountA >= amountAMin, 'UniswapV2Router: INSUFFICIENT_A_AMOUNT'); - require(amountB >= amountBMin, 'UniswapV2Router: INSUFFICIENT_B_AMOUNT'); - } - function removeLiquidityETH( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) public virtual override ensure(deadline) returns (uint amountToken, uint amountETH) { - (amountToken, amountETH) = removeLiquidity( - token, - WETH, - liquidity, - amountTokenMin, - amountETHMin, - address(this), - deadline - ); - TransferHelper.safeTransfer(token, to, amountToken); - IWETH(WETH).withdraw(amountETH); - TransferHelper.safeTransferETH(to, amountETH); - } - function removeLiquidityWithPermit( - address tokenA, - address tokenB, - uint liquidity, - uint amountAMin, - uint amountBMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external virtual override returns (uint amountA, uint amountB) { - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - uint value = approveMax ? uint(-1) : liquidity; - IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); - (amountA, amountB) = removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline); - } - function removeLiquidityETHWithPermit( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external virtual override returns (uint amountToken, uint amountETH) { - address pair = UniswapV2Library.pairFor(factory, token, WETH); - uint value = approveMax ? uint(-1) : liquidity; - IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); - (amountToken, amountETH) = removeLiquidityETH(token, liquidity, amountTokenMin, amountETHMin, to, deadline); - } - - // **** REMOVE LIQUIDITY (supporting fee-on-transfer tokens) **** - function removeLiquidityETHSupportingFeeOnTransferTokens( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) public virtual override ensure(deadline) returns (uint amountETH) { - (, amountETH) = removeLiquidity( - token, - WETH, - liquidity, - amountTokenMin, - amountETHMin, - address(this), - deadline - ); - TransferHelper.safeTransfer(token, to, IERC20(token).balanceOf(address(this))); - IWETH(WETH).withdraw(amountETH); - TransferHelper.safeTransferETH(to, amountETH); - } - function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external virtual override returns (uint amountETH) { - address pair = UniswapV2Library.pairFor(factory, token, WETH); - uint value = approveMax ? uint(-1) : liquidity; - IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); - amountETH = removeLiquidityETHSupportingFeeOnTransferTokens( - token, liquidity, amountTokenMin, amountETHMin, to, deadline - ); - } - - // **** SWAP **** - // requires the initial amount to have already been sent to the first pair - function _swap(uint[] memory amounts, address[] memory path, address _to) internal virtual { - for (uint i; i < path.length - 1; i++) { - (address input, address output) = (path[i], path[i + 1]); - (address token0,) = UniswapV2Library.sortTokens(input, output); - uint amountOut = amounts[i + 1]; - (uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOut) : (amountOut, uint(0)); - address to = i < path.length - 2 ? UniswapV2Library.pairFor(factory, output, path[i + 2]) : _to; - IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output)).swap( - amount0Out, amount1Out, to, new bytes(0) - ); - } - } - function swapExactTokensForTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external virtual override ensure(deadline) returns (uint[] memory amounts) { - amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path); - require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - TransferHelper.safeTransferFrom( - path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0] - ); - _swap(amounts, path, to); - } - function swapTokensForExactTokens( - uint amountOut, - uint amountInMax, - address[] calldata path, - address to, - uint deadline - ) external virtual override ensure(deadline) returns (uint[] memory amounts) { - amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); - require(amounts[0] <= amountInMax, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'); - TransferHelper.safeTransferFrom( - path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0] - ); - _swap(amounts, path, to); - } - function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) - external - virtual - override - payable - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsOut(factory, msg.value, path); - require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - IWETH(WETH).deposit{value: amounts[0]}(); - assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0])); - _swap(amounts, path, to); - } - function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) - external - virtual - override - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); - require(amounts[0] <= amountInMax, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'); - TransferHelper.safeTransferFrom( - path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0] - ); - _swap(amounts, path, address(this)); - IWETH(WETH).withdraw(amounts[amounts.length - 1]); - TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]); - } - function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) - external - virtual - override - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path); - require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - TransferHelper.safeTransferFrom( - path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0] - ); - _swap(amounts, path, address(this)); - IWETH(WETH).withdraw(amounts[amounts.length - 1]); - TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]); - } - function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) - external - virtual - override - payable - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); - require(amounts[0] <= msg.value, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'); - IWETH(WETH).deposit{value: amounts[0]}(); - assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0])); - _swap(amounts, path, to); - // refund dust eth, if any - if (msg.value > amounts[0]) TransferHelper.safeTransferETH(msg.sender, msg.value - amounts[0]); - } - - // **** SWAP (supporting fee-on-transfer tokens) **** - // requires the initial amount to have already been sent to the first pair - function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual { - for (uint i; i < path.length - 1; i++) { - (address input, address output) = (path[i], path[i + 1]); - (address token0,) = UniswapV2Library.sortTokens(input, output); - IUniswapV2Pair pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output)); - uint amountInput; - uint amountOutput; - { // scope to avoid stack too deep errors - (uint reserve0, uint reserve1,) = pair.getReserves(); - (uint reserveInput, uint reserveOutput) = input == token0 ? (reserve0, reserve1) : (reserve1, reserve0); - amountInput = IERC20(input).balanceOf(address(pair)).sub(reserveInput); - amountOutput = UniswapV2Library.getAmountOut(amountInput, reserveInput, reserveOutput); - } - (uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOutput) : (amountOutput, uint(0)); - address to = i < path.length - 2 ? UniswapV2Library.pairFor(factory, output, path[i + 2]) : _to; - pair.swap(amount0Out, amount1Out, to, new bytes(0)); - } - } - function swapExactTokensForTokensSupportingFeeOnTransferTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external virtual override ensure(deadline) { - TransferHelper.safeTransferFrom( - path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn - ); - uint balanceBefore = IERC20(path[path.length - 1]).balanceOf(to); - _swapSupportingFeeOnTransferTokens(path, to); - require( - IERC20(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin, - 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT' - ); - } - function swapExactETHForTokensSupportingFeeOnTransferTokens( - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) - external - virtual - override - payable - ensure(deadline) - { - require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH'); - uint amountIn = msg.value; - IWETH(WETH).deposit{value: amountIn}(); - assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn)); - uint balanceBefore = IERC20(path[path.length - 1]).balanceOf(to); - _swapSupportingFeeOnTransferTokens(path, to); - require( - IERC20(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin, - 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT' - ); - } - function swapExactTokensForETHSupportingFeeOnTransferTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) - external - virtual - override - ensure(deadline) - { - require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH'); - TransferHelper.safeTransferFrom( - path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn - ); - _swapSupportingFeeOnTransferTokens(path, address(this)); - uint amountOut = IERC20(WETH).balanceOf(address(this)); - require(amountOut >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - IWETH(WETH).withdraw(amountOut); - TransferHelper.safeTransferETH(to, amountOut); - } - - // **** LIBRARY FUNCTIONS **** - function quote(uint amountA, uint reserveA, uint reserveB) public pure virtual override returns (uint amountB) { - return UniswapV2Library.quote(amountA, reserveA, reserveB); - } - - function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) - public - pure - virtual - override - returns (uint amountOut) - { - return UniswapV2Library.getAmountOut(amountIn, reserveIn, reserveOut); - } - - function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) - public - pure - virtual - override - returns (uint amountIn) - { - return UniswapV2Library.getAmountIn(amountOut, reserveIn, reserveOut); - } - - function getAmountsOut(uint amountIn, address[] memory path) - public - view - virtual - override - returns (uint[] memory amounts) - { - return UniswapV2Library.getAmountsOut(factory, amountIn, path); - } - - function getAmountsIn(uint amountOut, address[] memory path) - public - view - virtual - override - returns (uint[] memory amounts) - { - return UniswapV2Library.getAmountsIn(factory, amountOut, path); - } -} diff --git a/contract/lib/v2-periphery/contracts/examples/ExampleComputeLiquidityValue.sol b/contract/lib/v2-periphery/contracts/examples/ExampleComputeLiquidityValue.sol deleted file mode 100644 index bda37f7..0000000 --- a/contract/lib/v2-periphery/contracts/examples/ExampleComputeLiquidityValue.sol +++ /dev/null @@ -1,90 +0,0 @@ -pragma solidity =0.6.6; - -import '../libraries/UniswapV2LiquidityMathLibrary.sol'; - -contract ExampleComputeLiquidityValue { - using SafeMath for uint256; - - address public immutable factory; - - constructor(address factory_) public { - factory = factory_; - } - - // see UniswapV2LiquidityMathLibrary#getReservesAfterArbitrage - function getReservesAfterArbitrage( - address tokenA, - address tokenB, - uint256 truePriceTokenA, - uint256 truePriceTokenB - ) external view returns (uint256 reserveA, uint256 reserveB) { - return UniswapV2LiquidityMathLibrary.getReservesAfterArbitrage( - factory, - tokenA, - tokenB, - truePriceTokenA, - truePriceTokenB - ); - } - - // see UniswapV2LiquidityMathLibrary#getLiquidityValue - function getLiquidityValue( - address tokenA, - address tokenB, - uint256 liquidityAmount - ) external view returns ( - uint256 tokenAAmount, - uint256 tokenBAmount - ) { - return UniswapV2LiquidityMathLibrary.getLiquidityValue( - factory, - tokenA, - tokenB, - liquidityAmount - ); - } - - // see UniswapV2LiquidityMathLibrary#getLiquidityValueAfterArbitrageToPrice - function getLiquidityValueAfterArbitrageToPrice( - address tokenA, - address tokenB, - uint256 truePriceTokenA, - uint256 truePriceTokenB, - uint256 liquidityAmount - ) external view returns ( - uint256 tokenAAmount, - uint256 tokenBAmount - ) { - return UniswapV2LiquidityMathLibrary.getLiquidityValueAfterArbitrageToPrice( - factory, - tokenA, - tokenB, - truePriceTokenA, - truePriceTokenB, - liquidityAmount - ); - } - - // test function to measure the gas cost of the above function - function getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - address tokenA, - address tokenB, - uint256 truePriceTokenA, - uint256 truePriceTokenB, - uint256 liquidityAmount - ) external view returns ( - uint256 - ) { - uint gasBefore = gasleft(); - UniswapV2LiquidityMathLibrary.getLiquidityValueAfterArbitrageToPrice( - factory, - tokenA, - tokenB, - truePriceTokenA, - truePriceTokenB, - liquidityAmount - ); - uint gasAfter = gasleft(); - return gasBefore - gasAfter; - } -} diff --git a/contract/lib/v2-periphery/contracts/examples/ExampleFlashSwap.sol b/contract/lib/v2-periphery/contracts/examples/ExampleFlashSwap.sol deleted file mode 100644 index 17b2781..0000000 --- a/contract/lib/v2-periphery/contracts/examples/ExampleFlashSwap.sol +++ /dev/null @@ -1,67 +0,0 @@ -pragma solidity =0.6.6; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Callee.sol'; - -import '../libraries/UniswapV2Library.sol'; -import '../interfaces/V1/IUniswapV1Factory.sol'; -import '../interfaces/V1/IUniswapV1Exchange.sol'; -import '../interfaces/IUniswapV2Router01.sol'; -import '../interfaces/IERC20.sol'; -import '../interfaces/IWETH.sol'; - -contract ExampleFlashSwap is IUniswapV2Callee { - IUniswapV1Factory immutable factoryV1; - address immutable factory; - IWETH immutable WETH; - - constructor(address _factory, address _factoryV1, address router) public { - factoryV1 = IUniswapV1Factory(_factoryV1); - factory = _factory; - WETH = IWETH(IUniswapV2Router01(router).WETH()); - } - - // needs to accept ETH from any V1 exchange and WETH. ideally this could be enforced, as in the router, - // but it's not possible because it requires a call to the v1 factory, which takes too much gas - receive() external payable {} - - // gets tokens/WETH via a V2 flash swap, swaps for the ETH/tokens on V1, repays V2, and keeps the rest! - function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external override { - address[] memory path = new address[](2); - uint amountToken; - uint amountETH; - { // scope for token{0,1}, avoids stack too deep errors - address token0 = IUniswapV2Pair(msg.sender).token0(); - address token1 = IUniswapV2Pair(msg.sender).token1(); - assert(msg.sender == UniswapV2Library.pairFor(factory, token0, token1)); // ensure that msg.sender is actually a V2 pair - assert(amount0 == 0 || amount1 == 0); // this strategy is unidirectional - path[0] = amount0 == 0 ? token0 : token1; - path[1] = amount0 == 0 ? token1 : token0; - amountToken = token0 == address(WETH) ? amount1 : amount0; - amountETH = token0 == address(WETH) ? amount0 : amount1; - } - - assert(path[0] == address(WETH) || path[1] == address(WETH)); // this strategy only works with a V2 WETH pair - IERC20 token = IERC20(path[0] == address(WETH) ? path[1] : path[0]); - IUniswapV1Exchange exchangeV1 = IUniswapV1Exchange(factoryV1.getExchange(address(token))); // get V1 exchange - - if (amountToken > 0) { - (uint minETH) = abi.decode(data, (uint)); // slippage parameter for V1, passed in by caller - token.approve(address(exchangeV1), amountToken); - uint amountReceived = exchangeV1.tokenToEthSwapInput(amountToken, minETH, uint(-1)); - uint amountRequired = UniswapV2Library.getAmountsIn(factory, amountToken, path)[0]; - assert(amountReceived > amountRequired); // fail if we didn't get enough ETH back to repay our flash loan - WETH.deposit{value: amountRequired}(); - assert(WETH.transfer(msg.sender, amountRequired)); // return WETH to V2 pair - (bool success,) = sender.call{value: amountReceived - amountRequired}(new bytes(0)); // keep the rest! (ETH) - assert(success); - } else { - (uint minTokens) = abi.decode(data, (uint)); // slippage parameter for V1, passed in by caller - WETH.withdraw(amountETH); - uint amountReceived = exchangeV1.ethToTokenSwapInput{value: amountETH}(minTokens, uint(-1)); - uint amountRequired = UniswapV2Library.getAmountsIn(factory, amountETH, path)[0]; - assert(amountReceived > amountRequired); // fail if we didn't get enough tokens back to repay our flash loan - assert(token.transfer(msg.sender, amountRequired)); // return tokens to V2 pair - assert(token.transfer(sender, amountReceived - amountRequired)); // keep the rest! (tokens) - } - } -} diff --git a/contract/lib/v2-periphery/contracts/examples/ExampleOracleSimple.sol b/contract/lib/v2-periphery/contracts/examples/ExampleOracleSimple.sol deleted file mode 100644 index 6ab916f..0000000 --- a/contract/lib/v2-periphery/contracts/examples/ExampleOracleSimple.sol +++ /dev/null @@ -1,67 +0,0 @@ -pragma solidity =0.6.6; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol'; -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; -import '@uniswap/lib/contracts/libraries/FixedPoint.sol'; - -import '../libraries/UniswapV2OracleLibrary.sol'; -import '../libraries/UniswapV2Library.sol'; - -// fixed window oracle that recomputes the average price for the entire period once every period -// note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period -contract ExampleOracleSimple { - using FixedPoint for *; - - uint public constant PERIOD = 24 hours; - - IUniswapV2Pair immutable pair; - address public immutable token0; - address public immutable token1; - - uint public price0CumulativeLast; - uint public price1CumulativeLast; - uint32 public blockTimestampLast; - FixedPoint.uq112x112 public price0Average; - FixedPoint.uq112x112 public price1Average; - - constructor(address factory, address tokenA, address tokenB) public { - IUniswapV2Pair _pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, tokenA, tokenB)); - pair = _pair; - token0 = _pair.token0(); - token1 = _pair.token1(); - price0CumulativeLast = _pair.price0CumulativeLast(); // fetch the current accumulated price value (1 / 0) - price1CumulativeLast = _pair.price1CumulativeLast(); // fetch the current accumulated price value (0 / 1) - uint112 reserve0; - uint112 reserve1; - (reserve0, reserve1, blockTimestampLast) = _pair.getReserves(); - require(reserve0 != 0 && reserve1 != 0, 'ExampleOracleSimple: NO_RESERVES'); // ensure that there's liquidity in the pair - } - - function update() external { - (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) = - UniswapV2OracleLibrary.currentCumulativePrices(address(pair)); - uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired - - // ensure that at least one full period has passed since the last update - require(timeElapsed >= PERIOD, 'ExampleOracleSimple: PERIOD_NOT_ELAPSED'); - - // overflow is desired, casting never truncates - // cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed - price0Average = FixedPoint.uq112x112(uint224((price0Cumulative - price0CumulativeLast) / timeElapsed)); - price1Average = FixedPoint.uq112x112(uint224((price1Cumulative - price1CumulativeLast) / timeElapsed)); - - price0CumulativeLast = price0Cumulative; - price1CumulativeLast = price1Cumulative; - blockTimestampLast = blockTimestamp; - } - - // note this will always return 0 before update has been called successfully for the first time. - function consult(address token, uint amountIn) external view returns (uint amountOut) { - if (token == token0) { - amountOut = price0Average.mul(amountIn).decode144(); - } else { - require(token == token1, 'ExampleOracleSimple: INVALID_TOKEN'); - amountOut = price1Average.mul(amountIn).decode144(); - } - } -} diff --git a/contract/lib/v2-periphery/contracts/examples/ExampleSlidingWindowOracle.sol b/contract/lib/v2-periphery/contracts/examples/ExampleSlidingWindowOracle.sol deleted file mode 100644 index 1b8af30..0000000 --- a/contract/lib/v2-periphery/contracts/examples/ExampleSlidingWindowOracle.sol +++ /dev/null @@ -1,125 +0,0 @@ -pragma solidity =0.6.6; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol'; -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; -import '@uniswap/lib/contracts/libraries/FixedPoint.sol'; - -import '../libraries/SafeMath.sol'; -import '../libraries/UniswapV2Library.sol'; -import '../libraries/UniswapV2OracleLibrary.sol'; - -// sliding window oracle that uses observations collected over a window to provide moving price averages in the past -// `windowSize` with a precision of `windowSize / granularity` -// note this is a singleton oracle and only needs to be deployed once per desired parameters, which -// differs from the simple oracle which must be deployed once per pair. -contract ExampleSlidingWindowOracle { - using FixedPoint for *; - using SafeMath for uint; - - struct Observation { - uint timestamp; - uint price0Cumulative; - uint price1Cumulative; - } - - address public immutable factory; - // the desired amount of time over which the moving average should be computed, e.g. 24 hours - uint public immutable windowSize; - // the number of observations stored for each pair, i.e. how many price observations are stored for the window. - // as granularity increases from 1, more frequent updates are needed, but moving averages become more precise. - // averages are computed over intervals with sizes in the range: - // [windowSize - (windowSize / granularity) * 2, windowSize] - // e.g. if the window size is 24 hours, and the granularity is 24, the oracle will return the average price for - // the period: - // [now - [22 hours, 24 hours], now] - uint8 public immutable granularity; - // this is redundant with granularity and windowSize, but stored for gas savings & informational purposes. - uint public immutable periodSize; - - // mapping from pair address to a list of price observations of that pair - mapping(address => Observation[]) public pairObservations; - - constructor(address factory_, uint windowSize_, uint8 granularity_) public { - require(granularity_ > 1, 'SlidingWindowOracle: GRANULARITY'); - require( - (periodSize = windowSize_ / granularity_) * granularity_ == windowSize_, - 'SlidingWindowOracle: WINDOW_NOT_EVENLY_DIVISIBLE' - ); - factory = factory_; - windowSize = windowSize_; - granularity = granularity_; - } - - // returns the index of the observation corresponding to the given timestamp - function observationIndexOf(uint timestamp) public view returns (uint8 index) { - uint epochPeriod = timestamp / periodSize; - return uint8(epochPeriod % granularity); - } - - // returns the observation from the oldest epoch (at the beginning of the window) relative to the current time - function getFirstObservationInWindow(address pair) private view returns (Observation storage firstObservation) { - uint8 observationIndex = observationIndexOf(block.timestamp); - // no overflow issue. if observationIndex + 1 overflows, result is still zero. - uint8 firstObservationIndex = (observationIndex + 1) % granularity; - firstObservation = pairObservations[pair][firstObservationIndex]; - } - - // update the cumulative price for the observation at the current timestamp. each observation is updated at most - // once per epoch period. - function update(address tokenA, address tokenB) external { - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - - // populate the array with empty observations (first call only) - for (uint i = pairObservations[pair].length; i < granularity; i++) { - pairObservations[pair].push(); - } - - // get the observation for the current period - uint8 observationIndex = observationIndexOf(block.timestamp); - Observation storage observation = pairObservations[pair][observationIndex]; - - // we only want to commit updates once per period (i.e. windowSize / granularity) - uint timeElapsed = block.timestamp - observation.timestamp; - if (timeElapsed > periodSize) { - (uint price0Cumulative, uint price1Cumulative,) = UniswapV2OracleLibrary.currentCumulativePrices(pair); - observation.timestamp = block.timestamp; - observation.price0Cumulative = price0Cumulative; - observation.price1Cumulative = price1Cumulative; - } - } - - // given the cumulative prices of the start and end of a period, and the length of the period, compute the average - // price in terms of how much amount out is received for the amount in - function computeAmountOut( - uint priceCumulativeStart, uint priceCumulativeEnd, - uint timeElapsed, uint amountIn - ) private pure returns (uint amountOut) { - // overflow is desired. - FixedPoint.uq112x112 memory priceAverage = FixedPoint.uq112x112( - uint224((priceCumulativeEnd - priceCumulativeStart) / timeElapsed) - ); - amountOut = priceAverage.mul(amountIn).decode144(); - } - - // returns the amount out corresponding to the amount in for a given token using the moving average over the time - // range [now - [windowSize, windowSize - periodSize * 2], now] - // update must have been called for the bucket corresponding to timestamp `now - windowSize` - function consult(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut) { - address pair = UniswapV2Library.pairFor(factory, tokenIn, tokenOut); - Observation storage firstObservation = getFirstObservationInWindow(pair); - - uint timeElapsed = block.timestamp - firstObservation.timestamp; - require(timeElapsed <= windowSize, 'SlidingWindowOracle: MISSING_HISTORICAL_OBSERVATION'); - // should never happen. - require(timeElapsed >= windowSize - periodSize * 2, 'SlidingWindowOracle: UNEXPECTED_TIME_ELAPSED'); - - (uint price0Cumulative, uint price1Cumulative,) = UniswapV2OracleLibrary.currentCumulativePrices(pair); - (address token0,) = UniswapV2Library.sortTokens(tokenIn, tokenOut); - - if (token0 == tokenIn) { - return computeAmountOut(firstObservation.price0Cumulative, price0Cumulative, timeElapsed, amountIn); - } else { - return computeAmountOut(firstObservation.price1Cumulative, price1Cumulative, timeElapsed, amountIn); - } - } -} diff --git a/contract/lib/v2-periphery/contracts/examples/ExampleSwapToPrice.sol b/contract/lib/v2-periphery/contracts/examples/ExampleSwapToPrice.sol deleted file mode 100644 index e0f7eef..0000000 --- a/contract/lib/v2-periphery/contracts/examples/ExampleSwapToPrice.sol +++ /dev/null @@ -1,77 +0,0 @@ -pragma solidity =0.6.6; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; -import '@uniswap/lib/contracts/libraries/Babylonian.sol'; -import '@uniswap/lib/contracts/libraries/TransferHelper.sol'; - -import '../libraries/UniswapV2LiquidityMathLibrary.sol'; -import '../interfaces/IERC20.sol'; -import '../interfaces/IUniswapV2Router01.sol'; -import '../libraries/SafeMath.sol'; -import '../libraries/UniswapV2Library.sol'; - -contract ExampleSwapToPrice { - using SafeMath for uint256; - - IUniswapV2Router01 public immutable router; - address public immutable factory; - - constructor(address factory_, IUniswapV2Router01 router_) public { - factory = factory_; - router = router_; - } - - // swaps an amount of either token such that the trade is profit-maximizing, given an external true price - // true price is expressed in the ratio of token A to token B - // caller must approve this contract to spend whichever token is intended to be swapped - function swapToPrice( - address tokenA, - address tokenB, - uint256 truePriceTokenA, - uint256 truePriceTokenB, - uint256 maxSpendTokenA, - uint256 maxSpendTokenB, - address to, - uint256 deadline - ) public { - // true price is expressed as a ratio, so both values must be non-zero - require(truePriceTokenA != 0 && truePriceTokenB != 0, "ExampleSwapToPrice: ZERO_PRICE"); - // caller can specify 0 for either if they wish to swap in only one direction, but not both - require(maxSpendTokenA != 0 || maxSpendTokenB != 0, "ExampleSwapToPrice: ZERO_SPEND"); - - bool aToB; - uint256 amountIn; - { - (uint256 reserveA, uint256 reserveB) = UniswapV2Library.getReserves(factory, tokenA, tokenB); - (aToB, amountIn) = UniswapV2LiquidityMathLibrary.computeProfitMaximizingTrade( - truePriceTokenA, truePriceTokenB, - reserveA, reserveB - ); - } - - require(amountIn > 0, 'ExampleSwapToPrice: ZERO_AMOUNT_IN'); - - // spend up to the allowance of the token in - uint256 maxSpend = aToB ? maxSpendTokenA : maxSpendTokenB; - if (amountIn > maxSpend) { - amountIn = maxSpend; - } - - address tokenIn = aToB ? tokenA : tokenB; - address tokenOut = aToB ? tokenB : tokenA; - TransferHelper.safeTransferFrom(tokenIn, msg.sender, address(this), amountIn); - TransferHelper.safeApprove(tokenIn, address(router), amountIn); - - address[] memory path = new address[](2); - path[0] = tokenIn; - path[1] = tokenOut; - - router.swapExactTokensForTokens( - amountIn, - 0, // amountOutMin: we can skip computing this number because the math is tested - path, - to, - deadline - ); - } -} diff --git a/contract/lib/v2-periphery/contracts/examples/README.md b/contract/lib/v2-periphery/contracts/examples/README.md deleted file mode 100644 index 49fa2af..0000000 --- a/contract/lib/v2-periphery/contracts/examples/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Examples - -## Disclaimer - -These contracts are for demonstrative purposes only. -While these contracts have unit tests, and we generally expect them to be -correct, there are no guarantees about the correctness or security of -these contracts. We hold these contracts to a different standard of -correctness and security than other contracts in this repository. -E.g., we have explicitly excluded these contracts from the -[bug bounty](https://uniswap.org/bug-bounty/#scope). - -You must do your own due diligence if you wish to use code -from these examples in your project. diff --git a/contract/lib/v2-periphery/contracts/interfaces/IERC20.sol b/contract/lib/v2-periphery/contracts/interfaces/IERC20.sol deleted file mode 100644 index c1e8c3e..0000000 --- a/contract/lib/v2-periphery/contracts/interfaces/IERC20.sol +++ /dev/null @@ -1,17 +0,0 @@ -pragma solidity >=0.5.0; - -interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint value); - event Transfer(address indexed from, address indexed to, uint value); - - function name() external view returns (string memory); - function symbol() external view returns (string memory); - function decimals() external view returns (uint8); - function totalSupply() external view returns (uint); - function balanceOf(address owner) external view returns (uint); - function allowance(address owner, address spender) external view returns (uint); - - function approve(address spender, uint value) external returns (bool); - function transfer(address to, uint value) external returns (bool); - function transferFrom(address from, address to, uint value) external returns (bool); -} diff --git a/contract/lib/v2-periphery/contracts/interfaces/IUniswapV2Migrator.sol b/contract/lib/v2-periphery/contracts/interfaces/IUniswapV2Migrator.sol deleted file mode 100644 index 723e348..0000000 --- a/contract/lib/v2-periphery/contracts/interfaces/IUniswapV2Migrator.sol +++ /dev/null @@ -1,5 +0,0 @@ -pragma solidity >=0.5.0; - -interface IUniswapV2Migrator { - function migrate(address token, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external; -} diff --git a/contract/lib/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol b/contract/lib/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol deleted file mode 100644 index 4619967..0000000 --- a/contract/lib/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol +++ /dev/null @@ -1,95 +0,0 @@ -pragma solidity >=0.6.2; - -interface IUniswapV2Router01 { - function factory() external pure returns (address); - function WETH() external pure returns (address); - - function addLiquidity( - address tokenA, - address tokenB, - uint amountADesired, - uint amountBDesired, - uint amountAMin, - uint amountBMin, - address to, - uint deadline - ) external returns (uint amountA, uint amountB, uint liquidity); - function addLiquidityETH( - address token, - uint amountTokenDesired, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) external payable returns (uint amountToken, uint amountETH, uint liquidity); - function removeLiquidity( - address tokenA, - address tokenB, - uint liquidity, - uint amountAMin, - uint amountBMin, - address to, - uint deadline - ) external returns (uint amountA, uint amountB); - function removeLiquidityETH( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) external returns (uint amountToken, uint amountETH); - function removeLiquidityWithPermit( - address tokenA, - address tokenB, - uint liquidity, - uint amountAMin, - uint amountBMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external returns (uint amountA, uint amountB); - function removeLiquidityETHWithPermit( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external returns (uint amountToken, uint amountETH); - function swapExactTokensForTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external returns (uint[] memory amounts); - function swapTokensForExactTokens( - uint amountOut, - uint amountInMax, - address[] calldata path, - address to, - uint deadline - ) external returns (uint[] memory amounts); - function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) - external - payable - returns (uint[] memory amounts); - function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) - external - returns (uint[] memory amounts); - function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) - external - returns (uint[] memory amounts); - function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) - external - payable - returns (uint[] memory amounts); - - function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); - function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); - function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); - function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); - function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); -} diff --git a/contract/lib/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol b/contract/lib/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol deleted file mode 100644 index 1fc7b0a..0000000 --- a/contract/lib/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol +++ /dev/null @@ -1,44 +0,0 @@ -pragma solidity >=0.6.2; - -import './IUniswapV2Router01.sol'; - -interface IUniswapV2Router02 is IUniswapV2Router01 { - function removeLiquidityETHSupportingFeeOnTransferTokens( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) external returns (uint amountETH); - function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external returns (uint amountETH); - - function swapExactTokensForTokensSupportingFeeOnTransferTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external; - function swapExactETHForTokensSupportingFeeOnTransferTokens( - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external payable; - function swapExactTokensForETHSupportingFeeOnTransferTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external; -} diff --git a/contract/lib/v2-periphery/contracts/interfaces/IWETH.sol b/contract/lib/v2-periphery/contracts/interfaces/IWETH.sol deleted file mode 100644 index e05fb77..0000000 --- a/contract/lib/v2-periphery/contracts/interfaces/IWETH.sol +++ /dev/null @@ -1,7 +0,0 @@ -pragma solidity >=0.5.0; - -interface IWETH { - function deposit() external payable; - function transfer(address to, uint value) external returns (bool); - function withdraw(uint) external; -} diff --git a/contract/lib/v2-periphery/contracts/interfaces/V1/IUniswapV1Exchange.sol b/contract/lib/v2-periphery/contracts/interfaces/V1/IUniswapV1Exchange.sol deleted file mode 100644 index 039060f..0000000 --- a/contract/lib/v2-periphery/contracts/interfaces/V1/IUniswapV1Exchange.sol +++ /dev/null @@ -1,9 +0,0 @@ -pragma solidity >=0.5.0; - -interface IUniswapV1Exchange { - function balanceOf(address owner) external view returns (uint); - function transferFrom(address from, address to, uint value) external returns (bool); - function removeLiquidity(uint, uint, uint, uint) external returns (uint, uint); - function tokenToEthSwapInput(uint, uint, uint) external returns (uint); - function ethToTokenSwapInput(uint, uint) external payable returns (uint); -} diff --git a/contract/lib/v2-periphery/contracts/interfaces/V1/IUniswapV1Factory.sol b/contract/lib/v2-periphery/contracts/interfaces/V1/IUniswapV1Factory.sol deleted file mode 100644 index 1c302fb..0000000 --- a/contract/lib/v2-periphery/contracts/interfaces/V1/IUniswapV1Factory.sol +++ /dev/null @@ -1,5 +0,0 @@ -pragma solidity >=0.5.0; - -interface IUniswapV1Factory { - function getExchange(address) external view returns (address); -} diff --git a/contract/lib/v2-periphery/contracts/libraries/SafeMath.sol b/contract/lib/v2-periphery/contracts/libraries/SafeMath.sol deleted file mode 100644 index ba6fc21..0000000 --- a/contract/lib/v2-periphery/contracts/libraries/SafeMath.sol +++ /dev/null @@ -1,17 +0,0 @@ -pragma solidity =0.6.6; - -// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) - -library SafeMath { - function add(uint x, uint y) internal pure returns (uint z) { - require((z = x + y) >= x, 'ds-math-add-overflow'); - } - - function sub(uint x, uint y) internal pure returns (uint z) { - require((z = x - y) <= x, 'ds-math-sub-underflow'); - } - - function mul(uint x, uint y) internal pure returns (uint z) { - require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow'); - } -} diff --git a/contract/lib/v2-periphery/contracts/libraries/UniswapV2Library.sol b/contract/lib/v2-periphery/contracts/libraries/UniswapV2Library.sol deleted file mode 100644 index 107fb2e..0000000 --- a/contract/lib/v2-periphery/contracts/libraries/UniswapV2Library.sol +++ /dev/null @@ -1,82 +0,0 @@ -pragma solidity >=0.5.0; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; - -import "./SafeMath.sol"; - -library UniswapV2Library { - using SafeMath for uint; - - // returns sorted token addresses, used to handle return values from pairs sorted in this order - function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { - require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); - (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); - require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); - } - - // calculates the CREATE2 address for a pair without making any external calls - function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { - (address token0, address token1) = sortTokens(tokenA, tokenB); - pair = address(uint(keccak256(abi.encodePacked( - hex'ff', - factory, - keccak256(abi.encodePacked(token0, token1)), - hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash - )))); - } - - // fetches and sorts the reserves for a pair - function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { - (address token0,) = sortTokens(tokenA, tokenB); - (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); - (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); - } - - // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset - function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { - require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); - require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); - amountB = amountA.mul(reserveB) / reserveA; - } - - // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset - function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { - require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); - require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); - uint amountInWithFee = amountIn.mul(997); - uint numerator = amountInWithFee.mul(reserveOut); - uint denominator = reserveIn.mul(1000).add(amountInWithFee); - amountOut = numerator / denominator; - } - - // given an output amount of an asset and pair reserves, returns a required input amount of the other asset - function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { - require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); - require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); - uint numerator = reserveIn.mul(amountOut).mul(1000); - uint denominator = reserveOut.sub(amountOut).mul(997); - amountIn = (numerator / denominator).add(1); - } - - // performs chained getAmountOut calculations on any number of pairs - function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { - require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); - amounts = new uint[](path.length); - amounts[0] = amountIn; - for (uint i; i < path.length - 1; i++) { - (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); - amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); - } - } - - // performs chained getAmountIn calculations on any number of pairs - function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { - require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); - amounts = new uint[](path.length); - amounts[amounts.length - 1] = amountOut; - for (uint i = path.length - 1; i > 0; i--) { - (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); - amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); - } - } -} diff --git a/contract/lib/v2-periphery/contracts/libraries/UniswapV2LiquidityMathLibrary.sol b/contract/lib/v2-periphery/contracts/libraries/UniswapV2LiquidityMathLibrary.sol deleted file mode 100644 index 9b4afce..0000000 --- a/contract/lib/v2-periphery/contracts/libraries/UniswapV2LiquidityMathLibrary.sol +++ /dev/null @@ -1,139 +0,0 @@ -pragma solidity >=0.5.0; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol'; -import '@uniswap/lib/contracts/libraries/Babylonian.sol'; -import '@uniswap/lib/contracts/libraries/FullMath.sol'; - -import './SafeMath.sol'; -import './UniswapV2Library.sol'; - -// library containing some math for dealing with the liquidity shares of a pair, e.g. computing their exact value -// in terms of the underlying tokens -library UniswapV2LiquidityMathLibrary { - using SafeMath for uint256; - - // computes the direction and magnitude of the profit-maximizing trade - function computeProfitMaximizingTrade( - uint256 truePriceTokenA, - uint256 truePriceTokenB, - uint256 reserveA, - uint256 reserveB - ) pure internal returns (bool aToB, uint256 amountIn) { - aToB = FullMath.mulDiv(reserveA, truePriceTokenB, reserveB) < truePriceTokenA; - - uint256 invariant = reserveA.mul(reserveB); - - uint256 leftSide = Babylonian.sqrt( - FullMath.mulDiv( - invariant.mul(1000), - aToB ? truePriceTokenA : truePriceTokenB, - (aToB ? truePriceTokenB : truePriceTokenA).mul(997) - ) - ); - uint256 rightSide = (aToB ? reserveA.mul(1000) : reserveB.mul(1000)) / 997; - - if (leftSide < rightSide) return (false, 0); - - // compute the amount that must be sent to move the price to the profit-maximizing price - amountIn = leftSide.sub(rightSide); - } - - // gets the reserves after an arbitrage moves the price to the profit-maximizing ratio given an externally observed true price - function getReservesAfterArbitrage( - address factory, - address tokenA, - address tokenB, - uint256 truePriceTokenA, - uint256 truePriceTokenB - ) view internal returns (uint256 reserveA, uint256 reserveB) { - // first get reserves before the swap - (reserveA, reserveB) = UniswapV2Library.getReserves(factory, tokenA, tokenB); - - require(reserveA > 0 && reserveB > 0, 'UniswapV2ArbitrageLibrary: ZERO_PAIR_RESERVES'); - - // then compute how much to swap to arb to the true price - (bool aToB, uint256 amountIn) = computeProfitMaximizingTrade(truePriceTokenA, truePriceTokenB, reserveA, reserveB); - - if (amountIn == 0) { - return (reserveA, reserveB); - } - - // now affect the trade to the reserves - if (aToB) { - uint amountOut = UniswapV2Library.getAmountOut(amountIn, reserveA, reserveB); - reserveA += amountIn; - reserveB -= amountOut; - } else { - uint amountOut = UniswapV2Library.getAmountOut(amountIn, reserveB, reserveA); - reserveB += amountIn; - reserveA -= amountOut; - } - } - - // computes liquidity value given all the parameters of the pair - function computeLiquidityValue( - uint256 reservesA, - uint256 reservesB, - uint256 totalSupply, - uint256 liquidityAmount, - bool feeOn, - uint kLast - ) internal pure returns (uint256 tokenAAmount, uint256 tokenBAmount) { - if (feeOn && kLast > 0) { - uint rootK = Babylonian.sqrt(reservesA.mul(reservesB)); - uint rootKLast = Babylonian.sqrt(kLast); - if (rootK > rootKLast) { - uint numerator1 = totalSupply; - uint numerator2 = rootK.sub(rootKLast); - uint denominator = rootK.mul(5).add(rootKLast); - uint feeLiquidity = FullMath.mulDiv(numerator1, numerator2, denominator); - totalSupply = totalSupply.add(feeLiquidity); - } - } - return (reservesA.mul(liquidityAmount) / totalSupply, reservesB.mul(liquidityAmount) / totalSupply); - } - - // get all current parameters from the pair and compute value of a liquidity amount - // **note this is subject to manipulation, e.g. sandwich attacks**. prefer passing a manipulation resistant price to - // #getLiquidityValueAfterArbitrageToPrice - function getLiquidityValue( - address factory, - address tokenA, - address tokenB, - uint256 liquidityAmount - ) internal view returns (uint256 tokenAAmount, uint256 tokenBAmount) { - (uint256 reservesA, uint256 reservesB) = UniswapV2Library.getReserves(factory, tokenA, tokenB); - IUniswapV2Pair pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, tokenA, tokenB)); - bool feeOn = IUniswapV2Factory(factory).feeTo() != address(0); - uint kLast = feeOn ? pair.kLast() : 0; - uint totalSupply = pair.totalSupply(); - return computeLiquidityValue(reservesA, reservesB, totalSupply, liquidityAmount, feeOn, kLast); - } - - // given two tokens, tokenA and tokenB, and their "true price", i.e. the observed ratio of value of token A to token B, - // and a liquidity amount, returns the value of the liquidity in terms of tokenA and tokenB - function getLiquidityValueAfterArbitrageToPrice( - address factory, - address tokenA, - address tokenB, - uint256 truePriceTokenA, - uint256 truePriceTokenB, - uint256 liquidityAmount - ) internal view returns ( - uint256 tokenAAmount, - uint256 tokenBAmount - ) { - bool feeOn = IUniswapV2Factory(factory).feeTo() != address(0); - IUniswapV2Pair pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, tokenA, tokenB)); - uint kLast = feeOn ? pair.kLast() : 0; - uint totalSupply = pair.totalSupply(); - - // this also checks that totalSupply > 0 - require(totalSupply >= liquidityAmount && liquidityAmount > 0, 'ComputeLiquidityValue: LIQUIDITY_AMOUNT'); - - (uint reservesA, uint reservesB) = getReservesAfterArbitrage(factory, tokenA, tokenB, truePriceTokenA, truePriceTokenB); - - return computeLiquidityValue(reservesA, reservesB, totalSupply, liquidityAmount, feeOn, kLast); - } -} diff --git a/contract/lib/v2-periphery/contracts/libraries/UniswapV2OracleLibrary.sol b/contract/lib/v2-periphery/contracts/libraries/UniswapV2OracleLibrary.sol deleted file mode 100644 index 4cff017..0000000 --- a/contract/lib/v2-periphery/contracts/libraries/UniswapV2OracleLibrary.sol +++ /dev/null @@ -1,35 +0,0 @@ -pragma solidity >=0.5.0; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; -import '@uniswap/lib/contracts/libraries/FixedPoint.sol'; - -// library with helper methods for oracles that are concerned with computing average prices -library UniswapV2OracleLibrary { - using FixedPoint for *; - - // helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1] - function currentBlockTimestamp() internal view returns (uint32) { - return uint32(block.timestamp % 2 ** 32); - } - - // produces the cumulative price using counterfactuals to save gas and avoid a call to sync. - function currentCumulativePrices( - address pair - ) internal view returns (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) { - blockTimestamp = currentBlockTimestamp(); - price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast(); - price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast(); - - // if time has elapsed since the last update on the pair, mock the accumulated price values - (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves(); - if (blockTimestampLast != blockTimestamp) { - // subtraction overflow is desired - uint32 timeElapsed = blockTimestamp - blockTimestampLast; - // addition overflow is desired - // counterfactual - price0Cumulative += uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed; - // counterfactual - price1Cumulative += uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed; - } - } -} diff --git a/contract/lib/v2-periphery/contracts/test/DeflatingERC20.sol b/contract/lib/v2-periphery/contracts/test/DeflatingERC20.sol deleted file mode 100644 index 4bb6ed2..0000000 --- a/contract/lib/v2-periphery/contracts/test/DeflatingERC20.sol +++ /dev/null @@ -1,97 +0,0 @@ -pragma solidity =0.6.6; - -import '../libraries/SafeMath.sol'; - -contract DeflatingERC20 { - using SafeMath for uint; - - string public constant name = 'Deflating Test Token'; - string public constant symbol = 'DTT'; - uint8 public constant decimals = 18; - uint public totalSupply; - mapping(address => uint) public balanceOf; - mapping(address => mapping(address => uint)) public allowance; - - bytes32 public DOMAIN_SEPARATOR; - // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); - bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; - mapping(address => uint) public nonces; - - event Approval(address indexed owner, address indexed spender, uint value); - event Transfer(address indexed from, address indexed to, uint value); - - constructor(uint _totalSupply) public { - uint chainId; - assembly { - chainId := chainid() - } - DOMAIN_SEPARATOR = keccak256( - abi.encode( - keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'), - keccak256(bytes(name)), - keccak256(bytes('1')), - chainId, - address(this) - ) - ); - _mint(msg.sender, _totalSupply); - } - - function _mint(address to, uint value) internal { - totalSupply = totalSupply.add(value); - balanceOf[to] = balanceOf[to].add(value); - emit Transfer(address(0), to, value); - } - - function _burn(address from, uint value) internal { - balanceOf[from] = balanceOf[from].sub(value); - totalSupply = totalSupply.sub(value); - emit Transfer(from, address(0), value); - } - - function _approve(address owner, address spender, uint value) private { - allowance[owner][spender] = value; - emit Approval(owner, spender, value); - } - - function _transfer(address from, address to, uint value) private { - uint burnAmount = value / 100; - _burn(from, burnAmount); - uint transferAmount = value.sub(burnAmount); - balanceOf[from] = balanceOf[from].sub(transferAmount); - balanceOf[to] = balanceOf[to].add(transferAmount); - emit Transfer(from, to, transferAmount); - } - - function approve(address spender, uint value) external returns (bool) { - _approve(msg.sender, spender, value); - return true; - } - - function transfer(address to, uint value) external returns (bool) { - _transfer(msg.sender, to, value); - return true; - } - - function transferFrom(address from, address to, uint value) external returns (bool) { - if (allowance[from][msg.sender] != uint(-1)) { - allowance[from][msg.sender] = allowance[from][msg.sender].sub(value); - } - _transfer(from, to, value); - return true; - } - - function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external { - require(deadline >= block.timestamp, 'EXPIRED'); - bytes32 digest = keccak256( - abi.encodePacked( - '\x19\x01', - DOMAIN_SEPARATOR, - keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)) - ) - ); - address recoveredAddress = ecrecover(digest, v, r, s); - require(recoveredAddress != address(0) && recoveredAddress == owner, 'INVALID_SIGNATURE'); - _approve(owner, spender, value); - } -} diff --git a/contract/lib/v2-periphery/contracts/test/ERC20.sol b/contract/lib/v2-periphery/contracts/test/ERC20.sol deleted file mode 100644 index b47ee30..0000000 --- a/contract/lib/v2-periphery/contracts/test/ERC20.sol +++ /dev/null @@ -1,94 +0,0 @@ -pragma solidity =0.6.6; - -import '../libraries/SafeMath.sol'; - -contract ERC20 { - using SafeMath for uint; - - string public constant name = 'Test Token'; - string public constant symbol = 'TT'; - uint8 public constant decimals = 18; - uint public totalSupply; - mapping(address => uint) public balanceOf; - mapping(address => mapping(address => uint)) public allowance; - - bytes32 public DOMAIN_SEPARATOR; - // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); - bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; - mapping(address => uint) public nonces; - - event Approval(address indexed owner, address indexed spender, uint value); - event Transfer(address indexed from, address indexed to, uint value); - - constructor(uint _totalSupply) public { - uint chainId; - assembly { - chainId := chainid() - } - DOMAIN_SEPARATOR = keccak256( - abi.encode( - keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'), - keccak256(bytes(name)), - keccak256(bytes('1')), - chainId, - address(this) - ) - ); - _mint(msg.sender, _totalSupply); - } - - function _mint(address to, uint value) internal { - totalSupply = totalSupply.add(value); - balanceOf[to] = balanceOf[to].add(value); - emit Transfer(address(0), to, value); - } - - function _burn(address from, uint value) internal { - balanceOf[from] = balanceOf[from].sub(value); - totalSupply = totalSupply.sub(value); - emit Transfer(from, address(0), value); - } - - function _approve(address owner, address spender, uint value) private { - allowance[owner][spender] = value; - emit Approval(owner, spender, value); - } - - function _transfer(address from, address to, uint value) private { - balanceOf[from] = balanceOf[from].sub(value); - balanceOf[to] = balanceOf[to].add(value); - emit Transfer(from, to, value); - } - - function approve(address spender, uint value) external returns (bool) { - _approve(msg.sender, spender, value); - return true; - } - - function transfer(address to, uint value) external returns (bool) { - _transfer(msg.sender, to, value); - return true; - } - - function transferFrom(address from, address to, uint value) external returns (bool) { - if (allowance[from][msg.sender] != uint(-1)) { - allowance[from][msg.sender] = allowance[from][msg.sender].sub(value); - } - _transfer(from, to, value); - return true; - } - - function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external { - require(deadline >= block.timestamp, 'EXPIRED'); - bytes32 digest = keccak256( - abi.encodePacked( - '\x19\x01', - DOMAIN_SEPARATOR, - keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)) - ) - ); - address recoveredAddress = ecrecover(digest, v, r, s); - require(recoveredAddress != address(0) && recoveredAddress == owner, 'INVALID_SIGNATURE'); - _approve(owner, spender, value); - } -} diff --git a/contract/lib/v2-periphery/contracts/test/RouterEventEmitter.sol b/contract/lib/v2-periphery/contracts/test/RouterEventEmitter.sol deleted file mode 100644 index 319af12..0000000 --- a/contract/lib/v2-periphery/contracts/test/RouterEventEmitter.sol +++ /dev/null @@ -1,97 +0,0 @@ -pragma solidity =0.6.6; - -import '../interfaces/IUniswapV2Router01.sol'; - -contract RouterEventEmitter { - event Amounts(uint[] amounts); - - receive() external payable {} - - function swapExactTokensForTokens( - address router, - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external { - (bool success, bytes memory returnData) = router.delegatecall(abi.encodeWithSelector( - IUniswapV2Router01(router).swapExactTokensForTokens.selector, amountIn, amountOutMin, path, to, deadline - )); - assert(success); - emit Amounts(abi.decode(returnData, (uint[]))); - } - - function swapTokensForExactTokens( - address router, - uint amountOut, - uint amountInMax, - address[] calldata path, - address to, - uint deadline - ) external { - (bool success, bytes memory returnData) = router.delegatecall(abi.encodeWithSelector( - IUniswapV2Router01(router).swapTokensForExactTokens.selector, amountOut, amountInMax, path, to, deadline - )); - assert(success); - emit Amounts(abi.decode(returnData, (uint[]))); - } - - function swapExactETHForTokens( - address router, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external payable { - (bool success, bytes memory returnData) = router.delegatecall(abi.encodeWithSelector( - IUniswapV2Router01(router).swapExactETHForTokens.selector, amountOutMin, path, to, deadline - )); - assert(success); - emit Amounts(abi.decode(returnData, (uint[]))); - } - - function swapTokensForExactETH( - address router, - uint amountOut, - uint amountInMax, - address[] calldata path, - address to, - uint deadline - ) external { - (bool success, bytes memory returnData) = router.delegatecall(abi.encodeWithSelector( - IUniswapV2Router01(router).swapTokensForExactETH.selector, amountOut, amountInMax, path, to, deadline - )); - assert(success); - emit Amounts(abi.decode(returnData, (uint[]))); - } - - function swapExactTokensForETH( - address router, - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external { - (bool success, bytes memory returnData) = router.delegatecall(abi.encodeWithSelector( - IUniswapV2Router01(router).swapExactTokensForETH.selector, amountIn, amountOutMin, path, to, deadline - )); - assert(success); - emit Amounts(abi.decode(returnData, (uint[]))); - } - - function swapETHForExactTokens( - address router, - uint amountOut, - address[] calldata path, - address to, - uint deadline - ) external payable { - (bool success, bytes memory returnData) = router.delegatecall(abi.encodeWithSelector( - IUniswapV2Router01(router).swapETHForExactTokens.selector, amountOut, path, to, deadline - )); - assert(success); - emit Amounts(abi.decode(returnData, (uint[]))); - } -} diff --git a/contract/lib/v2-periphery/contracts/test/WETH9.sol b/contract/lib/v2-periphery/contracts/test/WETH9.sol deleted file mode 100644 index c5c4c76..0000000 --- a/contract/lib/v2-periphery/contracts/test/WETH9.sol +++ /dev/null @@ -1,756 +0,0 @@ -// Copyright (C) 2015, 2016, 2017 Dapphub - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity =0.6.6; - -contract WETH9 { - string public name = "Wrapped Ether"; - string public symbol = "WETH"; - uint8 public decimals = 18; - - event Approval(address indexed src, address indexed guy, uint wad); - event Transfer(address indexed src, address indexed dst, uint wad); - event Deposit(address indexed dst, uint wad); - event Withdrawal(address indexed src, uint wad); - - mapping (address => uint) public balanceOf; - mapping (address => mapping (address => uint)) public allowance; - - // function() public payable { - // deposit(); - // } - function deposit() public payable { - balanceOf[msg.sender] += msg.value; - emit Deposit(msg.sender, msg.value); - } - function withdraw(uint wad) public { - require(balanceOf[msg.sender] >= wad, ""); - balanceOf[msg.sender] -= wad; - msg.sender.transfer(wad); - emit Withdrawal(msg.sender, wad); - } - - function totalSupply() public view returns (uint) { - return address(this).balance; - } - - function approve(address guy, uint wad) public returns (bool) { - allowance[msg.sender][guy] = wad; - emit Approval(msg.sender, guy, wad); - return true; - } - - function transfer(address dst, uint wad) public returns (bool) { - return transferFrom(msg.sender, dst, wad); - } - - function transferFrom(address src, address dst, uint wad) - public - returns (bool) - { - require(balanceOf[src] >= wad, ""); - - if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) { - require(allowance[src][msg.sender] >= wad, ""); - allowance[src][msg.sender] -= wad; - } - - balanceOf[src] -= wad; - balanceOf[dst] += wad; - - emit Transfer(src, dst, wad); - - return true; - } -} - - -/* - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. - -*/ \ No newline at end of file diff --git a/contract/lib/v2-periphery/package.json b/contract/lib/v2-periphery/package.json deleted file mode 100644 index c5b1bff..0000000 --- a/contract/lib/v2-periphery/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "@uniswap/v2-periphery", - "version": "1.1.0-beta.0", - "description": "🎚 Peripheral smart contracts for interacting with Uniswap V2", - "engines": { - "node": ">=10" - }, - "homepage": "https://uniswap.org", - "repository": { - "type": "git", - "url": "https://github.com/Uniswap/uniswap-v2-periphery" - }, - "files": [ - "build", - "contracts" - ], - "dependencies": { - "@uniswap/lib": "4.0.1-alpha", - "@uniswap/v2-core": "1.0.0" - }, - "devDependencies": { - "@types/chai": "^4.2.6", - "@types/mocha": "^5.2.7", - "chai": "^4.2.0", - "ethereum-waffle": "^2.4.1", - "ethereumjs-util": "^6.2.0", - "mocha": "^6.2.2", - "ncp": "^2.0.0", - "prettier": "^1.19.1", - "rimraf": "^3.0.0", - "solc": "0.6.6", - "ts-node": "^8.5.4", - "typescript": "^3.7.3" - }, - "scripts": { - "lint": "yarn prettier ./test/*.ts --check", - "lint:fix": "yarn prettier ./test/*.ts --write", - "clean": "rimraf ./build/", - "copy-v1-artifacts": "ncp ./buildV1 ./build", - "precompile": "yarn clean", - "compile": "waffle .waffle.json", - "postcompile": "yarn copy-v1-artifacts", - "pretest": "yarn compile", - "test": "mocha", - "prepublishOnly": "yarn test" - }, - "license": "GPL-3.0-or-later" -} diff --git a/contract/lib/v2-periphery/test/ExampleComputeLiquidityValue.spec.ts b/contract/lib/v2-periphery/test/ExampleComputeLiquidityValue.spec.ts deleted file mode 100644 index 26ba182..0000000 --- a/contract/lib/v2-periphery/test/ExampleComputeLiquidityValue.spec.ts +++ /dev/null @@ -1,454 +0,0 @@ -import { AddressZero, MaxUint256 } from 'ethers/constants' -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { solidity, MockProvider, createFixtureLoader, deployContract } from 'ethereum-waffle' - -import { expandTo18Decimals } from './shared/utilities' -import { v2Fixture } from './shared/fixtures' - -import ExampleComputeLiquidityValue from '../build/ExampleComputeLiquidityValue.json' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -describe('ExampleComputeLiquidityValue', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let token0: Contract - let token1: Contract - let factory: Contract - let pair: Contract - let computeLiquidityValue: Contract - let router: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - token0 = fixture.token0 - token1 = fixture.token1 - pair = fixture.pair - factory = fixture.factoryV2 - router = fixture.router - computeLiquidityValue = await deployContract( - wallet, - ExampleComputeLiquidityValue, - [fixture.factoryV2.address], - overrides - ) - }) - - beforeEach('mint some liquidity for the pair at 1:100 (100 shares minted)', async () => { - await token0.transfer(pair.address, expandTo18Decimals(10)) - await token1.transfer(pair.address, expandTo18Decimals(1000)) - await pair.mint(wallet.address, overrides) - expect(await pair.totalSupply()).to.eq(expandTo18Decimals(100)) - }) - - it('correct factory address', async () => { - expect(await computeLiquidityValue.factory()).to.eq(factory.address) - }) - - describe('#getLiquidityValue', () => { - it('correct for 5 shares', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValue( - token0.address, - token1.address, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('500000000000000000') - expect(token1Amount).to.eq('50000000000000000000') - }) - it('correct for 7 shares', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValue( - token0.address, - token1.address, - expandTo18Decimals(7) - ) - expect(token0Amount).to.eq('700000000000000000') - expect(token1Amount).to.eq('70000000000000000000') - }) - - it('correct after swap', async () => { - await token0.approve(router.address, MaxUint256, overrides) - await router.swapExactTokensForTokens( - expandTo18Decimals(10), - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValue( - token0.address, - token1.address, - expandTo18Decimals(7) - ) - expect(token0Amount).to.eq('1400000000000000000') - expect(token1Amount).to.eq('35052578868302453680') - }) - - describe('fee on', () => { - beforeEach('turn on fee', async () => { - await factory.setFeeTo(wallet.address) - }) - - // this is necessary to cause kLast to be set - beforeEach('mint more liquidity to address zero', async () => { - await token0.transfer(pair.address, expandTo18Decimals(10)) - await token1.transfer(pair.address, expandTo18Decimals(1000)) - await pair.mint(AddressZero, overrides) - expect(await pair.totalSupply()).to.eq(expandTo18Decimals(200)) - }) - - it('correct after swap', async () => { - await token0.approve(router.address, MaxUint256, overrides) - await router.swapExactTokensForTokens( - expandTo18Decimals(20), - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValue( - token0.address, - token1.address, - expandTo18Decimals(7) - ) - expect(token0Amount).to.eq('1399824934325735058') - expect(token1Amount).to.eq('35048195651620807684') - }) - }) - }) - - describe('#getReservesAfterArbitrage', () => { - it('1/400', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - 1, - 400 - ) - expect(reserveA).to.eq('5007516917298542016') - expect(reserveB).to.eq('1999997739838173075192') - }) - it('1/200', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - 1, - 200 - ) - expect(reserveA).to.eq('7081698338256310291') - expect(reserveB).to.eq('1413330640570018326894') - }) - it('1/100 (same price)', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - 1, - 100 - ) - expect(reserveA).to.eq('10000000000000000000') - expect(reserveB).to.eq('1000000000000000000000') - }) - it('1/50', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - 1, - 50 - ) - expect(reserveA).to.eq('14133306405700183269') - expect(reserveB).to.eq('708169833825631029041') - }) - it('1/25', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - 1, - 25 - ) - expect(reserveA).to.eq('19999977398381730752') - expect(reserveB).to.eq('500751691729854201595') - }) - it('25/1', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - 25, - 1 - ) - expect(reserveA).to.eq('500721601459041764285') - expect(reserveB).to.eq('20030067669194168064') - }) - it('works with large numbers for the price', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - MaxUint256.div(1000), - MaxUint256.div(1000) - ) - // diff of 30 bips - expect(reserveA).to.eq('100120248075158403008') - expect(reserveB).to.eq('100150338345970840319') - }) - }) - - describe('#getLiquidityValue', () => { - describe('fee is off', () => { - it('produces the correct value after arbing to 1:105', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 105, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('488683612488266114') // slightly less than 5% of 10, or 0.5 - expect(token1Amount).to.eq('51161327957205755422') // slightly more than 5% of 100, or 5 - }) - - it('produces the correct value after arbing to 1:95', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 95, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('512255881944227034') // slightly more than 5% of 10, or 0.5 - expect(token1Amount).to.eq('48807237571060645526') // slightly less than 5% of 100, or 5 - }) - - it('produces correct value at the current price', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 100, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('500000000000000000') - expect(token1Amount).to.eq('50000000000000000000') - }) - - it('gas current price', async () => { - expect( - await computeLiquidityValue.getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 100, - expandTo18Decimals(5) - ) - ).to.eq('12705') - }) - - it('gas higher price', async () => { - expect( - await computeLiquidityValue.getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 105, - expandTo18Decimals(5) - ) - ).to.eq('13478') - }) - - it('gas lower price', async () => { - expect( - await computeLiquidityValue.getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 95, - expandTo18Decimals(5) - ) - ).to.eq('13523') - }) - - describe('after a swap', () => { - beforeEach('swap to ~1:25', async () => { - await token0.approve(router.address, MaxUint256, overrides) - await router.swapExactTokensForTokens( - expandTo18Decimals(10), - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - const [reserve0, reserve1] = await pair.getReserves() - expect(reserve0).to.eq('20000000000000000000') - expect(reserve1).to.eq('500751126690035052579') // half plus the fee - }) - - it('is roughly 1/25th liquidity', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 25, - expandTo18Decimals(5) - ) - - expect(token0Amount).to.eq('1000000000000000000') - expect(token1Amount).to.eq('25037556334501752628') - }) - - it('shares after arbing back to 1:100', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 100, - expandTo18Decimals(5) - ) - - expect(token0Amount).to.eq('501127678536722155') - expect(token1Amount).to.eq('50037429168613534246') - }) - }) - }) - - describe('fee is on', () => { - beforeEach('turn on fee', async () => { - await factory.setFeeTo(wallet.address) - }) - - // this is necessary to cause kLast to be set - beforeEach('mint more liquidity to address zero', async () => { - await token0.transfer(pair.address, expandTo18Decimals(10)) - await token1.transfer(pair.address, expandTo18Decimals(1000)) - await pair.mint(AddressZero, overrides) - expect(await pair.totalSupply()).to.eq(expandTo18Decimals(200)) - }) - - describe('no fee to be collected', () => { - it('produces the correct value after arbing to 1:105', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 105, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('488680839243189328') // slightly less than 5% of 10, or 0.5 - expect(token1Amount).to.eq('51161037620273529068') // slightly more than 5% of 100, or 5 - }) - - it('produces the correct value after arbing to 1:95', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 95, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('512252817918759166') // slightly more than 5% of 10, or 0.5 - expect(token1Amount).to.eq('48806945633721895174') // slightly less than 5% of 100, or 5 - }) - - it('produces correct value at the current price', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 100, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('500000000000000000') - expect(token1Amount).to.eq('50000000000000000000') - }) - }) - - it('gas current price', async () => { - expect( - await computeLiquidityValue.getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 100, - expandTo18Decimals(5) - ) - ).to.eq('16938') - }) - - it('gas higher price', async () => { - expect( - await computeLiquidityValue.getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 105, - expandTo18Decimals(5) - ) - ).to.eq('18475') - }) - - it('gas lower price', async () => { - expect( - await computeLiquidityValue.getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 95, - expandTo18Decimals(5) - ) - ).to.eq('18406') - }) - - describe('after a swap', () => { - beforeEach('swap to ~1:25', async () => { - await token0.approve(router.address, MaxUint256, overrides) - await router.swapExactTokensForTokens( - expandTo18Decimals(20), - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - const [reserve0, reserve1] = await pair.getReserves() - expect(reserve0).to.eq('40000000000000000000') - expect(reserve1).to.eq('1001502253380070105158') // half plus the fee - }) - - it('is roughly 1:25', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 25, - expandTo18Decimals(5) - ) - - expect(token0Amount).to.eq('999874953089810756') - expect(token1Amount).to.eq('25034425465443434060') - }) - - it('shares after arbing back to 1:100', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 100, - expandTo18Decimals(5) - ) - - expect(token0Amount).to.eq('501002443792372662') - expect(token1Amount).to.eq('50024924521757597314') - }) - }) - }) - }) -}) diff --git a/contract/lib/v2-periphery/test/ExampleFlashSwap.spec.ts b/contract/lib/v2-periphery/test/ExampleFlashSwap.spec.ts deleted file mode 100644 index 8be2898..0000000 --- a/contract/lib/v2-periphery/test/ExampleFlashSwap.spec.ts +++ /dev/null @@ -1,153 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { MaxUint256 } from 'ethers/constants' -import { BigNumber, bigNumberify, defaultAbiCoder, formatEther } from 'ethers/utils' -import { solidity, MockProvider, createFixtureLoader, deployContract } from 'ethereum-waffle' - -import { expandTo18Decimals } from './shared/utilities' -import { v2Fixture } from './shared/fixtures' - -import ExampleFlashSwap from '../build/ExampleFlashSwap.json' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999, - gasPrice: 0 -} - -describe('ExampleFlashSwap', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let WETH: Contract - let WETHPartner: Contract - let WETHExchangeV1: Contract - let WETHPair: Contract - let flashSwapExample: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - - WETH = fixture.WETH - WETHPartner = fixture.WETHPartner - WETHExchangeV1 = fixture.WETHExchangeV1 - WETHPair = fixture.WETHPair - flashSwapExample = await deployContract( - wallet, - ExampleFlashSwap, - [fixture.factoryV2.address, fixture.factoryV1.address, fixture.router.address], - overrides - ) - }) - - it('uniswapV2Call:0', async () => { - // add liquidity to V1 at a rate of 1 ETH / 200 X - const WETHPartnerAmountV1 = expandTo18Decimals(2000) - const ETHAmountV1 = expandTo18Decimals(10) - await WETHPartner.approve(WETHExchangeV1.address, WETHPartnerAmountV1) - await WETHExchangeV1.addLiquidity(bigNumberify(1), WETHPartnerAmountV1, MaxUint256, { - ...overrides, - value: ETHAmountV1 - }) - - // add liquidity to V2 at a rate of 1 ETH / 100 X - const WETHPartnerAmountV2 = expandTo18Decimals(1000) - const ETHAmountV2 = expandTo18Decimals(10) - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmountV2) - await WETH.deposit({ value: ETHAmountV2 }) - await WETH.transfer(WETHPair.address, ETHAmountV2) - await WETHPair.mint(wallet.address, overrides) - - const balanceBefore = await WETHPartner.balanceOf(wallet.address) - - // now, execute arbitrage via uniswapV2Call: - // receive 1 ETH from V2, get as much X from V1 as we can, repay V2 with minimum X, keep the rest! - const arbitrageAmount = expandTo18Decimals(1) - // instead of being 'hard-coded', the above value could be calculated optimally off-chain. this would be - // better, but it'd be better yet to calculate the amount at runtime, on-chain. unfortunately, this requires a - // swap-to-price calculation, which is a little tricky, and out of scope for the moment - const WETHPairToken0 = await WETHPair.token0() - const amount0 = WETHPairToken0 === WETHPartner.address ? bigNumberify(0) : arbitrageAmount - const amount1 = WETHPairToken0 === WETHPartner.address ? arbitrageAmount : bigNumberify(0) - await WETHPair.swap( - amount0, - amount1, - flashSwapExample.address, - defaultAbiCoder.encode(['uint'], [bigNumberify(1)]), - overrides - ) - - const balanceAfter = await WETHPartner.balanceOf(wallet.address) - const profit = balanceAfter.sub(balanceBefore).div(expandTo18Decimals(1)) - const reservesV1 = [ - await WETHPartner.balanceOf(WETHExchangeV1.address), - await provider.getBalance(WETHExchangeV1.address) - ] - const priceV1 = reservesV1[0].div(reservesV1[1]) - const reservesV2 = (await WETHPair.getReserves()).slice(0, 2) - const priceV2 = - WETHPairToken0 === WETHPartner.address ? reservesV2[0].div(reservesV2[1]) : reservesV2[1].div(reservesV2[0]) - - expect(profit.toString()).to.eq('69') // our profit is ~69 tokens - expect(priceV1.toString()).to.eq('165') // we pushed the v1 price down to ~165 - expect(priceV2.toString()).to.eq('123') // we pushed the v2 price up to ~123 - }) - - it('uniswapV2Call:1', async () => { - // add liquidity to V1 at a rate of 1 ETH / 100 X - const WETHPartnerAmountV1 = expandTo18Decimals(1000) - const ETHAmountV1 = expandTo18Decimals(10) - await WETHPartner.approve(WETHExchangeV1.address, WETHPartnerAmountV1) - await WETHExchangeV1.addLiquidity(bigNumberify(1), WETHPartnerAmountV1, MaxUint256, { - ...overrides, - value: ETHAmountV1 - }) - - // add liquidity to V2 at a rate of 1 ETH / 200 X - const WETHPartnerAmountV2 = expandTo18Decimals(2000) - const ETHAmountV2 = expandTo18Decimals(10) - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmountV2) - await WETH.deposit({ value: ETHAmountV2 }) - await WETH.transfer(WETHPair.address, ETHAmountV2) - await WETHPair.mint(wallet.address, overrides) - - const balanceBefore = await provider.getBalance(wallet.address) - - // now, execute arbitrage via uniswapV2Call: - // receive 200 X from V2, get as much ETH from V1 as we can, repay V2 with minimum ETH, keep the rest! - const arbitrageAmount = expandTo18Decimals(200) - // instead of being 'hard-coded', the above value could be calculated optimally off-chain. this would be - // better, but it'd be better yet to calculate the amount at runtime, on-chain. unfortunately, this requires a - // swap-to-price calculation, which is a little tricky, and out of scope for the moment - const WETHPairToken0 = await WETHPair.token0() - const amount0 = WETHPairToken0 === WETHPartner.address ? arbitrageAmount : bigNumberify(0) - const amount1 = WETHPairToken0 === WETHPartner.address ? bigNumberify(0) : arbitrageAmount - await WETHPair.swap( - amount0, - amount1, - flashSwapExample.address, - defaultAbiCoder.encode(['uint'], [bigNumberify(1)]), - overrides - ) - - const balanceAfter = await provider.getBalance(wallet.address) - const profit = balanceAfter.sub(balanceBefore) - const reservesV1 = [ - await WETHPartner.balanceOf(WETHExchangeV1.address), - await provider.getBalance(WETHExchangeV1.address) - ] - const priceV1 = reservesV1[0].div(reservesV1[1]) - const reservesV2 = (await WETHPair.getReserves()).slice(0, 2) - const priceV2 = - WETHPairToken0 === WETHPartner.address ? reservesV2[0].div(reservesV2[1]) : reservesV2[1].div(reservesV2[0]) - - expect(formatEther(profit)).to.eq('0.548043441089763649') // our profit is ~.5 ETH - expect(priceV1.toString()).to.eq('143') // we pushed the v1 price up to ~143 - expect(priceV2.toString()).to.eq('161') // we pushed the v2 price down to ~161 - }) -}) diff --git a/contract/lib/v2-periphery/test/ExampleOracleSimple.spec.ts b/contract/lib/v2-periphery/test/ExampleOracleSimple.spec.ts deleted file mode 100644 index 5c1727d..0000000 --- a/contract/lib/v2-periphery/test/ExampleOracleSimple.spec.ts +++ /dev/null @@ -1,70 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { BigNumber } from 'ethers/utils' -import { solidity, MockProvider, createFixtureLoader, deployContract } from 'ethereum-waffle' - -import { expandTo18Decimals, mineBlock, encodePrice } from './shared/utilities' -import { v2Fixture } from './shared/fixtures' - -import ExampleOracleSimple from '../build/ExampleOracleSimple.json' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -const token0Amount = expandTo18Decimals(5) -const token1Amount = expandTo18Decimals(10) - -describe('ExampleOracleSimple', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let token0: Contract - let token1: Contract - let pair: Contract - let exampleOracleSimple: Contract - - async function addLiquidity() { - await token0.transfer(pair.address, token0Amount) - await token1.transfer(pair.address, token1Amount) - await pair.mint(wallet.address, overrides) - } - - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - - token0 = fixture.token0 - token1 = fixture.token1 - pair = fixture.pair - await addLiquidity() - exampleOracleSimple = await deployContract( - wallet, - ExampleOracleSimple, - [fixture.factoryV2.address, token0.address, token1.address], - overrides - ) - }) - - it('update', async () => { - const blockTimestamp = (await pair.getReserves())[2] - await mineBlock(provider, blockTimestamp + 60 * 60 * 23) - await expect(exampleOracleSimple.update(overrides)).to.be.reverted - await mineBlock(provider, blockTimestamp + 60 * 60 * 24) - await exampleOracleSimple.update(overrides) - - const expectedPrice = encodePrice(token0Amount, token1Amount) - - expect(await exampleOracleSimple.price0Average()).to.eq(expectedPrice[0]) - expect(await exampleOracleSimple.price1Average()).to.eq(expectedPrice[1]) - - expect(await exampleOracleSimple.consult(token0.address, token0Amount)).to.eq(token1Amount) - expect(await exampleOracleSimple.consult(token1.address, token1Amount)).to.eq(token0Amount) - }) -}) diff --git a/contract/lib/v2-periphery/test/ExampleSlidingWindowOracle.spec.ts b/contract/lib/v2-periphery/test/ExampleSlidingWindowOracle.spec.ts deleted file mode 100644 index a5b5f65..0000000 --- a/contract/lib/v2-periphery/test/ExampleSlidingWindowOracle.spec.ts +++ /dev/null @@ -1,294 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { BigNumber, bigNumberify } from 'ethers/utils' -import { solidity, MockProvider, createFixtureLoader, deployContract } from 'ethereum-waffle' - -import { expandTo18Decimals, mineBlock, encodePrice } from './shared/utilities' -import { v2Fixture } from './shared/fixtures' - -import ExampleSlidingWindowOracle from '../build/ExampleSlidingWindowOracle.json' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -const defaultToken0Amount = expandTo18Decimals(5) -const defaultToken1Amount = expandTo18Decimals(10) - -describe('ExampleSlidingWindowOracle', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let token0: Contract - let token1: Contract - let pair: Contract - let weth: Contract - let factory: Contract - - async function addLiquidity(amount0: BigNumber = defaultToken0Amount, amount1: BigNumber = defaultToken1Amount) { - if (!amount0.isZero()) await token0.transfer(pair.address, amount0) - if (!amount1.isZero()) await token1.transfer(pair.address, amount1) - await pair.sync() - } - - const defaultWindowSize = 86400 // 24 hours - const defaultGranularity = 24 // 1 hour each - - function observationIndexOf( - timestamp: number, - windowSize: number = defaultWindowSize, - granularity: number = defaultGranularity - ): number { - const periodSize = Math.floor(windowSize / granularity) - const epochPeriod = Math.floor(timestamp / periodSize) - return epochPeriod % granularity - } - - function deployOracle(windowSize: number, granularity: number) { - return deployContract(wallet, ExampleSlidingWindowOracle, [factory.address, windowSize, granularity], overrides) - } - - beforeEach('deploy fixture', async function() { - const fixture = await loadFixture(v2Fixture) - - token0 = fixture.token0 - token1 = fixture.token1 - pair = fixture.pair - weth = fixture.WETH - factory = fixture.factoryV2 - }) - - // 1/1/2020 @ 12:00 am UTC - // cannot be 0 because that instructs ganache to set it to current timestamp - // cannot be 86400 because then timestamp 0 is a valid historical observation - const startTime = 1577836800 - - // must come before adding liquidity to pairs for correct cumulative price computations - // cannot use 0 because that resets to current timestamp - beforeEach(`set start time to ${startTime}`, () => mineBlock(provider, startTime)) - - it('requires granularity to be greater than 0', async () => { - await expect(deployOracle(defaultWindowSize, 0)).to.be.revertedWith('SlidingWindowOracle: GRANULARITY') - }) - - it('requires windowSize to be evenly divisible by granularity', async () => { - await expect(deployOracle(defaultWindowSize - 1, defaultGranularity)).to.be.revertedWith( - 'SlidingWindowOracle: WINDOW_NOT_EVENLY_DIVISIBLE' - ) - }) - - it('computes the periodSize correctly', async () => { - const oracle = await deployOracle(defaultWindowSize, defaultGranularity) - expect(await oracle.periodSize()).to.eq(3600) - const oracleOther = await deployOracle(defaultWindowSize * 2, defaultGranularity / 2) - expect(await oracleOther.periodSize()).to.eq(3600 * 4) - }) - - describe('#observationIndexOf', () => { - it('works for examples', async () => { - const oracle = await deployOracle(defaultWindowSize, defaultGranularity) - expect(await oracle.observationIndexOf(0)).to.eq(0) - expect(await oracle.observationIndexOf(3599)).to.eq(0) - expect(await oracle.observationIndexOf(3600)).to.eq(1) - expect(await oracle.observationIndexOf(4800)).to.eq(1) - expect(await oracle.observationIndexOf(7199)).to.eq(1) - expect(await oracle.observationIndexOf(7200)).to.eq(2) - expect(await oracle.observationIndexOf(86399)).to.eq(23) - expect(await oracle.observationIndexOf(86400)).to.eq(0) - expect(await oracle.observationIndexOf(90000)).to.eq(1) - }) - it('overflow safe', async () => { - const oracle = await deployOracle(25500, 255) // 100 period size - expect(await oracle.observationIndexOf(0)).to.eq(0) - expect(await oracle.observationIndexOf(99)).to.eq(0) - expect(await oracle.observationIndexOf(100)).to.eq(1) - expect(await oracle.observationIndexOf(199)).to.eq(1) - expect(await oracle.observationIndexOf(25499)).to.eq(254) // 255th element - expect(await oracle.observationIndexOf(25500)).to.eq(0) - }) - it('matches offline computation', async () => { - const oracle = await deployOracle(defaultWindowSize, defaultGranularity) - for (let timestamp of [0, 5000, 1000, 25000, 86399, 86400, 86401]) { - expect(await oracle.observationIndexOf(timestamp)).to.eq(observationIndexOf(timestamp)) - } - }) - }) - - describe('#update', () => { - let slidingWindowOracle: Contract - - beforeEach( - 'deploy oracle', - async () => (slidingWindowOracle = await deployOracle(defaultWindowSize, defaultGranularity)) - ) - - beforeEach('add default liquidity', () => addLiquidity()) - - it('succeeds', async () => { - await slidingWindowOracle.update(token0.address, token1.address, overrides) - }) - - it('sets the appropriate epoch slot', async () => { - const blockTimestamp = (await pair.getReserves())[2] - expect(blockTimestamp).to.eq(startTime) - await slidingWindowOracle.update(token0.address, token1.address, overrides) - expect(await slidingWindowOracle.pairObservations(pair.address, observationIndexOf(blockTimestamp))).to.deep.eq([ - bigNumberify(blockTimestamp), - await pair.price0CumulativeLast(), - await pair.price1CumulativeLast() - ]) - }).retries(2) // we may have slight differences between pair blockTimestamp and the expected timestamp - // because the previous block timestamp may differ from the current block timestamp by 1 second - - it('gas for first update (allocates empty array)', async () => { - const tx = await slidingWindowOracle.update(token0.address, token1.address, overrides) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq('116816') - }).retries(2) // gas test inconsistent - - it('gas for second update in the same period (skips)', async () => { - await slidingWindowOracle.update(token0.address, token1.address, overrides) - const tx = await slidingWindowOracle.update(token0.address, token1.address, overrides) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq('25574') - }).retries(2) // gas test inconsistent - - it('gas for second update different period (no allocate, no skip)', async () => { - await slidingWindowOracle.update(token0.address, token1.address, overrides) - await mineBlock(provider, startTime + 3600) - const tx = await slidingWindowOracle.update(token0.address, token1.address, overrides) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq('94703') - }).retries(2) // gas test inconsistent - - it('second update in one timeslot does not overwrite', async () => { - await slidingWindowOracle.update(token0.address, token1.address, overrides) - const before = await slidingWindowOracle.pairObservations(pair.address, observationIndexOf(0)) - // first hour still - await mineBlock(provider, startTime + 1800) - await slidingWindowOracle.update(token0.address, token1.address, overrides) - const after = await slidingWindowOracle.pairObservations(pair.address, observationIndexOf(1800)) - expect(observationIndexOf(1800)).to.eq(observationIndexOf(0)) - expect(before).to.deep.eq(after) - }) - - it('fails for invalid pair', async () => { - await expect(slidingWindowOracle.update(weth.address, token1.address)).to.be.reverted - }) - }) - - describe('#consult', () => { - let slidingWindowOracle: Contract - - beforeEach( - 'deploy oracle', - async () => (slidingWindowOracle = await deployOracle(defaultWindowSize, defaultGranularity)) - ) - - // must come after setting time to 0 for correct cumulative price computations in the pair - beforeEach('add default liquidity', () => addLiquidity()) - - it('fails if previous bucket not set', async () => { - await slidingWindowOracle.update(token0.address, token1.address, overrides) - await expect(slidingWindowOracle.consult(token0.address, 0, token1.address)).to.be.revertedWith( - 'SlidingWindowOracle: MISSING_HISTORICAL_OBSERVATION' - ) - }) - - it('fails for invalid pair', async () => { - await expect(slidingWindowOracle.consult(weth.address, 0, token1.address)).to.be.reverted - }) - - describe('happy path', () => { - let blockTimestamp: number - let previousBlockTimestamp: number - let previousCumulativePrices: any - beforeEach('add some prices', async () => { - previousBlockTimestamp = (await pair.getReserves())[2] - previousCumulativePrices = [await pair.price0CumulativeLast(), await pair.price1CumulativeLast()] - await slidingWindowOracle.update(token0.address, token1.address, overrides) - blockTimestamp = previousBlockTimestamp + 23 * 3600 - await mineBlock(provider, blockTimestamp) - await slidingWindowOracle.update(token0.address, token1.address, overrides) - }) - - it('has cumulative price in previous bucket', async () => { - expect( - await slidingWindowOracle.pairObservations(pair.address, observationIndexOf(previousBlockTimestamp)) - ).to.deep.eq([bigNumberify(previousBlockTimestamp), previousCumulativePrices[0], previousCumulativePrices[1]]) - }).retries(5) // test flaky because timestamps aren't mocked - - it('has cumulative price in current bucket', async () => { - const timeElapsed = blockTimestamp - previousBlockTimestamp - const prices = encodePrice(defaultToken0Amount, defaultToken1Amount) - expect( - await slidingWindowOracle.pairObservations(pair.address, observationIndexOf(blockTimestamp)) - ).to.deep.eq([bigNumberify(blockTimestamp), prices[0].mul(timeElapsed), prices[1].mul(timeElapsed)]) - }).retries(5) // test flaky because timestamps aren't mocked - - it('provides the current ratio in consult token0', async () => { - expect(await slidingWindowOracle.consult(token0.address, 100, token1.address)).to.eq(200) - }) - - it('provides the current ratio in consult token1', async () => { - expect(await slidingWindowOracle.consult(token1.address, 100, token0.address)).to.eq(50) - }) - }) - - describe('price changes over period', () => { - const hour = 3600 - beforeEach('add some prices', async () => { - // starting price of 1:2, or token0 = 2token1, token1 = 0.5token0 - await slidingWindowOracle.update(token0.address, token1.address, overrides) // hour 0, 1:2 - // change the price at hour 3 to 1:1 and immediately update - await mineBlock(provider, startTime + 3 * hour) - await addLiquidity(defaultToken0Amount, bigNumberify(0)) - await slidingWindowOracle.update(token0.address, token1.address, overrides) - - // change the ratios at hour 6:00 to 2:1, don't update right away - await mineBlock(provider, startTime + 6 * hour) - await token0.transfer(pair.address, defaultToken0Amount.mul(2)) - await pair.sync() - - // update at hour 9:00 (price has been 2:1 for 3 hours, invokes counterfactual) - await mineBlock(provider, startTime + 9 * hour) - await slidingWindowOracle.update(token0.address, token1.address, overrides) - // move to hour 23:00 so we can check prices - await mineBlock(provider, startTime + 23 * hour) - }) - - it('provides the correct ratio in consult token0', async () => { - // at hour 23, price of token 0 spent 3 hours at 2, 3 hours at 1, 17 hours at 0.5 so price should - // be less than 1 - expect(await slidingWindowOracle.consult(token0.address, 100, token1.address)).to.eq(76) - }) - - it('provides the correct ratio in consult token1', async () => { - // price should be greater than 1 - expect(await slidingWindowOracle.consult(token1.address, 100, token0.address)).to.eq(167) - }) - - // price has been 2:1 all of 23 hours - describe('hour 32', () => { - beforeEach('set hour 32', () => mineBlock(provider, startTime + 32 * hour)) - it('provides the correct ratio in consult token0', async () => { - // at hour 23, price of token 0 spent 3 hours at 2, 3 hours at 1, 17 hours at 0.5 so price should - // be less than 1 - expect(await slidingWindowOracle.consult(token0.address, 100, token1.address)).to.eq(50) - }) - - it('provides the correct ratio in consult token1', async () => { - // price should be greater than 1 - expect(await slidingWindowOracle.consult(token1.address, 100, token0.address)).to.eq(200) - }) - }) - }) - }) -}) diff --git a/contract/lib/v2-periphery/test/ExampleSwapToPrice.spec.ts b/contract/lib/v2-periphery/test/ExampleSwapToPrice.spec.ts deleted file mode 100644 index 51d861a..0000000 --- a/contract/lib/v2-periphery/test/ExampleSwapToPrice.spec.ts +++ /dev/null @@ -1,198 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { MaxUint256 } from 'ethers/constants' -import { BigNumber, bigNumberify, defaultAbiCoder, formatEther } from 'ethers/utils' -import { solidity, MockProvider, createFixtureLoader, deployContract } from 'ethereum-waffle' - -import { expandTo18Decimals } from './shared/utilities' -import { v2Fixture } from './shared/fixtures' - -import ExampleSwapToPrice from '../build/ExampleSwapToPrice.json' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -describe('ExampleSwapToPrice', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let token0: Contract - let token1: Contract - let pair: Contract - let swapToPriceExample: Contract - let router: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - token0 = fixture.token0 - token1 = fixture.token1 - pair = fixture.pair - router = fixture.router - swapToPriceExample = await deployContract( - wallet, - ExampleSwapToPrice, - [fixture.factoryV2.address, fixture.router.address], - overrides - ) - }) - - beforeEach('set up price differential of 1:100', async () => { - await token0.transfer(pair.address, expandTo18Decimals(10)) - await token1.transfer(pair.address, expandTo18Decimals(1000)) - await pair.sync(overrides) - }) - - beforeEach('approve the swap contract to spend any amount of both tokens', async () => { - await token0.approve(swapToPriceExample.address, MaxUint256) - await token1.approve(swapToPriceExample.address, MaxUint256) - }) - - it('correct router address', async () => { - expect(await swapToPriceExample.router()).to.eq(router.address) - }) - - describe('#swapToPrice', () => { - it('requires non-zero true price inputs', async () => { - await expect( - swapToPriceExample.swapToPrice( - token0.address, - token1.address, - 0, - 0, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256 - ) - ).to.be.revertedWith('ExampleSwapToPrice: ZERO_PRICE') - await expect( - swapToPriceExample.swapToPrice( - token0.address, - token1.address, - 10, - 0, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256 - ) - ).to.be.revertedWith('ExampleSwapToPrice: ZERO_PRICE') - await expect( - swapToPriceExample.swapToPrice( - token0.address, - token1.address, - 0, - 10, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256 - ) - ).to.be.revertedWith('ExampleSwapToPrice: ZERO_PRICE') - }) - - it('requires non-zero max spend', async () => { - await expect( - swapToPriceExample.swapToPrice(token0.address, token1.address, 1, 100, 0, 0, wallet.address, MaxUint256) - ).to.be.revertedWith('ExampleSwapToPrice: ZERO_SPEND') - }) - - it('moves the price to 1:90', async () => { - await expect( - swapToPriceExample.swapToPrice( - token0.address, - token1.address, - 1, - 90, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256, - overrides - ) - ) - // (1e19 + 526682316179835569) : (1e21 - 49890467170695440744) ~= 1:90 - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, swapToPriceExample.address, '526682316179835569') - .to.emit(token0, 'Approval') - .withArgs(swapToPriceExample.address, router.address, '526682316179835569') - .to.emit(token0, 'Transfer') - .withArgs(swapToPriceExample.address, pair.address, '526682316179835569') - .to.emit(token1, 'Transfer') - .withArgs(pair.address, wallet.address, '49890467170695440744') - }) - - it('moves the price to 1:110', async () => { - await expect( - swapToPriceExample.swapToPrice( - token0.address, - token1.address, - 1, - 110, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256, - overrides - ) - ) - // (1e21 + 47376582963642643588) : (1e19 - 451039908682851138) ~= 1:110 - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, swapToPriceExample.address, '47376582963642643588') - .to.emit(token1, 'Approval') - .withArgs(swapToPriceExample.address, router.address, '47376582963642643588') - .to.emit(token1, 'Transfer') - .withArgs(swapToPriceExample.address, pair.address, '47376582963642643588') - .to.emit(token0, 'Transfer') - .withArgs(pair.address, wallet.address, '451039908682851138') - }) - - it('reverse token order', async () => { - await expect( - swapToPriceExample.swapToPrice( - token1.address, - token0.address, - 110, - 1, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256, - overrides - ) - ) - // (1e21 + 47376582963642643588) : (1e19 - 451039908682851138) ~= 1:110 - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, swapToPriceExample.address, '47376582963642643588') - .to.emit(token1, 'Approval') - .withArgs(swapToPriceExample.address, router.address, '47376582963642643588') - .to.emit(token1, 'Transfer') - .withArgs(swapToPriceExample.address, pair.address, '47376582963642643588') - .to.emit(token0, 'Transfer') - .withArgs(pair.address, wallet.address, '451039908682851138') - }) - - it('swap gas cost', async () => { - const tx = await swapToPriceExample.swapToPrice( - token0.address, - token1.address, - 1, - 110, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256, - overrides - ) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq('115129') - }).retries(2) // gas test is inconsistent - }) -}) diff --git a/contract/lib/v2-periphery/test/UniswapV2Migrator.spec.ts b/contract/lib/v2-periphery/test/UniswapV2Migrator.spec.ts deleted file mode 100644 index ba4938d..0000000 --- a/contract/lib/v2-periphery/test/UniswapV2Migrator.spec.ts +++ /dev/null @@ -1,70 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { AddressZero, MaxUint256 } from 'ethers/constants' -import { bigNumberify } from 'ethers/utils' -import { solidity, MockProvider, createFixtureLoader } from 'ethereum-waffle' - -import { v2Fixture } from './shared/fixtures' -import { expandTo18Decimals, MINIMUM_LIQUIDITY } from './shared/utilities' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -describe('UniswapV2Migrator', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let WETHPartner: Contract - let WETHPair: Contract - let router: Contract - let migrator: Contract - let WETHExchangeV1: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - WETHPartner = fixture.WETHPartner - WETHPair = fixture.WETHPair - router = fixture.router01 // we used router01 for this contract - migrator = fixture.migrator - WETHExchangeV1 = fixture.WETHExchangeV1 - }) - - it('migrate', async () => { - const WETHPartnerAmount = expandTo18Decimals(1) - const ETHAmount = expandTo18Decimals(4) - await WETHPartner.approve(WETHExchangeV1.address, MaxUint256) - await WETHExchangeV1.addLiquidity(bigNumberify(1), WETHPartnerAmount, MaxUint256, { - ...overrides, - value: ETHAmount - }) - await WETHExchangeV1.approve(migrator.address, MaxUint256) - const expectedLiquidity = expandTo18Decimals(2) - const WETHPairToken0 = await WETHPair.token0() - await expect( - migrator.migrate(WETHPartner.address, WETHPartnerAmount, ETHAmount, wallet.address, MaxUint256, overrides) - ) - .to.emit(WETHPair, 'Transfer') - .withArgs(AddressZero, AddressZero, MINIMUM_LIQUIDITY) - .to.emit(WETHPair, 'Transfer') - .withArgs(AddressZero, wallet.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address ? WETHPartnerAmount : ETHAmount, - WETHPairToken0 === WETHPartner.address ? ETHAmount : WETHPartnerAmount - ) - .to.emit(WETHPair, 'Mint') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? WETHPartnerAmount : ETHAmount, - WETHPairToken0 === WETHPartner.address ? ETHAmount : WETHPartnerAmount - ) - expect(await WETHPair.balanceOf(wallet.address)).to.eq(expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - }) -}) diff --git a/contract/lib/v2-periphery/test/UniswapV2Router01.spec.ts b/contract/lib/v2-periphery/test/UniswapV2Router01.spec.ts deleted file mode 100644 index 651c562..0000000 --- a/contract/lib/v2-periphery/test/UniswapV2Router01.spec.ts +++ /dev/null @@ -1,734 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { AddressZero, Zero, MaxUint256 } from 'ethers/constants' -import { BigNumber, bigNumberify } from 'ethers/utils' -import { solidity, MockProvider, createFixtureLoader } from 'ethereum-waffle' -import { ecsign } from 'ethereumjs-util' - -import { expandTo18Decimals, getApprovalDigest, mineBlock, MINIMUM_LIQUIDITY } from './shared/utilities' -import { v2Fixture } from './shared/fixtures' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -enum RouterVersion { - UniswapV2Router01 = 'UniswapV2Router01', - UniswapV2Router02 = 'UniswapV2Router02' -} - -describe('UniswapV2Router{01,02}', () => { - for (const routerVersion of Object.keys(RouterVersion)) { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let token0: Contract - let token1: Contract - let WETH: Contract - let WETHPartner: Contract - let factory: Contract - let router: Contract - let pair: Contract - let WETHPair: Contract - let routerEventEmitter: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - token0 = fixture.token0 - token1 = fixture.token1 - WETH = fixture.WETH - WETHPartner = fixture.WETHPartner - factory = fixture.factoryV2 - router = { - [RouterVersion.UniswapV2Router01]: fixture.router01, - [RouterVersion.UniswapV2Router02]: fixture.router02 - }[routerVersion as RouterVersion] - pair = fixture.pair - WETHPair = fixture.WETHPair - routerEventEmitter = fixture.routerEventEmitter - }) - - afterEach(async function() { - expect(await provider.getBalance(router.address)).to.eq(Zero) - }) - - describe(routerVersion, () => { - it('factory, WETH', async () => { - expect(await router.factory()).to.eq(factory.address) - expect(await router.WETH()).to.eq(WETH.address) - }) - - it('addLiquidity', async () => { - const token0Amount = expandTo18Decimals(1) - const token1Amount = expandTo18Decimals(4) - - const expectedLiquidity = expandTo18Decimals(2) - await token0.approve(router.address, MaxUint256) - await token1.approve(router.address, MaxUint256) - await expect( - router.addLiquidity( - token0.address, - token1.address, - token0Amount, - token1Amount, - 0, - 0, - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pair.address, token0Amount) - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, pair.address, token1Amount) - .to.emit(pair, 'Transfer') - .withArgs(AddressZero, AddressZero, MINIMUM_LIQUIDITY) - .to.emit(pair, 'Transfer') - .withArgs(AddressZero, wallet.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(pair, 'Sync') - .withArgs(token0Amount, token1Amount) - .to.emit(pair, 'Mint') - .withArgs(router.address, token0Amount, token1Amount) - - expect(await pair.balanceOf(wallet.address)).to.eq(expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - }) - - it('addLiquidityETH', async () => { - const WETHPartnerAmount = expandTo18Decimals(1) - const ETHAmount = expandTo18Decimals(4) - - const expectedLiquidity = expandTo18Decimals(2) - const WETHPairToken0 = await WETHPair.token0() - await WETHPartner.approve(router.address, MaxUint256) - await expect( - router.addLiquidityETH( - WETHPartner.address, - WETHPartnerAmount, - WETHPartnerAmount, - ETHAmount, - wallet.address, - MaxUint256, - { ...overrides, value: ETHAmount } - ) - ) - .to.emit(WETHPair, 'Transfer') - .withArgs(AddressZero, AddressZero, MINIMUM_LIQUIDITY) - .to.emit(WETHPair, 'Transfer') - .withArgs(AddressZero, wallet.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address ? WETHPartnerAmount : ETHAmount, - WETHPairToken0 === WETHPartner.address ? ETHAmount : WETHPartnerAmount - ) - .to.emit(WETHPair, 'Mint') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? WETHPartnerAmount : ETHAmount, - WETHPairToken0 === WETHPartner.address ? ETHAmount : WETHPartnerAmount - ) - - expect(await WETHPair.balanceOf(wallet.address)).to.eq(expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - }) - - async function addLiquidity(token0Amount: BigNumber, token1Amount: BigNumber) { - await token0.transfer(pair.address, token0Amount) - await token1.transfer(pair.address, token1Amount) - await pair.mint(wallet.address, overrides) - } - it('removeLiquidity', async () => { - const token0Amount = expandTo18Decimals(1) - const token1Amount = expandTo18Decimals(4) - await addLiquidity(token0Amount, token1Amount) - - const expectedLiquidity = expandTo18Decimals(2) - await pair.approve(router.address, MaxUint256) - await expect( - router.removeLiquidity( - token0.address, - token1.address, - expectedLiquidity.sub(MINIMUM_LIQUIDITY), - 0, - 0, - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(pair, 'Transfer') - .withArgs(wallet.address, pair.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(pair, 'Transfer') - .withArgs(pair.address, AddressZero, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(token0, 'Transfer') - .withArgs(pair.address, wallet.address, token0Amount.sub(500)) - .to.emit(token1, 'Transfer') - .withArgs(pair.address, wallet.address, token1Amount.sub(2000)) - .to.emit(pair, 'Sync') - .withArgs(500, 2000) - .to.emit(pair, 'Burn') - .withArgs(router.address, token0Amount.sub(500), token1Amount.sub(2000), wallet.address) - - expect(await pair.balanceOf(wallet.address)).to.eq(0) - const totalSupplyToken0 = await token0.totalSupply() - const totalSupplyToken1 = await token1.totalSupply() - expect(await token0.balanceOf(wallet.address)).to.eq(totalSupplyToken0.sub(500)) - expect(await token1.balanceOf(wallet.address)).to.eq(totalSupplyToken1.sub(2000)) - }) - - it('removeLiquidityETH', async () => { - const WETHPartnerAmount = expandTo18Decimals(1) - const ETHAmount = expandTo18Decimals(4) - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - - const expectedLiquidity = expandTo18Decimals(2) - const WETHPairToken0 = await WETHPair.token0() - await WETHPair.approve(router.address, MaxUint256) - await expect( - router.removeLiquidityETH( - WETHPartner.address, - expectedLiquidity.sub(MINIMUM_LIQUIDITY), - 0, - 0, - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(WETHPair, 'Transfer') - .withArgs(wallet.address, WETHPair.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(WETHPair, 'Transfer') - .withArgs(WETHPair.address, AddressZero, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(WETH, 'Transfer') - .withArgs(WETHPair.address, router.address, ETHAmount.sub(2000)) - .to.emit(WETHPartner, 'Transfer') - .withArgs(WETHPair.address, router.address, WETHPartnerAmount.sub(500)) - .to.emit(WETHPartner, 'Transfer') - .withArgs(router.address, wallet.address, WETHPartnerAmount.sub(500)) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address ? 500 : 2000, - WETHPairToken0 === WETHPartner.address ? 2000 : 500 - ) - .to.emit(WETHPair, 'Burn') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? WETHPartnerAmount.sub(500) : ETHAmount.sub(2000), - WETHPairToken0 === WETHPartner.address ? ETHAmount.sub(2000) : WETHPartnerAmount.sub(500), - router.address - ) - - expect(await WETHPair.balanceOf(wallet.address)).to.eq(0) - const totalSupplyWETHPartner = await WETHPartner.totalSupply() - const totalSupplyWETH = await WETH.totalSupply() - expect(await WETHPartner.balanceOf(wallet.address)).to.eq(totalSupplyWETHPartner.sub(500)) - expect(await WETH.balanceOf(wallet.address)).to.eq(totalSupplyWETH.sub(2000)) - }) - - it('removeLiquidityWithPermit', async () => { - const token0Amount = expandTo18Decimals(1) - const token1Amount = expandTo18Decimals(4) - await addLiquidity(token0Amount, token1Amount) - - const expectedLiquidity = expandTo18Decimals(2) - - const nonce = await pair.nonces(wallet.address) - const digest = await getApprovalDigest( - pair, - { owner: wallet.address, spender: router.address, value: expectedLiquidity.sub(MINIMUM_LIQUIDITY) }, - nonce, - MaxUint256 - ) - - const { v, r, s } = ecsign(Buffer.from(digest.slice(2), 'hex'), Buffer.from(wallet.privateKey.slice(2), 'hex')) - - await router.removeLiquidityWithPermit( - token0.address, - token1.address, - expectedLiquidity.sub(MINIMUM_LIQUIDITY), - 0, - 0, - wallet.address, - MaxUint256, - false, - v, - r, - s, - overrides - ) - }) - - it('removeLiquidityETHWithPermit', async () => { - const WETHPartnerAmount = expandTo18Decimals(1) - const ETHAmount = expandTo18Decimals(4) - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - - const expectedLiquidity = expandTo18Decimals(2) - - const nonce = await WETHPair.nonces(wallet.address) - const digest = await getApprovalDigest( - WETHPair, - { owner: wallet.address, spender: router.address, value: expectedLiquidity.sub(MINIMUM_LIQUIDITY) }, - nonce, - MaxUint256 - ) - - const { v, r, s } = ecsign(Buffer.from(digest.slice(2), 'hex'), Buffer.from(wallet.privateKey.slice(2), 'hex')) - - await router.removeLiquidityETHWithPermit( - WETHPartner.address, - expectedLiquidity.sub(MINIMUM_LIQUIDITY), - 0, - 0, - wallet.address, - MaxUint256, - false, - v, - r, - s, - overrides - ) - }) - - describe('swapExactTokensForTokens', () => { - const token0Amount = expandTo18Decimals(5) - const token1Amount = expandTo18Decimals(10) - const swapAmount = expandTo18Decimals(1) - const expectedOutputAmount = bigNumberify('1662497915624478906') - - beforeEach(async () => { - await addLiquidity(token0Amount, token1Amount) - await token0.approve(router.address, MaxUint256) - }) - - it('happy path', async () => { - await expect( - router.swapExactTokensForTokens( - swapAmount, - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pair.address, swapAmount) - .to.emit(token1, 'Transfer') - .withArgs(pair.address, wallet.address, expectedOutputAmount) - .to.emit(pair, 'Sync') - .withArgs(token0Amount.add(swapAmount), token1Amount.sub(expectedOutputAmount)) - .to.emit(pair, 'Swap') - .withArgs(router.address, swapAmount, 0, 0, expectedOutputAmount, wallet.address) - }) - - it('amounts', async () => { - await token0.approve(routerEventEmitter.address, MaxUint256) - await expect( - routerEventEmitter.swapExactTokensForTokens( - router.address, - swapAmount, - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(routerEventEmitter, 'Amounts') - .withArgs([swapAmount, expectedOutputAmount]) - }) - - it('gas', async () => { - // ensure that setting price{0,1}CumulativeLast for the first time doesn't affect our gas math - await mineBlock(provider, (await provider.getBlock('latest')).timestamp + 1) - await pair.sync(overrides) - - await token0.approve(router.address, MaxUint256) - await mineBlock(provider, (await provider.getBlock('latest')).timestamp + 1) - const tx = await router.swapExactTokensForTokens( - swapAmount, - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq( - { - [RouterVersion.UniswapV2Router01]: 101876, - [RouterVersion.UniswapV2Router02]: 101898 - }[routerVersion as RouterVersion] - ) - }).retries(3) - }) - - describe('swapTokensForExactTokens', () => { - const token0Amount = expandTo18Decimals(5) - const token1Amount = expandTo18Decimals(10) - const expectedSwapAmount = bigNumberify('557227237267357629') - const outputAmount = expandTo18Decimals(1) - - beforeEach(async () => { - await addLiquidity(token0Amount, token1Amount) - }) - - it('happy path', async () => { - await token0.approve(router.address, MaxUint256) - await expect( - router.swapTokensForExactTokens( - outputAmount, - MaxUint256, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pair.address, expectedSwapAmount) - .to.emit(token1, 'Transfer') - .withArgs(pair.address, wallet.address, outputAmount) - .to.emit(pair, 'Sync') - .withArgs(token0Amount.add(expectedSwapAmount), token1Amount.sub(outputAmount)) - .to.emit(pair, 'Swap') - .withArgs(router.address, expectedSwapAmount, 0, 0, outputAmount, wallet.address) - }) - - it('amounts', async () => { - await token0.approve(routerEventEmitter.address, MaxUint256) - await expect( - routerEventEmitter.swapTokensForExactTokens( - router.address, - outputAmount, - MaxUint256, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(routerEventEmitter, 'Amounts') - .withArgs([expectedSwapAmount, outputAmount]) - }) - }) - - describe('swapExactETHForTokens', () => { - const WETHPartnerAmount = expandTo18Decimals(10) - const ETHAmount = expandTo18Decimals(5) - const swapAmount = expandTo18Decimals(1) - const expectedOutputAmount = bigNumberify('1662497915624478906') - - beforeEach(async () => { - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - - await token0.approve(router.address, MaxUint256) - }) - - it('happy path', async () => { - const WETHPairToken0 = await WETHPair.token0() - await expect( - router.swapExactETHForTokens(0, [WETH.address, WETHPartner.address], wallet.address, MaxUint256, { - ...overrides, - value: swapAmount - }) - ) - .to.emit(WETH, 'Transfer') - .withArgs(router.address, WETHPair.address, swapAmount) - .to.emit(WETHPartner, 'Transfer') - .withArgs(WETHPair.address, wallet.address, expectedOutputAmount) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address - ? WETHPartnerAmount.sub(expectedOutputAmount) - : ETHAmount.add(swapAmount), - WETHPairToken0 === WETHPartner.address - ? ETHAmount.add(swapAmount) - : WETHPartnerAmount.sub(expectedOutputAmount) - ) - .to.emit(WETHPair, 'Swap') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? 0 : swapAmount, - WETHPairToken0 === WETHPartner.address ? swapAmount : 0, - WETHPairToken0 === WETHPartner.address ? expectedOutputAmount : 0, - WETHPairToken0 === WETHPartner.address ? 0 : expectedOutputAmount, - wallet.address - ) - }) - - it('amounts', async () => { - await expect( - routerEventEmitter.swapExactETHForTokens( - router.address, - 0, - [WETH.address, WETHPartner.address], - wallet.address, - MaxUint256, - { - ...overrides, - value: swapAmount - } - ) - ) - .to.emit(routerEventEmitter, 'Amounts') - .withArgs([swapAmount, expectedOutputAmount]) - }) - - it('gas', async () => { - const WETHPartnerAmount = expandTo18Decimals(10) - const ETHAmount = expandTo18Decimals(5) - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - - // ensure that setting price{0,1}CumulativeLast for the first time doesn't affect our gas math - await mineBlock(provider, (await provider.getBlock('latest')).timestamp + 1) - await pair.sync(overrides) - - const swapAmount = expandTo18Decimals(1) - await mineBlock(provider, (await provider.getBlock('latest')).timestamp + 1) - const tx = await router.swapExactETHForTokens( - 0, - [WETH.address, WETHPartner.address], - wallet.address, - MaxUint256, - { - ...overrides, - value: swapAmount - } - ) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq( - { - [RouterVersion.UniswapV2Router01]: 138770, - [RouterVersion.UniswapV2Router02]: 138770 - }[routerVersion as RouterVersion] - ) - }).retries(3) - }) - - describe('swapTokensForExactETH', () => { - const WETHPartnerAmount = expandTo18Decimals(5) - const ETHAmount = expandTo18Decimals(10) - const expectedSwapAmount = bigNumberify('557227237267357629') - const outputAmount = expandTo18Decimals(1) - - beforeEach(async () => { - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - }) - - it('happy path', async () => { - await WETHPartner.approve(router.address, MaxUint256) - const WETHPairToken0 = await WETHPair.token0() - await expect( - router.swapTokensForExactETH( - outputAmount, - MaxUint256, - [WETHPartner.address, WETH.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(WETHPartner, 'Transfer') - .withArgs(wallet.address, WETHPair.address, expectedSwapAmount) - .to.emit(WETH, 'Transfer') - .withArgs(WETHPair.address, router.address, outputAmount) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address - ? WETHPartnerAmount.add(expectedSwapAmount) - : ETHAmount.sub(outputAmount), - WETHPairToken0 === WETHPartner.address - ? ETHAmount.sub(outputAmount) - : WETHPartnerAmount.add(expectedSwapAmount) - ) - .to.emit(WETHPair, 'Swap') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? expectedSwapAmount : 0, - WETHPairToken0 === WETHPartner.address ? 0 : expectedSwapAmount, - WETHPairToken0 === WETHPartner.address ? 0 : outputAmount, - WETHPairToken0 === WETHPartner.address ? outputAmount : 0, - router.address - ) - }) - - it('amounts', async () => { - await WETHPartner.approve(routerEventEmitter.address, MaxUint256) - await expect( - routerEventEmitter.swapTokensForExactETH( - router.address, - outputAmount, - MaxUint256, - [WETHPartner.address, WETH.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(routerEventEmitter, 'Amounts') - .withArgs([expectedSwapAmount, outputAmount]) - }) - }) - - describe('swapExactTokensForETH', () => { - const WETHPartnerAmount = expandTo18Decimals(5) - const ETHAmount = expandTo18Decimals(10) - const swapAmount = expandTo18Decimals(1) - const expectedOutputAmount = bigNumberify('1662497915624478906') - - beforeEach(async () => { - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - }) - - it('happy path', async () => { - await WETHPartner.approve(router.address, MaxUint256) - const WETHPairToken0 = await WETHPair.token0() - await expect( - router.swapExactTokensForETH( - swapAmount, - 0, - [WETHPartner.address, WETH.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(WETHPartner, 'Transfer') - .withArgs(wallet.address, WETHPair.address, swapAmount) - .to.emit(WETH, 'Transfer') - .withArgs(WETHPair.address, router.address, expectedOutputAmount) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address - ? WETHPartnerAmount.add(swapAmount) - : ETHAmount.sub(expectedOutputAmount), - WETHPairToken0 === WETHPartner.address - ? ETHAmount.sub(expectedOutputAmount) - : WETHPartnerAmount.add(swapAmount) - ) - .to.emit(WETHPair, 'Swap') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? swapAmount : 0, - WETHPairToken0 === WETHPartner.address ? 0 : swapAmount, - WETHPairToken0 === WETHPartner.address ? 0 : expectedOutputAmount, - WETHPairToken0 === WETHPartner.address ? expectedOutputAmount : 0, - router.address - ) - }) - - it('amounts', async () => { - await WETHPartner.approve(routerEventEmitter.address, MaxUint256) - await expect( - routerEventEmitter.swapExactTokensForETH( - router.address, - swapAmount, - 0, - [WETHPartner.address, WETH.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(routerEventEmitter, 'Amounts') - .withArgs([swapAmount, expectedOutputAmount]) - }) - }) - - describe('swapETHForExactTokens', () => { - const WETHPartnerAmount = expandTo18Decimals(10) - const ETHAmount = expandTo18Decimals(5) - const expectedSwapAmount = bigNumberify('557227237267357629') - const outputAmount = expandTo18Decimals(1) - - beforeEach(async () => { - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - }) - - it('happy path', async () => { - const WETHPairToken0 = await WETHPair.token0() - await expect( - router.swapETHForExactTokens( - outputAmount, - [WETH.address, WETHPartner.address], - wallet.address, - MaxUint256, - { - ...overrides, - value: expectedSwapAmount - } - ) - ) - .to.emit(WETH, 'Transfer') - .withArgs(router.address, WETHPair.address, expectedSwapAmount) - .to.emit(WETHPartner, 'Transfer') - .withArgs(WETHPair.address, wallet.address, outputAmount) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address - ? WETHPartnerAmount.sub(outputAmount) - : ETHAmount.add(expectedSwapAmount), - WETHPairToken0 === WETHPartner.address - ? ETHAmount.add(expectedSwapAmount) - : WETHPartnerAmount.sub(outputAmount) - ) - .to.emit(WETHPair, 'Swap') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? 0 : expectedSwapAmount, - WETHPairToken0 === WETHPartner.address ? expectedSwapAmount : 0, - WETHPairToken0 === WETHPartner.address ? outputAmount : 0, - WETHPairToken0 === WETHPartner.address ? 0 : outputAmount, - wallet.address - ) - }) - - it('amounts', async () => { - await expect( - routerEventEmitter.swapETHForExactTokens( - router.address, - outputAmount, - [WETH.address, WETHPartner.address], - wallet.address, - MaxUint256, - { - ...overrides, - value: expectedSwapAmount - } - ) - ) - .to.emit(routerEventEmitter, 'Amounts') - .withArgs([expectedSwapAmount, outputAmount]) - }) - }) - }) - } -}) diff --git a/contract/lib/v2-periphery/test/UniswapV2Router02.spec.ts b/contract/lib/v2-periphery/test/UniswapV2Router02.spec.ts deleted file mode 100644 index ddd0f3c..0000000 --- a/contract/lib/v2-periphery/test/UniswapV2Router02.spec.ts +++ /dev/null @@ -1,380 +0,0 @@ -import chai, { expect } from 'chai' -import { solidity, MockProvider, createFixtureLoader, deployContract } from 'ethereum-waffle' -import { Contract } from 'ethers' -import { BigNumber, bigNumberify } from 'ethers/utils' -import { MaxUint256 } from 'ethers/constants' -import IUniswapV2Pair from '@uniswap/v2-core/build/IUniswapV2Pair.json' - -import { v2Fixture } from './shared/fixtures' -import { expandTo18Decimals, getApprovalDigest, MINIMUM_LIQUIDITY } from './shared/utilities' - -import DeflatingERC20 from '../build/DeflatingERC20.json' -import { ecsign } from 'ethereumjs-util' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -describe('UniswapV2Router02', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let token0: Contract - let token1: Contract - let router: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - token0 = fixture.token0 - token1 = fixture.token1 - router = fixture.router02 - }) - - it('quote', async () => { - expect(await router.quote(bigNumberify(1), bigNumberify(100), bigNumberify(200))).to.eq(bigNumberify(2)) - expect(await router.quote(bigNumberify(2), bigNumberify(200), bigNumberify(100))).to.eq(bigNumberify(1)) - await expect(router.quote(bigNumberify(0), bigNumberify(100), bigNumberify(200))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_AMOUNT' - ) - await expect(router.quote(bigNumberify(1), bigNumberify(0), bigNumberify(200))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_LIQUIDITY' - ) - await expect(router.quote(bigNumberify(1), bigNumberify(100), bigNumberify(0))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_LIQUIDITY' - ) - }) - - it('getAmountOut', async () => { - expect(await router.getAmountOut(bigNumberify(2), bigNumberify(100), bigNumberify(100))).to.eq(bigNumberify(1)) - await expect(router.getAmountOut(bigNumberify(0), bigNumberify(100), bigNumberify(100))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT' - ) - await expect(router.getAmountOut(bigNumberify(2), bigNumberify(0), bigNumberify(100))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_LIQUIDITY' - ) - await expect(router.getAmountOut(bigNumberify(2), bigNumberify(100), bigNumberify(0))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_LIQUIDITY' - ) - }) - - it('getAmountIn', async () => { - expect(await router.getAmountIn(bigNumberify(1), bigNumberify(100), bigNumberify(100))).to.eq(bigNumberify(2)) - await expect(router.getAmountIn(bigNumberify(0), bigNumberify(100), bigNumberify(100))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT' - ) - await expect(router.getAmountIn(bigNumberify(1), bigNumberify(0), bigNumberify(100))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_LIQUIDITY' - ) - await expect(router.getAmountIn(bigNumberify(1), bigNumberify(100), bigNumberify(0))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_LIQUIDITY' - ) - }) - - it('getAmountsOut', async () => { - await token0.approve(router.address, MaxUint256) - await token1.approve(router.address, MaxUint256) - await router.addLiquidity( - token0.address, - token1.address, - bigNumberify(10000), - bigNumberify(10000), - 0, - 0, - wallet.address, - MaxUint256, - overrides - ) - - await expect(router.getAmountsOut(bigNumberify(2), [token0.address])).to.be.revertedWith( - 'UniswapV2Library: INVALID_PATH' - ) - const path = [token0.address, token1.address] - expect(await router.getAmountsOut(bigNumberify(2), path)).to.deep.eq([bigNumberify(2), bigNumberify(1)]) - }) - - it('getAmountsIn', async () => { - await token0.approve(router.address, MaxUint256) - await token1.approve(router.address, MaxUint256) - await router.addLiquidity( - token0.address, - token1.address, - bigNumberify(10000), - bigNumberify(10000), - 0, - 0, - wallet.address, - MaxUint256, - overrides - ) - - await expect(router.getAmountsIn(bigNumberify(1), [token0.address])).to.be.revertedWith( - 'UniswapV2Library: INVALID_PATH' - ) - const path = [token0.address, token1.address] - expect(await router.getAmountsIn(bigNumberify(1), path)).to.deep.eq([bigNumberify(2), bigNumberify(1)]) - }) -}) - -describe('fee-on-transfer tokens', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let DTT: Contract - let WETH: Contract - let router: Contract - let pair: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - - WETH = fixture.WETH - router = fixture.router02 - - DTT = await deployContract(wallet, DeflatingERC20, [expandTo18Decimals(10000)]) - - // make a DTT<>WETH pair - await fixture.factoryV2.createPair(DTT.address, WETH.address) - const pairAddress = await fixture.factoryV2.getPair(DTT.address, WETH.address) - pair = new Contract(pairAddress, JSON.stringify(IUniswapV2Pair.abi), provider).connect(wallet) - }) - - afterEach(async function() { - expect(await provider.getBalance(router.address)).to.eq(0) - }) - - async function addLiquidity(DTTAmount: BigNumber, WETHAmount: BigNumber) { - await DTT.approve(router.address, MaxUint256) - await router.addLiquidityETH(DTT.address, DTTAmount, DTTAmount, WETHAmount, wallet.address, MaxUint256, { - ...overrides, - value: WETHAmount - }) - } - - it('removeLiquidityETHSupportingFeeOnTransferTokens', async () => { - const DTTAmount = expandTo18Decimals(1) - const ETHAmount = expandTo18Decimals(4) - await addLiquidity(DTTAmount, ETHAmount) - - const DTTInPair = await DTT.balanceOf(pair.address) - const WETHInPair = await WETH.balanceOf(pair.address) - const liquidity = await pair.balanceOf(wallet.address) - const totalSupply = await pair.totalSupply() - const NaiveDTTExpected = DTTInPair.mul(liquidity).div(totalSupply) - const WETHExpected = WETHInPair.mul(liquidity).div(totalSupply) - - await pair.approve(router.address, MaxUint256) - await router.removeLiquidityETHSupportingFeeOnTransferTokens( - DTT.address, - liquidity, - NaiveDTTExpected, - WETHExpected, - wallet.address, - MaxUint256, - overrides - ) - }) - - it('removeLiquidityETHWithPermitSupportingFeeOnTransferTokens', async () => { - const DTTAmount = expandTo18Decimals(1) - .mul(100) - .div(99) - const ETHAmount = expandTo18Decimals(4) - await addLiquidity(DTTAmount, ETHAmount) - - const expectedLiquidity = expandTo18Decimals(2) - - const nonce = await pair.nonces(wallet.address) - const digest = await getApprovalDigest( - pair, - { owner: wallet.address, spender: router.address, value: expectedLiquidity.sub(MINIMUM_LIQUIDITY) }, - nonce, - MaxUint256 - ) - const { v, r, s } = ecsign(Buffer.from(digest.slice(2), 'hex'), Buffer.from(wallet.privateKey.slice(2), 'hex')) - - const DTTInPair = await DTT.balanceOf(pair.address) - const WETHInPair = await WETH.balanceOf(pair.address) - const liquidity = await pair.balanceOf(wallet.address) - const totalSupply = await pair.totalSupply() - const NaiveDTTExpected = DTTInPair.mul(liquidity).div(totalSupply) - const WETHExpected = WETHInPair.mul(liquidity).div(totalSupply) - - await pair.approve(router.address, MaxUint256) - await router.removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( - DTT.address, - liquidity, - NaiveDTTExpected, - WETHExpected, - wallet.address, - MaxUint256, - false, - v, - r, - s, - overrides - ) - }) - - describe('swapExactTokensForTokensSupportingFeeOnTransferTokens', () => { - const DTTAmount = expandTo18Decimals(5) - .mul(100) - .div(99) - const ETHAmount = expandTo18Decimals(10) - const amountIn = expandTo18Decimals(1) - - beforeEach(async () => { - await addLiquidity(DTTAmount, ETHAmount) - }) - - it('DTT -> WETH', async () => { - await DTT.approve(router.address, MaxUint256) - - await router.swapExactTokensForTokensSupportingFeeOnTransferTokens( - amountIn, - 0, - [DTT.address, WETH.address], - wallet.address, - MaxUint256, - overrides - ) - }) - - // WETH -> DTT - it('WETH -> DTT', async () => { - await WETH.deposit({ value: amountIn }) // mint WETH - await WETH.approve(router.address, MaxUint256) - - await router.swapExactTokensForTokensSupportingFeeOnTransferTokens( - amountIn, - 0, - [WETH.address, DTT.address], - wallet.address, - MaxUint256, - overrides - ) - }) - }) - - // ETH -> DTT - it('swapExactETHForTokensSupportingFeeOnTransferTokens', async () => { - const DTTAmount = expandTo18Decimals(10) - .mul(100) - .div(99) - const ETHAmount = expandTo18Decimals(5) - const swapAmount = expandTo18Decimals(1) - await addLiquidity(DTTAmount, ETHAmount) - - await router.swapExactETHForTokensSupportingFeeOnTransferTokens( - 0, - [WETH.address, DTT.address], - wallet.address, - MaxUint256, - { - ...overrides, - value: swapAmount - } - ) - }) - - // DTT -> ETH - it('swapExactTokensForETHSupportingFeeOnTransferTokens', async () => { - const DTTAmount = expandTo18Decimals(5) - .mul(100) - .div(99) - const ETHAmount = expandTo18Decimals(10) - const swapAmount = expandTo18Decimals(1) - - await addLiquidity(DTTAmount, ETHAmount) - await DTT.approve(router.address, MaxUint256) - - await router.swapExactTokensForETHSupportingFeeOnTransferTokens( - swapAmount, - 0, - [DTT.address, WETH.address], - wallet.address, - MaxUint256, - overrides - ) - }) -}) - -describe('fee-on-transfer tokens: reloaded', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let DTT: Contract - let DTT2: Contract - let router: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - - router = fixture.router02 - - DTT = await deployContract(wallet, DeflatingERC20, [expandTo18Decimals(10000)]) - DTT2 = await deployContract(wallet, DeflatingERC20, [expandTo18Decimals(10000)]) - - // make a DTT<>WETH pair - await fixture.factoryV2.createPair(DTT.address, DTT2.address) - const pairAddress = await fixture.factoryV2.getPair(DTT.address, DTT2.address) - }) - - afterEach(async function() { - expect(await provider.getBalance(router.address)).to.eq(0) - }) - - async function addLiquidity(DTTAmount: BigNumber, DTT2Amount: BigNumber) { - await DTT.approve(router.address, MaxUint256) - await DTT2.approve(router.address, MaxUint256) - await router.addLiquidity( - DTT.address, - DTT2.address, - DTTAmount, - DTT2Amount, - DTTAmount, - DTT2Amount, - wallet.address, - MaxUint256, - overrides - ) - } - - describe('swapExactTokensForTokensSupportingFeeOnTransferTokens', () => { - const DTTAmount = expandTo18Decimals(5) - .mul(100) - .div(99) - const DTT2Amount = expandTo18Decimals(5) - const amountIn = expandTo18Decimals(1) - - beforeEach(async () => { - await addLiquidity(DTTAmount, DTT2Amount) - }) - - it('DTT -> DTT2', async () => { - await DTT.approve(router.address, MaxUint256) - - await router.swapExactTokensForTokensSupportingFeeOnTransferTokens( - amountIn, - 0, - [DTT.address, DTT2.address], - wallet.address, - MaxUint256, - overrides - ) - }) - }) -}) diff --git a/contract/lib/v2-periphery/test/shared/fixtures.ts b/contract/lib/v2-periphery/test/shared/fixtures.ts deleted file mode 100644 index 0e9da37..0000000 --- a/contract/lib/v2-periphery/test/shared/fixtures.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { Wallet, Contract } from 'ethers' -import { Web3Provider } from 'ethers/providers' -import { deployContract } from 'ethereum-waffle' - -import { expandTo18Decimals } from './utilities' - -import UniswapV2Factory from '@uniswap/v2-core/build/UniswapV2Factory.json' -import IUniswapV2Pair from '@uniswap/v2-core/build/IUniswapV2Pair.json' - -import ERC20 from '../../build/ERC20.json' -import WETH9 from '../../build/WETH9.json' -import UniswapV1Exchange from '../../build/UniswapV1Exchange.json' -import UniswapV1Factory from '../../build/UniswapV1Factory.json' -import UniswapV2Router01 from '../../build/UniswapV2Router01.json' -import UniswapV2Migrator from '../../build/UniswapV2Migrator.json' -import UniswapV2Router02 from '../../build/UniswapV2Router02.json' -import RouterEventEmitter from '../../build/RouterEventEmitter.json' - -const overrides = { - gasLimit: 9999999 -} - -interface V2Fixture { - token0: Contract - token1: Contract - WETH: Contract - WETHPartner: Contract - factoryV1: Contract - factoryV2: Contract - router01: Contract - router02: Contract - routerEventEmitter: Contract - router: Contract - migrator: Contract - WETHExchangeV1: Contract - pair: Contract - WETHPair: Contract -} - -export async function v2Fixture(provider: Web3Provider, [wallet]: Wallet[]): Promise { - // deploy tokens - const tokenA = await deployContract(wallet, ERC20, [expandTo18Decimals(10000)]) - const tokenB = await deployContract(wallet, ERC20, [expandTo18Decimals(10000)]) - const WETH = await deployContract(wallet, WETH9) - const WETHPartner = await deployContract(wallet, ERC20, [expandTo18Decimals(10000)]) - - // deploy V1 - const factoryV1 = await deployContract(wallet, UniswapV1Factory, []) - await factoryV1.initializeFactory((await deployContract(wallet, UniswapV1Exchange, [])).address) - - // deploy V2 - const factoryV2 = await deployContract(wallet, UniswapV2Factory, [wallet.address]) - - // deploy routers - const router01 = await deployContract(wallet, UniswapV2Router01, [factoryV2.address, WETH.address], overrides) - const router02 = await deployContract(wallet, UniswapV2Router02, [factoryV2.address, WETH.address], overrides) - - // event emitter for testing - const routerEventEmitter = await deployContract(wallet, RouterEventEmitter, []) - - // deploy migrator - const migrator = await deployContract(wallet, UniswapV2Migrator, [factoryV1.address, router01.address], overrides) - - // initialize V1 - await factoryV1.createExchange(WETHPartner.address, overrides) - const WETHExchangeV1Address = await factoryV1.getExchange(WETHPartner.address) - const WETHExchangeV1 = new Contract(WETHExchangeV1Address, JSON.stringify(UniswapV1Exchange.abi), provider).connect( - wallet - ) - - // initialize V2 - await factoryV2.createPair(tokenA.address, tokenB.address) - const pairAddress = await factoryV2.getPair(tokenA.address, tokenB.address) - const pair = new Contract(pairAddress, JSON.stringify(IUniswapV2Pair.abi), provider).connect(wallet) - - const token0Address = await pair.token0() - const token0 = tokenA.address === token0Address ? tokenA : tokenB - const token1 = tokenA.address === token0Address ? tokenB : tokenA - - await factoryV2.createPair(WETH.address, WETHPartner.address) - const WETHPairAddress = await factoryV2.getPair(WETH.address, WETHPartner.address) - const WETHPair = new Contract(WETHPairAddress, JSON.stringify(IUniswapV2Pair.abi), provider).connect(wallet) - - return { - token0, - token1, - WETH, - WETHPartner, - factoryV1, - factoryV2, - router01, - router02, - router: router02, // the default router, 01 had a minor bug - routerEventEmitter, - migrator, - WETHExchangeV1, - pair, - WETHPair - } -} diff --git a/contract/lib/v2-periphery/test/shared/utilities.ts b/contract/lib/v2-periphery/test/shared/utilities.ts deleted file mode 100644 index 52de7fa..0000000 --- a/contract/lib/v2-periphery/test/shared/utilities.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { Contract } from 'ethers' -import { Web3Provider } from 'ethers/providers' -import { BigNumber, bigNumberify, keccak256, defaultAbiCoder, toUtf8Bytes, solidityPack } from 'ethers/utils' - -export const MINIMUM_LIQUIDITY = bigNumberify(10).pow(3) - -const PERMIT_TYPEHASH = keccak256( - toUtf8Bytes('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)') -) - -export function expandTo18Decimals(n: number): BigNumber { - return bigNumberify(n).mul(bigNumberify(10).pow(18)) -} - -function getDomainSeparator(name: string, tokenAddress: string) { - return keccak256( - defaultAbiCoder.encode( - ['bytes32', 'bytes32', 'bytes32', 'uint256', 'address'], - [ - keccak256(toUtf8Bytes('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)')), - keccak256(toUtf8Bytes(name)), - keccak256(toUtf8Bytes('1')), - 1, - tokenAddress - ] - ) - ) -} - -export async function getApprovalDigest( - token: Contract, - approve: { - owner: string - spender: string - value: BigNumber - }, - nonce: BigNumber, - deadline: BigNumber -): Promise { - const name = await token.name() - const DOMAIN_SEPARATOR = getDomainSeparator(name, token.address) - return keccak256( - solidityPack( - ['bytes1', 'bytes1', 'bytes32', 'bytes32'], - [ - '0x19', - '0x01', - DOMAIN_SEPARATOR, - keccak256( - defaultAbiCoder.encode( - ['bytes32', 'address', 'address', 'uint256', 'uint256', 'uint256'], - [PERMIT_TYPEHASH, approve.owner, approve.spender, approve.value, nonce, deadline] - ) - ) - ] - ) - ) -} - -export async function mineBlock(provider: Web3Provider, timestamp: number): Promise { - await new Promise(async (resolve, reject) => { - ;(provider._web3Provider.sendAsync as any)( - { jsonrpc: '2.0', method: 'evm_mine', params: [timestamp] }, - (error: any, result: any): void => { - if (error) { - reject(error) - } else { - resolve(result) - } - } - ) - }) -} - -export function encodePrice(reserve0: BigNumber, reserve1: BigNumber) { - return [reserve1.mul(bigNumberify(2).pow(112)).div(reserve0), reserve0.mul(bigNumberify(2).pow(112)).div(reserve1)] -} diff --git a/contract/lib/v2-periphery/tsconfig.json b/contract/lib/v2-periphery/tsconfig.json deleted file mode 100644 index 13ad6fe..0000000 --- a/contract/lib/v2-periphery/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "module": "commonjs", - "strict": true, - "esModuleInterop": true, - "resolveJsonModule": true - } -} diff --git a/contract/lib/v2-periphery/yarn.lock b/contract/lib/v2-periphery/yarn.lock deleted file mode 100644 index 2655a44..0000000 --- a/contract/lib/v2-periphery/yarn.lock +++ /dev/null @@ -1,6347 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@ethereum-waffle/chai@^2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/chai/-/chai-2.5.1.tgz#8bdc055952fc80ff78132571396a2771a36d97ae" - integrity sha512-g/PTnycTM5bODJCumO0XnccKeLITKELwuWOll3EAK+lE5u/OYvfVH5tAsDMJkB8m7J6wVKJ8iT+UiLEKb1qO1g== - dependencies: - "@ethereum-waffle/provider" "^2.5.1" - ethers "^4.0.45" - -"@ethereum-waffle/compiler@^2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/compiler/-/compiler-2.5.1.tgz#955a1fd6558f66b388707c4cec05459e6253535f" - integrity sha512-H08PgcJ+M4URDP2JBjDeYJRMtsh7PusEdRTaEQ7bHeVyjqqv18UEtFPBD7bR169sK9RGlkzjYmCeIRWomCQLlw== - dependencies: - "@resolver-engine/imports" "^0.3.3" - "@resolver-engine/imports-fs" "^0.3.3" - "@types/mkdirp" "^0.5.2" - "@types/node-fetch" "^2.5.5" - ethers "^4.0.45" - mkdirp "^0.5.1" - node-fetch "^2.6.0" - solc "^0.6.3" - -"@ethereum-waffle/mock-contract@^2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/mock-contract/-/mock-contract-2.5.1.tgz#83dbd85bbcab0c0747eadca1bb802f228d7b0874" - integrity sha512-KuUCaCaMRKOI9sJ/MqiJU9ne8wpMWN4NB3beGZpPEo66jK2Ythvz5mgYLNAwAZdzM531NPKc/cWmLUdEF7jnlw== - dependencies: - ethers "^4.0.45" - -"@ethereum-waffle/provider@^2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/provider/-/provider-2.5.1.tgz#fba3c120239c4928caae82db6b1bc4a4e294017a" - integrity sha512-J2yAB7F8eLIPHghcEKjPHBD4Zuix5mM8V4c5JHO20FTrqElWJbZ8pkg/aoztPms2JEt9gEvadAFTcxhd9eYDnA== - dependencies: - ethers "^4.0.45" - ganache-core "^2.10.2" - -"@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.5.0": - version "5.5.1" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz#2f1f6e8a3ab7d378d8ad0b5718460f85649710c5" - integrity sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/networks" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - "@ethersproject/web" "^5.5.0" - -"@ethersproject/abstract-signer@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz#590ff6693370c60ae376bf1c7ada59eb2a8dd08d" - integrity sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA== - dependencies: - "@ethersproject/abstract-provider" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - -"@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.5.0.tgz#bcc6f576a553f21f3dd7ba17248f81b473c9c78f" - integrity sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/rlp" "^5.5.0" - -"@ethersproject/base64@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.5.0.tgz#881e8544e47ed976930836986e5eb8fab259c090" - integrity sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA== - dependencies: - "@ethersproject/bytes" "^5.5.0" - -"@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.5.0.tgz#875b143f04a216f4f8b96245bde942d42d279527" - integrity sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - bn.js "^4.11.9" - -"@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" - integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.5.0.tgz#d2a2cd7d94bd1d58377d1d66c4f53c9be4d0a45e" - integrity sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - -"@ethersproject/hash@>=5.0.0-beta.128": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.5.0.tgz#7cee76d08f88d1873574c849e0207dcb32380cc9" - integrity sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg== - dependencies: - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - -"@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.5.0.tgz#e4b1f9d7701da87c564ffe336f86dcee82983492" - integrity sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg== - dependencies: - "@ethersproject/bytes" "^5.5.0" - js-sha3 "0.8.0" - -"@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" - integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== - -"@ethersproject/networks@^5.5.0": - version "5.5.1" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.5.1.tgz#b7f7b9fb88dec1ea48f739b7fb9621311aa8ce6c" - integrity sha512-tYRDM4zZtSUcKnD4UMuAlj7SeXH/k5WC4SP2u1Pn57++JdXHkRu2zwNkgNogZoxHzhm9Q6qqurDBVptHOsW49Q== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.5.0.tgz#61f00f2bb83376d2071baab02245f92070c59995" - integrity sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/rlp@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.5.0.tgz#530f4f608f9ca9d4f89c24ab95db58ab56ab99a0" - integrity sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/signing-key@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.5.0.tgz#2aa37169ce7e01e3e80f2c14325f624c29cedbe0" - integrity sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - bn.js "^4.11.9" - elliptic "6.5.4" - hash.js "1.1.7" - -"@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.5.0.tgz#e6784d00ec6c57710755699003bc747e98c5d549" - integrity sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.5.0.tgz#7e9bf72e97bcdf69db34fe0d59e2f4203c7a2908" - integrity sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA== - dependencies: - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/rlp" "^5.5.0" - "@ethersproject/signing-key" "^5.5.0" - -"@ethersproject/web@^5.5.0": - version "5.5.1" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.5.1.tgz#cfcc4a074a6936c657878ac58917a61341681316" - integrity sha512-olvLvc1CB12sREc1ROPSHTdFCdvMh0J5GSJYiQg2D0hdD4QmJDy8QYDb1CvoqD/bF1c++aeKv2sR5uduuG9dQg== - dependencies: - "@ethersproject/base64" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - -"@resolver-engine/core@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967" - integrity sha512-eB8nEbKDJJBi5p5SrvrvILn4a0h42bKtbCTri3ZxCGt6UvoQyp7HnGOfki944bUjBSHKK3RvgfViHn+kqdXtnQ== - dependencies: - debug "^3.1.0" - is-url "^1.2.4" - request "^2.85.0" - -"@resolver-engine/fs@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/fs/-/fs-0.3.3.tgz#fbf83fa0c4f60154a82c817d2fe3f3b0c049a973" - integrity sha512-wQ9RhPUcny02Wm0IuJwYMyAG8fXVeKdmhm8xizNByD4ryZlx6PP6kRen+t/haF43cMfmaV7T3Cx6ChOdHEhFUQ== - dependencies: - "@resolver-engine/core" "^0.3.3" - debug "^3.1.0" - -"@resolver-engine/imports-fs@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/imports-fs/-/imports-fs-0.3.3.tgz#4085db4b8d3c03feb7a425fbfcf5325c0d1e6c1b" - integrity sha512-7Pjg/ZAZtxpeyCFlZR5zqYkz+Wdo84ugB5LApwriT8XFeQoLwGUj4tZFFvvCuxaNCcqZzCYbonJgmGObYBzyCA== - dependencies: - "@resolver-engine/fs" "^0.3.3" - "@resolver-engine/imports" "^0.3.3" - debug "^3.1.0" - -"@resolver-engine/imports@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/imports/-/imports-0.3.3.tgz#badfb513bb3ff3c1ee9fd56073e3144245588bcc" - integrity sha512-anHpS4wN4sRMwsAbMXhMfOD/y4a4Oo0Cw/5+rue7hSwGWsDOQaAU1ClK1OxjUC35/peazxEl8JaSRRS+Xb8t3Q== - dependencies: - "@resolver-engine/core" "^0.3.3" - debug "^3.1.0" - hosted-git-info "^2.6.0" - path-browserify "^1.0.0" - url "^0.11.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" - -"@types/bn.js@^4.11.3", "@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/bn.js@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" - integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== - dependencies: - "@types/node" "*" - -"@types/chai@^4.2.6": - version "4.2.22" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.22.tgz#47020d7e4cf19194d43b5202f35f75bd2ad35ce7" - integrity sha512-tFfcE+DSTzWAgifkjik9AySNqIyNoYwmR+uecPwwD/XRNfvOjmC/FjCxpiUGDkDVDphPfCUecSQVFw+lN3M3kQ== - -"@types/mkdirp@^0.5.2": - version "0.5.2" - resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" - integrity sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg== - dependencies: - "@types/node" "*" - -"@types/mocha@^5.2.7": - version "5.2.7" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea" - integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ== - -"@types/node-fetch@^2.5.5": - version "2.5.12" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.12.tgz#8a6f779b1d4e60b7a57fb6fd48d84fb545b9cc66" - integrity sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - -"@types/node@*": - version "16.11.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.11.tgz#6ea7342dfb379ea1210835bada87b3c512120234" - integrity sha512-KB0sixD67CeecHC33MYn+eYARkqTheIRNuu97y2XMjR7Wu3XibO1vaY6VBV6O/a89SPI81cEUIYT87UqUWlZNw== - -"@types/node@^12.12.6": - version "12.20.37" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.37.tgz#abb38afa9d6e8a2f627a8cb52290b3c80fbe61ed" - integrity sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA== - -"@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.3" - resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" - integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== - dependencies: - "@types/node" "*" - -"@uniswap/lib@4.0.1-alpha": - version "4.0.1-alpha" - resolved "https://registry.yarnpkg.com/@uniswap/lib/-/lib-4.0.1-alpha.tgz#2881008e55f075344675b3bca93f020b028fbd02" - integrity sha512-f6UIliwBbRsgVLxIaBANF6w09tYqc6Y/qXdsrbEmXHyFA7ILiKrIwRFXe1yOg8M3cksgVsO9N7yuL2DdCGQKBA== - -"@uniswap/v2-core@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@uniswap/v2-core/-/v2-core-1.0.0.tgz#e0fab91a7d53e8cafb5326ae4ca18351116b0844" - integrity sha512-BJiXrBGnN8mti7saW49MXwxDBRFiWemGetE58q8zgfnPPzQKq55ADltEILqOt6VFZ22kVeVKbF8gVd8aY3l7pA== - -"@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-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-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" - -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-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-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-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-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.6" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" - integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== - 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-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@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== - -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.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base-x@^3.0.2, base-x@^3.0.8: - version "3.0.9" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" - integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== - 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@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.1.tgz#8d7ba124c882bfd8e43260c67475518d0689e4e5" - integrity sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA== - -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" - -blakejs@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.1.tgz#bf313053978b2cd4c444a48795710be05c785702" - integrity sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg== - -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.0.0, bn.js@^4.1.0, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.8.0: - version "4.12.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" - integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== - -bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" - integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== - -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: - 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" - -brorand@^1.0.1, brorand@^1.1.0: - 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.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-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -buffer-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.5" - resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.5.tgz#da9ea8166911cc276bf677b8aed2d02d31f59028" - integrity sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A== - dependencies: - node-gyp-build "^4.3.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, call-bind@^1.0.2, call-bind@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -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.30001284" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001284.tgz#d3653929ded898cd0c1f09a56fd8ca6952df4fca" - integrity sha512-t28SKa7g6kiIQi6NHeOcKrOrGMzCRrXvlasPwWC26TH2QNdglgzQIRUuJ0cR3NeQPH+5jpuveeeSFDLm2zbkEw== - -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.3.4" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" - integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== - 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.1" - 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.1, 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" - -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" - -chownr@^1.1.4: - 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@^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-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@2.1.2, clone@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= - -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-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= - -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" - -command-exists@^1.2.8: - version "1.2.9" - resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" - integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== - -commander@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" - integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== - -component-emitter@^1.2.1: - 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: - 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.1: - version "1.8.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - 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: - version "2.1.3" - resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.3.tgz#fc7a6216e408e74414b90230050842dacda75acc" - integrity sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ== - -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= - -core-js-pure@^3.0.1: - version "3.19.2" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.19.2.tgz#26b5bfb503178cff6e3e115bc2ba6c6419383680" - integrity sha512-5LkcgQEy8pFeVnd/zomkUBSwnmIxuF1C8E9KrMAbOc8f34IBT9RGvTYeNDdp1PnvMJrrVhvk1hg/yVV5h/znlg== - -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: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -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" - -cross-fetch@^2.1.0, cross-fetch@^2.1.1: - version "2.2.5" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.5.tgz#afaf5729f3b6c78d89c9296115c9f142541a5705" - integrity sha512-xqYAhQb4NhCJSRym03dwxpP1bYXpK3y7UN83Bo2WFi3x1Zmzn0SL/6xGoPr+gpt4WmNrgCCX3HPysvOwFOW36w== - dependencies: - node-fetch "2.6.1" - whatwg-fetch "2.0.4" - -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" - -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.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@^3.1.0: - version "3.2.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" - integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== - dependencies: - ms "^2.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" - -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" - -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-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@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== - -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" - -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= - -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.4.10" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.10.tgz#5f44ae6f6725b1949d6e8d34352f80d4c1880734" - integrity sha512-tFgA40Iq2oy4k2PnZrLJowbgpij+lD6ZLxkw8Ht1NKTYyN8dvSvC5xlo8X0WW2jqhKSzITrbr5mpB4/AZ/8OUA== - -elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3: - version "6.5.4" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - -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.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.8" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" - integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A== - dependencies: - prr "~1.0.1" - -es-abstract@^1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" - integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== - dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - get-intrinsic "^1.1.1" - get-symbol-description "^1.0.0" - has "^1.0.3" - has-symbols "^1.0.2" - internal-slot "^1.0.3" - is-callable "^1.2.4" - is-negative-zero "^2.0.1" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.1" - is-string "^1.0.7" - is-weakref "^1.0.1" - object-inspect "^1.11.0" - object-keys "^1.1.1" - object.assign "^4.1.2" - string.prototype.trimend "^1.0.4" - string.prototype.trimstart "^1.0.4" - unbox-primitive "^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.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.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" - -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= - -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.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@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-3.0.0.tgz#75133b3d7c20a5731af0690c385e184ab942b97e" - integrity sha512-4eFkMOhpGbTxBQ3AMzVf0haUX2uTur7DpWiHzWyTURa28BVJJtOkcb9Ok5TV0YvEPG61DODPW7ZUATbJTslioQ== - 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-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.10" - resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.10.tgz#3ca07f4aed698e75bd134584850260246a5fed8a" - integrity sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA== - 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" - -ethereum-waffle@^2.4.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-2.5.1.tgz#537325bb5112fae35ee00a0e783343f8a6f6b917" - integrity sha512-GPumiHpJHN9ONO7owo4mEZJDZzyDRawV3ukBdd+mPCxJkJbe69LTvza1nxcgwMjruXOd9GHaOnE/C2Sb+uGuMA== - dependencies: - "@ethereum-waffle/chai" "^2.5.1" - "@ethereum-waffle/compiler" "^2.5.1" - "@ethereum-waffle/mock-contract" "^2.5.1" - "@ethereum-waffle/provider" "^2.5.1" - ethers "^4.0.45" - -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.8: - version "0.6.8" - resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" - integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== - dependencies: - bn.js "^4.11.8" - ethereumjs-util "^6.0.0" - -"ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": - version "0.6.8" - resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#ee3994657fa7a427238e6ba92a84d0b529bbcde0" - 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.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.1.3" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.3.tgz#b55d7b64dde3e3e45749e4c41288238edec32d23" - integrity sha512-y+82tEbyASO0K0X1/SRhbJJoAlfcvq8JbrG4a5cjrOks7HS/36efU/0j2flxCPOUM++HFahk33kr/ZxyC4vNuw== - dependencies: - "@types/bn.js" "^5.1.0" - bn.js "^5.1.2" - create-hash "^1.1.2" - ethereum-cryptography "^0.1.3" - rlp "^2.2.4" - -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.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.45: - version "4.0.49" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894" - integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg== - dependencies: - aes-js "3.0.0" - bn.js "^4.11.9" - elliptic "6.5.4" - hash.js "1.1.3" - js-sha3 "0.5.7" - scrypt-js "2.0.4" - 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@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.3.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" - integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== - -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" - -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" - -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.6.0" - resolved "https://registry.yarnpkg.com/ext/-/ext-1.6.0.tgz#3871d50641e874cc172e2b53f919842d19db4c52" - integrity sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg== - dependencies: - type "^2.5.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.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.1" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" - integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== - -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" - -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: - 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== - -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" - -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" - -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-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" - -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= - -for-each@^0.3.3, 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.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -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.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - 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" - -forwarded@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" - integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== - -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-extra@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - path-is-absolute "^1.0.0" - rimraf "^2.2.8" - -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.7: - 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.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= - -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-core@^2.10.2: - version "2.13.2" - resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.13.2.tgz#27e6fc5417c10e6e76e2e646671869d7665814a3" - integrity sha512-tIF5cR+ANQz0+3pHWxHjIwHqFXcVo0Mb+kcsNhglNFALcYo49aQpnS9dqHartqPfMFjiHh/qFoD3mYK0d/qGgw== - 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 "3.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@^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.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -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.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-symbol-description@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" - integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.1" - -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@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.3: - version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@~7.1.7: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== - 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@~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== - -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.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== - -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== - -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-bigints@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" - integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== - -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-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, has-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== - -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-tostringtag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" - integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== - dependencies: - has-symbols "^1.0.2" - -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.1.7, 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" - -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.1: - 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" - -hosted-git-info@^2.6.0: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - -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.3" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" - integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== - 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= - -internal-slot@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" - integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== - dependencies: - get-intrinsic "^1.1.0" - has "^1.0.3" - side-channel "^1.0.4" - -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" - -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-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.1" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" - integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-bigint@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" - integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== - dependencies: - has-bigints "^1.0.1" - -is-boolean-object@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" - integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.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.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" - integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== - -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.2.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" - integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== - 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.5" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" - integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== - dependencies: - has-tostringtag "^1.0.0" - -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-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@^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-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-negative-zero@^2.0.1: - 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-object@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" - integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== - dependencies: - has-tostringtag "^1.0.0" - -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-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.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.4, is-regex@~1.1.3: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" - integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^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-shared-array-buffer@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" - integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== - -is-stream@^1.0.0, is-stream@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - -is-string@^1.0.5, is-string@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" - integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== - dependencies: - has-tostringtag "^1.0.0" - -is-symbol@^1.0.2, is-symbol@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" - integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== - dependencies: - has-symbols "^1.0.2" - -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-url@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" - integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww== - -is-weakref@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2" - integrity sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ== - dependencies: - call-bind "^1.0.0" - -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" - -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, 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": - 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.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" - integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== - -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@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= - optionalDependencies: - graceful-fs "^4.1.6" - -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.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" - integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" - -keccak@3.0.1: - 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@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.2.tgz#4c2c6e8c54e04f2670ee49fa734eb9da152206e0" - integrity sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ== - dependencies: - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - readable-stream "^3.6.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: - 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" - -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= - optionalDependencies: - graceful-fs "^4.1.9" - -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" - -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.20: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - -lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -log-symbols@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== - dependencies: - chalk "^2.0.1" - -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-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== - -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" - -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= - -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" - -memorystream@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" - integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= - -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@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" - -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" - -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.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" - -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.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== - -mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== - dependencies: - mime-db "1.51.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== - -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.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@^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.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.3.3: - 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.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.4.tgz#fd01504a6797ec5c9be81ff43d204961ed64a512" - integrity sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw== - dependencies: - minimist "^1.2.5" - -mkdirp@^0.5.1, mkdirp@^0.5.5: - 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@^6.2.2: - version "6.2.3" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.2.3.tgz#e648432181d8b99393410212664450a4c1e31912" - integrity sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg== - dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - 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 "2.2.0" - minimatch "3.0.4" - mkdirp "0.5.4" - ms "2.1.1" - node-environment-flags "1.0.5" - 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.14.0" - resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.14.0.tgz#ce5124d2c601421255985e6e94da80a7357b1b18" - integrity sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw== - -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.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" - -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" - -ncp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" - integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M= - -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@^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.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.5.tgz#fa930275f5bf5dae188d6192b24b4c8bbac3d76a" - integrity sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" - -node-fetch@2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - -node-fetch@^2.6.0: - version "2.6.6" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89" - integrity sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA== - dependencies: - whatwg-url "^5.0.0" - -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, node-gyp-build@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" - integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== - -normalize-url@^4.1.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" - integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== - -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.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.11.0, object-inspect@^1.9.0, object-inspect@~1.11.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" - integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== - -object-is@^1.0.1: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" - integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== - dependencies: - call-bind "^1.0.2" - 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.1.2: - 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.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz#b223cf38e17fefb97a63c10c91df72ccb386df9e" - integrity sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - -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" - -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.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -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-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-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-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-headers@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.4.tgz#9eaf2d02bed2d1eff494331ce3df36d7924760bf" - integrity sha512-psZ9iZoCNFLrgRjZ1d8mn0h9WRqJwFxM9q3x7iUjN/YT2OksthDJ5TiPCu2F38kS4zutqfW+YdVVkBZZx3/1aw== - -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: - 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-browserify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - -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.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.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -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= - -pathval@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" - integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== - -pbkdf2@^3.0.17, pbkdf2@^3.0.3, pbkdf2@^3.0.9: - version "3.1.2" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" - integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -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= - -pify@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= - -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= - -prettier@^1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== - -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: - 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.7" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" - integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== - dependencies: - forwarded "0.2.0" - 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@^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" - -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= - -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.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" - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= - -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" - -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.5, readable-stream@^2.2.2, readable-stream@^2.2.8, readable-stream@^2.2.9, 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.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" - -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.1" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26" - integrity sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -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" - -repeat-element@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" - integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== - -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" - -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-from-string@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -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-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.20.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== - dependencies: - is-core-module "^2.2.0" - 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.2.8, 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" - -rimraf@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - 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.7" - resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" - integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== - dependencies: - bn.js "^5.2.0" - -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== - -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.1, 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.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16" - integrity sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw== - -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== - -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" - -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== - -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@^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@~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= - -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - -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== - -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" - -solc@0.6.6: - version "0.6.6" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.6.6.tgz#0d4b9c2e7105dd6015583f5e1c5ba6a35861ea71" - integrity sha512-p0IO/1fRaHWKN+qR+mUivpwnBpFYD8EoFAzT8VL4lmllNwsyEO7TJJAc2QK0XUeWOYOT92NWKhDNNNLTVbHShA== - dependencies: - command-exists "^1.2.8" - commander "3.0.2" - fs-extra "^0.30.0" - js-sha3 "0.8.0" - memorystream "^0.3.1" - require-from-string "^2.0.0" - semver "^5.5.0" - tmp "0.0.33" - -solc@^0.6.3: - version "0.6.12" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.6.12.tgz#48ac854e0c729361b22a7483645077f58cba080e" - integrity sha512-Lm0Ql2G9Qc7yPP2Ba+WNmzw2jwsrd3u4PobHYlSOxaut3TtUbj9+5ZrT6f4DUpNPEoBaFUOEg9Op9C0mk7ge9g== - dependencies: - command-exists "^1.2.8" - commander "3.0.2" - fs-extra "^0.30.0" - js-sha3 "0.8.0" - memorystream "^0.3.1" - require-from-string "^2.0.0" - semver "^5.5.0" - tmp "0.0.33" - -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.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-url@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" - integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== - -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== - -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" - -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-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.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.4: - version "1.2.5" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.5.tgz#a587bcc8bfad8cb9829a577f5de30dd170c1682c" - integrity sha512-Lnh17webJVsD6ECeovpVN17RlAKjmz4rF9S+8Y45CkMc/ufVpTkU3vZIyIC7sllQ1FCvObZnnCdNs/HXTUOTlg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - -string.prototype.trimend@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" - integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -string.prototype.trimstart@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" - integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== - dependencies: - call-bind "^1.0.2" - 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: - 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-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= - -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" - -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.14.0" - resolved "https://registry.yarnpkg.com/tape/-/tape-4.14.0.tgz#e4d46097e129817175b90925f2385f6b1bcfa826" - integrity sha512-z0+WrUUJuG6wIdWrl4W3rTte2CR26G6qcPOj3w1hfRdcmhF3kHBhOBW9VHsPVAkz08ZmGzp7phVpDupbLzrYKQ== - dependencies: - call-bind "~1.0.2" - deep-equal "~1.1.1" - defined "~1.0.0" - dotignore "~0.1.2" - for-each "~0.3.3" - glob "~7.1.7" - has "~1.0.3" - inherits "~2.0.4" - is-regex "~1.1.3" - minimist "~1.2.5" - object-inspect "~1.11.0" - resolve "~1.20.0" - resumer "~0.0.0" - string.prototype.trim "~1.2.4" - through "~2.3.8" - -tar@^4.0.2: - version "4.4.19" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" - integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA== - dependencies: - chownr "^1.1.4" - fs-minipass "^1.2.7" - minipass "^2.9.0" - minizlib "^1.3.3" - mkdirp "^0.5.5" - safe-buffer "^5.2.1" - yallist "^3.1.1" - -through2@^2.0.3: - 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.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= - -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.0.33, 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" - -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" - -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@^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" - -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" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= - -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= - -ts-node@^8.5.4: - version "8.10.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.10.2.tgz#eee03764633b1234ddd37f8db9ec10b75ec7fb8d" - integrity sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA== - dependencies: - arg "^4.1.0" - diff "^4.0.1" - make-error "^1.1.1" - source-map-support "^0.5.17" - yn "3.1.1" - -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.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/type/-/type-2.5.0.tgz#0a2e78c2e77907b252abe5f298c1b01c63f0db3d" - integrity sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw== - -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@^3.7.3: - version "3.9.10" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" - integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== - -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== - -unbox-primitive@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" - integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== - dependencies: - function-bind "^1.1.1" - has-bigints "^1.0.1" - has-symbols "^1.0.2" - which-boxed-primitive "^1.0.2" - -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== - -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" - -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" - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - 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= - -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= - dependencies: - punycode "1.3.2" - querystring "0.2.0" - -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.7" - resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.7.tgz#c15a19a6af1f7ad9ec7ddc425747ca28c3644922" - integrity sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q== - dependencies: - node-gyp-build "^4.3.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.1.1" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.1.1.tgz#77832f57ced2c9478174149cae9b96e9918cd54b" - integrity sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - for-each "^0.3.3" - has-symbols "^1.0.1" - object.getownpropertydescriptors "^2.1.1" - -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== - -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" - -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-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-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-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-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-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@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-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-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-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-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-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-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@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-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-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-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-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-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-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@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" - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - -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.34" - resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.34.tgz#2bdc2602c08bf2c82253b730655c0ef7dcab3111" - integrity sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ== - 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== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -which-boxed-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" - integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== - dependencies: - is-bigint "^1.0.1" - is-boolean-object "^1.1.0" - is-number-object "^1.0.4" - is-string "^1.0.5" - is-symbol "^1.0.3" - -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.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@^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.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.3.tgz#05541053414921bc29c63bee14b8b0dd50b07b3d" - integrity sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA== - 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: - 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@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== - -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.1.1: - 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.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-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.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" - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== diff --git a/contract/lib/v3-core b/contract/lib/v3-core new file mode 160000 index 0000000..e3589b1 --- /dev/null +++ b/contract/lib/v3-core @@ -0,0 +1 @@ +Subproject commit e3589b192d0be27e100cd0daaf6c97204fdb1899 diff --git a/contract/lib/v3-core/.gitattributes b/contract/lib/v3-core/.gitattributes deleted file mode 100644 index 7cc88f0..0000000 --- a/contract/lib/v3-core/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.sol linguist-language=Solidity \ No newline at end of file diff --git a/contract/lib/v3-core/.github/workflows/fuzz-testing.yml b/contract/lib/v3-core/.github/workflows/fuzz-testing.yml deleted file mode 100644 index bf3892e..0000000 --- a/contract/lib/v3-core/.github/workflows/fuzz-testing.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Fuzz Testing - -on: - push: - branches: - - main - pull_request: - -jobs: - echidna: - name: Echidna - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - testName: - - TickBitmapEchidnaTest - - TickMathEchidnaTest - - SqrtPriceMathEchidnaTest - - SwapMathEchidnaTest - - TickEchidnaTest - - TickOverflowSafetyEchidnaTest - - OracleEchidnaTest - - BitMathEchidnaTest - - LowGasSafeMathEchidnaTest - - UnsafeMathEchidnaTest - - FullMathEchidnaTest - - steps: - - uses: actions/checkout@v2 - - - name: Set up node - uses: actions/setup-node@v1 - with: - node-version: 12 - - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Install node dependencies - run: yarn install --frozen-lockfile - - - name: Install pip3 - run: | - python -m pip install --upgrade pip - - - name: Install slither - run: | - pip3 install slither-analyzer - - - name: Install echidna - run: | - sudo wget -O /tmp/echidna-test.tar.gz https://github.com/crytic/echidna/releases/download/v1.6.0/echidna-test-v1.6.0-Ubuntu-18.04.tar.gz - sudo tar -xf /tmp/echidna-test.tar.gz -C /usr/bin - sudo chmod +x /usr/bin/echidna-test - - - name: Run ${{ matrix.testName }} - run: echidna-test . --contract ${{ matrix.testName }} --config echidna.config.yml diff --git a/contract/lib/v3-core/.github/workflows/lint.yml b/contract/lib/v3-core/.github/workflows/lint.yml deleted file mode 100644 index 942d420..0000000 --- a/contract/lib/v3-core/.github/workflows/lint.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Lint - -on: - push: - branches: - - main - pull_request: - -jobs: - run-linters: - name: Run linters - runs-on: ubuntu-latest - - steps: - - name: Check out Git repository - uses: actions/checkout@v2 - - - name: Set up node - uses: actions/setup-node@v1 - with: - node-version: 12 - - - name: Install dependencies - run: yarn install --frozen-lockfile - - - name: Run linters - uses: wearerequired/lint-action@a8497ddb33fb1205941fd40452ca9fff07e0770d - with: - github_token: ${{ secrets.github_token }} - prettier: true - auto_fix: true - prettier_extensions: 'css,html,js,json,jsx,md,sass,scss,ts,tsx,vue,yaml,yml,sol' diff --git a/contract/lib/v3-core/.github/workflows/mythx.yml b/contract/lib/v3-core/.github/workflows/mythx.yml deleted file mode 100644 index ffe713f..0000000 --- a/contract/lib/v3-core/.github/workflows/mythx.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Mythx - -on: - workflow_dispatch: - -jobs: - mythx: - name: Submit to Mythx - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up node - uses: actions/setup-node@v1 - with: - node-version: 12 - - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Install node dependencies - run: yarn install --frozen-lockfile - - - name: Install pip3 - run: | - python -m pip install --upgrade pip - - - name: Install mythx CLI - run: | - pip3 install mythx-cli - - - name: Install solc-select - run: | - pip3 install solc-select - - - name: Install solc 0.7.6 - run: | - solc-select install 0.7.6 - solc-select use 0.7.6 - - - name: Submit code to Mythx - run: | - mythx --api-key ${{ secrets.MYTHX_API_KEY }} \ - --yes \ - analyze \ - --mode deep \ - --async \ - --create-group \ - --group-name "@uniswap/v3-core@${{ github.sha }}" \ - --solc-version 0.7.6 \ - --check-properties \ - contracts/test/TickBitmapEchidnaTest.sol --include TickBitmapEchidnaTest \ - contracts/test/TickMathEchidnaTest.sol --include TickMathEchidnaTest \ - contracts/test/SqrtPriceMathEchidnaTest.sol --include SqrtPriceMathEchidnaTest \ - contracts/test/SwapMathEchidnaTest.sol --include SwapMathEchidnaTest \ - contracts/test/TickEchidnaTest.sol --include TickEchidnaTest \ - contracts/test/TickOverflowSafetyEchidnaTest.sol --include TickOverflowSafetyEchidnaTest \ - contracts/test/OracleEchidnaTest.sol --include OracleEchidnaTest \ - contracts/test/BitMathEchidnaTest.sol --include BitMathEchidnaTest \ - contracts/test/LowGasSafeMathEchidnaTest.sol --include LowGasSafeMathEchidnaTest \ - contracts/test/UnsafeMathEchidnaTest.sol --include UnsafeMathEchidnaTest \ - contracts/test/FullMathEchidnaTest.sol --include FullMathEchidnaTest diff --git a/contract/lib/v3-core/.github/workflows/tests.yml b/contract/lib/v3-core/.github/workflows/tests.yml deleted file mode 100644 index 89567f9..0000000 --- a/contract/lib/v3-core/.github/workflows/tests.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Tests - -on: - push: - branches: - - main - pull_request: - -jobs: - unit-tests: - name: Unit Tests - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: 12.x - - - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v1 - with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - yarn- - - - name: Install dependencies - run: yarn install --frozen-lockfile - - # This is required separately from yarn test because it generates the typechain definitions - - name: Compile - run: yarn compile - - - name: Run unit tests - run: yarn test diff --git a/contract/lib/v3-core/.prettierrc b/contract/lib/v3-core/.prettierrc deleted file mode 100644 index 31ba22d..0000000 --- a/contract/lib/v3-core/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "semi": false, - "singleQuote": true, - "printWidth": 120 -} diff --git a/contract/lib/v3-core/.solhint.json b/contract/lib/v3-core/.solhint.json deleted file mode 100644 index 11b3647..0000000 --- a/contract/lib/v3-core/.solhint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "plugins": ["prettier"], - "rules": { - "prettier/prettier": "error" - } -} diff --git a/contract/lib/v3-core/.yarnrc b/contract/lib/v3-core/.yarnrc deleted file mode 100644 index 5455c6c..0000000 --- a/contract/lib/v3-core/.yarnrc +++ /dev/null @@ -1 +0,0 @@ -ignore-scripts true diff --git a/contract/lib/v3-core/LICENSE b/contract/lib/v3-core/LICENSE deleted file mode 100644 index 075a13a..0000000 --- a/contract/lib/v3-core/LICENSE +++ /dev/null @@ -1,100 +0,0 @@ -Business Source License 1.1 - -License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. -"Business Source License" is a trademark of MariaDB Corporation Ab. - ------------------------------------------------------------------------------ - -Parameters - -Licensor: Uniswap Labs - -Licensed Work: Uniswap V3 Core - The Licensed Work is (c) 2021 Uniswap Labs - -Additional Use Grant: Any uses listed and defined at - v3-core-license-grants.uniswap.eth - -Change Date: The earlier of 2023-04-01 or a date specified at - v3-core-license-date.uniswap.eth - -Change License: GNU General Public License v2.0 or later - ------------------------------------------------------------------------------ - -Terms - -The Licensor hereby grants you the right to copy, modify, create derivative -works, redistribute, and make non-production use of the Licensed Work. The -Licensor may make an Additional Use Grant, above, permitting limited -production use. - -Effective on the Change Date, or the fourth anniversary of the first publicly -available distribution of a specific version of the Licensed Work under this -License, whichever comes first, the Licensor hereby grants you rights under -the terms of the Change License, and the rights granted in the paragraph -above terminate. - -If your use of the Licensed Work does not comply with the requirements -currently in effect as described in this License, you must purchase a -commercial license from the Licensor, its affiliated entities, or authorized -resellers, or you must refrain from using the Licensed Work. - -All copies of the original and modified Licensed Work, and derivative works -of the Licensed Work, are subject to this License. This License applies -separately for each version of the Licensed Work and the Change Date may vary -for each version of the Licensed Work released by Licensor. - -You must conspicuously display this License on each original or modified copy -of the Licensed Work. If you receive the Licensed Work in original or -modified form from a third party, the terms and conditions set forth in this -License apply to your use of that work. - -Any use of the Licensed Work in violation of this License will automatically -terminate your rights under this License for the current and all other -versions of the Licensed Work. - -This License does not grant you any right in any trademark or logo of -Licensor or its affiliates (provided that you may use a trademark or logo of -Licensor as expressly required by this License). - -TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, -EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -TITLE. - -MariaDB hereby grants you permission to use this License’s text to license -your works, and to refer to it using the trademark "Business Source License", -as long as you comply with the Covenants of Licensor below. - ------------------------------------------------------------------------------ - -Covenants of Licensor - -In consideration of the right to use this License’s text and the "Business -Source License" name and trademark, Licensor covenants to MariaDB, and to all -other recipients of the licensed work to be provided by Licensor: - -1. To specify as the Change License the GPL Version 2.0 or any later version, - or a license that is compatible with GPL Version 2.0 or a later version, - where "compatible" means that software provided under the Change License can - be included in a program with software provided under GPL Version 2.0 or a - later version. Licensor may specify additional Change Licenses without - limitation. - -2. To either: (a) specify an additional grant of rights to use that does not - impose any additional restriction on the right granted in this License, as - the Additional Use Grant; or (b) insert the text "None". - -3. To specify a Change Date. - -4. Not to modify this License in any other way. - ------------------------------------------------------------------------------ - -Notice - -The Business Source License (this document, or the "License") is not an Open -Source license. However, the Licensed Work will eventually be made available -under an Open Source License, as stated in this License. diff --git a/contract/lib/v3-core/README.md b/contract/lib/v3-core/README.md deleted file mode 100644 index bc366a5..0000000 --- a/contract/lib/v3-core/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# Uniswap V3 - -[![Lint](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/lint.yml/badge.svg)](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/lint.yml) -[![Tests](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/tests.yml/badge.svg)](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/tests.yml) -[![Fuzz Testing](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/fuzz-testing.yml/badge.svg)](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/fuzz-testing.yml) -[![Mythx](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/mythx.yml/badge.svg)](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/mythx.yml) -[![npm version](https://img.shields.io/npm/v/@uniswap/v3-core/latest.svg)](https://www.npmjs.com/package/@uniswap/v3-core/v/latest) - -This repository contains the core smart contracts for the Uniswap V3 Protocol. -For higher level contracts, see the [uniswap-v3-periphery](https://github.com/Uniswap/uniswap-v3-periphery) -repository. - -## Bug bounty - -This repository is subject to the Uniswap V3 bug bounty program, per the terms defined [here](./bug-bounty.md). - -## Local deployment - -In order to deploy this code to a local testnet, you should install the npm package -`@uniswap/v3-core` -and import the factory bytecode located at -`@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json`. -For example: - -```typescript -import { - abi as FACTORY_ABI, - bytecode as FACTORY_BYTECODE, -} from '@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json' - -// deploy the bytecode -``` - -This will ensure that you are testing against the same bytecode that is deployed to -mainnet and public testnets, and all Uniswap code will correctly interoperate with -your local deployment. - -## Using solidity interfaces - -The Uniswap v3 interfaces are available for import into solidity smart contracts -via the npm artifact `@uniswap/v3-core`, e.g.: - -```solidity -import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; - -contract MyContract { - IUniswapV3Pool pool; - - function doSomethingWithPool() { - // pool.swap(...); - } -} - -``` - -## Licensing - -The primary license for Uniswap V3 Core is the Business Source License 1.1 (`BUSL-1.1`), see [`LICENSE`](./LICENSE). - -### Exceptions - -- All files in `contracts/interfaces/` are licensed under `GPL-2.0-or-later` (as indicated in their SPDX headers), see [`contracts/interfaces/LICENSE`](./contracts/interfaces/LICENSE) -- Several files in `contracts/libraries/` are licensed under `GPL-2.0-or-later` (as indicated in their SPDX headers), see [`contracts/libraries/LICENSE_GPL`](contracts/libraries/LICENSE_GPL) -- `contracts/libraries/FullMath.sol` is licensed under `MIT` (as indicated in its SPDX header), see [`contracts/libraries/LICENSE_MIT`](contracts/libraries/LICENSE_MIT) -- All files in `contracts/test` remain unlicensed. diff --git a/contract/lib/v3-core/audits/abdk/audit.pdf b/contract/lib/v3-core/audits/abdk/audit.pdf deleted file mode 100644 index d851413..0000000 Binary files a/contract/lib/v3-core/audits/abdk/audit.pdf and /dev/null differ diff --git a/contract/lib/v3-core/audits/tob/README.md b/contract/lib/v3-core/audits/tob/README.md deleted file mode 100644 index 5e4b55e..0000000 --- a/contract/lib/v3-core/audits/tob/README.md +++ /dev/null @@ -1,166 +0,0 @@ -The following contains the properties written by Trail of Bits. - -- [End to End testing with Echidna](#end-to-end-testing-with-echidna) -- [Verification with Manticore](#verification-with-manticore) - -# End to End testing with Echidna - -We've implemented end-to-end properties for the Uniswap V3 Core pool contract. - -## Installation - -In order to run this, you need to install [echidna 1.7.0](https://github.com/crytic/echidna/releases/tag/v1.7.0). - -## Run - -Assuming you're in the root of the repo - -``` -echidna-test contracts/crytic/echidna/E2E_swap.sol --config contracts/crytic/echidna/E2E_swap.config.yaml --contract E2E_swap - -echidna-test contracts/crytic/echidna/E2E_mint_burn.sol --config contracts/crytic/echidna/E2E_mint_burn.config.yaml --contract E2E_mint_burn - -echidna-test contracts/crytic/echidna/Other.sol --config contracts/crytic/echidna/Other.config.yaml --contract Other -``` - -## Random but valid pool initialisation, created positions, and priceLimits - -To help Echidna to get good coverage we've used multiple helper functions to: - -- create random but valid pool initialization params (fee, tickSpacing, initial price) before doing swaps or mint/burn [link](./E2E_mint_burn.sol#L303-L337) [link](./E2E_swap.sol#L196-L230) -- create a random number of random but valid positions before testing swaps [link](./E2E_swap.sol#L233-L283) -- create a random but valid priceLimit when doing swap [link](./E2E_swap.sol#L68-L80) -- create random but valid position params when doing mint [link](./E2E_mint_burn.sol#L102-L130) - -By doing the above Echidna will be able to test the actual properties we want to test instead of bashing it's head against using an invalid priceLimit or invalid position params. The above also allows the creation of a dynamic number of random positions before executing swaps instead of using a static list. - -To achieve the above random but valid outcomes we use the `uint128 _amount` of swap/mint/burn as a seed to create randomness in the helper functions. This also means that retrieving the exact used params is not very straightforward. However, through a combination of hardhat `console.sol` and writing a small js unit test it's possible to retrieve the exact used params of every (list of) call(s). - -## Adjust hardhat.config.ts - -The Echidna contracts cost too much gas to deploy due to all the calls inside the constructor. - -Adjust the `hardhat.config.ts` to: - -```json -hardhat: { - allowUnlimitedContractSize: true, - gas: 950000000, - blockGasLimit: 950000000, - gasPrice: 1, -}, -``` - -### E2E_swap: retrieving the pool initialisation params and created positions - -The pool initialisation and created positions is deterministic and there is a `view` function that will return whatever a specific `_amount` (used as `_seed`) will create. - -Write a js unit test: - -```js -console.log(await E2E_swap.viewRandomInit('')) -``` - -### E2E_swap: retrieving the used priceLimit of a swap - -The priceLimit depends on the state of the pool contract, it is therefore easiest to retrieve by using hardhat's `console.sol`. - -Uncomment the following lines: - -- at the top of `E2E_swap.sol`: `// import 'hardhat/console.sol';` -- inside the swap functions: `// console.log('sqrtPriceLimitX96 = %s', sqrtPriceLimitX96); ` - -Instead of just one swap call, imagine Echidna reports two swap calls, and the second one causes an assertion failure. - -```js -// to get pool params + created positions -console.log(await E2E_swap.viewRandomInit('')) - -// execute the swap, which will create the above and log the used priceLimit to the console -await E2E_swap.test_swap_exactOut_oneForZero('') - -// execute the swap, logs the used priceLimit to the console -await E2E_swap.test_swap_exactIn_oneForZero('') -``` - -### E2E_mint_burn: retrieving the pool initialisation params - -The pool initialisation params creation is deterministic and there is a `view` function that will return whatever a specific `_amount` (used as `_seed`) will create. - -Write a js unit test: - -```js -console.log(await E2E_mint_burn.viewInitRandomPoolParams('')) -``` - -### E2E_mint_burn: retrieving a mint's created random position - -```js -const poolInitParams = await E2E_mint_burn.viewInitRandomPoolParams('') - -const positionParams = await E2E_mint_burn.viewMintRandomNewPosition( - '', - poolInitParams.tickSpacing, - poolInitParams.tickCount, - poolInitParams.maxTick -) - -console.log(positionParams) -``` - -### E2E_mint_burn: retrieving a burn's used position - -Uncomment the following lines: - -- at the top of `E2E_mint_burn.sol`: `// import 'hardhat/console.sol';` -- inside the particular burn function: `// console.log('burn posIdx = %s', posIdx);` -- if this is a partial burn, also want to see the burned amount. inside the `test_burn_partial` function: `// console.log('burn amount = %s', burnAmount);` - -Then execute the burn in a js test. - -```js -// show pool init params -const poolInitParams = await E2E_mint_burn.viewInitRandomPoolParams('') -console.log(positionParams) - -// show pool mint position params -const positionParams = await E2E_mint_burn.viewMintRandomNewPosition( - '', - poolInitParams.tickSpacing, - poolInitParams.tickCount, - poolInitParams.maxTick -) -console.log(positionParams) - -// execute the first mint -await E2E_mint_burn.test_mint('') - -// execute the burn -await E2E_mint_burn.test_burn_partial('') -// this should log the index of the position that was burned to the console -// as well as the amount that was burned. -// together with the above output this should make it clear which exact position -// was burned and how much -``` - -# Verification with Manticore - -The verification was performed with the experimental branch [dev-evm-experiments](https://github.com/trailofbits/manticore/tree/dev-evm-experiments), which contains new optimizations and is a work in progress. Trail of Bits will ensure that the following properties hold once the branch has stabilized and been included in a Manticore release. - -For conveniance, we followed the pattern "if there is reacheable path, there is a bug". - -To verify a property, run: - -``` -manticore . --contract CONTRACT_NAME --txlimit 1 --smt.solver all --quick-mode --lazy-evaluation --core.procs 1 -``` - -> The command might change once `dev-evm-experiments` has stabilized - -Manticore will create a `mcore_X` directory. If no `X.tx` file is generated, it means that Manticore did not find a path violating the property. - -| ID | Description | Contract | Status | -| --- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | -------- | -| 01 | `BitMath.mostSignificantBit returns a value in x >= 2**msb && (msb == 255 or x < 2**(msb+1)).` | [`VerifyBitMathMsb`](./contracts/crytic/manticore/001.sol) | Verified | -| 02 | `BitMath.leastSignificantBit returns a value in ((x & 2** lsb) != 0) && ((x & (2**(lsb -1))) == 0).` | [`VerifyBitMathLsb`](./contracts/crytic/manticore/002.sol) | Verified | -| 03 | `If LiquidityMath.addDelta returns, the value will be equal to x + uint128(y).` | [`VerifyLiquidityMathAddDelta`](./contracts/crytic/manticore/003.sol) | Verified | diff --git a/contract/lib/v3-core/audits/tob/audit.pdf b/contract/lib/v3-core/audits/tob/audit.pdf deleted file mode 100644 index 7a7f0dc..0000000 Binary files a/contract/lib/v3-core/audits/tob/audit.pdf and /dev/null differ diff --git a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_mint_burn.config.yaml b/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_mint_burn.config.yaml deleted file mode 100644 index 37472eb..0000000 --- a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_mint_burn.config.yaml +++ /dev/null @@ -1,16 +0,0 @@ -checkAsserts: true -coverage: true -codeSize: 0x60000 -corpusDir: echidna_e2e_mint_burn_corpus -seqLen: 10 -testLimit: 100000 -timeout: 600 # 10 minutes - -# blacklist -filterFunctions: - [ - 'E2E_mint_burn.viewInitRandomPoolParams(uint128)', - 'E2E_mint_burn.viewMintRandomNewPosition(uint128,int24,uint24,int24)', - 'E2E_mint_burn.viewBurnRandomPositionIdx(uint128,uint128)', - 'E2E_mint_burn.viewBurnRandomPositionBurnAmount(uint128,uint128)', - ] diff --git a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_mint_burn.sol b/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_mint_burn.sol deleted file mode 100644 index 4cd3b03..0000000 --- a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_mint_burn.sol +++ /dev/null @@ -1,503 +0,0 @@ -pragma solidity =0.7.6; -pragma abicoder v2; - -import './Setup.sol'; -import '../../../../../contracts/test/TestERC20.sol'; -import '../../../../../contracts/libraries/TickMath.sol'; -import '../../../../../contracts/UniswapV3Pool.sol'; -import '../../../../../contracts/libraries/Position.sol'; - -// import 'hardhat/console.sol'; - -contract E2E_mint_burn { - SetupTokens tokens; - SetupUniswap uniswap; - - UniswapV3Pool pool; - - TestERC20 token0; - TestERC20 token1; - - UniswapMinter minter; - UniswapSwapper swapper; - - int24[] usedTicks; - bool inited; - - PoolPosition[] positions; - - struct PoolPosition { - int24 tickLower; - int24 tickUpper; - uint128 amount; - bytes32 key; - } - - struct PoolParams { - uint24 fee; - int24 tickSpacing; - int24 minTick; - int24 maxTick; - uint24 tickCount; - uint160 startPrice; - int24 startTick; - } - - PoolParams poolParams; - - constructor() public { - tokens = new SetupTokens(); - token0 = tokens.token0(); - token1 = tokens.token1(); - - uniswap = new SetupUniswap(token0, token1); - - minter = new UniswapMinter(token0, token1); - swapper = new UniswapSwapper(token0, token1); - - tokens.mintTo(0, address(minter), 1e10 ether); - tokens.mintTo(1, address(minter), 1e10 ether); - } - - // - // - // Helpers - // - // - - function _getRandomPositionIdx(uint128 _seed, uint256 _positionsCount) internal view returns (uint128 positionIdx) { - positionIdx = _seed % uint128(_positionsCount); - } - - function _getRandomBurnAmount(uint128 _seed, uint128 _positionAmount) internal view returns (uint128 burnAmount) { - burnAmount = _seed % _positionAmount; - require(burnAmount < _positionAmount); - require(burnAmount > 0); - } - - function _getRandomPositionIdxAndBurnAmount(uint128 _seed) - internal - view - returns (uint128 positionIdx, uint128 burnAmount) - { - positionIdx = _getRandomPositionIdx(_seed, positions.length); - burnAmount = _getRandomBurnAmount(_seed, positions[positionIdx].amount); - } - - // adds all lower and upper ticks to an array such that the liquidity(Net) invariants - // can loop over them - function storeUsedTicks(int24 _tL, int24 _tU) internal { - bool lowerAlreadyUsed = false; - bool upperAlreadyUsed = false; - for (uint8 j = 0; j < usedTicks.length; j++) { - if (usedTicks[j] == _tL) lowerAlreadyUsed = true; - else if (usedTicks[j] == _tU) upperAlreadyUsed = true; - } - if (!lowerAlreadyUsed) usedTicks.push(_tL); - if (!upperAlreadyUsed) usedTicks.push(_tU); - } - - function removePosition(uint256 _posIdx) internal { - positions[_posIdx] = positions[positions.length - 1]; - positions.pop(); - } - - // use the _amount as _seed to create a random but valid position - function forgePosition( - uint128 _seed, - int24 _poolTickSpacing, - uint24 _poolTickCount, - int24 _poolMaxTick - ) internal view returns (int24 tickLower, int24 tickUpper) { - int24 randomTick1 = int24((_seed % uint128(_poolTickCount)) * uint128(_poolTickSpacing)); - - if (_seed % 2 == 0) { - // make tickLower positive - tickLower = randomTick1; - - // tickUpper is somewhere above tickLower - uint24 poolTickCountLeft = uint24((_poolMaxTick - randomTick1) / _poolTickSpacing); - int24 randomTick2 = int24((_seed % uint128(poolTickCountLeft)) * uint128(_poolTickSpacing)); - tickUpper = tickLower + randomTick2; - } else { - // make tickLower negative or zero - tickLower = randomTick1 == 0 ? 0 : -randomTick1; - - uint24 poolTickCountNegativeLeft = uint24((_poolMaxTick - randomTick1) / _poolTickSpacing); - uint24 poolTickCountTotalLeft = poolTickCountNegativeLeft + _poolTickCount; - - uint24 randomIncrement = uint24((_seed % uint128(poolTickCountTotalLeft)) * uint128(_poolTickSpacing)); - - if (randomIncrement <= uint24(tickLower)) { - // tickUpper will also be negative - tickUpper = tickLower + int24(randomIncrement); - } else { - // tickUpper is positive - randomIncrement -= uint24(-tickLower); - tickUpper = tickLower + int24(randomIncrement); - } - } - } - - // - // - // Invariants - // - // - - function check_liquidityNet_invariant() internal { - int128 liquidityNet = 0; - for (uint256 i = 0; i < usedTicks.length; i++) { - (, int128 tickLiquidityNet, , ) = pool.ticks(usedTicks[i]); - int128 result = liquidityNet + tickLiquidityNet; - assert( - (tickLiquidityNet >= 0 && result >= liquidityNet) || (tickLiquidityNet < 0 && result < liquidityNet) - ); - liquidityNet = result; - } - - // prop #20 - assert(liquidityNet == 0); - } - - function check_liquidity_invariant() internal { - (, int24 currentTick, , , , , ) = pool.slot0(); - - int128 liquidity = 0; - for (uint256 i = 0; i < usedTicks.length; i++) { - int24 tick = usedTicks[i]; - - if (tick <= currentTick) { - (, int128 tickLiquidityNet, , ) = pool.ticks(tick); - - int128 result = liquidity + tickLiquidityNet; - assert((tickLiquidityNet >= 0 && result >= liquidity) || (tickLiquidityNet < 0 && result < liquidity)); - liquidity = result; - } - } - - // prop #21 - assert(uint128(liquidity) == pool.liquidity()); - assert(liquidity >= 0); - } - - function check_tick_feegrowth_invariant() internal { - (, int24 currentTick, , , , , ) = pool.slot0(); - - if (currentTick == poolParams.maxTick || currentTick == poolParams.minTick) return; - - int24 tickBelow = currentTick - poolParams.tickSpacing; - int24 tickAbove = currentTick + poolParams.tickSpacing; - - (, , uint256 tB_feeGrowthOutside0X128, uint256 tB_feeGrowthOutside1X128) = pool.ticks(tickBelow); - (, , uint256 tA_feeGrowthOutside0X128, uint256 tA_feeGrowthOutside1X128) = pool.ticks(tickAbove); - - // prop #22 - assert(tB_feeGrowthOutside0X128 + tA_feeGrowthOutside0X128 <= pool.feeGrowthGlobal0X128()); - - // prop #23 - assert(tB_feeGrowthOutside1X128 + tA_feeGrowthOutside1X128 <= pool.feeGrowthGlobal1X128()); - } - - function check_mint_invariants( - int24 _tickLower, - int24 _tickUpper, - UniswapMinter.MinterStats memory bfre, - UniswapMinter.MinterStats memory aftr - ) internal { - (, int24 currentTick, , , , , ) = pool.slot0(); - - // prop #1 - if (currentTick >= _tickLower && currentTick < _tickUpper) { - assert(aftr.liq > bfre.liq); - } else { - assert(aftr.liq == bfre.liq); - } - - // prop #2 - assert(aftr.tL_liqGross > bfre.tL_liqGross); - - // prop #3 - assert(aftr.tU_liqGross > bfre.tU_liqGross); - - // prop #4 - assert(aftr.tL_liqNet > bfre.tL_liqNet); - - // prop #5 - assert(aftr.tU_liqNet < bfre.tU_liqNet); - } - - function check_burn_invariants( - uint128 _burnAmount, - int24 _tickLower, - int24 _tickUpper, - uint128 _newPosAmount, - UniswapMinter.MinterStats memory bfre, - UniswapMinter.MinterStats memory aftr - ) internal { - (, int24 currentTick, , , , , ) = pool.slot0(); - - if (_burnAmount > 0) { - // prop #7 - if (currentTick >= _tickLower && currentTick < _tickUpper) { - assert(aftr.liq < bfre.liq); - } else { - assert(aftr.liq == bfre.liq); - } - } else { - // prop #29 - assert(aftr.liq == bfre.liq); - } - - // prop #8 - assert(aftr.tL_liqGross <= bfre.tL_liqGross); - - // prop #9 - assert(aftr.tU_liqGross <= bfre.tU_liqGross); - - // prop #10 - assert(aftr.tL_liqNet <= bfre.tL_liqNet); - - // prop #11 - assert(aftr.tU_liqNet >= bfre.tU_liqNet); - - bytes32 positionKey = keccak256(abi.encodePacked(address(minter), _tickLower, _tickUpper)); - (uint128 positionLiquidity, , , , ) = pool.positions(positionKey); - - // prop #27 - assert(positionLiquidity == _newPosAmount); - } - - // - // - // Helper to reconstruct the "random" init setup of the pool - // - // - - function viewInitRandomPoolParams(uint128 _seed) public view returns (PoolParams memory _poolParams) { - _poolParams = forgePoolParams(_seed); - } - - function viewMintRandomNewPosition( - uint128 _seed, - int24 _poolTickSpacing, - uint24 _poolTickCount, - int24 _poolMaxTick - ) - public - view - returns ( - int24 tickLower, - int24 tickUpper, - uint128 amount - ) - { - (tickLower, tickUpper) = forgePosition(_seed, _poolTickSpacing, _poolTickCount, _poolMaxTick); - amount = _seed; - } - - function viewBurnRandomPositionIdx(uint128 _seed, uint128 _positionsCount) - public - view - returns (uint128 positionIdx) - { - positionIdx = _getRandomPositionIdx(_seed, _positionsCount); - } - - function viewBurnRandomPositionBurnAmount(uint128 _seed, uint128 _positionAmount) - public - view - returns (uint128 burnAmount) - { - burnAmount = _getRandomBurnAmount(_seed, _positionAmount); - } - - // - // - // Setup functions - // - // - - function forgePoolParams(uint128 _seed) internal view returns (PoolParams memory _poolParams) { - // - // decide on one of the three fees, and corresponding tickSpacing - // - if (_seed % 3 == 0) { - _poolParams.fee = uint24(500); - _poolParams.tickSpacing = int24(10); - } else if (_seed % 3 == 1) { - _poolParams.fee = uint24(3000); - _poolParams.tickSpacing = int24(60); - } else if (_seed % 3 == 2) { - _poolParams.fee = uint24(10000); - _poolParams.tickSpacing = int24(2000); - } - - _poolParams.maxTick = (int24(887272) / _poolParams.tickSpacing) * _poolParams.tickSpacing; - _poolParams.minTick = -_poolParams.maxTick; - _poolParams.tickCount = uint24(_poolParams.maxTick / _poolParams.tickSpacing); - - // - // set the initial price - // - _poolParams.startTick = int24((_seed % uint128(_poolParams.tickCount)) * uint128(_poolParams.tickSpacing)); - if (_seed % 3 == 0) { - // set below 0 - _poolParams.startPrice = TickMath.getSqrtRatioAtTick(-_poolParams.startTick); - } else if (_seed % 3 == 1) { - // set at 0 - _poolParams.startPrice = TickMath.getSqrtRatioAtTick(0); - _poolParams.startTick = 0; - } else if (_seed % 3 == 2) { - // set above 0 - _poolParams.startPrice = TickMath.getSqrtRatioAtTick(_poolParams.startTick); - } - } - - function _init(uint128 _seed) internal { - // - // generate random pool params - // - poolParams = forgePoolParams(_seed); - - // - // deploy the pool - // - uniswap.createPool(poolParams.fee, poolParams.startPrice); - pool = uniswap.pool(); - - // - // set the pool inside the minter and swapper contracts - // - minter.setPool(pool); - - inited = true; - } - - // - // - // Functions to fuzz - // - // - - function test_mint(uint128 _amount) public { - if (!inited) _init(_amount); - (int24 _tL, int24 _tU) = - forgePosition(_amount, poolParams.tickSpacing, poolParams.tickCount, poolParams.maxTick); - - (UniswapMinter.MinterStats memory bfre, UniswapMinter.MinterStats memory aftr) = - minter.doMint(_tL, _tU, _amount); - storeUsedTicks(_tL, _tU); - - check_mint_invariants(_tL, _tU, bfre, aftr); - - check_liquidityNet_invariant(); - check_liquidity_invariant(); - check_tick_feegrowth_invariant(); - - bytes32 positionKey = keccak256(abi.encodePacked(address(minter), _tL, _tU)); - - bool mintingToExistingPos = false; - for (uint256 i = 0; i < positions.length; i++) { - if (positions[i].key == positionKey) { - // minting to an existing position - positions[i].amount += _amount; - mintingToExistingPos = true; - break; - } - } - - if (!mintingToExistingPos) { - positions.push(PoolPosition(_tL, _tU, _amount, positionKey)); - } - } - - function test_burn_partial(uint128 _amount) public { - require(positions.length > 0); - - (uint128 posIdx, uint128 burnAmount) = _getRandomPositionIdxAndBurnAmount(_amount); - // console.log('burn posIdx = %s', posIdx); - // console.log('burn amount = %s', burnAmount); - PoolPosition storage pos = positions[posIdx]; - - UniswapMinter.MinterStats memory bfre; - UniswapMinter.MinterStats memory aftr; - - try minter.doBurn(pos.tickLower, pos.tickUpper, burnAmount) returns ( - UniswapMinter.MinterStats memory bfre_burn, - UniswapMinter.MinterStats memory aftr_burn - ) { - bfre = bfre_burn; - aftr = aftr_burn; - } catch { - // prop #28 - assert(false); - } - - check_burn_invariants(burnAmount, pos.tickLower, pos.tickUpper, pos.amount - burnAmount, bfre, aftr); - - check_liquidityNet_invariant(); - check_liquidity_invariant(); - check_tick_feegrowth_invariant(); - - pos.amount = pos.amount - burnAmount; - } - - function test_burn_full(uint128 _amount) public { - require(positions.length > 0); - - uint128 posIdx = _getRandomPositionIdx(_amount, positions.length); - // console.log('burn posIdx = %s', posIdx); - PoolPosition storage pos = positions[posIdx]; - - UniswapMinter.MinterStats memory bfre; - UniswapMinter.MinterStats memory aftr; - - try minter.doBurn(pos.tickLower, pos.tickUpper, pos.amount) returns ( - UniswapMinter.MinterStats memory bfre_burn, - UniswapMinter.MinterStats memory aftr_burn - ) { - bfre = bfre_burn; - aftr = aftr_burn; - } catch { - // prop #25 - assert(false); - } - - check_burn_invariants(pos.amount, pos.tickLower, pos.tickUpper, 0, bfre, aftr); - - check_liquidityNet_invariant(); - check_liquidity_invariant(); - check_tick_feegrowth_invariant(); - - removePosition(posIdx); - } - - function test_burn_zero(uint128 _amount) public { - require(positions.length > 0); - - uint128 posIdx = _getRandomPositionIdx(_amount, positions.length); - // console.log('burn posIdx = %s', posIdx); - PoolPosition storage pos = positions[posIdx]; - - UniswapMinter.MinterStats memory bfre; - UniswapMinter.MinterStats memory aftr; - - try minter.doBurn(pos.tickLower, pos.tickUpper, 0) returns ( - UniswapMinter.MinterStats memory bfre_burn, - UniswapMinter.MinterStats memory aftr_burn - ) { - bfre = bfre_burn; - aftr = aftr_burn; - } catch { - // prop #26 - assert(false); - } - - check_burn_invariants(0, pos.tickLower, pos.tickUpper, pos.amount, bfre, aftr); - - check_liquidityNet_invariant(); - check_liquidity_invariant(); - check_tick_feegrowth_invariant(); - } -} diff --git a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_swap.config.yaml b/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_swap.config.yaml deleted file mode 100644 index b2c5c6d..0000000 --- a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_swap.config.yaml +++ /dev/null @@ -1,10 +0,0 @@ -checkAsserts: true -coverage: true -codeSize: 0x60000 -corpusDir: echidna_e2e_swap_corpus -seqLen: 10 -testLimit: 100000 -timeout: 3600 # 1 hour - -# blacklist -filterFunctions: ['E2E_swap.viewRandomInit(uint128)'] diff --git a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_swap.sol b/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_swap.sol deleted file mode 100644 index 289ccb9..0000000 --- a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_swap.sol +++ /dev/null @@ -1,487 +0,0 @@ -pragma solidity =0.7.6; -pragma abicoder v2; - -import './Setup.sol'; -import '../../../../../contracts/test/TestERC20.sol'; -import '../../../../../contracts/libraries/TickMath.sol'; -import '../../../../../contracts/UniswapV3Pool.sol'; - -// import 'hardhat/console.sol'; - -contract E2E_swap { - SetupTokens tokens; - SetupUniswap uniswap; - - UniswapV3Pool pool; - - TestERC20 token0; - TestERC20 token1; - - UniswapMinter minter; - UniswapSwapper swapper; - - int24[] usedTicks; - bool inited; - - struct PoolParams { - uint24 fee; - int24 tickSpacing; - int24 minTick; - int24 maxTick; - uint24 tickCount; - uint160 startPrice; - int24 startTick; - } - - struct PoolPositions { - int24[] tickLowers; - int24[] tickUppers; - uint128[] amounts; - } - - PoolParams poolParams; - PoolPositions poolPositions; - - constructor() public { - tokens = new SetupTokens(); - token0 = tokens.token0(); - token1 = tokens.token1(); - - uniswap = new SetupUniswap(token0, token1); - - minter = new UniswapMinter(token0, token1); - swapper = new UniswapSwapper(token0, token1); - - tokens.mintTo(0, address(swapper), 1e9 ether); - tokens.mintTo(1, address(swapper), 1e9 ether); - - tokens.mintTo(0, address(minter), 1e10 ether); - tokens.mintTo(1, address(minter), 1e10 ether); - } - - // - // - // Helpers - // - // - - function get_random_zeroForOne_priceLimit(int256 _amountSpecified) - internal - view - returns (uint160 sqrtPriceLimitX96) - { - // help echidna a bit by calculating a valid sqrtPriceLimitX96 using the amount as random seed - (uint160 currentPrice, , , , , , ) = pool.slot0(); - uint160 minimumPrice = TickMath.MIN_SQRT_RATIO; - sqrtPriceLimitX96 = - minimumPrice + - uint160( - (uint256(_amountSpecified > 0 ? _amountSpecified : -_amountSpecified) % (currentPrice - minimumPrice)) - ); - } - - function get_random_oneForZero_priceLimit(int256 _amountSpecified) - internal - view - returns (uint160 sqrtPriceLimitX96) - { - // help echidna a bit by calculating a valid sqrtPriceLimitX96 using the amount as random seed - (uint160 currentPrice, , , , , , ) = pool.slot0(); - uint160 maximumPrice = TickMath.MAX_SQRT_RATIO; - sqrtPriceLimitX96 = - currentPrice + - uint160( - (uint256(_amountSpecified > 0 ? _amountSpecified : -_amountSpecified) % (maximumPrice - currentPrice)) - ); - } - - // - // - // Invariants - // - // - - function check_liquidityNet_invariant() internal { - int128 liquidityNet = 0; - for (uint256 i = 0; i < usedTicks.length; i++) { - (, int128 tickLiquidityNet, , ) = pool.ticks(usedTicks[i]); - int128 result = liquidityNet + tickLiquidityNet; - assert( - (tickLiquidityNet >= 0 && result >= liquidityNet) || (tickLiquidityNet < 0 && result < liquidityNet) - ); - liquidityNet = result; - } - - // prop #20 - assert(liquidityNet == 0); - } - - function check_liquidity_invariant() internal { - (, int24 currentTick, , , , , ) = pool.slot0(); - int128 liquidity = 0; - for (uint256 i = 0; i < usedTicks.length; i++) { - int24 tick = usedTicks[i]; - if (tick <= currentTick) { - (, int128 tickLiquidityNet, , ) = pool.ticks(tick); - int128 result = liquidity + tickLiquidityNet; - assert((tickLiquidityNet >= 0 && result >= liquidity) || (tickLiquidityNet < 0 && result < liquidity)); - liquidity = result; - } - } - - // prop #21 - assert(uint128(liquidity) == pool.liquidity()); - assert(liquidity >= 0); - } - - function check_tick_feegrowth_invariant() internal { - (, int24 currentTick, , , , , ) = pool.slot0(); - - if (currentTick == poolParams.maxTick || currentTick == poolParams.minTick) return; - - int24 tickBelow = currentTick - poolParams.tickSpacing; - int24 tickAbove = currentTick + poolParams.tickSpacing; - - (, , uint256 tB_feeGrowthOutside0X128, uint256 tB_feeGrowthOutside1X128) = pool.ticks(tickBelow); - (, , uint256 tA_feeGrowthOutside0X128, uint256 tA_feeGrowthOutside1X128) = pool.ticks(tickAbove); - - // prop #22 - assert(tB_feeGrowthOutside0X128 + tA_feeGrowthOutside0X128 <= pool.feeGrowthGlobal0X128()); - - // prop #23 - assert(tB_feeGrowthOutside1X128 + tA_feeGrowthOutside1X128 <= pool.feeGrowthGlobal1X128()); - } - - function check_swap_invariants( - int24 tick_bfre, - int24 tick_aftr, - uint128 liq_bfre, - uint128 liq_aftr, - uint256 bal_sell_bfre, - uint256 bal_sell_aftr, - uint256 bal_buy_bfre, - uint256 bal_buy_aftr, - uint256 feegrowth_sell_bfre, - uint256 feegrowth_sell_aftr, - uint256 feegrowth_buy_bfre, - uint256 feegrowth_buy_aftr - ) internal { - // prop #17 - if (tick_bfre == tick_aftr) { - assert(liq_bfre == liq_aftr); - } - - // prop #13 + #15 - assert(feegrowth_sell_bfre <= feegrowth_sell_aftr); - - // prop #14 + #16 - assert(feegrowth_buy_bfre == feegrowth_buy_aftr); - - // prop #18 + #19 - if (bal_sell_bfre == bal_sell_aftr) { - assert(bal_buy_bfre == bal_buy_aftr); - } - } - - // - // - // Helper to reconstruct the "random" init setup of the pool - // - // - - function viewRandomInit(uint128 _seed) - public - view - returns (PoolParams memory poolParams, PoolPositions memory poolPositions) - { - poolParams = forgePoolParams(_seed); - poolPositions = forgePoolPositions(_seed, poolParams.tickSpacing, poolParams.tickCount, poolParams.maxTick); - } - - // - // - // Setup functions - // - // - - function forgePoolParams(uint128 _seed) internal view returns (PoolParams memory poolParams) { - // - // decide on one of the three fees, and corresponding tickSpacing - // - if (_seed % 3 == 0) { - poolParams.fee = uint24(500); - poolParams.tickSpacing = int24(10); - } else if (_seed % 3 == 1) { - poolParams.fee = uint24(3000); - poolParams.tickSpacing = int24(60); - } else if (_seed % 3 == 2) { - poolParams.fee = uint24(10000); - poolParams.tickSpacing = int24(2000); - } - - poolParams.maxTick = (int24(887272) / poolParams.tickSpacing) * poolParams.tickSpacing; - poolParams.minTick = -poolParams.maxTick; - poolParams.tickCount = uint24(poolParams.maxTick / poolParams.tickSpacing); - - // - // set the initial price - // - poolParams.startTick = int24((_seed % uint128(poolParams.tickCount)) * uint128(poolParams.tickSpacing)); - if (_seed % 3 == 0) { - // set below 0 - poolParams.startPrice = TickMath.getSqrtRatioAtTick(-poolParams.startTick); - } else if (_seed % 3 == 1) { - // set at 0 - poolParams.startPrice = TickMath.getSqrtRatioAtTick(0); - poolParams.startTick = 0; - } else if (_seed % 3 == 2) { - // set above 0 - poolParams.startPrice = TickMath.getSqrtRatioAtTick(poolParams.startTick); - } - } - - function forgePoolPositions( - uint128 _seed, - int24 _poolTickSpacing, - uint24 _poolTickCount, - int24 _poolMaxTick - ) internal view returns (PoolPositions memory poolPositions_) { - // between 1 and 10 (inclusive) positions - uint8 positionsCount = uint8(_seed % 10) + 1; - - poolPositions_.tickLowers = new int24[](positionsCount); - poolPositions_.tickUppers = new int24[](positionsCount); - poolPositions_.amounts = new uint128[](positionsCount); - - for (uint8 i = 0; i < positionsCount; i++) { - int24 tickLower; - int24 tickUpper; - uint128 amount; - - int24 randomTick1 = int24((_seed % uint128(_poolTickCount)) * uint128(_poolTickSpacing)); - - if (_seed % 2 == 0) { - // make tickLower positive - tickLower = randomTick1; - - // tickUpper is somewhere above tickLower - uint24 poolTickCountLeft = uint24((_poolMaxTick - randomTick1) / _poolTickSpacing); - int24 randomTick2 = int24((_seed % uint128(poolTickCountLeft)) * uint128(_poolTickSpacing)); - tickUpper = tickLower + randomTick2; - } else { - // make tickLower negative or zero - tickLower = randomTick1 == 0 ? 0 : -randomTick1; - - uint24 poolTickCountNegativeLeft = uint24((_poolMaxTick - randomTick1) / _poolTickSpacing); - uint24 poolTickCountTotalLeft = poolTickCountNegativeLeft + _poolTickCount; - - uint24 randomIncrement = uint24((_seed % uint128(poolTickCountTotalLeft)) * uint128(_poolTickSpacing)); - - if (randomIncrement <= uint24(tickLower)) { - // tickUpper will also be negative - tickUpper = tickLower + int24(randomIncrement); - } else { - // tickUpper is positive - randomIncrement -= uint24(-tickLower); - tickUpper = tickLower + int24(randomIncrement); - } - } - - amount = uint128(1e8 ether); - - poolPositions_.tickLowers[i] = tickLower; - poolPositions_.tickUppers[i] = tickUpper; - poolPositions_.amounts[i] = amount; - - _seed += uint128(tickLower); - } - } - - function _init(uint128 _seed) internal { - // - // generate random pool params - // - poolParams = forgePoolParams(_seed); - - // - // deploy the pool - // - uniswap.createPool(poolParams.fee, poolParams.startPrice); - pool = uniswap.pool(); - - // - // set the pool inside the minter and swapper contracts - // - minter.setPool(pool); - swapper.setPool(pool); - - // - // generate random positions - // - poolPositions = forgePoolPositions(_seed, poolParams.tickSpacing, poolParams.tickCount, poolParams.maxTick); - - // - // create the positions - // - for (uint8 i = 0; i < poolPositions.tickLowers.length; i++) { - int24 tickLower = poolPositions.tickLowers[i]; - int24 tickUpper = poolPositions.tickUppers[i]; - uint128 amount = poolPositions.amounts[i]; - - minter.doMint(tickLower, tickUpper, amount); - - bool lowerAlreadyUsed = false; - bool upperAlreadyUsed = false; - for (uint8 j = 0; j < usedTicks.length; j++) { - if (usedTicks[j] == tickLower) lowerAlreadyUsed = true; - else if (usedTicks[j] == tickUpper) upperAlreadyUsed = true; - } - if (!lowerAlreadyUsed) usedTicks.push(tickLower); - if (!upperAlreadyUsed) usedTicks.push(tickUpper); - } - - inited = true; - } - - // - // - // Functions to fuzz - // - // - - function test_swap_exactIn_zeroForOne(uint128 _amount) public { - require(_amount != 0); - - if (!inited) _init(_amount); - - require(token0.balanceOf(address(swapper)) >= uint256(_amount)); - int256 _amountSpecified = int256(_amount); - - uint160 sqrtPriceLimitX96 = get_random_zeroForOne_priceLimit(_amount); - // console.log('sqrtPriceLimitX96 = %s', sqrtPriceLimitX96); - - (UniswapSwapper.SwapperStats memory bfre, UniswapSwapper.SwapperStats memory aftr) = - swapper.doSwap(true, _amountSpecified, sqrtPriceLimitX96); - - check_swap_invariants( - bfre.tick, - aftr.tick, - bfre.liq, - aftr.liq, - bfre.bal0, - aftr.bal0, - bfre.bal1, - aftr.bal1, - bfre.feeGrowthGlobal0X128, - aftr.feeGrowthGlobal0X128, - bfre.feeGrowthGlobal1X128, - aftr.feeGrowthGlobal1X128 - ); - - check_liquidityNet_invariant(); - check_liquidity_invariant(); - check_tick_feegrowth_invariant(); - } - - function test_swap_exactIn_oneForZero(uint128 _amount) public { - require(_amount != 0); - - if (!inited) _init(_amount); - - require(token1.balanceOf(address(swapper)) >= uint256(_amount)); - int256 _amountSpecified = int256(_amount); - - uint160 sqrtPriceLimitX96 = get_random_oneForZero_priceLimit(_amount); - // console.log('sqrtPriceLimitX96 = %s', sqrtPriceLimitX96); - - (UniswapSwapper.SwapperStats memory bfre, UniswapSwapper.SwapperStats memory aftr) = - swapper.doSwap(false, _amountSpecified, sqrtPriceLimitX96); - - check_swap_invariants( - bfre.tick, - aftr.tick, - bfre.liq, - aftr.liq, - bfre.bal1, - aftr.bal1, - bfre.bal0, - aftr.bal0, - bfre.feeGrowthGlobal1X128, - aftr.feeGrowthGlobal1X128, - bfre.feeGrowthGlobal0X128, - aftr.feeGrowthGlobal0X128 - ); - - check_liquidityNet_invariant(); - check_liquidity_invariant(); - check_tick_feegrowth_invariant(); - } - - function test_swap_exactOut_zeroForOne(uint128 _amount) public { - require(_amount != 0); - - if (!inited) _init(_amount); - - require(token0.balanceOf(address(swapper)) > 0); - int256 _amountSpecified = -int256(_amount); - - uint160 sqrtPriceLimitX96 = get_random_zeroForOne_priceLimit(_amount); - // console.log('sqrtPriceLimitX96 = %s', sqrtPriceLimitX96); - - (UniswapSwapper.SwapperStats memory bfre, UniswapSwapper.SwapperStats memory aftr) = - swapper.doSwap(true, _amountSpecified, sqrtPriceLimitX96); - - check_swap_invariants( - bfre.tick, - aftr.tick, - bfre.liq, - aftr.liq, - bfre.bal0, - aftr.bal0, - bfre.bal1, - aftr.bal1, - bfre.feeGrowthGlobal0X128, - aftr.feeGrowthGlobal0X128, - bfre.feeGrowthGlobal1X128, - aftr.feeGrowthGlobal1X128 - ); - - check_liquidityNet_invariant(); - check_liquidity_invariant(); - check_tick_feegrowth_invariant(); - } - - function test_swap_exactOut_oneForZero(uint128 _amount) public { - require(_amount != 0); - - if (!inited) _init(_amount); - - require(token0.balanceOf(address(swapper)) > 0); - int256 _amountSpecified = -int256(_amount); - - uint160 sqrtPriceLimitX96 = get_random_oneForZero_priceLimit(_amount); - // console.log('sqrtPriceLimitX96 = %s', sqrtPriceLimitX96); - - (UniswapSwapper.SwapperStats memory bfre, UniswapSwapper.SwapperStats memory aftr) = - swapper.doSwap(false, _amountSpecified, sqrtPriceLimitX96); - - check_swap_invariants( - bfre.tick, - aftr.tick, - bfre.liq, - aftr.liq, - bfre.bal1, - aftr.bal1, - bfre.bal0, - aftr.bal0, - bfre.feeGrowthGlobal1X128, - aftr.feeGrowthGlobal1X128, - bfre.feeGrowthGlobal0X128, - aftr.feeGrowthGlobal0X128 - ); - - check_liquidityNet_invariant(); - check_liquidity_invariant(); - check_tick_feegrowth_invariant(); - } -} diff --git a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/Other.config.yaml b/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/Other.config.yaml deleted file mode 100644 index 0bad147..0000000 --- a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/Other.config.yaml +++ /dev/null @@ -1,7 +0,0 @@ -checkAsserts: true -coverage: true -codeSize: 0x60000 -corpusDir: echidna_other_corpus -seqLen: 1000 -testLimit: 100000 -timeout: 3600 # 1 hour diff --git a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/Other.sol b/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/Other.sol deleted file mode 100644 index 5832e8b..0000000 --- a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/Other.sol +++ /dev/null @@ -1,21 +0,0 @@ -pragma solidity =0.7.6; - -import '../../../../../contracts/libraries/SqrtPriceMath.sol'; -import '../../../../../contracts/libraries/TickMath.sol'; - -contract Other { - // prop #30 - function test_getNextSqrtPriceFromInAndOutput( - uint160 sqrtPX96, - uint128 liquidity, - uint256 amount, - bool add - ) public { - require(sqrtPX96 >= TickMath.MIN_SQRT_RATIO && sqrtPX96 < TickMath.MAX_SQRT_RATIO); - require(liquidity < 3121856577256316178563069792952001939); // max liquidity per tick - uint256 next_sqrt = SqrtPriceMath.getNextSqrtPriceFromInput(sqrtPX96, liquidity, amount, add); - assert(next_sqrt >= TickMath.MIN_SQRT_RATIO && next_sqrt < TickMath.MAX_SQRT_RATIO); - next_sqrt = SqrtPriceMath.getNextSqrtPriceFromOutput(sqrtPX96, liquidity, amount, add); - assert(next_sqrt >= TickMath.MIN_SQRT_RATIO && next_sqrt < TickMath.MAX_SQRT_RATIO); - } -} diff --git a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/Setup.sol b/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/Setup.sol deleted file mode 100644 index 922838c..0000000 --- a/contract/lib/v3-core/audits/tob/contracts/crytic/echidna/Setup.sol +++ /dev/null @@ -1,205 +0,0 @@ -pragma solidity =0.7.6; -pragma abicoder v2; - -import '../../../../../contracts/test/TestERC20.sol'; -import '../../../../../contracts/UniswapV3Pool.sol'; -import '../../../../../contracts/UniswapV3Factory.sol'; - -contract SetupToken { - TestERC20 public token; - - constructor() public { - // this contract will receive the total supply of 100 tokens - token = new TestERC20(1e12 ether); - } - - function mintTo(address _recipient, uint256 _amount) public { - token.transfer(_recipient, _amount); - } -} - -contract SetupTokens { - SetupToken tokenSetup0; - SetupToken tokenSetup1; - - TestERC20 public token0; - TestERC20 public token1; - - constructor() public { - // create the token wrappers - tokenSetup0 = new SetupToken(); - tokenSetup1 = new SetupToken(); - - // switch them around so that token0's address is lower than token1's - // since this is what the uniswap factory will do when you create the pool - if (address(tokenSetup0.token()) > address(tokenSetup1.token())) { - (tokenSetup0, tokenSetup1) = (tokenSetup1, tokenSetup0); - } - - // save the erc20 tokens - token0 = tokenSetup0.token(); - token1 = tokenSetup1.token(); - } - - // mint either token0 or token1 to a chosen account - function mintTo( - uint256 _tokenIdx, - address _recipient, - uint256 _amount - ) public { - require(_tokenIdx == 0 || _tokenIdx == 1, 'invalid token idx'); - if (_tokenIdx == 0) tokenSetup0.mintTo(_recipient, _amount); - if (_tokenIdx == 1) tokenSetup1.mintTo(_recipient, _amount); - } -} - -contract SetupUniswap { - UniswapV3Pool public pool; - TestERC20 token0; - TestERC20 token1; - - // will create the following enabled fees and corresponding tickSpacing - // fee 500 + tickSpacing 10 - // fee 3000 + tickSpacing 60 - // fee 10000 + tickSpacing 200 - UniswapV3Factory factory; - - constructor(TestERC20 _token0, TestERC20 _token1) public { - factory = new UniswapV3Factory(); - token0 = _token0; - token1 = _token1; - } - - function createPool(uint24 _fee, uint160 _startPrice) public { - pool = UniswapV3Pool(factory.createPool(address(token0), address(token1), _fee)); - pool.initialize(_startPrice); - } -} - -contract UniswapMinter { - UniswapV3Pool pool; - TestERC20 token0; - TestERC20 token1; - - struct MinterStats { - uint128 liq; - uint128 tL_liqGross; - int128 tL_liqNet; - uint128 tU_liqGross; - int128 tU_liqNet; - } - - constructor(TestERC20 _token0, TestERC20 _token1) public { - token0 = _token0; - token1 = _token1; - } - - function setPool(UniswapV3Pool _pool) public { - pool = _pool; - } - - function uniswapV3MintCallback( - uint256 amount0Owed, - uint256 amount1Owed, - bytes calldata data - ) external { - if (amount0Owed > 0) token0.transfer(address(pool), amount0Owed); - if (amount1Owed > 0) token1.transfer(address(pool), amount1Owed); - } - - function getTickLiquidityVars(int24 _tickLower, int24 _tickUpper) - internal - view - returns ( - uint128, - int128, - uint128, - int128 - ) - { - (uint128 tL_liqGross, int128 tL_liqNet, , ) = pool.ticks(_tickLower); - (uint128 tU_liqGross, int128 tU_liqNet, , ) = pool.ticks(_tickUpper); - return (tL_liqGross, tL_liqNet, tU_liqGross, tU_liqNet); - } - - function getStats(int24 _tickLower, int24 _tickUpper) internal view returns (MinterStats memory stats) { - (uint128 tL_lg, int128 tL_ln, uint128 tU_lg, int128 tU_ln) = getTickLiquidityVars(_tickLower, _tickUpper); - return MinterStats(pool.liquidity(), tL_lg, tL_ln, tU_lg, tU_ln); - } - - function doMint( - int24 _tickLower, - int24 _tickUpper, - uint128 _amount - ) public returns (MinterStats memory bfre, MinterStats memory aftr) { - bfre = getStats(_tickLower, _tickUpper); - pool.mint(address(this), _tickLower, _tickUpper, _amount, new bytes(0)); - aftr = getStats(_tickLower, _tickUpper); - } - - function doBurn( - int24 _tickLower, - int24 _tickUpper, - uint128 _amount - ) public returns (MinterStats memory bfre, MinterStats memory aftr) { - bfre = getStats(_tickLower, _tickUpper); - pool.burn(_tickLower, _tickUpper, _amount); - aftr = getStats(_tickLower, _tickUpper); - } -} - -contract UniswapSwapper { - UniswapV3Pool pool; - TestERC20 token0; - TestERC20 token1; - - struct SwapperStats { - uint128 liq; - uint256 feeGrowthGlobal0X128; - uint256 feeGrowthGlobal1X128; - uint256 bal0; - uint256 bal1; - int24 tick; - } - - constructor(TestERC20 _token0, TestERC20 _token1) public { - token0 = _token0; - token1 = _token1; - } - - function setPool(UniswapV3Pool _pool) public { - pool = _pool; - } - - function uniswapV3SwapCallback( - int256 amount0Delta, - int256 amount1Delta, - bytes calldata data - ) external { - if (amount0Delta > 0) token0.transfer(address(pool), uint256(amount0Delta)); - if (amount1Delta > 0) token1.transfer(address(pool), uint256(amount1Delta)); - } - - function getStats() internal view returns (SwapperStats memory stats) { - (, int24 currentTick, , , , , ) = pool.slot0(); - return - SwapperStats( - pool.liquidity(), - pool.feeGrowthGlobal0X128(), - pool.feeGrowthGlobal1X128(), - token0.balanceOf(address(this)), - token1.balanceOf(address(this)), - currentTick - ); - } - - function doSwap( - bool _zeroForOne, - int256 _amountSpecified, - uint160 _sqrtPriceLimitX96 - ) public returns (SwapperStats memory bfre, SwapperStats memory aftr) { - bfre = getStats(); - pool.swap(address(this), _zeroForOne, _amountSpecified, _sqrtPriceLimitX96, new bytes(0)); - aftr = getStats(); - } -} diff --git a/contract/lib/v3-core/audits/tob/contracts/crytic/manticore/001.sol b/contract/lib/v3-core/audits/tob/contracts/crytic/manticore/001.sol deleted file mode 100644 index dada7c4..0000000 --- a/contract/lib/v3-core/audits/tob/contracts/crytic/manticore/001.sol +++ /dev/null @@ -1,11 +0,0 @@ -import '../../../../../contracts/libraries/BitMath.sol'; - -contract VerifyBitMathMsb { - function verify(uint256 x) external { - uint256 msb = BitMath.mostSignificantBit(x); - - bool property = x >= 2**msb && (msb == 255 || x < 2**(msb + 1)); - - require(!property); - } -} diff --git a/contract/lib/v3-core/audits/tob/contracts/crytic/manticore/002.sol b/contract/lib/v3-core/audits/tob/contracts/crytic/manticore/002.sol deleted file mode 100644 index 055bc92..0000000 --- a/contract/lib/v3-core/audits/tob/contracts/crytic/manticore/002.sol +++ /dev/null @@ -1,12 +0,0 @@ -import '../../../../../contracts/libraries/BitMath.sol'; - -contract VerifyBitMathLsb { - function verify(uint256 x) external { - uint256 lsb = BitMath.leastSignificantBit(x); - - // (x & 2**leastSignificantBit(x)) != 0 and (x & (2**(leastSignificantBit(x)) - 1)) == 0) - bool property = ((x & (2**lsb)) != 0) && ((x & (2**(lsb - 1))) == 0); - - require(!property); - } -} diff --git a/contract/lib/v3-core/audits/tob/contracts/crytic/manticore/003.sol b/contract/lib/v3-core/audits/tob/contracts/crytic/manticore/003.sol deleted file mode 100644 index 99cee9f..0000000 --- a/contract/lib/v3-core/audits/tob/contracts/crytic/manticore/003.sol +++ /dev/null @@ -1,9 +0,0 @@ -import '../../../../../contracts/libraries/LiquidityMath.sol'; - -contract VerifyLiquidityMathAddDelta { - function verify(uint128 x, int128 y) external { - uint256 z = LiquidityMath.addDelta(x, y); - - require(z != x + uint128(y)); - } -} diff --git a/contract/lib/v3-core/bug-bounty.md b/contract/lib/v3-core/bug-bounty.md deleted file mode 100644 index f01c4c6..0000000 --- a/contract/lib/v3-core/bug-bounty.md +++ /dev/null @@ -1,76 +0,0 @@ -# Uniswap V3 Bug Bounty - -## Overview - -Starting on March 23rd, 2021, the [uniswap-v3-core](https://github.com/Uniswap/uniswap-v3-core) repository is subject to the Uniswap V3 Bug Bounty (the “Program”) to incentivize responsible bug disclosure. - -We are limiting the scope of the Program to critical and high severity bugs, and are offering a reward of up to $500,000. Happy hunting! - -## Scope - -The scope of the Program is limited to bugs that result in the draining of contract funds. - -The following are not within the scope of the Program: - -- Any contract located under [contracts/test](./contracts/test). -- Bugs in any third party contract or platform that interacts with Uniswap V3. -- Vulnerabilities already reported and/or discovered in contracts built by third parties on Uniswap V3. -- Any already-reported bugs. - -Vulnerabilities contingent upon the occurrence of any of the following also are outside the scope of this Program: - -- Frontend bugs -- DDOS attacks -- Spamming -- Phishing -- Automated tools (Github Actions, AWS, etc.) -- Compromise or misuse of third party systems or services - -## Assumptions - -Uniswap V3 was developed with the following assumptions, and thus any bug must also adhere to the following assumptions -to be eligible for the bug bounty: - -- The total supply of any token does not exceed 2128 - 1, i.e. `type(uint128).max`. -- The `transfer` and `transferFrom` methods of any token strictly decrease the balance of the token sender by the transfer amount and increases the balance of token recipient by the transfer amount, i.e. fee on transfer tokens are excluded. -- The token balance of an address can only change due to a call to `transfer` by the sender or `transferFrom` by an approved address, i.e. rebase tokens and interest bearing tokens are excluded. - -## Rewards - -Rewards will be allocated based on the severity of the bug disclosed and will be evaluated and rewarded at the discretion of the Uniswap Labs team. For critical bugs that lead to any loss of LP funds, rewards of up to $500,000 will be granted. Lower severity bugs will be rewarded at the discretion of the team. In addition, all vulnerabilities disclosed prior to the mainnet launch date will be subject to receive higher rewards. - -## Disclosure - -Any vulnerability or bug discovered must be reported only to the following email: [security@uniswap.org](mailto:security@uniswap.org). - -The vulnerability must not be disclosed publicly or to any other person, entity or email address before Uniswap Labs has been notified, has fixed the issue, and has granted permission for public disclosure. In addition, disclosure must be made within 24 hours following discovery of the vulnerability. - -A detailed report of a vulnerability increases the likelihood of a reward and may increase the reward amount. Please provide as much information about the vulnerability as possible, including: - -- The conditions on which reproducing the bug is contingent. -- The steps needed to reproduce the bug or, preferably, a proof of concept. -- The potential implications of the vulnerability being abused. - -Anyone who reports a unique, previously-unreported vulnerability that results in a change to the code or a configuration change and who keeps such vulnerability confidential until it has been resolved by our engineers will be recognized publicly for their contribution if they so choose. - -## Eligibility - -To be eligible for a reward under this Program, you must: - -- Discover a previously unreported, non-public vulnerability that would result in a loss of and/or lock on any ERC-20 token on Uniswap V3 (but not on any third party platform interacting with Uniswap V3) and that is within the scope of this Program. Vulnerabilities must be distinct from the issues covered in the Trail of Bits or ABDK audits. -- Be the first to disclose the unique vulnerability to [security@uniswap.org](mailto:security@uniswap.org), in compliance with the disclosure requirements above. If similar vulnerabilities are reported within the same 24 hour period, rewards will be split at the discretion of Uniswap Labs. -- Provide sufficient information to enable our engineers to reproduce and fix the vulnerability. -- Not engage in any unlawful conduct when disclosing the bug, including through threats, demands, or any other coercive tactics. -- Not exploit the vulnerability in any way, including through making it public or by obtaining a profit (other than a reward under this Program). -- Make a good faith effort to avoid privacy violations, destruction of data, interruption or degradation of Uniswap V3. -- Submit only one vulnerability per submission, unless you need to chain vulnerabilities to provide impact regarding any of the vulnerabilities. -- Not submit a vulnerability caused by an underlying issue that is the same as an issue on which a reward has been paid under this Program. -- Not be one of our current or former employees, vendors, or contractors or an employee of any of those vendors or contractors. -- Not be subject to US sanctions or reside in a US-embargoed country. -- Be at least 18 years of age or, if younger, submit your vulnerability with the consent of your parent or guardian. - -## Other Terms - -By submitting your report, you grant Uniswap Labs any and all rights, including intellectual property rights, needed to validate, mitigate, and disclose the vulnerability. All reward decisions, including eligibility for and amounts of the rewards and the manner in which such rewards will be paid, are made at our sole discretion. - -The terms and conditions of this Program may be altered at any time. diff --git a/contract/lib/v3-core/contracts/NoDelegateCall.sol b/contract/lib/v3-core/contracts/NoDelegateCall.sol deleted file mode 100644 index 5411979..0000000 --- a/contract/lib/v3-core/contracts/NoDelegateCall.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.7.6; - -/// @title Prevents delegatecall to a contract -/// @notice Base contract that provides a modifier for preventing delegatecall to methods in a child contract -abstract contract NoDelegateCall { - /// @dev The original address of this contract - address private immutable original; - - constructor() { - // Immutables are computed in the init code of the contract, and then inlined into the deployed bytecode. - // In other words, this variable won't change when it's checked at runtime. - original = address(this); - } - - /// @dev Private method is used instead of inlining into modifier because modifiers are copied into each method, - /// and the use of immutable means the address bytes are copied in every place the modifier is used. - function checkNotDelegateCall() private view { - require(address(this) == original); - } - - /// @notice Prevents delegatecall into the modified method - modifier noDelegateCall() { - checkNotDelegateCall(); - _; - } -} diff --git a/contract/lib/v3-core/contracts/UniswapV3Factory.sol b/contract/lib/v3-core/contracts/UniswapV3Factory.sol deleted file mode 100644 index 3553ce5..0000000 --- a/contract/lib/v3-core/contracts/UniswapV3Factory.sol +++ /dev/null @@ -1,73 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.7.6; - -import './interfaces/IUniswapV3Factory.sol'; - -import './UniswapV3PoolDeployer.sol'; -import './NoDelegateCall.sol'; - -import './UniswapV3Pool.sol'; - -/// @title Canonical Uniswap V3 factory -/// @notice Deploys Uniswap V3 pools and manages ownership and control over pool protocol fees -contract UniswapV3Factory is IUniswapV3Factory, UniswapV3PoolDeployer, NoDelegateCall { - /// @inheritdoc IUniswapV3Factory - address public override owner; - - /// @inheritdoc IUniswapV3Factory - mapping(uint24 => int24) public override feeAmountTickSpacing; - /// @inheritdoc IUniswapV3Factory - mapping(address => mapping(address => mapping(uint24 => address))) public override getPool; - - constructor() { - owner = msg.sender; - emit OwnerChanged(address(0), msg.sender); - - feeAmountTickSpacing[500] = 10; - emit FeeAmountEnabled(500, 10); - feeAmountTickSpacing[3000] = 60; - emit FeeAmountEnabled(3000, 60); - feeAmountTickSpacing[10000] = 200; - emit FeeAmountEnabled(10000, 200); - } - - /// @inheritdoc IUniswapV3Factory - function createPool( - address tokenA, - address tokenB, - uint24 fee - ) external override noDelegateCall returns (address pool) { - require(tokenA != tokenB); - (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); - require(token0 != address(0)); - int24 tickSpacing = feeAmountTickSpacing[fee]; - require(tickSpacing != 0); - require(getPool[token0][token1][fee] == address(0)); - pool = deploy(address(this), token0, token1, fee, tickSpacing); - getPool[token0][token1][fee] = pool; - // populate mapping in the reverse direction, deliberate choice to avoid the cost of comparing addresses - getPool[token1][token0][fee] = pool; - emit PoolCreated(token0, token1, fee, tickSpacing, pool); - } - - /// @inheritdoc IUniswapV3Factory - function setOwner(address _owner) external override { - require(msg.sender == owner); - emit OwnerChanged(owner, _owner); - owner = _owner; - } - - /// @inheritdoc IUniswapV3Factory - function enableFeeAmount(uint24 fee, int24 tickSpacing) public override { - require(msg.sender == owner); - require(fee < 1000000); - // tick spacing is capped at 16384 to prevent the situation where tickSpacing is so large that - // TickBitmap#nextInitializedTickWithinOneWord overflows int24 container from a valid tick - // 16384 ticks represents a >5x price change with ticks of 1 bips - require(tickSpacing > 0 && tickSpacing < 16384); - require(feeAmountTickSpacing[fee] == 0); - - feeAmountTickSpacing[fee] = tickSpacing; - emit FeeAmountEnabled(fee, tickSpacing); - } -} diff --git a/contract/lib/v3-core/contracts/UniswapV3Pool.sol b/contract/lib/v3-core/contracts/UniswapV3Pool.sol deleted file mode 100644 index 9e09821..0000000 --- a/contract/lib/v3-core/contracts/UniswapV3Pool.sol +++ /dev/null @@ -1,869 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.7.6; - -import './interfaces/IUniswapV3Pool.sol'; - -import './NoDelegateCall.sol'; - -import './libraries/LowGasSafeMath.sol'; -import './libraries/SafeCast.sol'; -import './libraries/Tick.sol'; -import './libraries/TickBitmap.sol'; -import './libraries/Position.sol'; -import './libraries/Oracle.sol'; - -import './libraries/FullMath.sol'; -import './libraries/FixedPoint128.sol'; -import './libraries/TransferHelper.sol'; -import './libraries/TickMath.sol'; -import './libraries/LiquidityMath.sol'; -import './libraries/SqrtPriceMath.sol'; -import './libraries/SwapMath.sol'; - -import './interfaces/IUniswapV3PoolDeployer.sol'; -import './interfaces/IUniswapV3Factory.sol'; -import './interfaces/IERC20Minimal.sol'; -import './interfaces/callback/IUniswapV3MintCallback.sol'; -import './interfaces/callback/IUniswapV3SwapCallback.sol'; -import './interfaces/callback/IUniswapV3FlashCallback.sol'; - -contract UniswapV3Pool is IUniswapV3Pool, NoDelegateCall { - using LowGasSafeMath for uint256; - using LowGasSafeMath for int256; - using SafeCast for uint256; - using SafeCast for int256; - using Tick for mapping(int24 => Tick.Info); - using TickBitmap for mapping(int16 => uint256); - using Position for mapping(bytes32 => Position.Info); - using Position for Position.Info; - using Oracle for Oracle.Observation[65535]; - - /// @inheritdoc IUniswapV3PoolImmutables - address public immutable override factory; - /// @inheritdoc IUniswapV3PoolImmutables - address public immutable override token0; - /// @inheritdoc IUniswapV3PoolImmutables - address public immutable override token1; - /// @inheritdoc IUniswapV3PoolImmutables - uint24 public immutable override fee; - - /// @inheritdoc IUniswapV3PoolImmutables - int24 public immutable override tickSpacing; - - /// @inheritdoc IUniswapV3PoolImmutables - uint128 public immutable override maxLiquidityPerTick; - - struct Slot0 { - // the current price - uint160 sqrtPriceX96; - // the current tick - int24 tick; - // the most-recently updated index of the observations array - uint16 observationIndex; - // the current maximum number of observations that are being stored - uint16 observationCardinality; - // the next maximum number of observations to store, triggered in observations.write - uint16 observationCardinalityNext; - // the current protocol fee as a percentage of the swap fee taken on withdrawal - // represented as an integer denominator (1/x)% - uint8 feeProtocol; - // whether the pool is locked - bool unlocked; - } - /// @inheritdoc IUniswapV3PoolState - Slot0 public override slot0; - - /// @inheritdoc IUniswapV3PoolState - uint256 public override feeGrowthGlobal0X128; - /// @inheritdoc IUniswapV3PoolState - uint256 public override feeGrowthGlobal1X128; - - // accumulated protocol fees in token0/token1 units - struct ProtocolFees { - uint128 token0; - uint128 token1; - } - /// @inheritdoc IUniswapV3PoolState - ProtocolFees public override protocolFees; - - /// @inheritdoc IUniswapV3PoolState - uint128 public override liquidity; - - /// @inheritdoc IUniswapV3PoolState - mapping(int24 => Tick.Info) public override ticks; - /// @inheritdoc IUniswapV3PoolState - mapping(int16 => uint256) public override tickBitmap; - /// @inheritdoc IUniswapV3PoolState - mapping(bytes32 => Position.Info) public override positions; - /// @inheritdoc IUniswapV3PoolState - Oracle.Observation[65535] public override observations; - - /// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance - /// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because - /// we use balance checks to determine the payment status of interactions such as mint, swap and flash. - modifier lock() { - require(slot0.unlocked, 'LOK'); - slot0.unlocked = false; - _; - slot0.unlocked = true; - } - - /// @dev Prevents calling a function from anyone except the address returned by IUniswapV3Factory#owner() - modifier onlyFactoryOwner() { - require(msg.sender == IUniswapV3Factory(factory).owner()); - _; - } - - constructor() { - int24 _tickSpacing; - (factory, token0, token1, fee, _tickSpacing) = IUniswapV3PoolDeployer(msg.sender).parameters(); - tickSpacing = _tickSpacing; - - maxLiquidityPerTick = Tick.tickSpacingToMaxLiquidityPerTick(_tickSpacing); - } - - /// @dev Common checks for valid tick inputs. - function checkTicks(int24 tickLower, int24 tickUpper) private pure { - require(tickLower < tickUpper, 'TLU'); - require(tickLower >= TickMath.MIN_TICK, 'TLM'); - require(tickUpper <= TickMath.MAX_TICK, 'TUM'); - } - - /// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests. - function _blockTimestamp() internal view virtual returns (uint32) { - return uint32(block.timestamp); // truncation is desired - } - - /// @dev Get the pool's balance of token0 - /// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize - /// check - function balance0() private view returns (uint256) { - (bool success, bytes memory data) = - token0.staticcall(abi.encodeWithSelector(IERC20Minimal.balanceOf.selector, address(this))); - require(success && data.length >= 32); - return abi.decode(data, (uint256)); - } - - /// @dev Get the pool's balance of token1 - /// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize - /// check - function balance1() private view returns (uint256) { - (bool success, bytes memory data) = - token1.staticcall(abi.encodeWithSelector(IERC20Minimal.balanceOf.selector, address(this))); - require(success && data.length >= 32); - return abi.decode(data, (uint256)); - } - - /// @inheritdoc IUniswapV3PoolDerivedState - function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) - external - view - override - noDelegateCall - returns ( - int56 tickCumulativeInside, - uint160 secondsPerLiquidityInsideX128, - uint32 secondsInside - ) - { - checkTicks(tickLower, tickUpper); - - int56 tickCumulativeLower; - int56 tickCumulativeUpper; - uint160 secondsPerLiquidityOutsideLowerX128; - uint160 secondsPerLiquidityOutsideUpperX128; - uint32 secondsOutsideLower; - uint32 secondsOutsideUpper; - - { - Tick.Info storage lower = ticks[tickLower]; - Tick.Info storage upper = ticks[tickUpper]; - bool initializedLower; - (tickCumulativeLower, secondsPerLiquidityOutsideLowerX128, secondsOutsideLower, initializedLower) = ( - lower.tickCumulativeOutside, - lower.secondsPerLiquidityOutsideX128, - lower.secondsOutside, - lower.initialized - ); - require(initializedLower); - - bool initializedUpper; - (tickCumulativeUpper, secondsPerLiquidityOutsideUpperX128, secondsOutsideUpper, initializedUpper) = ( - upper.tickCumulativeOutside, - upper.secondsPerLiquidityOutsideX128, - upper.secondsOutside, - upper.initialized - ); - require(initializedUpper); - } - - Slot0 memory _slot0 = slot0; - - if (_slot0.tick < tickLower) { - return ( - tickCumulativeLower - tickCumulativeUpper, - secondsPerLiquidityOutsideLowerX128 - secondsPerLiquidityOutsideUpperX128, - secondsOutsideLower - secondsOutsideUpper - ); - } else if (_slot0.tick < tickUpper) { - uint32 time = _blockTimestamp(); - (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) = - observations.observeSingle( - time, - 0, - _slot0.tick, - _slot0.observationIndex, - liquidity, - _slot0.observationCardinality - ); - return ( - tickCumulative - tickCumulativeLower - tickCumulativeUpper, - secondsPerLiquidityCumulativeX128 - - secondsPerLiquidityOutsideLowerX128 - - secondsPerLiquidityOutsideUpperX128, - time - secondsOutsideLower - secondsOutsideUpper - ); - } else { - return ( - tickCumulativeUpper - tickCumulativeLower, - secondsPerLiquidityOutsideUpperX128 - secondsPerLiquidityOutsideLowerX128, - secondsOutsideUpper - secondsOutsideLower - ); - } - } - - /// @inheritdoc IUniswapV3PoolDerivedState - function observe(uint32[] calldata secondsAgos) - external - view - override - noDelegateCall - returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) - { - return - observations.observe( - _blockTimestamp(), - secondsAgos, - slot0.tick, - slot0.observationIndex, - liquidity, - slot0.observationCardinality - ); - } - - /// @inheritdoc IUniswapV3PoolActions - function increaseObservationCardinalityNext(uint16 observationCardinalityNext) - external - override - lock - noDelegateCall - { - uint16 observationCardinalityNextOld = slot0.observationCardinalityNext; // for the event - uint16 observationCardinalityNextNew = - observations.grow(observationCardinalityNextOld, observationCardinalityNext); - slot0.observationCardinalityNext = observationCardinalityNextNew; - if (observationCardinalityNextOld != observationCardinalityNextNew) - emit IncreaseObservationCardinalityNext(observationCardinalityNextOld, observationCardinalityNextNew); - } - - /// @inheritdoc IUniswapV3PoolActions - /// @dev not locked because it initializes unlocked - function initialize(uint160 sqrtPriceX96) external override { - require(slot0.sqrtPriceX96 == 0, 'AI'); - - int24 tick = TickMath.getTickAtSqrtRatio(sqrtPriceX96); - - (uint16 cardinality, uint16 cardinalityNext) = observations.initialize(_blockTimestamp()); - - slot0 = Slot0({ - sqrtPriceX96: sqrtPriceX96, - tick: tick, - observationIndex: 0, - observationCardinality: cardinality, - observationCardinalityNext: cardinalityNext, - feeProtocol: 0, - unlocked: true - }); - - emit Initialize(sqrtPriceX96, tick); - } - - struct ModifyPositionParams { - // the address that owns the position - address owner; - // the lower and upper tick of the position - int24 tickLower; - int24 tickUpper; - // any change in liquidity - int128 liquidityDelta; - } - - /// @dev Effect some changes to a position - /// @param params the position details and the change to the position's liquidity to effect - /// @return position a storage pointer referencing the position with the given owner and tick range - /// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient - /// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient - function _modifyPosition(ModifyPositionParams memory params) - private - noDelegateCall - returns ( - Position.Info storage position, - int256 amount0, - int256 amount1 - ) - { - checkTicks(params.tickLower, params.tickUpper); - - Slot0 memory _slot0 = slot0; // SLOAD for gas optimization - - position = _updatePosition( - params.owner, - params.tickLower, - params.tickUpper, - params.liquidityDelta, - _slot0.tick - ); - - if (params.liquidityDelta != 0) { - if (_slot0.tick < params.tickLower) { - // current tick is below the passed range; liquidity can only become in range by crossing from left to - // right, when we'll need _more_ token0 (it's becoming more valuable) so user must provide it - amount0 = SqrtPriceMath.getAmount0Delta( - TickMath.getSqrtRatioAtTick(params.tickLower), - TickMath.getSqrtRatioAtTick(params.tickUpper), - params.liquidityDelta - ); - } else if (_slot0.tick < params.tickUpper) { - // current tick is inside the passed range - uint128 liquidityBefore = liquidity; // SLOAD for gas optimization - - // write an oracle entry - (slot0.observationIndex, slot0.observationCardinality) = observations.write( - _slot0.observationIndex, - _blockTimestamp(), - _slot0.tick, - liquidityBefore, - _slot0.observationCardinality, - _slot0.observationCardinalityNext - ); - - amount0 = SqrtPriceMath.getAmount0Delta( - _slot0.sqrtPriceX96, - TickMath.getSqrtRatioAtTick(params.tickUpper), - params.liquidityDelta - ); - amount1 = SqrtPriceMath.getAmount1Delta( - TickMath.getSqrtRatioAtTick(params.tickLower), - _slot0.sqrtPriceX96, - params.liquidityDelta - ); - - liquidity = LiquidityMath.addDelta(liquidityBefore, params.liquidityDelta); - } else { - // current tick is above the passed range; liquidity can only become in range by crossing from right to - // left, when we'll need _more_ token1 (it's becoming more valuable) so user must provide it - amount1 = SqrtPriceMath.getAmount1Delta( - TickMath.getSqrtRatioAtTick(params.tickLower), - TickMath.getSqrtRatioAtTick(params.tickUpper), - params.liquidityDelta - ); - } - } - } - - /// @dev Gets and updates a position with the given liquidity delta - /// @param owner the owner of the position - /// @param tickLower the lower tick of the position's tick range - /// @param tickUpper the upper tick of the position's tick range - /// @param tick the current tick, passed to avoid sloads - function _updatePosition( - address owner, - int24 tickLower, - int24 tickUpper, - int128 liquidityDelta, - int24 tick - ) private returns (Position.Info storage position) { - position = positions.get(owner, tickLower, tickUpper); - - uint256 _feeGrowthGlobal0X128 = feeGrowthGlobal0X128; // SLOAD for gas optimization - uint256 _feeGrowthGlobal1X128 = feeGrowthGlobal1X128; // SLOAD for gas optimization - - // if we need to update the ticks, do it - bool flippedLower; - bool flippedUpper; - if (liquidityDelta != 0) { - uint32 time = _blockTimestamp(); - (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) = - observations.observeSingle( - time, - 0, - slot0.tick, - slot0.observationIndex, - liquidity, - slot0.observationCardinality - ); - - flippedLower = ticks.update( - tickLower, - tick, - liquidityDelta, - _feeGrowthGlobal0X128, - _feeGrowthGlobal1X128, - secondsPerLiquidityCumulativeX128, - tickCumulative, - time, - false, - maxLiquidityPerTick - ); - flippedUpper = ticks.update( - tickUpper, - tick, - liquidityDelta, - _feeGrowthGlobal0X128, - _feeGrowthGlobal1X128, - secondsPerLiquidityCumulativeX128, - tickCumulative, - time, - true, - maxLiquidityPerTick - ); - - if (flippedLower) { - tickBitmap.flipTick(tickLower, tickSpacing); - } - if (flippedUpper) { - tickBitmap.flipTick(tickUpper, tickSpacing); - } - } - - (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) = - ticks.getFeeGrowthInside(tickLower, tickUpper, tick, _feeGrowthGlobal0X128, _feeGrowthGlobal1X128); - - position.update(liquidityDelta, feeGrowthInside0X128, feeGrowthInside1X128); - - // clear any tick data that is no longer needed - if (liquidityDelta < 0) { - if (flippedLower) { - ticks.clear(tickLower); - } - if (flippedUpper) { - ticks.clear(tickUpper); - } - } - } - - /// @inheritdoc IUniswapV3PoolActions - /// @dev noDelegateCall is applied indirectly via _modifyPosition - function mint( - address recipient, - int24 tickLower, - int24 tickUpper, - uint128 amount, - bytes calldata data - ) external override lock returns (uint256 amount0, uint256 amount1) { - require(amount > 0); - (, int256 amount0Int, int256 amount1Int) = - _modifyPosition( - ModifyPositionParams({ - owner: recipient, - tickLower: tickLower, - tickUpper: tickUpper, - liquidityDelta: int256(amount).toInt128() - }) - ); - - amount0 = uint256(amount0Int); - amount1 = uint256(amount1Int); - - uint256 balance0Before; - uint256 balance1Before; - if (amount0 > 0) balance0Before = balance0(); - if (amount1 > 0) balance1Before = balance1(); - IUniswapV3MintCallback(msg.sender).uniswapV3MintCallback(amount0, amount1, data); - if (amount0 > 0) require(balance0Before.add(amount0) <= balance0(), 'M0'); - if (amount1 > 0) require(balance1Before.add(amount1) <= balance1(), 'M1'); - - emit Mint(msg.sender, recipient, tickLower, tickUpper, amount, amount0, amount1); - } - - /// @inheritdoc IUniswapV3PoolActions - function collect( - address recipient, - int24 tickLower, - int24 tickUpper, - uint128 amount0Requested, - uint128 amount1Requested - ) external override lock returns (uint128 amount0, uint128 amount1) { - // we don't need to checkTicks here, because invalid positions will never have non-zero tokensOwed{0,1} - Position.Info storage position = positions.get(msg.sender, tickLower, tickUpper); - - amount0 = amount0Requested > position.tokensOwed0 ? position.tokensOwed0 : amount0Requested; - amount1 = amount1Requested > position.tokensOwed1 ? position.tokensOwed1 : amount1Requested; - - if (amount0 > 0) { - position.tokensOwed0 -= amount0; - TransferHelper.safeTransfer(token0, recipient, amount0); - } - if (amount1 > 0) { - position.tokensOwed1 -= amount1; - TransferHelper.safeTransfer(token1, recipient, amount1); - } - - emit Collect(msg.sender, recipient, tickLower, tickUpper, amount0, amount1); - } - - /// @inheritdoc IUniswapV3PoolActions - /// @dev noDelegateCall is applied indirectly via _modifyPosition - function burn( - int24 tickLower, - int24 tickUpper, - uint128 amount - ) external override lock returns (uint256 amount0, uint256 amount1) { - (Position.Info storage position, int256 amount0Int, int256 amount1Int) = - _modifyPosition( - ModifyPositionParams({ - owner: msg.sender, - tickLower: tickLower, - tickUpper: tickUpper, - liquidityDelta: -int256(amount).toInt128() - }) - ); - - amount0 = uint256(-amount0Int); - amount1 = uint256(-amount1Int); - - if (amount0 > 0 || amount1 > 0) { - (position.tokensOwed0, position.tokensOwed1) = ( - position.tokensOwed0 + uint128(amount0), - position.tokensOwed1 + uint128(amount1) - ); - } - - emit Burn(msg.sender, tickLower, tickUpper, amount, amount0, amount1); - } - - struct SwapCache { - // the protocol fee for the input token - uint8 feeProtocol; - // liquidity at the beginning of the swap - uint128 liquidityStart; - // the timestamp of the current block - uint32 blockTimestamp; - // the current value of the tick accumulator, computed only if we cross an initialized tick - int56 tickCumulative; - // the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick - uint160 secondsPerLiquidityCumulativeX128; - // whether we've computed and cached the above two accumulators - bool computedLatestObservation; - } - - // the top level state of the swap, the results of which are recorded in storage at the end - struct SwapState { - // the amount remaining to be swapped in/out of the input/output asset - int256 amountSpecifiedRemaining; - // the amount already swapped out/in of the output/input asset - int256 amountCalculated; - // current sqrt(price) - uint160 sqrtPriceX96; - // the tick associated with the current price - int24 tick; - // the global fee growth of the input token - uint256 feeGrowthGlobalX128; - // amount of input token paid as protocol fee - uint128 protocolFee; - // the current liquidity in range - uint128 liquidity; - } - - struct StepComputations { - // the price at the beginning of the step - uint160 sqrtPriceStartX96; - // the next tick to swap to from the current tick in the swap direction - int24 tickNext; - // whether tickNext is initialized or not - bool initialized; - // sqrt(price) for the next tick (1/0) - uint160 sqrtPriceNextX96; - // how much is being swapped in in this step - uint256 amountIn; - // how much is being swapped out - uint256 amountOut; - // how much fee is being paid in - uint256 feeAmount; - } - - /// @inheritdoc IUniswapV3PoolActions - function swap( - address recipient, - bool zeroForOne, - int256 amountSpecified, - uint160 sqrtPriceLimitX96, - bytes calldata data - ) external override noDelegateCall returns (int256 amount0, int256 amount1) { - require(amountSpecified != 0, 'AS'); - - Slot0 memory slot0Start = slot0; - - require(slot0Start.unlocked, 'LOK'); - require( - zeroForOne - ? sqrtPriceLimitX96 < slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 > TickMath.MIN_SQRT_RATIO - : sqrtPriceLimitX96 > slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 < TickMath.MAX_SQRT_RATIO, - 'SPL' - ); - - slot0.unlocked = false; - - SwapCache memory cache = - SwapCache({ - liquidityStart: liquidity, - blockTimestamp: _blockTimestamp(), - feeProtocol: zeroForOne ? (slot0Start.feeProtocol % 16) : (slot0Start.feeProtocol >> 4), - secondsPerLiquidityCumulativeX128: 0, - tickCumulative: 0, - computedLatestObservation: false - }); - - bool exactInput = amountSpecified > 0; - - SwapState memory state = - SwapState({ - amountSpecifiedRemaining: amountSpecified, - amountCalculated: 0, - sqrtPriceX96: slot0Start.sqrtPriceX96, - tick: slot0Start.tick, - feeGrowthGlobalX128: zeroForOne ? feeGrowthGlobal0X128 : feeGrowthGlobal1X128, - protocolFee: 0, - liquidity: cache.liquidityStart - }); - - // continue swapping as long as we haven't used the entire input/output and haven't reached the price limit - while (state.amountSpecifiedRemaining != 0 && state.sqrtPriceX96 != sqrtPriceLimitX96) { - StepComputations memory step; - - step.sqrtPriceStartX96 = state.sqrtPriceX96; - - (step.tickNext, step.initialized) = tickBitmap.nextInitializedTickWithinOneWord( - state.tick, - tickSpacing, - zeroForOne - ); - - // ensure that we do not overshoot the min/max tick, as the tick bitmap is not aware of these bounds - if (step.tickNext < TickMath.MIN_TICK) { - step.tickNext = TickMath.MIN_TICK; - } else if (step.tickNext > TickMath.MAX_TICK) { - step.tickNext = TickMath.MAX_TICK; - } - - // get the price for the next tick - step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext); - - // compute values to swap to the target tick, price limit, or point where input/output amount is exhausted - (state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount) = SwapMath.computeSwapStep( - state.sqrtPriceX96, - (zeroForOne ? step.sqrtPriceNextX96 < sqrtPriceLimitX96 : step.sqrtPriceNextX96 > sqrtPriceLimitX96) - ? sqrtPriceLimitX96 - : step.sqrtPriceNextX96, - state.liquidity, - state.amountSpecifiedRemaining, - fee - ); - - if (exactInput) { - state.amountSpecifiedRemaining -= (step.amountIn + step.feeAmount).toInt256(); - state.amountCalculated = state.amountCalculated.sub(step.amountOut.toInt256()); - } else { - state.amountSpecifiedRemaining += step.amountOut.toInt256(); - state.amountCalculated = state.amountCalculated.add((step.amountIn + step.feeAmount).toInt256()); - } - - // if the protocol fee is on, calculate how much is owed, decrement feeAmount, and increment protocolFee - if (cache.feeProtocol > 0) { - uint256 delta = step.feeAmount / cache.feeProtocol; - step.feeAmount -= delta; - state.protocolFee += uint128(delta); - } - - // update global fee tracker - if (state.liquidity > 0) - state.feeGrowthGlobalX128 += FullMath.mulDiv(step.feeAmount, FixedPoint128.Q128, state.liquidity); - - // shift tick if we reached the next price - if (state.sqrtPriceX96 == step.sqrtPriceNextX96) { - // if the tick is initialized, run the tick transition - if (step.initialized) { - // check for the placeholder value, which we replace with the actual value the first time the swap - // crosses an initialized tick - if (!cache.computedLatestObservation) { - (cache.tickCumulative, cache.secondsPerLiquidityCumulativeX128) = observations.observeSingle( - cache.blockTimestamp, - 0, - slot0Start.tick, - slot0Start.observationIndex, - cache.liquidityStart, - slot0Start.observationCardinality - ); - cache.computedLatestObservation = true; - } - int128 liquidityNet = - ticks.cross( - step.tickNext, - (zeroForOne ? state.feeGrowthGlobalX128 : feeGrowthGlobal0X128), - (zeroForOne ? feeGrowthGlobal1X128 : state.feeGrowthGlobalX128), - cache.secondsPerLiquidityCumulativeX128, - cache.tickCumulative, - cache.blockTimestamp - ); - // if we're moving leftward, we interpret liquidityNet as the opposite sign - // safe because liquidityNet cannot be type(int128).min - if (zeroForOne) liquidityNet = -liquidityNet; - - state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet); - } - - state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext; - } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) { - // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved - state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96); - } - } - - // update tick and write an oracle entry if the tick change - if (state.tick != slot0Start.tick) { - (uint16 observationIndex, uint16 observationCardinality) = - observations.write( - slot0Start.observationIndex, - cache.blockTimestamp, - slot0Start.tick, - cache.liquidityStart, - slot0Start.observationCardinality, - slot0Start.observationCardinalityNext - ); - (slot0.sqrtPriceX96, slot0.tick, slot0.observationIndex, slot0.observationCardinality) = ( - state.sqrtPriceX96, - state.tick, - observationIndex, - observationCardinality - ); - } else { - // otherwise just update the price - slot0.sqrtPriceX96 = state.sqrtPriceX96; - } - - // update liquidity if it changed - if (cache.liquidityStart != state.liquidity) liquidity = state.liquidity; - - // update fee growth global and, if necessary, protocol fees - // overflow is acceptable, protocol has to withdraw before it hits type(uint128).max fees - if (zeroForOne) { - feeGrowthGlobal0X128 = state.feeGrowthGlobalX128; - if (state.protocolFee > 0) protocolFees.token0 += state.protocolFee; - } else { - feeGrowthGlobal1X128 = state.feeGrowthGlobalX128; - if (state.protocolFee > 0) protocolFees.token1 += state.protocolFee; - } - - (amount0, amount1) = zeroForOne == exactInput - ? (amountSpecified - state.amountSpecifiedRemaining, state.amountCalculated) - : (state.amountCalculated, amountSpecified - state.amountSpecifiedRemaining); - - // do the transfers and collect payment - if (zeroForOne) { - if (amount1 < 0) TransferHelper.safeTransfer(token1, recipient, uint256(-amount1)); - - uint256 balance0Before = balance0(); - IUniswapV3SwapCallback(msg.sender).uniswapV3SwapCallback(amount0, amount1, data); - require(balance0Before.add(uint256(amount0)) <= balance0(), 'IIA'); - } else { - if (amount0 < 0) TransferHelper.safeTransfer(token0, recipient, uint256(-amount0)); - - uint256 balance1Before = balance1(); - IUniswapV3SwapCallback(msg.sender).uniswapV3SwapCallback(amount0, amount1, data); - require(balance1Before.add(uint256(amount1)) <= balance1(), 'IIA'); - } - - emit Swap(msg.sender, recipient, amount0, amount1, state.sqrtPriceX96, state.liquidity, state.tick); - slot0.unlocked = true; - } - - /// @inheritdoc IUniswapV3PoolActions - function flash( - address recipient, - uint256 amount0, - uint256 amount1, - bytes calldata data - ) external override lock noDelegateCall { - uint128 _liquidity = liquidity; - require(_liquidity > 0, 'L'); - - uint256 fee0 = FullMath.mulDivRoundingUp(amount0, fee, 1e6); - uint256 fee1 = FullMath.mulDivRoundingUp(amount1, fee, 1e6); - uint256 balance0Before = balance0(); - uint256 balance1Before = balance1(); - - if (amount0 > 0) TransferHelper.safeTransfer(token0, recipient, amount0); - if (amount1 > 0) TransferHelper.safeTransfer(token1, recipient, amount1); - - IUniswapV3FlashCallback(msg.sender).uniswapV3FlashCallback(fee0, fee1, data); - - uint256 balance0After = balance0(); - uint256 balance1After = balance1(); - - require(balance0Before.add(fee0) <= balance0After, 'F0'); - require(balance1Before.add(fee1) <= balance1After, 'F1'); - - // sub is safe because we know balanceAfter is gt balanceBefore by at least fee - uint256 paid0 = balance0After - balance0Before; - uint256 paid1 = balance1After - balance1Before; - - if (paid0 > 0) { - uint8 feeProtocol0 = slot0.feeProtocol % 16; - uint256 fees0 = feeProtocol0 == 0 ? 0 : paid0 / feeProtocol0; - if (uint128(fees0) > 0) protocolFees.token0 += uint128(fees0); - feeGrowthGlobal0X128 += FullMath.mulDiv(paid0 - fees0, FixedPoint128.Q128, _liquidity); - } - if (paid1 > 0) { - uint8 feeProtocol1 = slot0.feeProtocol >> 4; - uint256 fees1 = feeProtocol1 == 0 ? 0 : paid1 / feeProtocol1; - if (uint128(fees1) > 0) protocolFees.token1 += uint128(fees1); - feeGrowthGlobal1X128 += FullMath.mulDiv(paid1 - fees1, FixedPoint128.Q128, _liquidity); - } - - emit Flash(msg.sender, recipient, amount0, amount1, paid0, paid1); - } - - /// @inheritdoc IUniswapV3PoolOwnerActions - function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner { - require( - (feeProtocol0 == 0 || (feeProtocol0 >= 4 && feeProtocol0 <= 10)) && - (feeProtocol1 == 0 || (feeProtocol1 >= 4 && feeProtocol1 <= 10)) - ); - uint8 feeProtocolOld = slot0.feeProtocol; - slot0.feeProtocol = feeProtocol0 + (feeProtocol1 << 4); - emit SetFeeProtocol(feeProtocolOld % 16, feeProtocolOld >> 4, feeProtocol0, feeProtocol1); - } - - /// @inheritdoc IUniswapV3PoolOwnerActions - function collectProtocol( - address recipient, - uint128 amount0Requested, - uint128 amount1Requested - ) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) { - amount0 = amount0Requested > protocolFees.token0 ? protocolFees.token0 : amount0Requested; - amount1 = amount1Requested > protocolFees.token1 ? protocolFees.token1 : amount1Requested; - - if (amount0 > 0) { - if (amount0 == protocolFees.token0) amount0--; // ensure that the slot is not cleared, for gas savings - protocolFees.token0 -= amount0; - TransferHelper.safeTransfer(token0, recipient, amount0); - } - if (amount1 > 0) { - if (amount1 == protocolFees.token1) amount1--; // ensure that the slot is not cleared, for gas savings - protocolFees.token1 -= amount1; - TransferHelper.safeTransfer(token1, recipient, amount1); - } - - emit CollectProtocol(msg.sender, recipient, amount0, amount1); - } -} diff --git a/contract/lib/v3-core/contracts/UniswapV3PoolDeployer.sol b/contract/lib/v3-core/contracts/UniswapV3PoolDeployer.sol deleted file mode 100644 index 02bfd53..0000000 --- a/contract/lib/v3-core/contracts/UniswapV3PoolDeployer.sol +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.7.6; - -import './interfaces/IUniswapV3PoolDeployer.sol'; - -import './UniswapV3Pool.sol'; - -contract UniswapV3PoolDeployer is IUniswapV3PoolDeployer { - struct Parameters { - address factory; - address token0; - address token1; - uint24 fee; - int24 tickSpacing; - } - - /// @inheritdoc IUniswapV3PoolDeployer - Parameters public override parameters; - - /// @dev Deploys a pool with the given parameters by transiently setting the parameters storage slot and then - /// clearing it after deploying the pool. - /// @param factory The contract address of the Uniswap V3 factory - /// @param token0 The first token of the pool by address sort order - /// @param token1 The second token of the pool by address sort order - /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip - /// @param tickSpacing The spacing between usable ticks - function deploy( - address factory, - address token0, - address token1, - uint24 fee, - int24 tickSpacing - ) internal returns (address pool) { - parameters = Parameters({factory: factory, token0: token0, token1: token1, fee: fee, tickSpacing: tickSpacing}); - pool = address(new UniswapV3Pool{salt: keccak256(abi.encode(token0, token1, fee))}()); - delete parameters; - } -} diff --git a/contract/lib/v3-core/contracts/interfaces/IERC20Minimal.sol b/contract/lib/v3-core/contracts/interfaces/IERC20Minimal.sol deleted file mode 100644 index c303265..0000000 --- a/contract/lib/v3-core/contracts/interfaces/IERC20Minimal.sol +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Minimal ERC20 interface for Uniswap -/// @notice Contains a subset of the full ERC20 interface that is used in Uniswap V3 -interface IERC20Minimal { - /// @notice Returns the balance of a token - /// @param account The account for which to look up the number of tokens it has, i.e. its balance - /// @return The number of tokens held by the account - function balanceOf(address account) external view returns (uint256); - - /// @notice Transfers the amount of token from the `msg.sender` to the recipient - /// @param recipient The account that will receive the amount transferred - /// @param amount The number of tokens to send from the sender to the recipient - /// @return Returns true for a successful transfer, false for an unsuccessful transfer - function transfer(address recipient, uint256 amount) external returns (bool); - - /// @notice Returns the current allowance given to a spender by an owner - /// @param owner The account of the token owner - /// @param spender The account of the token spender - /// @return The current allowance granted by `owner` to `spender` - function allowance(address owner, address spender) external view returns (uint256); - - /// @notice Sets the allowance of a spender from the `msg.sender` to the value `amount` - /// @param spender The account which will be allowed to spend a given amount of the owners tokens - /// @param amount The amount of tokens allowed to be used by `spender` - /// @return Returns true for a successful approval, false for unsuccessful - function approve(address spender, uint256 amount) external returns (bool); - - /// @notice Transfers `amount` tokens from `sender` to `recipient` up to the allowance given to the `msg.sender` - /// @param sender The account from which the transfer will be initiated - /// @param recipient The recipient of the transfer - /// @param amount The amount of the transfer - /// @return Returns true for a successful transfer, false for unsuccessful - function transferFrom( - address sender, - address recipient, - uint256 amount - ) external returns (bool); - - /// @notice Event emitted when tokens are transferred from one address to another, either via `#transfer` or `#transferFrom`. - /// @param from The account from which the tokens were sent, i.e. the balance decreased - /// @param to The account to which the tokens were sent, i.e. the balance increased - /// @param value The amount of tokens that were transferred - event Transfer(address indexed from, address indexed to, uint256 value); - - /// @notice Event emitted when the approval amount for the spender of a given owner's tokens changes. - /// @param owner The account that approved spending of its tokens - /// @param spender The account for which the spending allowance was modified - /// @param value The new allowance from the owner to the spender - event Approval(address indexed owner, address indexed spender, uint256 value); -} diff --git a/contract/lib/v3-core/contracts/interfaces/IUniswapV3Factory.sol b/contract/lib/v3-core/contracts/interfaces/IUniswapV3Factory.sol deleted file mode 100644 index 540cfdc..0000000 --- a/contract/lib/v3-core/contracts/interfaces/IUniswapV3Factory.sol +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title The interface for the Uniswap V3 Factory -/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees -interface IUniswapV3Factory { - /// @notice Emitted when the owner of the factory is changed - /// @param oldOwner The owner before the owner was changed - /// @param newOwner The owner after the owner was changed - event OwnerChanged(address indexed oldOwner, address indexed newOwner); - - /// @notice Emitted when a pool is created - /// @param token0 The first token of the pool by address sort order - /// @param token1 The second token of the pool by address sort order - /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip - /// @param tickSpacing The minimum number of ticks between initialized ticks - /// @param pool The address of the created pool - event PoolCreated( - address indexed token0, - address indexed token1, - uint24 indexed fee, - int24 tickSpacing, - address pool - ); - - /// @notice Emitted when a new fee amount is enabled for pool creation via the factory - /// @param fee The enabled fee, denominated in hundredths of a bip - /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee - event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing); - - /// @notice Returns the current owner of the factory - /// @dev Can be changed by the current owner via setOwner - /// @return The address of the factory owner - function owner() external view returns (address); - - /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled - /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context - /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee - /// @return The tick spacing - function feeAmountTickSpacing(uint24 fee) external view returns (int24); - - /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist - /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order - /// @param tokenA The contract address of either token0 or token1 - /// @param tokenB The contract address of the other token - /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip - /// @return pool The pool address - function getPool( - address tokenA, - address tokenB, - uint24 fee - ) external view returns (address pool); - - /// @notice Creates a pool for the given two tokens and fee - /// @param tokenA One of the two tokens in the desired pool - /// @param tokenB The other of the two tokens in the desired pool - /// @param fee The desired fee for the pool - /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved - /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments - /// are invalid. - /// @return pool The address of the newly created pool - function createPool( - address tokenA, - address tokenB, - uint24 fee - ) external returns (address pool); - - /// @notice Updates the owner of the factory - /// @dev Must be called by the current owner - /// @param _owner The new owner of the factory - function setOwner(address _owner) external; - - /// @notice Enables a fee amount with the given tickSpacing - /// @dev Fee amounts may never be removed once enabled - /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6) - /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount - function enableFeeAmount(uint24 fee, int24 tickSpacing) external; -} diff --git a/contract/lib/v3-core/contracts/interfaces/IUniswapV3Pool.sol b/contract/lib/v3-core/contracts/interfaces/IUniswapV3Pool.sol deleted file mode 100644 index 56df050..0000000 --- a/contract/lib/v3-core/contracts/interfaces/IUniswapV3Pool.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -import './pool/IUniswapV3PoolImmutables.sol'; -import './pool/IUniswapV3PoolState.sol'; -import './pool/IUniswapV3PoolDerivedState.sol'; -import './pool/IUniswapV3PoolActions.sol'; -import './pool/IUniswapV3PoolOwnerActions.sol'; -import './pool/IUniswapV3PoolEvents.sol'; - -/// @title The interface for a Uniswap V3 Pool -/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform -/// to the ERC20 specification -/// @dev The pool interface is broken up into many smaller pieces -interface IUniswapV3Pool is - IUniswapV3PoolImmutables, - IUniswapV3PoolState, - IUniswapV3PoolDerivedState, - IUniswapV3PoolActions, - IUniswapV3PoolOwnerActions, - IUniswapV3PoolEvents -{ - -} diff --git a/contract/lib/v3-core/contracts/interfaces/IUniswapV3PoolDeployer.sol b/contract/lib/v3-core/contracts/interfaces/IUniswapV3PoolDeployer.sol deleted file mode 100644 index 72096c1..0000000 --- a/contract/lib/v3-core/contracts/interfaces/IUniswapV3PoolDeployer.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title An interface for a contract that is capable of deploying Uniswap V3 Pools -/// @notice A contract that constructs a pool must implement this to pass arguments to the pool -/// @dev This is used to avoid having constructor arguments in the pool contract, which results in the init code hash -/// of the pool being constant allowing the CREATE2 address of the pool to be cheaply computed on-chain -interface IUniswapV3PoolDeployer { - /// @notice Get the parameters to be used in constructing the pool, set transiently during pool creation. - /// @dev Called by the pool constructor to fetch the parameters of the pool - /// Returns factory The factory address - /// Returns token0 The first token of the pool by address sort order - /// Returns token1 The second token of the pool by address sort order - /// Returns fee The fee collected upon every swap in the pool, denominated in hundredths of a bip - /// Returns tickSpacing The minimum number of ticks between initialized ticks - function parameters() - external - view - returns ( - address factory, - address token0, - address token1, - uint24 fee, - int24 tickSpacing - ); -} diff --git a/contract/lib/v3-core/contracts/interfaces/LICENSE b/contract/lib/v3-core/contracts/interfaces/LICENSE deleted file mode 100644 index ecbc059..0000000 --- a/contract/lib/v3-core/contracts/interfaces/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. \ No newline at end of file diff --git a/contract/lib/v3-core/contracts/interfaces/callback/IUniswapV3FlashCallback.sol b/contract/lib/v3-core/contracts/interfaces/callback/IUniswapV3FlashCallback.sol deleted file mode 100644 index 18e54c4..0000000 --- a/contract/lib/v3-core/contracts/interfaces/callback/IUniswapV3FlashCallback.sol +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Callback for IUniswapV3PoolActions#flash -/// @notice Any contract that calls IUniswapV3PoolActions#flash must implement this interface -interface IUniswapV3FlashCallback { - /// @notice Called to `msg.sender` after transferring to the recipient from IUniswapV3Pool#flash. - /// @dev In the implementation you must repay the pool the tokens sent by flash plus the computed fee amounts. - /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. - /// @param fee0 The fee amount in token0 due to the pool by the end of the flash - /// @param fee1 The fee amount in token1 due to the pool by the end of the flash - /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#flash call - function uniswapV3FlashCallback( - uint256 fee0, - uint256 fee1, - bytes calldata data - ) external; -} diff --git a/contract/lib/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol b/contract/lib/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol deleted file mode 100644 index 85447e8..0000000 --- a/contract/lib/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Callback for IUniswapV3PoolActions#mint -/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface -interface IUniswapV3MintCallback { - /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint. - /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity. - /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. - /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity - /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity - /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call - function uniswapV3MintCallback( - uint256 amount0Owed, - uint256 amount1Owed, - bytes calldata data - ) external; -} diff --git a/contract/lib/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol b/contract/lib/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol deleted file mode 100644 index 9f183b2..0000000 --- a/contract/lib/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Callback for IUniswapV3PoolActions#swap -/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface -interface IUniswapV3SwapCallback { - /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap. - /// @dev In the implementation you must pay the pool tokens owed for the swap. - /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. - /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped. - /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by - /// the end of the swap. If positive, the callback must send that amount of token0 to the pool. - /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by - /// the end of the swap. If positive, the callback must send that amount of token1 to the pool. - /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call - function uniswapV3SwapCallback( - int256 amount0Delta, - int256 amount1Delta, - bytes calldata data - ) external; -} diff --git a/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol b/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol deleted file mode 100644 index 44fb61c..0000000 --- a/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol +++ /dev/null @@ -1,103 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Permissionless pool actions -/// @notice Contains pool methods that can be called by anyone -interface IUniswapV3PoolActions { - /// @notice Sets the initial price for the pool - /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value - /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96 - function initialize(uint160 sqrtPriceX96) external; - - /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position - /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback - /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends - /// on tickLower, tickUpper, the amount of liquidity, and the current price. - /// @param recipient The address for which the liquidity will be created - /// @param tickLower The lower tick of the position in which to add liquidity - /// @param tickUpper The upper tick of the position in which to add liquidity - /// @param amount The amount of liquidity to mint - /// @param data Any data that should be passed through to the callback - /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback - /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback - function mint( - address recipient, - int24 tickLower, - int24 tickUpper, - uint128 amount, - bytes calldata data - ) external returns (uint256 amount0, uint256 amount1); - - /// @notice Collects tokens owed to a position - /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. - /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or - /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the - /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity. - /// @param recipient The address which should receive the fees collected - /// @param tickLower The lower tick of the position for which to collect fees - /// @param tickUpper The upper tick of the position for which to collect fees - /// @param amount0Requested How much token0 should be withdrawn from the fees owed - /// @param amount1Requested How much token1 should be withdrawn from the fees owed - /// @return amount0 The amount of fees collected in token0 - /// @return amount1 The amount of fees collected in token1 - function collect( - address recipient, - int24 tickLower, - int24 tickUpper, - uint128 amount0Requested, - uint128 amount1Requested - ) external returns (uint128 amount0, uint128 amount1); - - /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position - /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 - /// @dev Fees must be collected separately via a call to #collect - /// @param tickLower The lower tick of the position for which to burn liquidity - /// @param tickUpper The upper tick of the position for which to burn liquidity - /// @param amount How much liquidity to burn - /// @return amount0 The amount of token0 sent to the recipient - /// @return amount1 The amount of token1 sent to the recipient - function burn( - int24 tickLower, - int24 tickUpper, - uint128 amount - ) external returns (uint256 amount0, uint256 amount1); - - /// @notice Swap token0 for token1, or token1 for token0 - /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback - /// @param recipient The address to receive the output of the swap - /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0 - /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative) - /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this - /// value after the swap. If one for zero, the price cannot be greater than this value after the swap - /// @param data Any data to be passed through to the callback - /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive - /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive - function swap( - address recipient, - bool zeroForOne, - int256 amountSpecified, - uint160 sqrtPriceLimitX96, - bytes calldata data - ) external returns (int256 amount0, int256 amount1); - - /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback - /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback - /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling - /// with 0 amount{0,1} and sending the donation amount(s) from the callback - /// @param recipient The address which will receive the token0 and token1 amounts - /// @param amount0 The amount of token0 to send - /// @param amount1 The amount of token1 to send - /// @param data Any data to be passed through to the callback - function flash( - address recipient, - uint256 amount0, - uint256 amount1, - bytes calldata data - ) external; - - /// @notice Increase the maximum number of price and liquidity observations that this pool will store - /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to - /// the input observationCardinalityNext. - /// @param observationCardinalityNext The desired minimum number of observations for the pool to store - function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external; -} diff --git a/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol b/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol deleted file mode 100644 index eda3a00..0000000 --- a/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Pool state that is not stored -/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the -/// blockchain. The functions here may have variable gas costs. -interface IUniswapV3PoolDerivedState { - /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp - /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing - /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick, - /// you must call it with secondsAgos = [3600, 0]. - /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in - /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio. - /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned - /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp - /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block - /// timestamp - function observe(uint32[] calldata secondsAgos) - external - view - returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s); - - /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range - /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed. - /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first - /// snapshot is taken and the second snapshot is taken. - /// @param tickLower The lower tick of the range - /// @param tickUpper The upper tick of the range - /// @return tickCumulativeInside The snapshot of the tick accumulator for the range - /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range - /// @return secondsInside The snapshot of seconds per liquidity for the range - function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) - external - view - returns ( - int56 tickCumulativeInside, - uint160 secondsPerLiquidityInsideX128, - uint32 secondsInside - ); -} diff --git a/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol b/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol deleted file mode 100644 index 9d915dd..0000000 --- a/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol +++ /dev/null @@ -1,121 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Events emitted by a pool -/// @notice Contains all events emitted by the pool -interface IUniswapV3PoolEvents { - /// @notice Emitted exactly once by a pool when #initialize is first called on the pool - /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize - /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 - /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool - event Initialize(uint160 sqrtPriceX96, int24 tick); - - /// @notice Emitted when liquidity is minted for a given position - /// @param sender The address that minted the liquidity - /// @param owner The owner of the position and recipient of any minted liquidity - /// @param tickLower The lower tick of the position - /// @param tickUpper The upper tick of the position - /// @param amount The amount of liquidity minted to the position range - /// @param amount0 How much token0 was required for the minted liquidity - /// @param amount1 How much token1 was required for the minted liquidity - event Mint( - address sender, - address indexed owner, - int24 indexed tickLower, - int24 indexed tickUpper, - uint128 amount, - uint256 amount0, - uint256 amount1 - ); - - /// @notice Emitted when fees are collected by the owner of a position - /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees - /// @param owner The owner of the position for which fees are collected - /// @param tickLower The lower tick of the position - /// @param tickUpper The upper tick of the position - /// @param amount0 The amount of token0 fees collected - /// @param amount1 The amount of token1 fees collected - event Collect( - address indexed owner, - address recipient, - int24 indexed tickLower, - int24 indexed tickUpper, - uint128 amount0, - uint128 amount1 - ); - - /// @notice Emitted when a position's liquidity is removed - /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect - /// @param owner The owner of the position for which liquidity is removed - /// @param tickLower The lower tick of the position - /// @param tickUpper The upper tick of the position - /// @param amount The amount of liquidity to remove - /// @param amount0 The amount of token0 withdrawn - /// @param amount1 The amount of token1 withdrawn - event Burn( - address indexed owner, - int24 indexed tickLower, - int24 indexed tickUpper, - uint128 amount, - uint256 amount0, - uint256 amount1 - ); - - /// @notice Emitted by the pool for any swaps between token0 and token1 - /// @param sender The address that initiated the swap call, and that received the callback - /// @param recipient The address that received the output of the swap - /// @param amount0 The delta of the token0 balance of the pool - /// @param amount1 The delta of the token1 balance of the pool - /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96 - /// @param liquidity The liquidity of the pool after the swap - /// @param tick The log base 1.0001 of price of the pool after the swap - event Swap( - address indexed sender, - address indexed recipient, - int256 amount0, - int256 amount1, - uint160 sqrtPriceX96, - uint128 liquidity, - int24 tick - ); - - /// @notice Emitted by the pool for any flashes of token0/token1 - /// @param sender The address that initiated the swap call, and that received the callback - /// @param recipient The address that received the tokens from flash - /// @param amount0 The amount of token0 that was flashed - /// @param amount1 The amount of token1 that was flashed - /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee - /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee - event Flash( - address indexed sender, - address indexed recipient, - uint256 amount0, - uint256 amount1, - uint256 paid0, - uint256 paid1 - ); - - /// @notice Emitted by the pool for increases to the number of observations that can be stored - /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index - /// just before a mint/swap/burn. - /// @param observationCardinalityNextOld The previous value of the next observation cardinality - /// @param observationCardinalityNextNew The updated value of the next observation cardinality - event IncreaseObservationCardinalityNext( - uint16 observationCardinalityNextOld, - uint16 observationCardinalityNextNew - ); - - /// @notice Emitted when the protocol fee is changed by the pool - /// @param feeProtocol0Old The previous value of the token0 protocol fee - /// @param feeProtocol1Old The previous value of the token1 protocol fee - /// @param feeProtocol0New The updated value of the token0 protocol fee - /// @param feeProtocol1New The updated value of the token1 protocol fee - event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New); - - /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner - /// @param sender The address that collects the protocol fees - /// @param recipient The address that receives the collected protocol fees - /// @param amount0 The amount of token0 protocol fees that is withdrawn - /// @param amount0 The amount of token1 protocol fees that is withdrawn - event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1); -} diff --git a/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol b/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol deleted file mode 100644 index c9beb15..0000000 --- a/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Pool state that never changes -/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values -interface IUniswapV3PoolImmutables { - /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface - /// @return The contract address - function factory() external view returns (address); - - /// @notice The first of the two tokens of the pool, sorted by address - /// @return The token contract address - function token0() external view returns (address); - - /// @notice The second of the two tokens of the pool, sorted by address - /// @return The token contract address - function token1() external view returns (address); - - /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6 - /// @return The fee - function fee() external view returns (uint24); - - /// @notice The pool tick spacing - /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive - /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ... - /// This value is an int24 to avoid casting even though it is always positive. - /// @return The tick spacing - function tickSpacing() external view returns (int24); - - /// @notice The maximum amount of position liquidity that can use any tick in the range - /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and - /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool - /// @return The max amount of liquidity per tick - function maxLiquidityPerTick() external view returns (uint128); -} diff --git a/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol b/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol deleted file mode 100644 index 2395ed3..0000000 --- a/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Permissioned pool actions -/// @notice Contains pool methods that may only be called by the factory owner -interface IUniswapV3PoolOwnerActions { - /// @notice Set the denominator of the protocol's % share of the fees - /// @param feeProtocol0 new protocol fee for token0 of the pool - /// @param feeProtocol1 new protocol fee for token1 of the pool - function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; - - /// @notice Collect the protocol fee accrued to the pool - /// @param recipient The address to which collected protocol fees should be sent - /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1 - /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0 - /// @return amount0 The protocol fee collected in token0 - /// @return amount1 The protocol fee collected in token1 - function collectProtocol( - address recipient, - uint128 amount0Requested, - uint128 amount1Requested - ) external returns (uint128 amount0, uint128 amount1); -} diff --git a/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol b/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol deleted file mode 100644 index 620256c..0000000 --- a/contract/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol +++ /dev/null @@ -1,116 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Pool state that can change -/// @notice These methods compose the pool's state, and can change with any frequency including multiple times -/// per transaction -interface IUniswapV3PoolState { - /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas - /// when accessed externally. - /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value - /// tick The current tick of the pool, i.e. according to the last tick transition that was run. - /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick - /// boundary. - /// observationIndex The index of the last oracle observation that was written, - /// observationCardinality The current maximum number of observations stored in the pool, - /// observationCardinalityNext The next maximum number of observations, to be updated when the observation. - /// feeProtocol The protocol fee for both tokens of the pool. - /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0 - /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee. - /// unlocked Whether the pool is currently locked to reentrancy - function slot0() - external - view - returns ( - uint160 sqrtPriceX96, - int24 tick, - uint16 observationIndex, - uint16 observationCardinality, - uint16 observationCardinalityNext, - uint8 feeProtocol, - bool unlocked - ); - - /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool - /// @dev This value can overflow the uint256 - function feeGrowthGlobal0X128() external view returns (uint256); - - /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool - /// @dev This value can overflow the uint256 - function feeGrowthGlobal1X128() external view returns (uint256); - - /// @notice The amounts of token0 and token1 that are owed to the protocol - /// @dev Protocol fees will never exceed uint128 max in either token - function protocolFees() external view returns (uint128 token0, uint128 token1); - - /// @notice The currently in range liquidity available to the pool - /// @dev This value has no relationship to the total liquidity across all ticks - function liquidity() external view returns (uint128); - - /// @notice Look up information about a specific tick in the pool - /// @param tick The tick to look up - /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or - /// tick upper, - /// liquidityNet how much liquidity changes when the pool price crosses the tick, - /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0, - /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1, - /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick - /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick, - /// secondsOutside the seconds spent on the other side of the tick from the current tick, - /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false. - /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0. - /// In addition, these values are only relative and must be used only in comparison to previous snapshots for - /// a specific position. - function ticks(int24 tick) - external - view - returns ( - uint128 liquidityGross, - int128 liquidityNet, - uint256 feeGrowthOutside0X128, - uint256 feeGrowthOutside1X128, - int56 tickCumulativeOutside, - uint160 secondsPerLiquidityOutsideX128, - uint32 secondsOutside, - bool initialized - ); - - /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information - function tickBitmap(int16 wordPosition) external view returns (uint256); - - /// @notice Returns the information about a position by the position's key - /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper - /// @return _liquidity The amount of liquidity in the position, - /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke, - /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke, - /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke, - /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke - function positions(bytes32 key) - external - view - returns ( - uint128 _liquidity, - uint256 feeGrowthInside0LastX128, - uint256 feeGrowthInside1LastX128, - uint128 tokensOwed0, - uint128 tokensOwed1 - ); - - /// @notice Returns data about a specific observation index - /// @param index The element of the observations array to fetch - /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time - /// ago, rather than at a specific index in the array. - /// @return blockTimestamp The timestamp of the observation, - /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp, - /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp, - /// Returns initialized whether the observation has been initialized and the values are safe to use - function observations(uint256 index) - external - view - returns ( - uint32 blockTimestamp, - int56 tickCumulative, - uint160 secondsPerLiquidityCumulativeX128, - bool initialized - ); -} diff --git a/contract/lib/v3-core/contracts/libraries/BitMath.sol b/contract/lib/v3-core/contracts/libraries/BitMath.sol deleted file mode 100644 index 3a7216c..0000000 --- a/contract/lib/v3-core/contracts/libraries/BitMath.sol +++ /dev/null @@ -1,94 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title BitMath -/// @dev This library provides functionality for computing bit properties of an unsigned integer -library BitMath { - /// @notice Returns the index of the most significant bit of the number, - /// where the least significant bit is at index 0 and the most significant bit is at index 255 - /// @dev The function satisfies the property: - /// x >= 2**mostSignificantBit(x) and x < 2**(mostSignificantBit(x)+1) - /// @param x the value for which to compute the most significant bit, must be greater than 0 - /// @return r the index of the most significant bit - function mostSignificantBit(uint256 x) internal pure returns (uint8 r) { - require(x > 0); - - if (x >= 0x100000000000000000000000000000000) { - x >>= 128; - r += 128; - } - if (x >= 0x10000000000000000) { - x >>= 64; - r += 64; - } - if (x >= 0x100000000) { - x >>= 32; - r += 32; - } - if (x >= 0x10000) { - x >>= 16; - r += 16; - } - if (x >= 0x100) { - x >>= 8; - r += 8; - } - if (x >= 0x10) { - x >>= 4; - r += 4; - } - if (x >= 0x4) { - x >>= 2; - r += 2; - } - if (x >= 0x2) r += 1; - } - - /// @notice Returns the index of the least significant bit of the number, - /// where the least significant bit is at index 0 and the most significant bit is at index 255 - /// @dev The function satisfies the property: - /// (x & 2**leastSignificantBit(x)) != 0 and (x & (2**(leastSignificantBit(x)) - 1)) == 0) - /// @param x the value for which to compute the least significant bit, must be greater than 0 - /// @return r the index of the least significant bit - function leastSignificantBit(uint256 x) internal pure returns (uint8 r) { - require(x > 0); - - r = 255; - if (x & type(uint128).max > 0) { - r -= 128; - } else { - x >>= 128; - } - if (x & type(uint64).max > 0) { - r -= 64; - } else { - x >>= 64; - } - if (x & type(uint32).max > 0) { - r -= 32; - } else { - x >>= 32; - } - if (x & type(uint16).max > 0) { - r -= 16; - } else { - x >>= 16; - } - if (x & type(uint8).max > 0) { - r -= 8; - } else { - x >>= 8; - } - if (x & 0xf > 0) { - r -= 4; - } else { - x >>= 4; - } - if (x & 0x3 > 0) { - r -= 2; - } else { - x >>= 2; - } - if (x & 0x1 > 0) r -= 1; - } -} diff --git a/contract/lib/v3-core/contracts/libraries/FixedPoint128.sol b/contract/lib/v3-core/contracts/libraries/FixedPoint128.sol deleted file mode 100644 index 6d6948b..0000000 --- a/contract/lib/v3-core/contracts/libraries/FixedPoint128.sol +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.4.0; - -/// @title FixedPoint128 -/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) -library FixedPoint128 { - uint256 internal constant Q128 = 0x100000000000000000000000000000000; -} diff --git a/contract/lib/v3-core/contracts/libraries/FixedPoint96.sol b/contract/lib/v3-core/contracts/libraries/FixedPoint96.sol deleted file mode 100644 index 63b42c2..0000000 --- a/contract/lib/v3-core/contracts/libraries/FixedPoint96.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.4.0; - -/// @title FixedPoint96 -/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) -/// @dev Used in SqrtPriceMath.sol -library FixedPoint96 { - uint8 internal constant RESOLUTION = 96; - uint256 internal constant Q96 = 0x1000000000000000000000000; -} diff --git a/contract/lib/v3-core/contracts/libraries/FullMath.sol b/contract/lib/v3-core/contracts/libraries/FullMath.sol deleted file mode 100644 index 8688a17..0000000 --- a/contract/lib/v3-core/contracts/libraries/FullMath.sol +++ /dev/null @@ -1,124 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.4.0; - -/// @title Contains 512-bit math functions -/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision -/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits -library FullMath { - /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 - /// @param a The multiplicand - /// @param b The multiplier - /// @param denominator The divisor - /// @return result The 256-bit result - /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv - function mulDiv( - uint256 a, - uint256 b, - uint256 denominator - ) internal pure returns (uint256 result) { - // 512-bit multiply [prod1 prod0] = a * b - // Compute the product mod 2**256 and mod 2**256 - 1 - // then use the Chinese Remainder Theorem to reconstruct - // the 512 bit result. The result is stored in two 256 - // variables such that product = prod1 * 2**256 + prod0 - uint256 prod0; // Least significant 256 bits of the product - uint256 prod1; // Most significant 256 bits of the product - assembly { - let mm := mulmod(a, b, not(0)) - prod0 := mul(a, b) - prod1 := sub(sub(mm, prod0), lt(mm, prod0)) - } - - // Handle non-overflow cases, 256 by 256 division - if (prod1 == 0) { - require(denominator > 0); - assembly { - result := div(prod0, denominator) - } - return result; - } - - // Make sure the result is less than 2**256. - // Also prevents denominator == 0 - require(denominator > prod1); - - /////////////////////////////////////////////// - // 512 by 256 division. - /////////////////////////////////////////////// - - // Make division exact by subtracting the remainder from [prod1 prod0] - // Compute remainder using mulmod - uint256 remainder; - assembly { - remainder := mulmod(a, b, denominator) - } - // Subtract 256 bit number from 512 bit number - assembly { - prod1 := sub(prod1, gt(remainder, prod0)) - prod0 := sub(prod0, remainder) - } - - // Factor powers of two out of denominator - // Compute largest power of two divisor of denominator. - // Always >= 1. - uint256 twos = -denominator & denominator; - // Divide denominator by power of two - assembly { - denominator := div(denominator, twos) - } - - // Divide [prod1 prod0] by the factors of two - assembly { - prod0 := div(prod0, twos) - } - // Shift in bits from prod1 into prod0. For this we need - // to flip `twos` such that it is 2**256 / twos. - // If twos is zero, then it becomes one - assembly { - twos := add(div(sub(0, twos), twos), 1) - } - prod0 |= prod1 * twos; - - // Invert denominator mod 2**256 - // Now that denominator is an odd number, it has an inverse - // modulo 2**256 such that denominator * inv = 1 mod 2**256. - // Compute the inverse by starting with a seed that is correct - // correct for four bits. That is, denominator * inv = 1 mod 2**4 - uint256 inv = (3 * denominator) ^ 2; - // Now use Newton-Raphson iteration to improve the precision. - // Thanks to Hensel's lifting lemma, this also works in modular - // arithmetic, doubling the correct bits in each step. - inv *= 2 - denominator * inv; // inverse mod 2**8 - inv *= 2 - denominator * inv; // inverse mod 2**16 - inv *= 2 - denominator * inv; // inverse mod 2**32 - inv *= 2 - denominator * inv; // inverse mod 2**64 - inv *= 2 - denominator * inv; // inverse mod 2**128 - inv *= 2 - denominator * inv; // inverse mod 2**256 - - // Because the division is now exact we can divide by multiplying - // with the modular inverse of denominator. This will give us the - // correct result modulo 2**256. Since the precoditions guarantee - // that the outcome is less than 2**256, this is the final result. - // We don't need to compute the high bits of the result and prod1 - // is no longer required. - result = prod0 * inv; - return result; - } - - /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 - /// @param a The multiplicand - /// @param b The multiplier - /// @param denominator The divisor - /// @return result The 256-bit result - function mulDivRoundingUp( - uint256 a, - uint256 b, - uint256 denominator - ) internal pure returns (uint256 result) { - result = mulDiv(a, b, denominator); - if (mulmod(a, b, denominator) > 0) { - require(result < type(uint256).max); - result++; - } - } -} diff --git a/contract/lib/v3-core/contracts/libraries/LICENSE_GPL b/contract/lib/v3-core/contracts/libraries/LICENSE_GPL deleted file mode 100644 index ecbc059..0000000 --- a/contract/lib/v3-core/contracts/libraries/LICENSE_GPL +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. \ No newline at end of file diff --git a/contract/lib/v3-core/contracts/libraries/LICENSE_MIT b/contract/lib/v3-core/contracts/libraries/LICENSE_MIT deleted file mode 100644 index bf4f90a..0000000 --- a/contract/lib/v3-core/contracts/libraries/LICENSE_MIT +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2021 Remco Bloemen - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/contract/lib/v3-core/contracts/libraries/LiquidityMath.sol b/contract/lib/v3-core/contracts/libraries/LiquidityMath.sol deleted file mode 100644 index d5e2303..0000000 --- a/contract/lib/v3-core/contracts/libraries/LiquidityMath.sol +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Math library for liquidity -library LiquidityMath { - /// @notice Add a signed liquidity delta to liquidity and revert if it overflows or underflows - /// @param x The liquidity before change - /// @param y The delta by which liquidity should be changed - /// @return z The liquidity delta - function addDelta(uint128 x, int128 y) internal pure returns (uint128 z) { - if (y < 0) { - require((z = x - uint128(-y)) < x, 'LS'); - } else { - require((z = x + uint128(y)) >= x, 'LA'); - } - } -} diff --git a/contract/lib/v3-core/contracts/libraries/LowGasSafeMath.sol b/contract/lib/v3-core/contracts/libraries/LowGasSafeMath.sol deleted file mode 100644 index dbc817c..0000000 --- a/contract/lib/v3-core/contracts/libraries/LowGasSafeMath.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.7.0; - -/// @title Optimized overflow and underflow safe math operations -/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost -library LowGasSafeMath { - /// @notice Returns x + y, reverts if sum overflows uint256 - /// @param x The augend - /// @param y The addend - /// @return z The sum of x and y - function add(uint256 x, uint256 y) internal pure returns (uint256 z) { - require((z = x + y) >= x); - } - - /// @notice Returns x - y, reverts if underflows - /// @param x The minuend - /// @param y The subtrahend - /// @return z The difference of x and y - function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { - require((z = x - y) <= x); - } - - /// @notice Returns x * y, reverts if overflows - /// @param x The multiplicand - /// @param y The multiplier - /// @return z The product of x and y - function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { - require(x == 0 || (z = x * y) / x == y); - } - - /// @notice Returns x + y, reverts if overflows or underflows - /// @param x The augend - /// @param y The addend - /// @return z The sum of x and y - function add(int256 x, int256 y) internal pure returns (int256 z) { - require((z = x + y) >= x == (y >= 0)); - } - - /// @notice Returns x - y, reverts if overflows or underflows - /// @param x The minuend - /// @param y The subtrahend - /// @return z The difference of x and y - function sub(int256 x, int256 y) internal pure returns (int256 z) { - require((z = x - y) <= x == (y >= 0)); - } -} diff --git a/contract/lib/v3-core/contracts/libraries/Oracle.sol b/contract/lib/v3-core/contracts/libraries/Oracle.sol deleted file mode 100644 index 3f6b3f3..0000000 --- a/contract/lib/v3-core/contracts/libraries/Oracle.sol +++ /dev/null @@ -1,325 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.5.0; - -/// @title Oracle -/// @notice Provides price and liquidity data useful for a wide variety of system designs -/// @dev Instances of stored oracle data, "observations", are collected in the oracle array -/// Every pool is initialized with an oracle array length of 1. Anyone can pay the SSTOREs to increase the -/// maximum length of the oracle array. New slots will be added when the array is fully populated. -/// Observations are overwritten when the full length of the oracle array is populated. -/// The most recent observation is available, independent of the length of the oracle array, by passing 0 to observe() -library Oracle { - struct Observation { - // the block timestamp of the observation - uint32 blockTimestamp; - // the tick accumulator, i.e. tick * time elapsed since the pool was first initialized - int56 tickCumulative; - // the seconds per liquidity, i.e. seconds elapsed / max(1, liquidity) since the pool was first initialized - uint160 secondsPerLiquidityCumulativeX128; - // whether or not the observation is initialized - bool initialized; - } - - /// @notice Transforms a previous observation into a new observation, given the passage of time and the current tick and liquidity values - /// @dev blockTimestamp _must_ be chronologically equal to or greater than last.blockTimestamp, safe for 0 or 1 overflows - /// @param last The specified observation to be transformed - /// @param blockTimestamp The timestamp of the new observation - /// @param tick The active tick at the time of the new observation - /// @param liquidity The total in-range liquidity at the time of the new observation - /// @return Observation The newly populated observation - function transform( - Observation memory last, - uint32 blockTimestamp, - int24 tick, - uint128 liquidity - ) private pure returns (Observation memory) { - uint32 delta = blockTimestamp - last.blockTimestamp; - return - Observation({ - blockTimestamp: blockTimestamp, - tickCumulative: last.tickCumulative + int56(tick) * delta, - secondsPerLiquidityCumulativeX128: last.secondsPerLiquidityCumulativeX128 + - ((uint160(delta) << 128) / (liquidity > 0 ? liquidity : 1)), - initialized: true - }); - } - - /// @notice Initialize the oracle array by writing the first slot. Called once for the lifecycle of the observations array - /// @param self The stored oracle array - /// @param time The time of the oracle initialization, via block.timestamp truncated to uint32 - /// @return cardinality The number of populated elements in the oracle array - /// @return cardinalityNext The new length of the oracle array, independent of population - function initialize(Observation[65535] storage self, uint32 time) - internal - returns (uint16 cardinality, uint16 cardinalityNext) - { - self[0] = Observation({ - blockTimestamp: time, - tickCumulative: 0, - secondsPerLiquidityCumulativeX128: 0, - initialized: true - }); - return (1, 1); - } - - /// @notice Writes an oracle observation to the array - /// @dev Writable at most once per block. Index represents the most recently written element. cardinality and index must be tracked externally. - /// If the index is at the end of the allowable array length (according to cardinality), and the next cardinality - /// is greater than the current one, cardinality may be increased. This restriction is created to preserve ordering. - /// @param self The stored oracle array - /// @param index The index of the observation that was most recently written to the observations array - /// @param blockTimestamp The timestamp of the new observation - /// @param tick The active tick at the time of the new observation - /// @param liquidity The total in-range liquidity at the time of the new observation - /// @param cardinality The number of populated elements in the oracle array - /// @param cardinalityNext The new length of the oracle array, independent of population - /// @return indexUpdated The new index of the most recently written element in the oracle array - /// @return cardinalityUpdated The new cardinality of the oracle array - function write( - Observation[65535] storage self, - uint16 index, - uint32 blockTimestamp, - int24 tick, - uint128 liquidity, - uint16 cardinality, - uint16 cardinalityNext - ) internal returns (uint16 indexUpdated, uint16 cardinalityUpdated) { - Observation memory last = self[index]; - - // early return if we've already written an observation this block - if (last.blockTimestamp == blockTimestamp) return (index, cardinality); - - // if the conditions are right, we can bump the cardinality - if (cardinalityNext > cardinality && index == (cardinality - 1)) { - cardinalityUpdated = cardinalityNext; - } else { - cardinalityUpdated = cardinality; - } - - indexUpdated = (index + 1) % cardinalityUpdated; - self[indexUpdated] = transform(last, blockTimestamp, tick, liquidity); - } - - /// @notice Prepares the oracle array to store up to `next` observations - /// @param self The stored oracle array - /// @param current The current next cardinality of the oracle array - /// @param next The proposed next cardinality which will be populated in the oracle array - /// @return next The next cardinality which will be populated in the oracle array - function grow( - Observation[65535] storage self, - uint16 current, - uint16 next - ) internal returns (uint16) { - require(current > 0, 'I'); - // no-op if the passed next value isn't greater than the current next value - if (next <= current) return current; - // store in each slot to prevent fresh SSTOREs in swaps - // this data will not be used because the initialized boolean is still false - for (uint16 i = current; i < next; i++) self[i].blockTimestamp = 1; - return next; - } - - /// @notice comparator for 32-bit timestamps - /// @dev safe for 0 or 1 overflows, a and b _must_ be chronologically before or equal to time - /// @param time A timestamp truncated to 32 bits - /// @param a A comparison timestamp from which to determine the relative position of `time` - /// @param b From which to determine the relative position of `time` - /// @return bool Whether `a` is chronologically <= `b` - function lte( - uint32 time, - uint32 a, - uint32 b - ) private pure returns (bool) { - // if there hasn't been overflow, no need to adjust - if (a <= time && b <= time) return a <= b; - - uint256 aAdjusted = a > time ? a : a + 2**32; - uint256 bAdjusted = b > time ? b : b + 2**32; - - return aAdjusted <= bAdjusted; - } - - /// @notice Fetches the observations beforeOrAt and atOrAfter a target, i.e. where [beforeOrAt, atOrAfter] is satisfied. - /// The result may be the same observation, or adjacent observations. - /// @dev The answer must be contained in the array, used when the target is located within the stored observation - /// boundaries: older than the most recent observation and younger, or the same age as, the oldest observation - /// @param self The stored oracle array - /// @param time The current block.timestamp - /// @param target The timestamp at which the reserved observation should be for - /// @param index The index of the observation that was most recently written to the observations array - /// @param cardinality The number of populated elements in the oracle array - /// @return beforeOrAt The observation recorded before, or at, the target - /// @return atOrAfter The observation recorded at, or after, the target - function binarySearch( - Observation[65535] storage self, - uint32 time, - uint32 target, - uint16 index, - uint16 cardinality - ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) { - uint256 l = (index + 1) % cardinality; // oldest observation - uint256 r = l + cardinality - 1; // newest observation - uint256 i; - while (true) { - i = (l + r) / 2; - - beforeOrAt = self[i % cardinality]; - - // we've landed on an uninitialized tick, keep searching higher (more recently) - if (!beforeOrAt.initialized) { - l = i + 1; - continue; - } - - atOrAfter = self[(i + 1) % cardinality]; - - bool targetAtOrAfter = lte(time, beforeOrAt.blockTimestamp, target); - - // check if we've found the answer! - if (targetAtOrAfter && lte(time, target, atOrAfter.blockTimestamp)) break; - - if (!targetAtOrAfter) r = i - 1; - else l = i + 1; - } - } - - /// @notice Fetches the observations beforeOrAt and atOrAfter a given target, i.e. where [beforeOrAt, atOrAfter] is satisfied - /// @dev Assumes there is at least 1 initialized observation. - /// Used by observeSingle() to compute the counterfactual accumulator values as of a given block timestamp. - /// @param self The stored oracle array - /// @param time The current block.timestamp - /// @param target The timestamp at which the reserved observation should be for - /// @param tick The active tick at the time of the returned or simulated observation - /// @param index The index of the observation that was most recently written to the observations array - /// @param liquidity The total pool liquidity at the time of the call - /// @param cardinality The number of populated elements in the oracle array - /// @return beforeOrAt The observation which occurred at, or before, the given timestamp - /// @return atOrAfter The observation which occurred at, or after, the given timestamp - function getSurroundingObservations( - Observation[65535] storage self, - uint32 time, - uint32 target, - int24 tick, - uint16 index, - uint128 liquidity, - uint16 cardinality - ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) { - // optimistically set before to the newest observation - beforeOrAt = self[index]; - - // if the target is chronologically at or after the newest observation, we can early return - if (lte(time, beforeOrAt.blockTimestamp, target)) { - if (beforeOrAt.blockTimestamp == target) { - // if newest observation equals target, we're in the same block, so we can ignore atOrAfter - return (beforeOrAt, atOrAfter); - } else { - // otherwise, we need to transform - return (beforeOrAt, transform(beforeOrAt, target, tick, liquidity)); - } - } - - // now, set before to the oldest observation - beforeOrAt = self[(index + 1) % cardinality]; - if (!beforeOrAt.initialized) beforeOrAt = self[0]; - - // ensure that the target is chronologically at or after the oldest observation - require(lte(time, beforeOrAt.blockTimestamp, target), 'OLD'); - - // if we've reached this point, we have to binary search - return binarySearch(self, time, target, index, cardinality); - } - - /// @dev Reverts if an observation at or before the desired observation timestamp does not exist. - /// 0 may be passed as `secondsAgo' to return the current cumulative values. - /// If called with a timestamp falling between two observations, returns the counterfactual accumulator values - /// at exactly the timestamp between the two observations. - /// @param self The stored oracle array - /// @param time The current block timestamp - /// @param secondsAgo The amount of time to look back, in seconds, at which point to return an observation - /// @param tick The current tick - /// @param index The index of the observation that was most recently written to the observations array - /// @param liquidity The current in-range pool liquidity - /// @param cardinality The number of populated elements in the oracle array - /// @return tickCumulative The tick * time elapsed since the pool was first initialized, as of `secondsAgo` - /// @return secondsPerLiquidityCumulativeX128 The time elapsed / max(1, liquidity) since the pool was first initialized, as of `secondsAgo` - function observeSingle( - Observation[65535] storage self, - uint32 time, - uint32 secondsAgo, - int24 tick, - uint16 index, - uint128 liquidity, - uint16 cardinality - ) internal view returns (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) { - if (secondsAgo == 0) { - Observation memory last = self[index]; - if (last.blockTimestamp != time) last = transform(last, time, tick, liquidity); - return (last.tickCumulative, last.secondsPerLiquidityCumulativeX128); - } - - uint32 target = time - secondsAgo; - - (Observation memory beforeOrAt, Observation memory atOrAfter) = - getSurroundingObservations(self, time, target, tick, index, liquidity, cardinality); - - if (target == beforeOrAt.blockTimestamp) { - // we're at the left boundary - return (beforeOrAt.tickCumulative, beforeOrAt.secondsPerLiquidityCumulativeX128); - } else if (target == atOrAfter.blockTimestamp) { - // we're at the right boundary - return (atOrAfter.tickCumulative, atOrAfter.secondsPerLiquidityCumulativeX128); - } else { - // we're in the middle - uint32 observationTimeDelta = atOrAfter.blockTimestamp - beforeOrAt.blockTimestamp; - uint32 targetDelta = target - beforeOrAt.blockTimestamp; - return ( - beforeOrAt.tickCumulative + - ((atOrAfter.tickCumulative - beforeOrAt.tickCumulative) / observationTimeDelta) * - targetDelta, - beforeOrAt.secondsPerLiquidityCumulativeX128 + - uint160( - (uint256( - atOrAfter.secondsPerLiquidityCumulativeX128 - beforeOrAt.secondsPerLiquidityCumulativeX128 - ) * targetDelta) / observationTimeDelta - ) - ); - } - } - - /// @notice Returns the accumulator values as of each time seconds ago from the given time in the array of `secondsAgos` - /// @dev Reverts if `secondsAgos` > oldest observation - /// @param self The stored oracle array - /// @param time The current block.timestamp - /// @param secondsAgos Each amount of time to look back, in seconds, at which point to return an observation - /// @param tick The current tick - /// @param index The index of the observation that was most recently written to the observations array - /// @param liquidity The current in-range pool liquidity - /// @param cardinality The number of populated elements in the oracle array - /// @return tickCumulatives The tick * time elapsed since the pool was first initialized, as of each `secondsAgo` - /// @return secondsPerLiquidityCumulativeX128s The cumulative seconds / max(1, liquidity) since the pool was first initialized, as of each `secondsAgo` - function observe( - Observation[65535] storage self, - uint32 time, - uint32[] memory secondsAgos, - int24 tick, - uint16 index, - uint128 liquidity, - uint16 cardinality - ) internal view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) { - require(cardinality > 0, 'I'); - - tickCumulatives = new int56[](secondsAgos.length); - secondsPerLiquidityCumulativeX128s = new uint160[](secondsAgos.length); - for (uint256 i = 0; i < secondsAgos.length; i++) { - (tickCumulatives[i], secondsPerLiquidityCumulativeX128s[i]) = observeSingle( - self, - time, - secondsAgos[i], - tick, - index, - liquidity, - cardinality - ); - } - } -} diff --git a/contract/lib/v3-core/contracts/libraries/Position.sol b/contract/lib/v3-core/contracts/libraries/Position.sol deleted file mode 100644 index 1c67c7f..0000000 --- a/contract/lib/v3-core/contracts/libraries/Position.sol +++ /dev/null @@ -1,88 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.5.0; - -import './FullMath.sol'; -import './FixedPoint128.sol'; -import './LiquidityMath.sol'; - -/// @title Position -/// @notice Positions represent an owner address' liquidity between a lower and upper tick boundary -/// @dev Positions store additional state for tracking fees owed to the position -library Position { - // info stored for each user's position - struct Info { - // the amount of liquidity owned by this position - uint128 liquidity; - // fee growth per unit of liquidity as of the last update to liquidity or fees owed - uint256 feeGrowthInside0LastX128; - uint256 feeGrowthInside1LastX128; - // the fees owed to the position owner in token0/token1 - uint128 tokensOwed0; - uint128 tokensOwed1; - } - - /// @notice Returns the Info struct of a position, given an owner and position boundaries - /// @param self The mapping containing all user positions - /// @param owner The address of the position owner - /// @param tickLower The lower tick boundary of the position - /// @param tickUpper The upper tick boundary of the position - /// @return position The position info struct of the given owners' position - function get( - mapping(bytes32 => Info) storage self, - address owner, - int24 tickLower, - int24 tickUpper - ) internal view returns (Position.Info storage position) { - position = self[keccak256(abi.encodePacked(owner, tickLower, tickUpper))]; - } - - /// @notice Credits accumulated fees to a user's position - /// @param self The individual position to update - /// @param liquidityDelta The change in pool liquidity as a result of the position update - /// @param feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries - /// @param feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries - function update( - Info storage self, - int128 liquidityDelta, - uint256 feeGrowthInside0X128, - uint256 feeGrowthInside1X128 - ) internal { - Info memory _self = self; - - uint128 liquidityNext; - if (liquidityDelta == 0) { - require(_self.liquidity > 0, 'NP'); // disallow pokes for 0 liquidity positions - liquidityNext = _self.liquidity; - } else { - liquidityNext = LiquidityMath.addDelta(_self.liquidity, liquidityDelta); - } - - // calculate accumulated fees - uint128 tokensOwed0 = - uint128( - FullMath.mulDiv( - feeGrowthInside0X128 - _self.feeGrowthInside0LastX128, - _self.liquidity, - FixedPoint128.Q128 - ) - ); - uint128 tokensOwed1 = - uint128( - FullMath.mulDiv( - feeGrowthInside1X128 - _self.feeGrowthInside1LastX128, - _self.liquidity, - FixedPoint128.Q128 - ) - ); - - // update the position - if (liquidityDelta != 0) self.liquidity = liquidityNext; - self.feeGrowthInside0LastX128 = feeGrowthInside0X128; - self.feeGrowthInside1LastX128 = feeGrowthInside1X128; - if (tokensOwed0 > 0 || tokensOwed1 > 0) { - // overflow is acceptable, have to withdraw before you hit type(uint128).max fees - self.tokensOwed0 += tokensOwed0; - self.tokensOwed1 += tokensOwed1; - } - } -} diff --git a/contract/lib/v3-core/contracts/libraries/SafeCast.sol b/contract/lib/v3-core/contracts/libraries/SafeCast.sol deleted file mode 100644 index a8ea229..0000000 --- a/contract/lib/v3-core/contracts/libraries/SafeCast.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Safe casting methods -/// @notice Contains methods for safely casting between types -library SafeCast { - /// @notice Cast a uint256 to a uint160, revert on overflow - /// @param y The uint256 to be downcasted - /// @return z The downcasted integer, now type uint160 - function toUint160(uint256 y) internal pure returns (uint160 z) { - require((z = uint160(y)) == y); - } - - /// @notice Cast a int256 to a int128, revert on overflow or underflow - /// @param y The int256 to be downcasted - /// @return z The downcasted integer, now type int128 - function toInt128(int256 y) internal pure returns (int128 z) { - require((z = int128(y)) == y); - } - - /// @notice Cast a uint256 to a int256, revert on overflow - /// @param y The uint256 to be casted - /// @return z The casted integer, now type int256 - function toInt256(uint256 y) internal pure returns (int256 z) { - require(y < 2**255); - z = int256(y); - } -} diff --git a/contract/lib/v3-core/contracts/libraries/SqrtPriceMath.sol b/contract/lib/v3-core/contracts/libraries/SqrtPriceMath.sol deleted file mode 100644 index 685f485..0000000 --- a/contract/lib/v3-core/contracts/libraries/SqrtPriceMath.sol +++ /dev/null @@ -1,227 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.5.0; - -import './LowGasSafeMath.sol'; -import './SafeCast.sol'; - -import './FullMath.sol'; -import './UnsafeMath.sol'; -import './FixedPoint96.sol'; - -/// @title Functions based on Q64.96 sqrt price and liquidity -/// @notice Contains the math that uses square root of price as a Q64.96 and liquidity to compute deltas -library SqrtPriceMath { - using LowGasSafeMath for uint256; - using SafeCast for uint256; - - /// @notice Gets the next sqrt price given a delta of token0 - /// @dev Always rounds up, because in the exact output case (increasing price) we need to move the price at least - /// far enough to get the desired output amount, and in the exact input case (decreasing price) we need to move the - /// price less in order to not send too much output. - /// The most precise formula for this is liquidity * sqrtPX96 / (liquidity +- amount * sqrtPX96), - /// if this is impossible because of overflow, we calculate liquidity / (liquidity / sqrtPX96 +- amount). - /// @param sqrtPX96 The starting price, i.e. before accounting for the token0 delta - /// @param liquidity The amount of usable liquidity - /// @param amount How much of token0 to add or remove from virtual reserves - /// @param add Whether to add or remove the amount of token0 - /// @return The price after adding or removing amount, depending on add - function getNextSqrtPriceFromAmount0RoundingUp( - uint160 sqrtPX96, - uint128 liquidity, - uint256 amount, - bool add - ) internal pure returns (uint160) { - // we short circuit amount == 0 because the result is otherwise not guaranteed to equal the input price - if (amount == 0) return sqrtPX96; - uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; - - if (add) { - uint256 product; - if ((product = amount * sqrtPX96) / amount == sqrtPX96) { - uint256 denominator = numerator1 + product; - if (denominator >= numerator1) - // always fits in 160 bits - return uint160(FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)); - } - - return uint160(UnsafeMath.divRoundingUp(numerator1, (numerator1 / sqrtPX96).add(amount))); - } else { - uint256 product; - // if the product overflows, we know the denominator underflows - // in addition, we must check that the denominator does not underflow - require((product = amount * sqrtPX96) / amount == sqrtPX96 && numerator1 > product); - uint256 denominator = numerator1 - product; - return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator).toUint160(); - } - } - - /// @notice Gets the next sqrt price given a delta of token1 - /// @dev Always rounds down, because in the exact output case (decreasing price) we need to move the price at least - /// far enough to get the desired output amount, and in the exact input case (increasing price) we need to move the - /// price less in order to not send too much output. - /// The formula we compute is within <1 wei of the lossless version: sqrtPX96 +- amount / liquidity - /// @param sqrtPX96 The starting price, i.e., before accounting for the token1 delta - /// @param liquidity The amount of usable liquidity - /// @param amount How much of token1 to add, or remove, from virtual reserves - /// @param add Whether to add, or remove, the amount of token1 - /// @return The price after adding or removing `amount` - function getNextSqrtPriceFromAmount1RoundingDown( - uint160 sqrtPX96, - uint128 liquidity, - uint256 amount, - bool add - ) internal pure returns (uint160) { - // if we're adding (subtracting), rounding down requires rounding the quotient down (up) - // in both cases, avoid a mulDiv for most inputs - if (add) { - uint256 quotient = - ( - amount <= type(uint160).max - ? (amount << FixedPoint96.RESOLUTION) / liquidity - : FullMath.mulDiv(amount, FixedPoint96.Q96, liquidity) - ); - - return uint256(sqrtPX96).add(quotient).toUint160(); - } else { - uint256 quotient = - ( - amount <= type(uint160).max - ? UnsafeMath.divRoundingUp(amount << FixedPoint96.RESOLUTION, liquidity) - : FullMath.mulDivRoundingUp(amount, FixedPoint96.Q96, liquidity) - ); - - require(sqrtPX96 > quotient); - // always fits 160 bits - return uint160(sqrtPX96 - quotient); - } - } - - /// @notice Gets the next sqrt price given an input amount of token0 or token1 - /// @dev Throws if price or liquidity are 0, or if the next price is out of bounds - /// @param sqrtPX96 The starting price, i.e., before accounting for the input amount - /// @param liquidity The amount of usable liquidity - /// @param amountIn How much of token0, or token1, is being swapped in - /// @param zeroForOne Whether the amount in is token0 or token1 - /// @return sqrtQX96 The price after adding the input amount to token0 or token1 - function getNextSqrtPriceFromInput( - uint160 sqrtPX96, - uint128 liquidity, - uint256 amountIn, - bool zeroForOne - ) internal pure returns (uint160 sqrtQX96) { - require(sqrtPX96 > 0); - require(liquidity > 0); - - // round to make sure that we don't pass the target price - return - zeroForOne - ? getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true) - : getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true); - } - - /// @notice Gets the next sqrt price given an output amount of token0 or token1 - /// @dev Throws if price or liquidity are 0 or the next price is out of bounds - /// @param sqrtPX96 The starting price before accounting for the output amount - /// @param liquidity The amount of usable liquidity - /// @param amountOut How much of token0, or token1, is being swapped out - /// @param zeroForOne Whether the amount out is token0 or token1 - /// @return sqrtQX96 The price after removing the output amount of token0 or token1 - function getNextSqrtPriceFromOutput( - uint160 sqrtPX96, - uint128 liquidity, - uint256 amountOut, - bool zeroForOne - ) internal pure returns (uint160 sqrtQX96) { - require(sqrtPX96 > 0); - require(liquidity > 0); - - // round to make sure that we pass the target price - return - zeroForOne - ? getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false) - : getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false); - } - - /// @notice Gets the amount0 delta between two prices - /// @dev Calculates liquidity / sqrt(lower) - liquidity / sqrt(upper), - /// i.e. liquidity * (sqrt(upper) - sqrt(lower)) / (sqrt(upper) * sqrt(lower)) - /// @param sqrtRatioAX96 A sqrt price - /// @param sqrtRatioBX96 Another sqrt price - /// @param liquidity The amount of usable liquidity - /// @param roundUp Whether to round the amount up or down - /// @return amount0 Amount of token0 required to cover a position of size liquidity between the two passed prices - function getAmount0Delta( - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - uint128 liquidity, - bool roundUp - ) internal pure returns (uint256 amount0) { - if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); - - uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; - uint256 numerator2 = sqrtRatioBX96 - sqrtRatioAX96; - - require(sqrtRatioAX96 > 0); - - return - roundUp - ? UnsafeMath.divRoundingUp( - FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), - sqrtRatioAX96 - ) - : FullMath.mulDiv(numerator1, numerator2, sqrtRatioBX96) / sqrtRatioAX96; - } - - /// @notice Gets the amount1 delta between two prices - /// @dev Calculates liquidity * (sqrt(upper) - sqrt(lower)) - /// @param sqrtRatioAX96 A sqrt price - /// @param sqrtRatioBX96 Another sqrt price - /// @param liquidity The amount of usable liquidity - /// @param roundUp Whether to round the amount up, or down - /// @return amount1 Amount of token1 required to cover a position of size liquidity between the two passed prices - function getAmount1Delta( - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - uint128 liquidity, - bool roundUp - ) internal pure returns (uint256 amount1) { - if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); - - return - roundUp - ? FullMath.mulDivRoundingUp(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96) - : FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96); - } - - /// @notice Helper that gets signed token0 delta - /// @param sqrtRatioAX96 A sqrt price - /// @param sqrtRatioBX96 Another sqrt price - /// @param liquidity The change in liquidity for which to compute the amount0 delta - /// @return amount0 Amount of token0 corresponding to the passed liquidityDelta between the two prices - function getAmount0Delta( - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - int128 liquidity - ) internal pure returns (int256 amount0) { - return - liquidity < 0 - ? -getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(-liquidity), false).toInt256() - : getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(liquidity), true).toInt256(); - } - - /// @notice Helper that gets signed token1 delta - /// @param sqrtRatioAX96 A sqrt price - /// @param sqrtRatioBX96 Another sqrt price - /// @param liquidity The change in liquidity for which to compute the amount1 delta - /// @return amount1 Amount of token1 corresponding to the passed liquidityDelta between the two prices - function getAmount1Delta( - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - int128 liquidity - ) internal pure returns (int256 amount1) { - return - liquidity < 0 - ? -getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(-liquidity), false).toInt256() - : getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(liquidity), true).toInt256(); - } -} diff --git a/contract/lib/v3-core/contracts/libraries/SwapMath.sol b/contract/lib/v3-core/contracts/libraries/SwapMath.sol deleted file mode 100644 index ee176fb..0000000 --- a/contract/lib/v3-core/contracts/libraries/SwapMath.sol +++ /dev/null @@ -1,98 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.5.0; - -import './FullMath.sol'; -import './SqrtPriceMath.sol'; - -/// @title Computes the result of a swap within ticks -/// @notice Contains methods for computing the result of a swap within a single tick price range, i.e., a single tick. -library SwapMath { - /// @notice Computes the result of swapping some amount in, or amount out, given the parameters of the swap - /// @dev The fee, plus the amount in, will never exceed the amount remaining if the swap's `amountSpecified` is positive - /// @param sqrtRatioCurrentX96 The current sqrt price of the pool - /// @param sqrtRatioTargetX96 The price that cannot be exceeded, from which the direction of the swap is inferred - /// @param liquidity The usable liquidity - /// @param amountRemaining How much input or output amount is remaining to be swapped in/out - /// @param feePips The fee taken from the input amount, expressed in hundredths of a bip - /// @return sqrtRatioNextX96 The price after swapping the amount in/out, not to exceed the price target - /// @return amountIn The amount to be swapped in, of either token0 or token1, based on the direction of the swap - /// @return amountOut The amount to be received, of either token0 or token1, based on the direction of the swap - /// @return feeAmount The amount of input that will be taken as a fee - function computeSwapStep( - uint160 sqrtRatioCurrentX96, - uint160 sqrtRatioTargetX96, - uint128 liquidity, - int256 amountRemaining, - uint24 feePips - ) - internal - pure - returns ( - uint160 sqrtRatioNextX96, - uint256 amountIn, - uint256 amountOut, - uint256 feeAmount - ) - { - bool zeroForOne = sqrtRatioCurrentX96 >= sqrtRatioTargetX96; - bool exactIn = amountRemaining >= 0; - - if (exactIn) { - uint256 amountRemainingLessFee = FullMath.mulDiv(uint256(amountRemaining), 1e6 - feePips, 1e6); - amountIn = zeroForOne - ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true) - : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true); - if (amountRemainingLessFee >= amountIn) sqrtRatioNextX96 = sqrtRatioTargetX96; - else - sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput( - sqrtRatioCurrentX96, - liquidity, - amountRemainingLessFee, - zeroForOne - ); - } else { - amountOut = zeroForOne - ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false) - : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false); - if (uint256(-amountRemaining) >= amountOut) sqrtRatioNextX96 = sqrtRatioTargetX96; - else - sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput( - sqrtRatioCurrentX96, - liquidity, - uint256(-amountRemaining), - zeroForOne - ); - } - - bool max = sqrtRatioTargetX96 == sqrtRatioNextX96; - - // get the input/output amounts - if (zeroForOne) { - amountIn = max && exactIn - ? amountIn - : SqrtPriceMath.getAmount0Delta(sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true); - amountOut = max && !exactIn - ? amountOut - : SqrtPriceMath.getAmount1Delta(sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false); - } else { - amountIn = max && exactIn - ? amountIn - : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioNextX96, liquidity, true); - amountOut = max && !exactIn - ? amountOut - : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioNextX96, liquidity, false); - } - - // cap the output amount to not exceed the remaining output amount - if (!exactIn && amountOut > uint256(-amountRemaining)) { - amountOut = uint256(-amountRemaining); - } - - if (exactIn && sqrtRatioNextX96 != sqrtRatioTargetX96) { - // we didn't reach the target, so take the remainder of the maximum input as fee - feeAmount = uint256(amountRemaining) - amountIn; - } else { - feeAmount = FullMath.mulDivRoundingUp(amountIn, feePips, 1e6 - feePips); - } - } -} diff --git a/contract/lib/v3-core/contracts/libraries/Tick.sol b/contract/lib/v3-core/contracts/libraries/Tick.sol deleted file mode 100644 index 13d3428..0000000 --- a/contract/lib/v3-core/contracts/libraries/Tick.sol +++ /dev/null @@ -1,183 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.5.0; - -import './LowGasSafeMath.sol'; -import './SafeCast.sol'; - -import './TickMath.sol'; -import './LiquidityMath.sol'; - -/// @title Tick -/// @notice Contains functions for managing tick processes and relevant calculations -library Tick { - using LowGasSafeMath for int256; - using SafeCast for int256; - - // info stored for each initialized individual tick - struct Info { - // the total position liquidity that references this tick - uint128 liquidityGross; - // amount of net liquidity added (subtracted) when tick is crossed from left to right (right to left), - int128 liquidityNet; - // fee growth per unit of liquidity on the _other_ side of this tick (relative to the current tick) - // only has relative meaning, not absolute — the value depends on when the tick is initialized - uint256 feeGrowthOutside0X128; - uint256 feeGrowthOutside1X128; - // the cumulative tick value on the other side of the tick - int56 tickCumulativeOutside; - // the seconds per unit of liquidity on the _other_ side of this tick (relative to the current tick) - // only has relative meaning, not absolute — the value depends on when the tick is initialized - uint160 secondsPerLiquidityOutsideX128; - // the seconds spent on the other side of the tick (relative to the current tick) - // only has relative meaning, not absolute — the value depends on when the tick is initialized - uint32 secondsOutside; - // true iff the tick is initialized, i.e. the value is exactly equivalent to the expression liquidityGross != 0 - // these 8 bits are set to prevent fresh sstores when crossing newly initialized ticks - bool initialized; - } - - /// @notice Derives max liquidity per tick from given tick spacing - /// @dev Executed within the pool constructor - /// @param tickSpacing The amount of required tick separation, realized in multiples of `tickSpacing` - /// e.g., a tickSpacing of 3 requires ticks to be initialized every 3rd tick i.e., ..., -6, -3, 0, 3, 6, ... - /// @return The max liquidity per tick - function tickSpacingToMaxLiquidityPerTick(int24 tickSpacing) internal pure returns (uint128) { - int24 minTick = (TickMath.MIN_TICK / tickSpacing) * tickSpacing; - int24 maxTick = (TickMath.MAX_TICK / tickSpacing) * tickSpacing; - uint24 numTicks = uint24((maxTick - minTick) / tickSpacing) + 1; - return type(uint128).max / numTicks; - } - - /// @notice Retrieves fee growth data - /// @param self The mapping containing all tick information for initialized ticks - /// @param tickLower The lower tick boundary of the position - /// @param tickUpper The upper tick boundary of the position - /// @param tickCurrent The current tick - /// @param feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0 - /// @param feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1 - /// @return feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries - /// @return feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries - function getFeeGrowthInside( - mapping(int24 => Tick.Info) storage self, - int24 tickLower, - int24 tickUpper, - int24 tickCurrent, - uint256 feeGrowthGlobal0X128, - uint256 feeGrowthGlobal1X128 - ) internal view returns (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) { - Info storage lower = self[tickLower]; - Info storage upper = self[tickUpper]; - - // calculate fee growth below - uint256 feeGrowthBelow0X128; - uint256 feeGrowthBelow1X128; - if (tickCurrent >= tickLower) { - feeGrowthBelow0X128 = lower.feeGrowthOutside0X128; - feeGrowthBelow1X128 = lower.feeGrowthOutside1X128; - } else { - feeGrowthBelow0X128 = feeGrowthGlobal0X128 - lower.feeGrowthOutside0X128; - feeGrowthBelow1X128 = feeGrowthGlobal1X128 - lower.feeGrowthOutside1X128; - } - - // calculate fee growth above - uint256 feeGrowthAbove0X128; - uint256 feeGrowthAbove1X128; - if (tickCurrent < tickUpper) { - feeGrowthAbove0X128 = upper.feeGrowthOutside0X128; - feeGrowthAbove1X128 = upper.feeGrowthOutside1X128; - } else { - feeGrowthAbove0X128 = feeGrowthGlobal0X128 - upper.feeGrowthOutside0X128; - feeGrowthAbove1X128 = feeGrowthGlobal1X128 - upper.feeGrowthOutside1X128; - } - - feeGrowthInside0X128 = feeGrowthGlobal0X128 - feeGrowthBelow0X128 - feeGrowthAbove0X128; - feeGrowthInside1X128 = feeGrowthGlobal1X128 - feeGrowthBelow1X128 - feeGrowthAbove1X128; - } - - /// @notice Updates a tick and returns true if the tick was flipped from initialized to uninitialized, or vice versa - /// @param self The mapping containing all tick information for initialized ticks - /// @param tick The tick that will be updated - /// @param tickCurrent The current tick - /// @param liquidityDelta A new amount of liquidity to be added (subtracted) when tick is crossed from left to right (right to left) - /// @param feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0 - /// @param feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1 - /// @param secondsPerLiquidityCumulativeX128 The all-time seconds per max(1, liquidity) of the pool - /// @param time The current block timestamp cast to a uint32 - /// @param upper true for updating a position's upper tick, or false for updating a position's lower tick - /// @param maxLiquidity The maximum liquidity allocation for a single tick - /// @return flipped Whether the tick was flipped from initialized to uninitialized, or vice versa - function update( - mapping(int24 => Tick.Info) storage self, - int24 tick, - int24 tickCurrent, - int128 liquidityDelta, - uint256 feeGrowthGlobal0X128, - uint256 feeGrowthGlobal1X128, - uint160 secondsPerLiquidityCumulativeX128, - int56 tickCumulative, - uint32 time, - bool upper, - uint128 maxLiquidity - ) internal returns (bool flipped) { - Tick.Info storage info = self[tick]; - - uint128 liquidityGrossBefore = info.liquidityGross; - uint128 liquidityGrossAfter = LiquidityMath.addDelta(liquidityGrossBefore, liquidityDelta); - - require(liquidityGrossAfter <= maxLiquidity, 'LO'); - - flipped = (liquidityGrossAfter == 0) != (liquidityGrossBefore == 0); - - if (liquidityGrossBefore == 0) { - // by convention, we assume that all growth before a tick was initialized happened _below_ the tick - if (tick <= tickCurrent) { - info.feeGrowthOutside0X128 = feeGrowthGlobal0X128; - info.feeGrowthOutside1X128 = feeGrowthGlobal1X128; - info.secondsPerLiquidityOutsideX128 = secondsPerLiquidityCumulativeX128; - info.tickCumulativeOutside = tickCumulative; - info.secondsOutside = time; - } - info.initialized = true; - } - - info.liquidityGross = liquidityGrossAfter; - - // when the lower (upper) tick is crossed left to right (right to left), liquidity must be added (removed) - info.liquidityNet = upper - ? int256(info.liquidityNet).sub(liquidityDelta).toInt128() - : int256(info.liquidityNet).add(liquidityDelta).toInt128(); - } - - /// @notice Clears tick data - /// @param self The mapping containing all initialized tick information for initialized ticks - /// @param tick The tick that will be cleared - function clear(mapping(int24 => Tick.Info) storage self, int24 tick) internal { - delete self[tick]; - } - - /// @notice Transitions to next tick as needed by price movement - /// @param self The mapping containing all tick information for initialized ticks - /// @param tick The destination tick of the transition - /// @param feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0 - /// @param feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1 - /// @param secondsPerLiquidityCumulativeX128 The current seconds per liquidity - /// @param time The current block.timestamp - /// @return liquidityNet The amount of liquidity added (subtracted) when tick is crossed from left to right (right to left) - function cross( - mapping(int24 => Tick.Info) storage self, - int24 tick, - uint256 feeGrowthGlobal0X128, - uint256 feeGrowthGlobal1X128, - uint160 secondsPerLiquidityCumulativeX128, - int56 tickCumulative, - uint32 time - ) internal returns (int128 liquidityNet) { - Tick.Info storage info = self[tick]; - info.feeGrowthOutside0X128 = feeGrowthGlobal0X128 - info.feeGrowthOutside0X128; - info.feeGrowthOutside1X128 = feeGrowthGlobal1X128 - info.feeGrowthOutside1X128; - info.secondsPerLiquidityOutsideX128 = secondsPerLiquidityCumulativeX128 - info.secondsPerLiquidityOutsideX128; - info.tickCumulativeOutside = tickCumulative - info.tickCumulativeOutside; - info.secondsOutside = time - info.secondsOutside; - liquidityNet = info.liquidityNet; - } -} diff --git a/contract/lib/v3-core/contracts/libraries/TickBitmap.sol b/contract/lib/v3-core/contracts/libraries/TickBitmap.sol deleted file mode 100644 index 3c43585..0000000 --- a/contract/lib/v3-core/contracts/libraries/TickBitmap.sol +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.5.0; - -import './BitMath.sol'; - -/// @title Packed tick initialized state library -/// @notice Stores a packed mapping of tick index to its initialized state -/// @dev The mapping uses int16 for keys since ticks are represented as int24 and there are 256 (2^8) values per word. -library TickBitmap { - /// @notice Computes the position in the mapping where the initialized bit for a tick lives - /// @param tick The tick for which to compute the position - /// @return wordPos The key in the mapping containing the word in which the bit is stored - /// @return bitPos The bit position in the word where the flag is stored - function position(int24 tick) private pure returns (int16 wordPos, uint8 bitPos) { - wordPos = int16(tick >> 8); - bitPos = uint8(tick % 256); - } - - /// @notice Flips the initialized state for a given tick from false to true, or vice versa - /// @param self The mapping in which to flip the tick - /// @param tick The tick to flip - /// @param tickSpacing The spacing between usable ticks - function flipTick( - mapping(int16 => uint256) storage self, - int24 tick, - int24 tickSpacing - ) internal { - require(tick % tickSpacing == 0); // ensure that the tick is spaced - (int16 wordPos, uint8 bitPos) = position(tick / tickSpacing); - uint256 mask = 1 << bitPos; - self[wordPos] ^= mask; - } - - /// @notice Returns the next initialized tick contained in the same word (or adjacent word) as the tick that is either - /// to the left (less than or equal to) or right (greater than) of the given tick - /// @param self The mapping in which to compute the next initialized tick - /// @param tick The starting tick - /// @param tickSpacing The spacing between usable ticks - /// @param lte Whether to search for the next initialized tick to the left (less than or equal to the starting tick) - /// @return next The next initialized or uninitialized tick up to 256 ticks away from the current tick - /// @return initialized Whether the next tick is initialized, as the function only searches within up to 256 ticks - function nextInitializedTickWithinOneWord( - mapping(int16 => uint256) storage self, - int24 tick, - int24 tickSpacing, - bool lte - ) internal view returns (int24 next, bool initialized) { - int24 compressed = tick / tickSpacing; - if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity - - if (lte) { - (int16 wordPos, uint8 bitPos) = position(compressed); - // all the 1s at or to the right of the current bitPos - uint256 mask = (1 << bitPos) - 1 + (1 << bitPos); - uint256 masked = self[wordPos] & mask; - - // if there are no initialized ticks to the right of or at the current tick, return rightmost in the word - initialized = masked != 0; - // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick - next = initialized - ? (compressed - int24(bitPos - BitMath.mostSignificantBit(masked))) * tickSpacing - : (compressed - int24(bitPos)) * tickSpacing; - } else { - // start from the word of the next tick, since the current tick state doesn't matter - (int16 wordPos, uint8 bitPos) = position(compressed + 1); - // all the 1s at or to the left of the bitPos - uint256 mask = ~((1 << bitPos) - 1); - uint256 masked = self[wordPos] & mask; - - // if there are no initialized ticks to the left of the current tick, return leftmost in the word - initialized = masked != 0; - // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick - next = initialized - ? (compressed + 1 + int24(BitMath.leastSignificantBit(masked) - bitPos)) * tickSpacing - : (compressed + 1 + int24(type(uint8).max - bitPos)) * tickSpacing; - } - } -} diff --git a/contract/lib/v3-core/contracts/libraries/TickMath.sol b/contract/lib/v3-core/contracts/libraries/TickMath.sol deleted file mode 100644 index 378e445..0000000 --- a/contract/lib/v3-core/contracts/libraries/TickMath.sol +++ /dev/null @@ -1,205 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Math library for computing sqrt prices from ticks and vice versa -/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports -/// prices between 2**-128 and 2**128 -library TickMath { - /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128 - int24 internal constant MIN_TICK = -887272; - /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128 - int24 internal constant MAX_TICK = -MIN_TICK; - - /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) - uint160 internal constant MIN_SQRT_RATIO = 4295128739; - /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) - uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; - - /// @notice Calculates sqrt(1.0001^tick) * 2^96 - /// @dev Throws if |tick| > max tick - /// @param tick The input tick for the above formula - /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0) - /// at the given tick - function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) { - uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick)); - require(absTick <= uint256(MAX_TICK), 'T'); - - uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000; - if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128; - if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128; - if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128; - if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128; - if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128; - if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128; - if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128; - if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128; - if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128; - if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128; - if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128; - if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128; - if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128; - if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128; - if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128; - if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128; - if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128; - if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128; - if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128; - - if (tick > 0) ratio = type(uint256).max / ratio; - - // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96. - // we then downcast because we know the result always fits within 160 bits due to our tick input constraint - // we round up in the division so getTickAtSqrtRatio of the output price is always consistent - sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)); - } - - /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio - /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may - /// ever return. - /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96 - /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio - function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) { - // second inequality must be < because the price can never reach the price at the max tick - require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R'); - uint256 ratio = uint256(sqrtPriceX96) << 32; - - uint256 r = ratio; - uint256 msb = 0; - - assembly { - let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := shl(5, gt(r, 0xFFFFFFFF)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := shl(4, gt(r, 0xFFFF)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := shl(3, gt(r, 0xFF)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := shl(2, gt(r, 0xF)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := shl(1, gt(r, 0x3)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := gt(r, 0x1) - msb := or(msb, f) - } - - if (msb >= 128) r = ratio >> (msb - 127); - else r = ratio << (127 - msb); - - int256 log_2 = (int256(msb) - 128) << 64; - - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(63, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(62, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(61, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(60, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(59, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(58, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(57, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(56, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(55, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(54, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(53, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(52, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(51, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(50, f)) - } - - int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number - - int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128); - int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128); - - tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow; - } -} diff --git a/contract/lib/v3-core/contracts/libraries/TransferHelper.sol b/contract/lib/v3-core/contracts/libraries/TransferHelper.sol deleted file mode 100644 index 25d6309..0000000 --- a/contract/lib/v3-core/contracts/libraries/TransferHelper.sol +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.6.0; - -import '../interfaces/IERC20Minimal.sol'; - -/// @title TransferHelper -/// @notice Contains helper methods for interacting with ERC20 tokens that do not consistently return true/false -library TransferHelper { - /// @notice Transfers tokens from msg.sender to a recipient - /// @dev Calls transfer on token contract, errors with TF if transfer fails - /// @param token The contract address of the token which will be transferred - /// @param to The recipient of the transfer - /// @param value The value of the transfer - function safeTransfer( - address token, - address to, - uint256 value - ) internal { - (bool success, bytes memory data) = - token.call(abi.encodeWithSelector(IERC20Minimal.transfer.selector, to, value)); - require(success && (data.length == 0 || abi.decode(data, (bool))), 'TF'); - } -} diff --git a/contract/lib/v3-core/contracts/libraries/UnsafeMath.sol b/contract/lib/v3-core/contracts/libraries/UnsafeMath.sol deleted file mode 100644 index f62f846..0000000 --- a/contract/lib/v3-core/contracts/libraries/UnsafeMath.sol +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity >=0.5.0; - -/// @title Math functions that do not check inputs or outputs -/// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks -library UnsafeMath { - /// @notice Returns ceil(x / y) - /// @dev division by 0 has unspecified behavior, and must be checked externally - /// @param x The dividend - /// @param y The divisor - /// @return z The quotient, ceil(x / y) - function divRoundingUp(uint256 x, uint256 y) internal pure returns (uint256 z) { - assembly { - z := add(div(x, y), gt(mod(x, y), 0)) - } - } -} diff --git a/contract/lib/v3-core/contracts/test/BitMathEchidnaTest.sol b/contract/lib/v3-core/contracts/test/BitMathEchidnaTest.sol deleted file mode 100644 index ca7d34f..0000000 --- a/contract/lib/v3-core/contracts/test/BitMathEchidnaTest.sol +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/BitMath.sol'; - -contract BitMathEchidnaTest { - function mostSignificantBitInvariant(uint256 input) external pure { - uint8 msb = BitMath.mostSignificantBit(input); - assert(input >= (uint256(2)**msb)); - assert(msb == 255 || input < uint256(2)**(msb + 1)); - } - - function leastSignificantBitInvariant(uint256 input) external pure { - uint8 lsb = BitMath.leastSignificantBit(input); - assert(input & (uint256(2)**lsb) != 0); - assert(input & (uint256(2)**lsb - 1) == 0); - } -} diff --git a/contract/lib/v3-core/contracts/test/BitMathTest.sol b/contract/lib/v3-core/contracts/test/BitMathTest.sol deleted file mode 100644 index 2b387be..0000000 --- a/contract/lib/v3-core/contracts/test/BitMathTest.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/BitMath.sol'; - -contract BitMathTest { - function mostSignificantBit(uint256 x) external pure returns (uint8 r) { - return BitMath.mostSignificantBit(x); - } - - function getGasCostOfMostSignificantBit(uint256 x) external view returns (uint256) { - uint256 gasBefore = gasleft(); - BitMath.mostSignificantBit(x); - return gasBefore - gasleft(); - } - - function leastSignificantBit(uint256 x) external pure returns (uint8 r) { - return BitMath.leastSignificantBit(x); - } - - function getGasCostOfLeastSignificantBit(uint256 x) external view returns (uint256) { - uint256 gasBefore = gasleft(); - BitMath.leastSignificantBit(x); - return gasBefore - gasleft(); - } -} diff --git a/contract/lib/v3-core/contracts/test/FullMathEchidnaTest.sol b/contract/lib/v3-core/contracts/test/FullMathEchidnaTest.sol deleted file mode 100644 index 9e1063d..0000000 --- a/contract/lib/v3-core/contracts/test/FullMathEchidnaTest.sol +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/FullMath.sol'; - -contract FullMathEchidnaTest { - function checkMulDivRounding( - uint256 x, - uint256 y, - uint256 d - ) external pure { - require(d > 0); - - uint256 ceiled = FullMath.mulDivRoundingUp(x, y, d); - uint256 floored = FullMath.mulDiv(x, y, d); - - if (mulmod(x, y, d) > 0) { - assert(ceiled - floored == 1); - } else { - assert(ceiled == floored); - } - } - - function checkMulDiv( - uint256 x, - uint256 y, - uint256 d - ) external pure { - require(d > 0); - uint256 z = FullMath.mulDiv(x, y, d); - if (x == 0 || y == 0) { - assert(z == 0); - return; - } - - // recompute x and y via mulDiv of the result of floor(x*y/d), should always be less than original inputs by < d - uint256 x2 = FullMath.mulDiv(z, d, y); - uint256 y2 = FullMath.mulDiv(z, d, x); - assert(x2 <= x); - assert(y2 <= y); - - assert(x - x2 < d); - assert(y - y2 < d); - } - - function checkMulDivRoundingUp( - uint256 x, - uint256 y, - uint256 d - ) external pure { - require(d > 0); - uint256 z = FullMath.mulDivRoundingUp(x, y, d); - if (x == 0 || y == 0) { - assert(z == 0); - return; - } - - // recompute x and y via mulDiv of the result of floor(x*y/d), should always be less than original inputs by < d - uint256 x2 = FullMath.mulDiv(z, d, y); - uint256 y2 = FullMath.mulDiv(z, d, x); - assert(x2 >= x); - assert(y2 >= y); - - assert(x2 - x < d); - assert(y2 - y < d); - } -} diff --git a/contract/lib/v3-core/contracts/test/FullMathTest.sol b/contract/lib/v3-core/contracts/test/FullMathTest.sol deleted file mode 100644 index ec59bc9..0000000 --- a/contract/lib/v3-core/contracts/test/FullMathTest.sol +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/FullMath.sol'; - -contract FullMathTest { - function mulDiv( - uint256 x, - uint256 y, - uint256 z - ) external pure returns (uint256) { - return FullMath.mulDiv(x, y, z); - } - - function mulDivRoundingUp( - uint256 x, - uint256 y, - uint256 z - ) external pure returns (uint256) { - return FullMath.mulDivRoundingUp(x, y, z); - } -} diff --git a/contract/lib/v3-core/contracts/test/LiquidityMathTest.sol b/contract/lib/v3-core/contracts/test/LiquidityMathTest.sol deleted file mode 100644 index d85e0f1..0000000 --- a/contract/lib/v3-core/contracts/test/LiquidityMathTest.sol +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/LiquidityMath.sol'; - -contract LiquidityMathTest { - function addDelta(uint128 x, int128 y) external pure returns (uint128 z) { - return LiquidityMath.addDelta(x, y); - } - - function getGasCostOfAddDelta(uint128 x, int128 y) external view returns (uint256) { - uint256 gasBefore = gasleft(); - LiquidityMath.addDelta(x, y); - return gasBefore - gasleft(); - } -} diff --git a/contract/lib/v3-core/contracts/test/LowGasSafeMathEchidnaTest.sol b/contract/lib/v3-core/contracts/test/LowGasSafeMathEchidnaTest.sol deleted file mode 100644 index 315531d..0000000 --- a/contract/lib/v3-core/contracts/test/LowGasSafeMathEchidnaTest.sol +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/LowGasSafeMath.sol'; - -contract LowGasSafeMathEchidnaTest { - function checkAdd(uint256 x, uint256 y) external pure { - uint256 z = LowGasSafeMath.add(x, y); - assert(z == x + y); - assert(z >= x && z >= y); - } - - function checkSub(uint256 x, uint256 y) external pure { - uint256 z = LowGasSafeMath.sub(x, y); - assert(z == x - y); - assert(z <= x); - } - - function checkMul(uint256 x, uint256 y) external pure { - uint256 z = LowGasSafeMath.mul(x, y); - assert(z == x * y); - assert(x == 0 || y == 0 || (z >= x && z >= y)); - } - - function checkAddi(int256 x, int256 y) external pure { - int256 z = LowGasSafeMath.add(x, y); - assert(z == x + y); - assert(y < 0 ? z < x : z >= x); - } - - function checkSubi(int256 x, int256 y) external pure { - int256 z = LowGasSafeMath.sub(x, y); - assert(z == x - y); - assert(y < 0 ? z > x : z <= x); - } -} diff --git a/contract/lib/v3-core/contracts/test/MockTimeUniswapV3Pool.sol b/contract/lib/v3-core/contracts/test/MockTimeUniswapV3Pool.sol deleted file mode 100644 index 66d2566..0000000 --- a/contract/lib/v3-core/contracts/test/MockTimeUniswapV3Pool.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../UniswapV3Pool.sol'; - -// used for testing time dependent behavior -contract MockTimeUniswapV3Pool is UniswapV3Pool { - // Monday, October 5, 2020 9:00:00 AM GMT-05:00 - uint256 public time = 1601906400; - - function setFeeGrowthGlobal0X128(uint256 _feeGrowthGlobal0X128) external { - feeGrowthGlobal0X128 = _feeGrowthGlobal0X128; - } - - function setFeeGrowthGlobal1X128(uint256 _feeGrowthGlobal1X128) external { - feeGrowthGlobal1X128 = _feeGrowthGlobal1X128; - } - - function advanceTime(uint256 by) external { - time += by; - } - - function _blockTimestamp() internal view override returns (uint32) { - return uint32(time); - } -} diff --git a/contract/lib/v3-core/contracts/test/MockTimeUniswapV3PoolDeployer.sol b/contract/lib/v3-core/contracts/test/MockTimeUniswapV3PoolDeployer.sol deleted file mode 100644 index a274fb7..0000000 --- a/contract/lib/v3-core/contracts/test/MockTimeUniswapV3PoolDeployer.sol +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../interfaces/IUniswapV3PoolDeployer.sol'; - -import './MockTimeUniswapV3Pool.sol'; - -contract MockTimeUniswapV3PoolDeployer is IUniswapV3PoolDeployer { - struct Parameters { - address factory; - address token0; - address token1; - uint24 fee; - int24 tickSpacing; - } - - Parameters public override parameters; - - event PoolDeployed(address pool); - - function deploy( - address factory, - address token0, - address token1, - uint24 fee, - int24 tickSpacing - ) external returns (address pool) { - parameters = Parameters({factory: factory, token0: token0, token1: token1, fee: fee, tickSpacing: tickSpacing}); - pool = address( - new MockTimeUniswapV3Pool{salt: keccak256(abi.encodePacked(token0, token1, fee, tickSpacing))}() - ); - emit PoolDeployed(pool); - delete parameters; - } -} diff --git a/contract/lib/v3-core/contracts/test/NoDelegateCallTest.sol b/contract/lib/v3-core/contracts/test/NoDelegateCallTest.sol deleted file mode 100644 index 8830d5c..0000000 --- a/contract/lib/v3-core/contracts/test/NoDelegateCallTest.sol +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../NoDelegateCall.sol'; - -contract NoDelegateCallTest is NoDelegateCall { - function canBeDelegateCalled() public view returns (uint256) { - return block.timestamp / 5; - } - - function cannotBeDelegateCalled() public view noDelegateCall returns (uint256) { - return block.timestamp / 5; - } - - function getGasCostOfCanBeDelegateCalled() external view returns (uint256) { - uint256 gasBefore = gasleft(); - canBeDelegateCalled(); - return gasBefore - gasleft(); - } - - function getGasCostOfCannotBeDelegateCalled() external view returns (uint256) { - uint256 gasBefore = gasleft(); - cannotBeDelegateCalled(); - return gasBefore - gasleft(); - } - - function callsIntoNoDelegateCallFunction() external view { - noDelegateCallPrivate(); - } - - function noDelegateCallPrivate() private view noDelegateCall {} -} diff --git a/contract/lib/v3-core/contracts/test/OracleEchidnaTest.sol b/contract/lib/v3-core/contracts/test/OracleEchidnaTest.sol deleted file mode 100644 index 2cf5f2e..0000000 --- a/contract/lib/v3-core/contracts/test/OracleEchidnaTest.sol +++ /dev/null @@ -1,137 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; -pragma abicoder v2; - -import './OracleTest.sol'; - -contract OracleEchidnaTest { - OracleTest private oracle; - - bool private initialized; - uint32 private timePassed; - - constructor() { - oracle = new OracleTest(); - } - - function initialize( - uint32 time, - int24 tick, - uint128 liquidity - ) external { - oracle.initialize(OracleTest.InitializeParams({time: time, tick: tick, liquidity: liquidity})); - initialized = true; - } - - function limitTimePassed(uint32 by) private { - require(timePassed + by >= timePassed); - timePassed += by; - } - - function advanceTime(uint32 by) public { - limitTimePassed(by); - oracle.advanceTime(by); - } - - // write an observation, then change tick and liquidity - function update( - uint32 advanceTimeBy, - int24 tick, - uint128 liquidity - ) external { - limitTimePassed(advanceTimeBy); - oracle.update(OracleTest.UpdateParams({advanceTimeBy: advanceTimeBy, tick: tick, liquidity: liquidity})); - } - - function grow(uint16 cardinality) external { - oracle.grow(cardinality); - } - - function checkTimeWeightedResultAssertions(uint32 secondsAgo0, uint32 secondsAgo1) private view { - require(secondsAgo0 != secondsAgo1); - require(initialized); - // secondsAgo0 should be the larger one - if (secondsAgo0 < secondsAgo1) (secondsAgo0, secondsAgo1) = (secondsAgo1, secondsAgo0); - - uint32 timeElapsed = secondsAgo0 - secondsAgo1; - - uint32[] memory secondsAgos = new uint32[](2); - secondsAgos[0] = secondsAgo0; - secondsAgos[1] = secondsAgo1; - - (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) = - oracle.observe(secondsAgos); - int56 timeWeightedTick = (tickCumulatives[1] - tickCumulatives[0]) / timeElapsed; - uint256 timeWeightedHarmonicMeanLiquidity = - (uint256(timeElapsed) * type(uint160).max) / - (uint256(secondsPerLiquidityCumulativeX128s[1] - secondsPerLiquidityCumulativeX128s[0]) << 32); - assert(timeWeightedHarmonicMeanLiquidity <= type(uint128).max); - assert(timeWeightedTick <= type(int24).max); - assert(timeWeightedTick >= type(int24).min); - } - - function echidna_indexAlwaysLtCardinality() external view returns (bool) { - return oracle.index() < oracle.cardinality() || !initialized; - } - - function echidna_AlwaysInitialized() external view returns (bool) { - (, , , bool isInitialized) = oracle.observations(0); - return oracle.cardinality() == 0 || isInitialized; - } - - function echidna_cardinalityAlwaysLteNext() external view returns (bool) { - return oracle.cardinality() <= oracle.cardinalityNext(); - } - - function echidna_canAlwaysObserve0IfInitialized() external view returns (bool) { - if (!initialized) { - return true; - } - uint32[] memory arr = new uint32[](1); - arr[0] = 0; - (bool success, ) = address(oracle).staticcall(abi.encodeWithSelector(OracleTest.observe.selector, arr)); - return success; - } - - function checkTwoAdjacentObservationsTickCumulativeModTimeElapsedAlways0(uint16 index) external view { - uint16 cardinality = oracle.cardinality(); - // check that the observations are initialized, and that the index is not the oldest observation - require(index < cardinality && index != (oracle.index() + 1) % cardinality); - - (uint32 blockTimestamp0, int56 tickCumulative0, , bool initialized0) = - oracle.observations(index == 0 ? cardinality - 1 : index - 1); - (uint32 blockTimestamp1, int56 tickCumulative1, , bool initialized1) = oracle.observations(index); - - require(initialized0); - require(initialized1); - - uint32 timeElapsed = blockTimestamp1 - blockTimestamp0; - assert(timeElapsed > 0); - assert((tickCumulative1 - tickCumulative0) % timeElapsed == 0); - } - - function checkTimeWeightedAveragesAlwaysFitsType(uint32 secondsAgo) external view { - require(initialized); - require(secondsAgo > 0); - uint32[] memory secondsAgos = new uint32[](2); - secondsAgos[0] = secondsAgo; - secondsAgos[1] = 0; - (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) = - oracle.observe(secondsAgos); - - // compute the time weighted tick, rounded towards negative infinity - int56 numerator = tickCumulatives[1] - tickCumulatives[0]; - int56 timeWeightedTick = numerator / int56(secondsAgo); - if (numerator < 0 && numerator % int56(secondsAgo) != 0) { - timeWeightedTick--; - } - - // the time weighted averages fit in their respective accumulated types - assert(timeWeightedTick <= type(int24).max && timeWeightedTick >= type(int24).min); - - uint256 timeWeightedHarmonicMeanLiquidity = - (uint256(secondsAgo) * type(uint160).max) / - (uint256(secondsPerLiquidityCumulativeX128s[1] - secondsPerLiquidityCumulativeX128s[0]) << 32); - assert(timeWeightedHarmonicMeanLiquidity <= type(uint128).max); - } -} diff --git a/contract/lib/v3-core/contracts/test/OracleTest.sol b/contract/lib/v3-core/contracts/test/OracleTest.sol deleted file mode 100644 index c0c83b1..0000000 --- a/contract/lib/v3-core/contracts/test/OracleTest.sol +++ /dev/null @@ -1,100 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; -pragma abicoder v2; - -import '../libraries/Oracle.sol'; - -contract OracleTest { - using Oracle for Oracle.Observation[65535]; - - Oracle.Observation[65535] public observations; - - uint32 public time; - int24 public tick; - uint128 public liquidity; - uint16 public index; - uint16 public cardinality; - uint16 public cardinalityNext; - - struct InitializeParams { - uint32 time; - int24 tick; - uint128 liquidity; - } - - function initialize(InitializeParams calldata params) external { - require(cardinality == 0, 'already initialized'); - time = params.time; - tick = params.tick; - liquidity = params.liquidity; - (cardinality, cardinalityNext) = observations.initialize(params.time); - } - - function advanceTime(uint32 by) public { - time += by; - } - - struct UpdateParams { - uint32 advanceTimeBy; - int24 tick; - uint128 liquidity; - } - - // write an observation, then change tick and liquidity - function update(UpdateParams calldata params) external { - advanceTime(params.advanceTimeBy); - (index, cardinality) = observations.write(index, time, tick, liquidity, cardinality, cardinalityNext); - tick = params.tick; - liquidity = params.liquidity; - } - - function batchUpdate(UpdateParams[] calldata params) external { - // sload everything - int24 _tick = tick; - uint128 _liquidity = liquidity; - uint16 _index = index; - uint16 _cardinality = cardinality; - uint16 _cardinalityNext = cardinalityNext; - uint32 _time = time; - - for (uint256 i = 0; i < params.length; i++) { - _time += params[i].advanceTimeBy; - (_index, _cardinality) = observations.write( - _index, - _time, - _tick, - _liquidity, - _cardinality, - _cardinalityNext - ); - _tick = params[i].tick; - _liquidity = params[i].liquidity; - } - - // sstore everything - tick = _tick; - liquidity = _liquidity; - index = _index; - cardinality = _cardinality; - time = _time; - } - - function grow(uint16 _cardinalityNext) external { - cardinalityNext = observations.grow(cardinalityNext, _cardinalityNext); - } - - function observe(uint32[] calldata secondsAgos) - external - view - returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) - { - return observations.observe(time, secondsAgos, tick, index, liquidity, cardinality); - } - - function getGasCostOfObserve(uint32[] calldata secondsAgos) external view returns (uint256) { - (uint32 _time, int24 _tick, uint128 _liquidity, uint16 _index) = (time, tick, liquidity, index); - uint256 gasBefore = gasleft(); - observations.observe(_time, secondsAgos, _tick, _index, _liquidity, cardinality); - return gasBefore - gasleft(); - } -} diff --git a/contract/lib/v3-core/contracts/test/SqrtPriceMathEchidnaTest.sol b/contract/lib/v3-core/contracts/test/SqrtPriceMathEchidnaTest.sol deleted file mode 100644 index 48010d9..0000000 --- a/contract/lib/v3-core/contracts/test/SqrtPriceMathEchidnaTest.sol +++ /dev/null @@ -1,232 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/FullMath.sol'; -import '../libraries/SqrtPriceMath.sol'; -import '../libraries/FixedPoint96.sol'; - -contract SqrtPriceMathEchidnaTest { - function mulDivRoundingUpInvariants( - uint256 x, - uint256 y, - uint256 z - ) external pure { - require(z > 0); - uint256 notRoundedUp = FullMath.mulDiv(x, y, z); - uint256 roundedUp = FullMath.mulDivRoundingUp(x, y, z); - assert(roundedUp >= notRoundedUp); - assert(roundedUp - notRoundedUp < 2); - if (roundedUp - notRoundedUp == 1) { - assert(mulmod(x, y, z) > 0); - } else { - assert(mulmod(x, y, z) == 0); - } - } - - function getNextSqrtPriceFromInputInvariants( - uint160 sqrtP, - uint128 liquidity, - uint256 amountIn, - bool zeroForOne - ) external pure { - uint160 sqrtQ = SqrtPriceMath.getNextSqrtPriceFromInput(sqrtP, liquidity, amountIn, zeroForOne); - - if (zeroForOne) { - assert(sqrtQ <= sqrtP); - assert(amountIn >= SqrtPriceMath.getAmount0Delta(sqrtQ, sqrtP, liquidity, true)); - } else { - assert(sqrtQ >= sqrtP); - assert(amountIn >= SqrtPriceMath.getAmount1Delta(sqrtP, sqrtQ, liquidity, true)); - } - } - - function getNextSqrtPriceFromOutputInvariants( - uint160 sqrtP, - uint128 liquidity, - uint256 amountOut, - bool zeroForOne - ) external pure { - uint160 sqrtQ = SqrtPriceMath.getNextSqrtPriceFromOutput(sqrtP, liquidity, amountOut, zeroForOne); - - if (zeroForOne) { - assert(sqrtQ <= sqrtP); - assert(amountOut <= SqrtPriceMath.getAmount1Delta(sqrtQ, sqrtP, liquidity, false)); - } else { - assert(sqrtQ > 0); // this has to be true, otherwise we need another require - assert(sqrtQ >= sqrtP); - assert(amountOut <= SqrtPriceMath.getAmount0Delta(sqrtP, sqrtQ, liquidity, false)); - } - } - - function getNextSqrtPriceFromAmount0RoundingUpInvariants( - uint160 sqrtPX96, - uint128 liquidity, - uint256 amount, - bool add - ) external pure { - require(sqrtPX96 > 0); - require(liquidity > 0); - uint160 sqrtQX96 = SqrtPriceMath.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amount, add); - - if (add) { - assert(sqrtQX96 <= sqrtPX96); - } else { - assert(sqrtQX96 >= sqrtPX96); - } - - if (amount == 0) { - assert(sqrtPX96 == sqrtQX96); - } - } - - function getNextSqrtPriceFromAmount1RoundingDownInvariants( - uint160 sqrtPX96, - uint128 liquidity, - uint256 amount, - bool add - ) external pure { - require(sqrtPX96 > 0); - require(liquidity > 0); - uint160 sqrtQX96 = SqrtPriceMath.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amount, add); - - if (add) { - assert(sqrtQX96 >= sqrtPX96); - } else { - assert(sqrtQX96 <= sqrtPX96); - } - - if (amount == 0) { - assert(sqrtPX96 == sqrtQX96); - } - } - - function getAmount0DeltaInvariants( - uint160 sqrtP, - uint160 sqrtQ, - uint128 liquidity - ) external pure { - require(sqrtP > 0 && sqrtQ > 0); - - uint256 amount0Down = SqrtPriceMath.getAmount0Delta(sqrtQ, sqrtP, liquidity, false); - assert(amount0Down == SqrtPriceMath.getAmount0Delta(sqrtP, sqrtQ, liquidity, false)); - - uint256 amount0Up = SqrtPriceMath.getAmount0Delta(sqrtQ, sqrtP, liquidity, true); - assert(amount0Up == SqrtPriceMath.getAmount0Delta(sqrtP, sqrtQ, liquidity, true)); - - assert(amount0Down <= amount0Up); - // diff is 0 or 1 - assert(amount0Up - amount0Down < 2); - } - - // ensure that chained division is always equal to the full-precision case for - // liquidity * (sqrt(P) - sqrt(Q)) / (sqrt(P) * sqrt(Q)) - function getAmount0DeltaEquivalency( - uint160 sqrtP, - uint160 sqrtQ, - uint128 liquidity, - bool roundUp - ) external pure { - require(sqrtP >= sqrtQ); - require(sqrtP > 0 && sqrtQ > 0); - require((sqrtP * sqrtQ) / sqrtP == sqrtQ); - - uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; - uint256 numerator2 = sqrtP - sqrtQ; - uint256 denominator = uint256(sqrtP) * sqrtQ; - - uint256 safeResult = - roundUp - ? FullMath.mulDivRoundingUp(numerator1, numerator2, denominator) - : FullMath.mulDiv(numerator1, numerator2, denominator); - uint256 fullResult = SqrtPriceMath.getAmount0Delta(sqrtQ, sqrtP, liquidity, roundUp); - - assert(safeResult == fullResult); - } - - function getAmount1DeltaInvariants( - uint160 sqrtP, - uint160 sqrtQ, - uint128 liquidity - ) external pure { - require(sqrtP > 0 && sqrtQ > 0); - - uint256 amount1Down = SqrtPriceMath.getAmount1Delta(sqrtP, sqrtQ, liquidity, false); - assert(amount1Down == SqrtPriceMath.getAmount1Delta(sqrtQ, sqrtP, liquidity, false)); - - uint256 amount1Up = SqrtPriceMath.getAmount1Delta(sqrtP, sqrtQ, liquidity, true); - assert(amount1Up == SqrtPriceMath.getAmount1Delta(sqrtQ, sqrtP, liquidity, true)); - - assert(amount1Down <= amount1Up); - // diff is 0 or 1 - assert(amount1Up - amount1Down < 2); - } - - function getAmount0DeltaSignedInvariants( - uint160 sqrtP, - uint160 sqrtQ, - int128 liquidity - ) external pure { - require(sqrtP > 0 && sqrtQ > 0); - - int256 amount0 = SqrtPriceMath.getAmount0Delta(sqrtQ, sqrtP, liquidity); - if (liquidity < 0) assert(amount0 <= 0); - if (liquidity > 0) { - if (sqrtP == sqrtQ) assert(amount0 == 0); - else assert(amount0 > 0); - } - if (liquidity == 0) assert(amount0 == 0); - } - - function getAmount1DeltaSignedInvariants( - uint160 sqrtP, - uint160 sqrtQ, - int128 liquidity - ) external pure { - require(sqrtP > 0 && sqrtQ > 0); - - int256 amount1 = SqrtPriceMath.getAmount1Delta(sqrtP, sqrtQ, liquidity); - if (liquidity < 0) assert(amount1 <= 0); - if (liquidity > 0) { - if (sqrtP == sqrtQ) assert(amount1 == 0); - else assert(amount1 > 0); - } - if (liquidity == 0) assert(amount1 == 0); - } - - function getOutOfRangeMintInvariants( - uint160 sqrtA, - uint160 sqrtB, - int128 liquidity - ) external pure { - require(sqrtA > 0 && sqrtB > 0); - require(liquidity > 0); - - int256 amount0 = SqrtPriceMath.getAmount0Delta(sqrtA, sqrtB, liquidity); - int256 amount1 = SqrtPriceMath.getAmount1Delta(sqrtA, sqrtB, liquidity); - - if (sqrtA == sqrtB) { - assert(amount0 == 0); - assert(amount1 == 0); - } else { - assert(amount0 > 0); - assert(amount1 > 0); - } - } - - function getInRangeMintInvariants( - uint160 sqrtLower, - uint160 sqrtCurrent, - uint160 sqrtUpper, - int128 liquidity - ) external pure { - require(sqrtLower > 0); - require(sqrtLower < sqrtUpper); - require(sqrtLower <= sqrtCurrent && sqrtCurrent <= sqrtUpper); - require(liquidity > 0); - - int256 amount0 = SqrtPriceMath.getAmount0Delta(sqrtCurrent, sqrtUpper, liquidity); - int256 amount1 = SqrtPriceMath.getAmount1Delta(sqrtLower, sqrtCurrent, liquidity); - - assert(amount0 > 0 || amount1 > 0); - } -} diff --git a/contract/lib/v3-core/contracts/test/SqrtPriceMathTest.sol b/contract/lib/v3-core/contracts/test/SqrtPriceMathTest.sol deleted file mode 100644 index 41fec2f..0000000 --- a/contract/lib/v3-core/contracts/test/SqrtPriceMathTest.sol +++ /dev/null @@ -1,86 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/SqrtPriceMath.sol'; - -contract SqrtPriceMathTest { - function getNextSqrtPriceFromInput( - uint160 sqrtP, - uint128 liquidity, - uint256 amountIn, - bool zeroForOne - ) external pure returns (uint160 sqrtQ) { - return SqrtPriceMath.getNextSqrtPriceFromInput(sqrtP, liquidity, amountIn, zeroForOne); - } - - function getGasCostOfGetNextSqrtPriceFromInput( - uint160 sqrtP, - uint128 liquidity, - uint256 amountIn, - bool zeroForOne - ) external view returns (uint256) { - uint256 gasBefore = gasleft(); - SqrtPriceMath.getNextSqrtPriceFromInput(sqrtP, liquidity, amountIn, zeroForOne); - return gasBefore - gasleft(); - } - - function getNextSqrtPriceFromOutput( - uint160 sqrtP, - uint128 liquidity, - uint256 amountOut, - bool zeroForOne - ) external pure returns (uint160 sqrtQ) { - return SqrtPriceMath.getNextSqrtPriceFromOutput(sqrtP, liquidity, amountOut, zeroForOne); - } - - function getGasCostOfGetNextSqrtPriceFromOutput( - uint160 sqrtP, - uint128 liquidity, - uint256 amountOut, - bool zeroForOne - ) external view returns (uint256) { - uint256 gasBefore = gasleft(); - SqrtPriceMath.getNextSqrtPriceFromOutput(sqrtP, liquidity, amountOut, zeroForOne); - return gasBefore - gasleft(); - } - - function getAmount0Delta( - uint160 sqrtLower, - uint160 sqrtUpper, - uint128 liquidity, - bool roundUp - ) external pure returns (uint256 amount0) { - return SqrtPriceMath.getAmount0Delta(sqrtLower, sqrtUpper, liquidity, roundUp); - } - - function getAmount1Delta( - uint160 sqrtLower, - uint160 sqrtUpper, - uint128 liquidity, - bool roundUp - ) external pure returns (uint256 amount1) { - return SqrtPriceMath.getAmount1Delta(sqrtLower, sqrtUpper, liquidity, roundUp); - } - - function getGasCostOfGetAmount0Delta( - uint160 sqrtLower, - uint160 sqrtUpper, - uint128 liquidity, - bool roundUp - ) external view returns (uint256) { - uint256 gasBefore = gasleft(); - SqrtPriceMath.getAmount0Delta(sqrtLower, sqrtUpper, liquidity, roundUp); - return gasBefore - gasleft(); - } - - function getGasCostOfGetAmount1Delta( - uint160 sqrtLower, - uint160 sqrtUpper, - uint128 liquidity, - bool roundUp - ) external view returns (uint256) { - uint256 gasBefore = gasleft(); - SqrtPriceMath.getAmount1Delta(sqrtLower, sqrtUpper, liquidity, roundUp); - return gasBefore - gasleft(); - } -} diff --git a/contract/lib/v3-core/contracts/test/SwapMathEchidnaTest.sol b/contract/lib/v3-core/contracts/test/SwapMathEchidnaTest.sol deleted file mode 100644 index 67bf861..0000000 --- a/contract/lib/v3-core/contracts/test/SwapMathEchidnaTest.sol +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/SwapMath.sol'; - -contract SwapMathEchidnaTest { - function checkComputeSwapStepInvariants( - uint160 sqrtPriceRaw, - uint160 sqrtPriceTargetRaw, - uint128 liquidity, - int256 amountRemaining, - uint24 feePips - ) external pure { - require(sqrtPriceRaw > 0); - require(sqrtPriceTargetRaw > 0); - require(feePips > 0); - require(feePips < 1e6); - - (uint160 sqrtQ, uint256 amountIn, uint256 amountOut, uint256 feeAmount) = - SwapMath.computeSwapStep(sqrtPriceRaw, sqrtPriceTargetRaw, liquidity, amountRemaining, feePips); - - assert(amountIn <= type(uint256).max - feeAmount); - - if (amountRemaining < 0) { - assert(amountOut <= uint256(-amountRemaining)); - } else { - assert(amountIn + feeAmount <= uint256(amountRemaining)); - } - - if (sqrtPriceRaw == sqrtPriceTargetRaw) { - assert(amountIn == 0); - assert(amountOut == 0); - assert(feeAmount == 0); - assert(sqrtQ == sqrtPriceTargetRaw); - } - - // didn't reach price target, entire amount must be consumed - if (sqrtQ != sqrtPriceTargetRaw) { - if (amountRemaining < 0) assert(amountOut == uint256(-amountRemaining)); - else assert(amountIn + feeAmount == uint256(amountRemaining)); - } - - // next price is between price and price target - if (sqrtPriceTargetRaw <= sqrtPriceRaw) { - assert(sqrtQ <= sqrtPriceRaw); - assert(sqrtQ >= sqrtPriceTargetRaw); - } else { - assert(sqrtQ >= sqrtPriceRaw); - assert(sqrtQ <= sqrtPriceTargetRaw); - } - } -} diff --git a/contract/lib/v3-core/contracts/test/SwapMathTest.sol b/contract/lib/v3-core/contracts/test/SwapMathTest.sol deleted file mode 100644 index b0f59df..0000000 --- a/contract/lib/v3-core/contracts/test/SwapMathTest.sol +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/SwapMath.sol'; - -contract SwapMathTest { - function computeSwapStep( - uint160 sqrtP, - uint160 sqrtPTarget, - uint128 liquidity, - int256 amountRemaining, - uint24 feePips - ) - external - pure - returns ( - uint160 sqrtQ, - uint256 amountIn, - uint256 amountOut, - uint256 feeAmount - ) - { - return SwapMath.computeSwapStep(sqrtP, sqrtPTarget, liquidity, amountRemaining, feePips); - } - - function getGasCostOfComputeSwapStep( - uint160 sqrtP, - uint160 sqrtPTarget, - uint128 liquidity, - int256 amountRemaining, - uint24 feePips - ) external view returns (uint256) { - uint256 gasBefore = gasleft(); - SwapMath.computeSwapStep(sqrtP, sqrtPTarget, liquidity, amountRemaining, feePips); - return gasBefore - gasleft(); - } -} diff --git a/contract/lib/v3-core/contracts/test/TestERC20.sol b/contract/lib/v3-core/contracts/test/TestERC20.sol deleted file mode 100644 index 411e0ea..0000000 --- a/contract/lib/v3-core/contracts/test/TestERC20.sol +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../interfaces/IERC20Minimal.sol'; - -contract TestERC20 is IERC20Minimal { - mapping(address => uint256) public override balanceOf; - mapping(address => mapping(address => uint256)) public override allowance; - - constructor(uint256 amountToMint) { - mint(msg.sender, amountToMint); - } - - function mint(address to, uint256 amount) public { - uint256 balanceNext = balanceOf[to] + amount; - require(balanceNext >= amount, 'overflow balance'); - balanceOf[to] = balanceNext; - } - - function transfer(address recipient, uint256 amount) external override returns (bool) { - uint256 balanceBefore = balanceOf[msg.sender]; - require(balanceBefore >= amount, 'insufficient balance'); - balanceOf[msg.sender] = balanceBefore - amount; - - uint256 balanceRecipient = balanceOf[recipient]; - require(balanceRecipient + amount >= balanceRecipient, 'recipient balance overflow'); - balanceOf[recipient] = balanceRecipient + amount; - - emit Transfer(msg.sender, recipient, amount); - return true; - } - - function approve(address spender, uint256 amount) external override returns (bool) { - allowance[msg.sender][spender] = amount; - emit Approval(msg.sender, spender, amount); - return true; - } - - function transferFrom( - address sender, - address recipient, - uint256 amount - ) external override returns (bool) { - uint256 allowanceBefore = allowance[sender][msg.sender]; - require(allowanceBefore >= amount, 'allowance insufficient'); - - allowance[sender][msg.sender] = allowanceBefore - amount; - - uint256 balanceRecipient = balanceOf[recipient]; - require(balanceRecipient + amount >= balanceRecipient, 'overflow balance recipient'); - balanceOf[recipient] = balanceRecipient + amount; - uint256 balanceSender = balanceOf[sender]; - require(balanceSender >= amount, 'underflow balance sender'); - balanceOf[sender] = balanceSender - amount; - - emit Transfer(sender, recipient, amount); - return true; - } -} diff --git a/contract/lib/v3-core/contracts/test/TestUniswapV3Callee.sol b/contract/lib/v3-core/contracts/test/TestUniswapV3Callee.sol deleted file mode 100644 index b569935..0000000 --- a/contract/lib/v3-core/contracts/test/TestUniswapV3Callee.sol +++ /dev/null @@ -1,142 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../interfaces/IERC20Minimal.sol'; - -import '../libraries/SafeCast.sol'; -import '../libraries/TickMath.sol'; - -import '../interfaces/callback/IUniswapV3MintCallback.sol'; -import '../interfaces/callback/IUniswapV3SwapCallback.sol'; -import '../interfaces/callback/IUniswapV3FlashCallback.sol'; - -import '../interfaces/IUniswapV3Pool.sol'; - -contract TestUniswapV3Callee is IUniswapV3MintCallback, IUniswapV3SwapCallback, IUniswapV3FlashCallback { - using SafeCast for uint256; - - function swapExact0For1( - address pool, - uint256 amount0In, - address recipient, - uint160 sqrtPriceLimitX96 - ) external { - IUniswapV3Pool(pool).swap(recipient, true, amount0In.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender)); - } - - function swap0ForExact1( - address pool, - uint256 amount1Out, - address recipient, - uint160 sqrtPriceLimitX96 - ) external { - IUniswapV3Pool(pool).swap(recipient, true, -amount1Out.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender)); - } - - function swapExact1For0( - address pool, - uint256 amount1In, - address recipient, - uint160 sqrtPriceLimitX96 - ) external { - IUniswapV3Pool(pool).swap(recipient, false, amount1In.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender)); - } - - function swap1ForExact0( - address pool, - uint256 amount0Out, - address recipient, - uint160 sqrtPriceLimitX96 - ) external { - IUniswapV3Pool(pool).swap(recipient, false, -amount0Out.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender)); - } - - function swapToLowerSqrtPrice( - address pool, - uint160 sqrtPriceX96, - address recipient - ) external { - IUniswapV3Pool(pool).swap(recipient, true, type(int256).max, sqrtPriceX96, abi.encode(msg.sender)); - } - - function swapToHigherSqrtPrice( - address pool, - uint160 sqrtPriceX96, - address recipient - ) external { - IUniswapV3Pool(pool).swap(recipient, false, type(int256).max, sqrtPriceX96, abi.encode(msg.sender)); - } - - event SwapCallback(int256 amount0Delta, int256 amount1Delta); - - function uniswapV3SwapCallback( - int256 amount0Delta, - int256 amount1Delta, - bytes calldata data - ) external override { - address sender = abi.decode(data, (address)); - - emit SwapCallback(amount0Delta, amount1Delta); - - if (amount0Delta > 0) { - IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom(sender, msg.sender, uint256(amount0Delta)); - } else if (amount1Delta > 0) { - IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom(sender, msg.sender, uint256(amount1Delta)); - } else { - // if both are not gt 0, both must be 0. - assert(amount0Delta == 0 && amount1Delta == 0); - } - } - - function mint( - address pool, - address recipient, - int24 tickLower, - int24 tickUpper, - uint128 amount - ) external { - IUniswapV3Pool(pool).mint(recipient, tickLower, tickUpper, amount, abi.encode(msg.sender)); - } - - event MintCallback(uint256 amount0Owed, uint256 amount1Owed); - - function uniswapV3MintCallback( - uint256 amount0Owed, - uint256 amount1Owed, - bytes calldata data - ) external override { - address sender = abi.decode(data, (address)); - - emit MintCallback(amount0Owed, amount1Owed); - if (amount0Owed > 0) - IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom(sender, msg.sender, amount0Owed); - if (amount1Owed > 0) - IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom(sender, msg.sender, amount1Owed); - } - - event FlashCallback(uint256 fee0, uint256 fee1); - - function flash( - address pool, - address recipient, - uint256 amount0, - uint256 amount1, - uint256 pay0, - uint256 pay1 - ) external { - IUniswapV3Pool(pool).flash(recipient, amount0, amount1, abi.encode(msg.sender, pay0, pay1)); - } - - function uniswapV3FlashCallback( - uint256 fee0, - uint256 fee1, - bytes calldata data - ) external override { - emit FlashCallback(fee0, fee1); - - (address sender, uint256 pay0, uint256 pay1) = abi.decode(data, (address, uint256, uint256)); - - if (pay0 > 0) IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom(sender, msg.sender, pay0); - if (pay1 > 0) IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom(sender, msg.sender, pay1); - } -} diff --git a/contract/lib/v3-core/contracts/test/TestUniswapV3ReentrantCallee.sol b/contract/lib/v3-core/contracts/test/TestUniswapV3ReentrantCallee.sol deleted file mode 100644 index fbd0b2a..0000000 --- a/contract/lib/v3-core/contracts/test/TestUniswapV3ReentrantCallee.sol +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/TickMath.sol'; - -import '../interfaces/callback/IUniswapV3SwapCallback.sol'; - -import '../interfaces/IUniswapV3Pool.sol'; - -contract TestUniswapV3ReentrantCallee is IUniswapV3SwapCallback { - string private constant expectedReason = 'LOK'; - - function swapToReenter(address pool) external { - IUniswapV3Pool(pool).swap(address(0), false, 1, TickMath.MAX_SQRT_RATIO - 1, new bytes(0)); - } - - function uniswapV3SwapCallback( - int256, - int256, - bytes calldata - ) external override { - // try to reenter swap - try IUniswapV3Pool(msg.sender).swap(address(0), false, 1, 0, new bytes(0)) {} catch Error( - string memory reason - ) { - require(keccak256(abi.encode(reason)) == keccak256(abi.encode(expectedReason))); - } - - // try to reenter mint - try IUniswapV3Pool(msg.sender).mint(address(0), 0, 0, 0, new bytes(0)) {} catch Error(string memory reason) { - require(keccak256(abi.encode(reason)) == keccak256(abi.encode(expectedReason))); - } - - // try to reenter collect - try IUniswapV3Pool(msg.sender).collect(address(0), 0, 0, 0, 0) {} catch Error(string memory reason) { - require(keccak256(abi.encode(reason)) == keccak256(abi.encode(expectedReason))); - } - - // try to reenter burn - try IUniswapV3Pool(msg.sender).burn(0, 0, 0) {} catch Error(string memory reason) { - require(keccak256(abi.encode(reason)) == keccak256(abi.encode(expectedReason))); - } - - // try to reenter flash - try IUniswapV3Pool(msg.sender).flash(address(0), 0, 0, new bytes(0)) {} catch Error(string memory reason) { - require(keccak256(abi.encode(reason)) == keccak256(abi.encode(expectedReason))); - } - - // try to reenter collectProtocol - try IUniswapV3Pool(msg.sender).collectProtocol(address(0), 0, 0) {} catch Error(string memory reason) { - require(keccak256(abi.encode(reason)) == keccak256(abi.encode(expectedReason))); - } - - require(false, 'Unable to reenter'); - } -} diff --git a/contract/lib/v3-core/contracts/test/TestUniswapV3Router.sol b/contract/lib/v3-core/contracts/test/TestUniswapV3Router.sol deleted file mode 100644 index 8f916dd..0000000 --- a/contract/lib/v3-core/contracts/test/TestUniswapV3Router.sol +++ /dev/null @@ -1,91 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/SafeCast.sol'; -import '../libraries/TickMath.sol'; - -import '../interfaces/IERC20Minimal.sol'; -import '../interfaces/callback/IUniswapV3SwapCallback.sol'; -import '../interfaces/IUniswapV3Pool.sol'; - -contract TestUniswapV3Router is IUniswapV3SwapCallback { - using SafeCast for uint256; - - // flash swaps for an exact amount of token0 in the output pool - function swapForExact0Multi( - address recipient, - address poolInput, - address poolOutput, - uint256 amount0Out - ) external { - address[] memory pools = new address[](1); - pools[0] = poolInput; - IUniswapV3Pool(poolOutput).swap( - recipient, - false, - -amount0Out.toInt256(), - TickMath.MAX_SQRT_RATIO - 1, - abi.encode(pools, msg.sender) - ); - } - - // flash swaps for an exact amount of token1 in the output pool - function swapForExact1Multi( - address recipient, - address poolInput, - address poolOutput, - uint256 amount1Out - ) external { - address[] memory pools = new address[](1); - pools[0] = poolInput; - IUniswapV3Pool(poolOutput).swap( - recipient, - true, - -amount1Out.toInt256(), - TickMath.MIN_SQRT_RATIO + 1, - abi.encode(pools, msg.sender) - ); - } - - event SwapCallback(int256 amount0Delta, int256 amount1Delta); - - function uniswapV3SwapCallback( - int256 amount0Delta, - int256 amount1Delta, - bytes calldata data - ) public override { - emit SwapCallback(amount0Delta, amount1Delta); - - (address[] memory pools, address payer) = abi.decode(data, (address[], address)); - - if (pools.length == 1) { - // get the address and amount of the token that we need to pay - address tokenToBePaid = - amount0Delta > 0 ? IUniswapV3Pool(msg.sender).token0() : IUniswapV3Pool(msg.sender).token1(); - int256 amountToBePaid = amount0Delta > 0 ? amount0Delta : amount1Delta; - - bool zeroForOne = tokenToBePaid == IUniswapV3Pool(pools[0]).token1(); - IUniswapV3Pool(pools[0]).swap( - msg.sender, - zeroForOne, - -amountToBePaid, - zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1, - abi.encode(new address[](0), payer) - ); - } else { - if (amount0Delta > 0) { - IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom( - payer, - msg.sender, - uint256(amount0Delta) - ); - } else { - IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom( - payer, - msg.sender, - uint256(amount1Delta) - ); - } - } - } -} diff --git a/contract/lib/v3-core/contracts/test/TestUniswapV3SwapPay.sol b/contract/lib/v3-core/contracts/test/TestUniswapV3SwapPay.sol deleted file mode 100644 index 0a78c88..0000000 --- a/contract/lib/v3-core/contracts/test/TestUniswapV3SwapPay.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../interfaces/IERC20Minimal.sol'; - -import '../interfaces/callback/IUniswapV3SwapCallback.sol'; -import '../interfaces/IUniswapV3Pool.sol'; - -contract TestUniswapV3SwapPay is IUniswapV3SwapCallback { - function swap( - address pool, - address recipient, - bool zeroForOne, - uint160 sqrtPriceX96, - int256 amountSpecified, - uint256 pay0, - uint256 pay1 - ) external { - IUniswapV3Pool(pool).swap( - recipient, - zeroForOne, - amountSpecified, - sqrtPriceX96, - abi.encode(msg.sender, pay0, pay1) - ); - } - - function uniswapV3SwapCallback( - int256, - int256, - bytes calldata data - ) external override { - (address sender, uint256 pay0, uint256 pay1) = abi.decode(data, (address, uint256, uint256)); - - if (pay0 > 0) { - IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom(sender, msg.sender, uint256(pay0)); - } else if (pay1 > 0) { - IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom(sender, msg.sender, uint256(pay1)); - } - } -} diff --git a/contract/lib/v3-core/contracts/test/TickBitmapEchidnaTest.sol b/contract/lib/v3-core/contracts/test/TickBitmapEchidnaTest.sol deleted file mode 100644 index 675798a..0000000 --- a/contract/lib/v3-core/contracts/test/TickBitmapEchidnaTest.sol +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/TickBitmap.sol'; - -contract TickBitmapEchidnaTest { - using TickBitmap for mapping(int16 => uint256); - - mapping(int16 => uint256) private bitmap; - - // returns whether the given tick is initialized - function isInitialized(int24 tick) private view returns (bool) { - (int24 next, bool initialized) = bitmap.nextInitializedTickWithinOneWord(tick, 1, true); - return next == tick ? initialized : false; - } - - function flipTick(int24 tick) external { - bool before = isInitialized(tick); - bitmap.flipTick(tick, 1); - assert(isInitialized(tick) == !before); - } - - function checkNextInitializedTickWithinOneWordInvariants(int24 tick, bool lte) external view { - (int24 next, bool initialized) = bitmap.nextInitializedTickWithinOneWord(tick, 1, lte); - if (lte) { - // type(int24).min + 256 - require(tick >= -8388352); - assert(next <= tick); - assert(tick - next < 256); - // all the ticks between the input tick and the next tick should be uninitialized - for (int24 i = tick; i > next; i--) { - assert(!isInitialized(i)); - } - assert(isInitialized(next) == initialized); - } else { - // type(int24).max - 256 - require(tick < 8388351); - assert(next > tick); - assert(next - tick <= 256); - // all the ticks between the input tick and the next tick should be uninitialized - for (int24 i = tick + 1; i < next; i++) { - assert(!isInitialized(i)); - } - assert(isInitialized(next) == initialized); - } - } -} diff --git a/contract/lib/v3-core/contracts/test/TickBitmapTest.sol b/contract/lib/v3-core/contracts/test/TickBitmapTest.sol deleted file mode 100644 index c6fb6b0..0000000 --- a/contract/lib/v3-core/contracts/test/TickBitmapTest.sol +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/TickBitmap.sol'; - -contract TickBitmapTest { - using TickBitmap for mapping(int16 => uint256); - - mapping(int16 => uint256) public bitmap; - - function flipTick(int24 tick) external { - bitmap.flipTick(tick, 1); - } - - function getGasCostOfFlipTick(int24 tick) external returns (uint256) { - uint256 gasBefore = gasleft(); - bitmap.flipTick(tick, 1); - return gasBefore - gasleft(); - } - - function nextInitializedTickWithinOneWord(int24 tick, bool lte) - external - view - returns (int24 next, bool initialized) - { - return bitmap.nextInitializedTickWithinOneWord(tick, 1, lte); - } - - function getGasCostOfNextInitializedTickWithinOneWord(int24 tick, bool lte) external view returns (uint256) { - uint256 gasBefore = gasleft(); - bitmap.nextInitializedTickWithinOneWord(tick, 1, lte); - return gasBefore - gasleft(); - } - - // returns whether the given tick is initialized - function isInitialized(int24 tick) external view returns (bool) { - (int24 next, bool initialized) = bitmap.nextInitializedTickWithinOneWord(tick, 1, true); - return next == tick ? initialized : false; - } -} diff --git a/contract/lib/v3-core/contracts/test/TickEchidnaTest.sol b/contract/lib/v3-core/contracts/test/TickEchidnaTest.sol deleted file mode 100644 index 1d5514f..0000000 --- a/contract/lib/v3-core/contracts/test/TickEchidnaTest.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/Tick.sol'; - -contract TickEchidnaTest { - function checkTickSpacingToParametersInvariants(int24 tickSpacing) external pure { - require(tickSpacing <= TickMath.MAX_TICK); - require(tickSpacing > 0); - - int24 minTick = (TickMath.MIN_TICK / tickSpacing) * tickSpacing; - int24 maxTick = (TickMath.MAX_TICK / tickSpacing) * tickSpacing; - - uint128 maxLiquidityPerTick = Tick.tickSpacingToMaxLiquidityPerTick(tickSpacing); - - // symmetry around 0 tick - assert(maxTick == -minTick); - // positive max tick - assert(maxTick > 0); - // divisibility - assert((maxTick - minTick) % tickSpacing == 0); - - uint256 numTicks = uint256((maxTick - minTick) / tickSpacing) + 1; - // max liquidity at every tick is less than the cap - assert(uint256(maxLiquidityPerTick) * numTicks <= type(uint128).max); - } -} diff --git a/contract/lib/v3-core/contracts/test/TickMathEchidnaTest.sol b/contract/lib/v3-core/contracts/test/TickMathEchidnaTest.sol deleted file mode 100644 index 91064b0..0000000 --- a/contract/lib/v3-core/contracts/test/TickMathEchidnaTest.sol +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/TickMath.sol'; - -contract TickMathEchidnaTest { - // uniqueness and increasing order - function checkGetSqrtRatioAtTickInvariants(int24 tick) external pure { - uint160 ratio = TickMath.getSqrtRatioAtTick(tick); - assert(TickMath.getSqrtRatioAtTick(tick - 1) < ratio && ratio < TickMath.getSqrtRatioAtTick(tick + 1)); - assert(ratio >= TickMath.MIN_SQRT_RATIO); - assert(ratio <= TickMath.MAX_SQRT_RATIO); - } - - // the ratio is always between the returned tick and the returned tick+1 - function checkGetTickAtSqrtRatioInvariants(uint160 ratio) external pure { - int24 tick = TickMath.getTickAtSqrtRatio(ratio); - assert(ratio >= TickMath.getSqrtRatioAtTick(tick) && ratio < TickMath.getSqrtRatioAtTick(tick + 1)); - assert(tick >= TickMath.MIN_TICK); - assert(tick < TickMath.MAX_TICK); - } -} diff --git a/contract/lib/v3-core/contracts/test/TickMathTest.sol b/contract/lib/v3-core/contracts/test/TickMathTest.sol deleted file mode 100644 index 2816e57..0000000 --- a/contract/lib/v3-core/contracts/test/TickMathTest.sol +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/TickMath.sol'; - -contract TickMathTest { - function getSqrtRatioAtTick(int24 tick) external pure returns (uint160) { - return TickMath.getSqrtRatioAtTick(tick); - } - - function getGasCostOfGetSqrtRatioAtTick(int24 tick) external view returns (uint256) { - uint256 gasBefore = gasleft(); - TickMath.getSqrtRatioAtTick(tick); - return gasBefore - gasleft(); - } - - function getTickAtSqrtRatio(uint160 sqrtPriceX96) external pure returns (int24) { - return TickMath.getTickAtSqrtRatio(sqrtPriceX96); - } - - function getGasCostOfGetTickAtSqrtRatio(uint160 sqrtPriceX96) external view returns (uint256) { - uint256 gasBefore = gasleft(); - TickMath.getTickAtSqrtRatio(sqrtPriceX96); - return gasBefore - gasleft(); - } - - function MIN_SQRT_RATIO() external pure returns (uint160) { - return TickMath.MIN_SQRT_RATIO; - } - - function MAX_SQRT_RATIO() external pure returns (uint160) { - return TickMath.MAX_SQRT_RATIO; - } -} diff --git a/contract/lib/v3-core/contracts/test/TickOverflowSafetyEchidnaTest.sol b/contract/lib/v3-core/contracts/test/TickOverflowSafetyEchidnaTest.sol deleted file mode 100644 index fcda269..0000000 --- a/contract/lib/v3-core/contracts/test/TickOverflowSafetyEchidnaTest.sol +++ /dev/null @@ -1,111 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/Tick.sol'; - -contract TickOverflowSafetyEchidnaTest { - using Tick for mapping(int24 => Tick.Info); - - int24 private constant MIN_TICK = -16; - int24 private constant MAX_TICK = 16; - uint128 private constant MAX_LIQUIDITY = type(uint128).max / 32; - - mapping(int24 => Tick.Info) private ticks; - int24 private tick = 0; - - // used to track how much total liquidity has been added. should never be negative - int256 totalLiquidity = 0; - // half the cap of fee growth has happened, this can overflow - uint256 private feeGrowthGlobal0X128 = type(uint256).max / 2; - uint256 private feeGrowthGlobal1X128 = type(uint256).max / 2; - // how much total growth has happened, this cannot overflow - uint256 private totalGrowth0 = 0; - uint256 private totalGrowth1 = 0; - - function increaseFeeGrowthGlobal0X128(uint256 amount) external { - require(totalGrowth0 + amount > totalGrowth0); // overflow check - feeGrowthGlobal0X128 += amount; // overflow desired - totalGrowth0 += amount; - } - - function increaseFeeGrowthGlobal1X128(uint256 amount) external { - require(totalGrowth1 + amount > totalGrowth1); // overflow check - feeGrowthGlobal1X128 += amount; // overflow desired - totalGrowth1 += amount; - } - - function setPosition( - int24 tickLower, - int24 tickUpper, - int128 liquidityDelta - ) external { - require(tickLower > MIN_TICK); - require(tickUpper < MAX_TICK); - require(tickLower < tickUpper); - bool flippedLower = - ticks.update( - tickLower, - tick, - liquidityDelta, - feeGrowthGlobal0X128, - feeGrowthGlobal1X128, - 0, - 0, - uint32(block.timestamp), - false, - MAX_LIQUIDITY - ); - bool flippedUpper = - ticks.update( - tickUpper, - tick, - liquidityDelta, - feeGrowthGlobal0X128, - feeGrowthGlobal1X128, - 0, - 0, - uint32(block.timestamp), - true, - MAX_LIQUIDITY - ); - - if (flippedLower) { - if (liquidityDelta < 0) { - assert(ticks[tickLower].liquidityGross == 0); - ticks.clear(tickLower); - } else assert(ticks[tickLower].liquidityGross > 0); - } - - if (flippedUpper) { - if (liquidityDelta < 0) { - assert(ticks[tickUpper].liquidityGross == 0); - ticks.clear(tickUpper); - } else assert(ticks[tickUpper].liquidityGross > 0); - } - - totalLiquidity += liquidityDelta; - // requires should have prevented this - assert(totalLiquidity >= 0); - - if (totalLiquidity == 0) { - totalGrowth0 = 0; - totalGrowth1 = 0; - } - } - - function moveToTick(int24 target) external { - require(target > MIN_TICK); - require(target < MAX_TICK); - while (tick != target) { - if (tick < target) { - if (ticks[tick + 1].liquidityGross > 0) - ticks.cross(tick + 1, feeGrowthGlobal0X128, feeGrowthGlobal1X128, 0, 0, uint32(block.timestamp)); - tick++; - } else { - if (ticks[tick].liquidityGross > 0) - ticks.cross(tick, feeGrowthGlobal0X128, feeGrowthGlobal1X128, 0, 0, uint32(block.timestamp)); - tick--; - } - } - } -} diff --git a/contract/lib/v3-core/contracts/test/TickTest.sol b/contract/lib/v3-core/contracts/test/TickTest.sol deleted file mode 100644 index d9fa7cb..0000000 --- a/contract/lib/v3-core/contracts/test/TickTest.sol +++ /dev/null @@ -1,79 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; -pragma abicoder v2; - -import '../libraries/Tick.sol'; - -contract TickTest { - using Tick for mapping(int24 => Tick.Info); - - mapping(int24 => Tick.Info) public ticks; - - function tickSpacingToMaxLiquidityPerTick(int24 tickSpacing) external pure returns (uint128) { - return Tick.tickSpacingToMaxLiquidityPerTick(tickSpacing); - } - - function setTick(int24 tick, Tick.Info memory info) external { - ticks[tick] = info; - } - - function getFeeGrowthInside( - int24 tickLower, - int24 tickUpper, - int24 tickCurrent, - uint256 feeGrowthGlobal0X128, - uint256 feeGrowthGlobal1X128 - ) external view returns (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) { - return ticks.getFeeGrowthInside(tickLower, tickUpper, tickCurrent, feeGrowthGlobal0X128, feeGrowthGlobal1X128); - } - - function update( - int24 tick, - int24 tickCurrent, - int128 liquidityDelta, - uint256 feeGrowthGlobal0X128, - uint256 feeGrowthGlobal1X128, - uint160 secondsPerLiquidityCumulativeX128, - int56 tickCumulative, - uint32 time, - bool upper, - uint128 maxLiquidity - ) external returns (bool flipped) { - return - ticks.update( - tick, - tickCurrent, - liquidityDelta, - feeGrowthGlobal0X128, - feeGrowthGlobal1X128, - secondsPerLiquidityCumulativeX128, - tickCumulative, - time, - upper, - maxLiquidity - ); - } - - function clear(int24 tick) external { - ticks.clear(tick); - } - - function cross( - int24 tick, - uint256 feeGrowthGlobal0X128, - uint256 feeGrowthGlobal1X128, - uint160 secondsPerLiquidityCumulativeX128, - int56 tickCumulative, - uint32 time - ) external returns (int128 liquidityNet) { - return - ticks.cross( - tick, - feeGrowthGlobal0X128, - feeGrowthGlobal1X128, - secondsPerLiquidityCumulativeX128, - tickCumulative, - time - ); - } -} diff --git a/contract/lib/v3-core/contracts/test/UniswapV3PoolSwapTest.sol b/contract/lib/v3-core/contracts/test/UniswapV3PoolSwapTest.sol deleted file mode 100644 index d1f900b..0000000 --- a/contract/lib/v3-core/contracts/test/UniswapV3PoolSwapTest.sol +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../interfaces/IERC20Minimal.sol'; - -import '../interfaces/callback/IUniswapV3SwapCallback.sol'; -import '../interfaces/IUniswapV3Pool.sol'; - -contract UniswapV3PoolSwapTest is IUniswapV3SwapCallback { - int256 private _amount0Delta; - int256 private _amount1Delta; - - function getSwapResult( - address pool, - bool zeroForOne, - int256 amountSpecified, - uint160 sqrtPriceLimitX96 - ) - external - returns ( - int256 amount0Delta, - int256 amount1Delta, - uint160 nextSqrtRatio - ) - { - (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap( - address(0), - zeroForOne, - amountSpecified, - sqrtPriceLimitX96, - abi.encode(msg.sender) - ); - - (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0(); - } - - function uniswapV3SwapCallback( - int256 amount0Delta, - int256 amount1Delta, - bytes calldata data - ) external override { - address sender = abi.decode(data, (address)); - - if (amount0Delta > 0) { - IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom(sender, msg.sender, uint256(amount0Delta)); - } else if (amount1Delta > 0) { - IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom(sender, msg.sender, uint256(amount1Delta)); - } - } -} diff --git a/contract/lib/v3-core/contracts/test/UnsafeMathEchidnaTest.sol b/contract/lib/v3-core/contracts/test/UnsafeMathEchidnaTest.sol deleted file mode 100644 index 0a44d7e..0000000 --- a/contract/lib/v3-core/contracts/test/UnsafeMathEchidnaTest.sol +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity =0.7.6; - -import '../libraries/UnsafeMath.sol'; - -contract UnsafeMathEchidnaTest { - function checkDivRoundingUp(uint256 x, uint256 d) external pure { - require(d > 0); - uint256 z = UnsafeMath.divRoundingUp(x, d); - uint256 diff = z - (x / d); - if (x % d == 0) { - assert(diff == 0); - } else { - assert(diff == 1); - } - } -} diff --git a/contract/lib/v3-core/echidna.config.yml b/contract/lib/v3-core/echidna.config.yml deleted file mode 100644 index 64a761d..0000000 --- a/contract/lib/v3-core/echidna.config.yml +++ /dev/null @@ -1,74 +0,0 @@ -#format can be "text" or "json" for different output (human or machine readable) -format: 'text' -#checkAsserts checks assertions -checkAsserts: true -#coverage controls coverage guided testing -coverage: false -# #psender is the sender for property transactions; by default intentionally -# #the same as contract deployer -# psender: "0x00a329c0648769a73afac7f9381e08fb43dbea70" -# #prefix is the prefix for Boolean functions that are properties to be checked -# prefix: "echidna_" -# #propMaxGas defines gas cost at which a property fails -# propMaxGas: 8000030 -# #testMaxGas is a gas limit; does not cause failure, but terminates sequence -# testMaxGas: 8000030 -# #maxGasprice is the maximum gas price -# maxGasprice: 100000000000 -# #testLimit is the number of test sequences to run -# testLimit: 50000 -# #stopOnFail makes echidna terminate as soon as any property fails and has been shrunk -# stopOnFail: false -# #estimateGas makes echidna perform analysis of maximum gas costs for functions (experimental) -# estimateGas: false -# #seqLen defines how many transactions are in a test sequence -# seqLen: 100 -# #shrinkLimit determines how much effort is spent shrinking failing sequences -# shrinkLimit: 5000 -# #contractAddr is the address of the contract itself -# contractAddr: "0x00a329c0648769a73afac7f9381e08fb43dbea72" -# #deployer is address of the contract deployer (who often is privileged owner, etc.) -# deployer: "0x00a329c0648769a73afac7f9381e08fb43dbea70" -# #sender is set of addresses transactions may originate from -# sender: ["0x10000", "0x20000", "0x00a329c0648769a73afac7f9381e08fb43dbea70"] -# #balanceAddr is default balance for addresses -# balanceAddr: 0xffffffff -# #balanceContract overrides balanceAddr for the contract address -# balanceContract: 0 -# #solcArgs allows special args to solc -# solcArgs: "" -# #solcLibs is solc libraries -# solcLibs: [] -# #cryticArgs allows special args to crytic -# cryticArgs: [] -# #quiet produces (much) less verbose output -# quiet: false -# #initialize the blockchain with some data -# initialize: null -# #whether ot not to use the multi-abi mode of testing -# multi-abi: false -# #benchmarkMode enables benchmark mode -# benchmarkMode: false -# #timeout controls test timeout settings -# timeout: null -# #seed not defined by default, is the random seed -# #seed: 0 -# #dictFreq controls how often to use echidna's internal dictionary vs random -# #values -# dictFreq: 0.40 -# maxTimeDelay: 604800 -# #maximum time between generated txs; default is one week -# maxBlockDelay: 60480 -# #maximum number of blocks elapsed between generated txs; default is expected increment in one week -# # timeout: -# #campaign timeout (in seconds) -# # list of methods to filter -# filterFunctions: [] -# # by default, blacklist methods in filterFunctions -# filterBlacklist: true -# #directory to save the corpus; by default is disabled -# corpusDir: null -# # constants for corpus mutations (for experimentation only) -# mutConsts: [100, 1, 1] -# # maximum value to send to payable functions -# maxValue: 100000000000000000000 # 100 eth diff --git a/contract/lib/v3-core/hardhat.config.ts b/contract/lib/v3-core/hardhat.config.ts deleted file mode 100644 index 1f0563d..0000000 --- a/contract/lib/v3-core/hardhat.config.ts +++ /dev/null @@ -1,47 +0,0 @@ -import 'hardhat-typechain' -import '@nomiclabs/hardhat-ethers' -import '@nomiclabs/hardhat-waffle' -import '@nomiclabs/hardhat-etherscan' - -export default { - networks: { - hardhat: { - allowUnlimitedContractSize: false, - }, - mainnet: { - url: `https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`, - }, - ropsten: { - url: `https://ropsten.infura.io/v3/${process.env.INFURA_API_KEY}`, - }, - rinkeby: { - url: `https://rinkeby.infura.io/v3/${process.env.INFURA_API_KEY}`, - }, - goerli: { - url: `https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`, - }, - kovan: { - url: `https://kovan.infura.io/v3/${process.env.INFURA_API_KEY}`, - }, - }, - etherscan: { - // Your API key for Etherscan - // Obtain one at https://etherscan.io/ - apiKey: process.env.ETHERSCAN_API_KEY, - }, - solidity: { - version: '0.7.6', - settings: { - optimizer: { - enabled: true, - runs: 800, - }, - metadata: { - // do not include the metadata hash, since this is machine dependent - // and we want all generated code to be deterministic - // https://docs.soliditylang.org/en/v0.7.6/metadata.html - bytecodeHash: 'none', - }, - }, - }, -} diff --git a/contract/lib/v3-core/package.json b/contract/lib/v3-core/package.json deleted file mode 100644 index ee746dc..0000000 --- a/contract/lib/v3-core/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "@uniswap/v3-core", - "description": "🦄 Core smart contracts of Uniswap V3", - "license": "BUSL-1.1", - "publishConfig": { - "access": "public" - }, - "version": "1.0.0", - "homepage": "https://uniswap.org", - "keywords": [ - "uniswap", - "core", - "v3" - ], - "repository": { - "type": "git", - "url": "https://github.com/Uniswap/uniswap-v3-core" - }, - "files": [ - "contracts/interfaces", - "contracts/libraries", - "artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json", - "artifacts/contracts/UniswapV3Pool.sol/UniswapV3Pool.json", - "artifacts/contracts/interfaces/**/*.json", - "!artifacts/contracts/interfaces/**/*.dbg.json" - ], - "engines": { - "node": ">=10" - }, - "dependencies": {}, - "devDependencies": { - "@nomiclabs/hardhat-ethers": "^2.0.2", - "@nomiclabs/hardhat-etherscan": "^2.1.1", - "@nomiclabs/hardhat-waffle": "^2.0.1", - "@typechain/ethers-v5": "^4.0.0", - "@types/chai": "^4.2.6", - "@types/mocha": "^5.2.7", - "chai": "^4.2.0", - "decimal.js": "^10.2.1", - "ethereum-waffle": "^3.0.2", - "ethers": "^5.0.8", - "hardhat": "^2.2.0", - "hardhat-typechain": "^0.3.5", - "mocha": "^6.2.2", - "mocha-chai-jest-snapshot": "^1.1.0", - "prettier": "^2.0.5", - "prettier-plugin-solidity": "^1.0.0-alpha.59", - "solhint": "^3.2.1", - "solhint-plugin-prettier": "^0.0.5", - "ts-generator": "^0.1.1", - "ts-node": "^8.5.4", - "typechain": "^4.0.0", - "typescript": "^3.7.3" - }, - "scripts": { - "compile": "hardhat compile", - "test": "hardhat test" - } -} diff --git a/contract/lib/v3-core/test/BitMath.spec.ts b/contract/lib/v3-core/test/BitMath.spec.ts deleted file mode 100644 index 00b9285..0000000 --- a/contract/lib/v3-core/test/BitMath.spec.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { expect } from './shared/expect' -import { BitMathTest } from '../typechain/BitMathTest' -import { ethers, waffle } from 'hardhat' -import snapshotGasCost from './shared/snapshotGasCost' - -const { BigNumber } = ethers - -describe('BitMath', () => { - let bitMath: BitMathTest - const fixture = async () => { - const factory = await ethers.getContractFactory('BitMathTest') - return (await factory.deploy()) as BitMathTest - } - beforeEach('deploy BitMathTest', async () => { - bitMath = await waffle.loadFixture(fixture) - }) - - describe('#mostSignificantBit', () => { - it('0', async () => { - await expect(bitMath.mostSignificantBit(0)).to.be.reverted - }) - it('1', async () => { - expect(await bitMath.mostSignificantBit(1)).to.eq(0) - }) - it('2', async () => { - expect(await bitMath.mostSignificantBit(2)).to.eq(1) - }) - it('all powers of 2', async () => { - const results = await Promise.all( - [...Array(255)].map((_, i) => bitMath.mostSignificantBit(BigNumber.from(2).pow(i))) - ) - expect(results).to.deep.eq([...Array(255)].map((_, i) => i)) - }) - it('uint256(-1)', async () => { - expect(await bitMath.mostSignificantBit(BigNumber.from(2).pow(256).sub(1))).to.eq(255) - }) - - it('gas cost of smaller number', async () => { - await snapshotGasCost(bitMath.getGasCostOfMostSignificantBit(BigNumber.from(3568))) - }) - it('gas cost of max uint128', async () => { - await snapshotGasCost(bitMath.getGasCostOfMostSignificantBit(BigNumber.from(2).pow(128).sub(1))) - }) - it('gas cost of max uint256', async () => { - await snapshotGasCost(bitMath.getGasCostOfMostSignificantBit(BigNumber.from(2).pow(256).sub(1))) - }) - }) - - describe('#leastSignificantBit', () => { - it('0', async () => { - await expect(bitMath.leastSignificantBit(0)).to.be.reverted - }) - it('1', async () => { - expect(await bitMath.leastSignificantBit(1)).to.eq(0) - }) - it('2', async () => { - expect(await bitMath.leastSignificantBit(2)).to.eq(1) - }) - it('all powers of 2', async () => { - const results = await Promise.all( - [...Array(255)].map((_, i) => bitMath.leastSignificantBit(BigNumber.from(2).pow(i))) - ) - expect(results).to.deep.eq([...Array(255)].map((_, i) => i)) - }) - it('uint256(-1)', async () => { - expect(await bitMath.leastSignificantBit(BigNumber.from(2).pow(256).sub(1))).to.eq(0) - }) - - it('gas cost of smaller number', async () => { - await snapshotGasCost(bitMath.getGasCostOfLeastSignificantBit(BigNumber.from(3568))) - }) - it('gas cost of max uint128', async () => { - await snapshotGasCost(bitMath.getGasCostOfLeastSignificantBit(BigNumber.from(2).pow(128).sub(1))) - }) - it('gas cost of max uint256', async () => { - await snapshotGasCost(bitMath.getGasCostOfLeastSignificantBit(BigNumber.from(2).pow(256).sub(1))) - }) - }) -}) diff --git a/contract/lib/v3-core/test/FullMath.spec.ts b/contract/lib/v3-core/test/FullMath.spec.ts deleted file mode 100644 index a7dfb92..0000000 --- a/contract/lib/v3-core/test/FullMath.spec.ts +++ /dev/null @@ -1,182 +0,0 @@ -import { ethers } from 'hardhat' -import { FullMathTest } from '../typechain/FullMathTest' -import { expect } from './shared/expect' -import { Decimal } from 'decimal.js' - -const { - BigNumber, - constants: { MaxUint256 }, -} = ethers -const Q128 = BigNumber.from(2).pow(128) - -Decimal.config({ toExpNeg: -500, toExpPos: 500 }) - -describe('FullMath', () => { - let fullMath: FullMathTest - before('deploy FullMathTest', async () => { - const factory = await ethers.getContractFactory('FullMathTest') - fullMath = (await factory.deploy()) as FullMathTest - }) - - describe('#mulDiv', () => { - it('reverts if denominator is 0', async () => { - await expect(fullMath.mulDiv(Q128, 5, 0)).to.be.reverted - }) - it('reverts if denominator is 0 and numerator overflows', async () => { - await expect(fullMath.mulDiv(Q128, Q128, 0)).to.be.reverted - }) - it('reverts if output overflows uint256', async () => { - await expect(fullMath.mulDiv(Q128, Q128, 1)).to.be.reverted - }) - it('reverts if output overflows uint256', async () => { - await expect(fullMath.mulDiv(Q128, Q128, 1)).to.be.reverted - }) - it('reverts on overflow with all max inputs', async () => { - await expect(fullMath.mulDiv(MaxUint256, MaxUint256, MaxUint256.sub(1))).to.be.reverted - }) - - it('all max inputs', async () => { - expect(await fullMath.mulDiv(MaxUint256, MaxUint256, MaxUint256)).to.eq(MaxUint256) - }) - - it('accurate without phantom overflow', async () => { - const result = Q128.div(3) - expect( - await fullMath.mulDiv( - Q128, - /*0.5=*/ BigNumber.from(50).mul(Q128).div(100), - /*1.5=*/ BigNumber.from(150).mul(Q128).div(100) - ) - ).to.eq(result) - }) - - it('accurate with phantom overflow', async () => { - const result = BigNumber.from(4375).mul(Q128).div(1000) - expect(await fullMath.mulDiv(Q128, BigNumber.from(35).mul(Q128), BigNumber.from(8).mul(Q128))).to.eq(result) - }) - - it('accurate with phantom overflow and repeating decimal', async () => { - const result = BigNumber.from(1).mul(Q128).div(3) - expect(await fullMath.mulDiv(Q128, BigNumber.from(1000).mul(Q128), BigNumber.from(3000).mul(Q128))).to.eq(result) - }) - }) - - describe('#mulDivRoundingUp', () => { - it('reverts if denominator is 0', async () => { - await expect(fullMath.mulDivRoundingUp(Q128, 5, 0)).to.be.reverted - }) - it('reverts if denominator is 0 and numerator overflows', async () => { - await expect(fullMath.mulDivRoundingUp(Q128, Q128, 0)).to.be.reverted - }) - it('reverts if output overflows uint256', async () => { - await expect(fullMath.mulDivRoundingUp(Q128, Q128, 1)).to.be.reverted - }) - it('reverts on overflow with all max inputs', async () => { - await expect(fullMath.mulDivRoundingUp(MaxUint256, MaxUint256, MaxUint256.sub(1))).to.be.reverted - }) - - it('reverts if mulDiv overflows 256 bits after rounding up', async () => { - await expect( - fullMath.mulDivRoundingUp( - '535006138814359', - '432862656469423142931042426214547535783388063929571229938474969', - '2' - ) - ).to.be.reverted - }) - - it('reverts if mulDiv overflows 256 bits after rounding up case 2', async () => { - await expect( - fullMath.mulDivRoundingUp( - '115792089237316195423570985008687907853269984659341747863450311749907997002549', - '115792089237316195423570985008687907853269984659341747863450311749907997002550', - '115792089237316195423570985008687907853269984653042931687443039491902864365164' - ) - ).to.be.reverted - }) - - it('all max inputs', async () => { - expect(await fullMath.mulDivRoundingUp(MaxUint256, MaxUint256, MaxUint256)).to.eq(MaxUint256) - }) - - it('accurate without phantom overflow', async () => { - const result = Q128.div(3).add(1) - expect( - await fullMath.mulDivRoundingUp( - Q128, - /*0.5=*/ BigNumber.from(50).mul(Q128).div(100), - /*1.5=*/ BigNumber.from(150).mul(Q128).div(100) - ) - ).to.eq(result) - }) - - it('accurate with phantom overflow', async () => { - const result = BigNumber.from(4375).mul(Q128).div(1000) - expect(await fullMath.mulDivRoundingUp(Q128, BigNumber.from(35).mul(Q128), BigNumber.from(8).mul(Q128))).to.eq( - result - ) - }) - - it('accurate with phantom overflow and repeating decimal', async () => { - const result = BigNumber.from(1).mul(Q128).div(3).add(1) - expect( - await fullMath.mulDivRoundingUp(Q128, BigNumber.from(1000).mul(Q128), BigNumber.from(3000).mul(Q128)) - ).to.eq(result) - }) - }) - - function pseudoRandomBigNumber() { - return BigNumber.from(new Decimal(MaxUint256.toString()).mul(Math.random().toString()).round().toString()) - } - - // tiny fuzzer. unskip to run - it.skip('check a bunch of random inputs against JS implementation', async () => { - // generates random inputs - const tests = Array(1_000) - .fill(null) - .map(() => { - return { - x: pseudoRandomBigNumber(), - y: pseudoRandomBigNumber(), - d: pseudoRandomBigNumber(), - } - }) - .map(({ x, y, d }) => { - return { - input: { - x, - y, - d, - }, - floored: fullMath.mulDiv(x, y, d), - ceiled: fullMath.mulDivRoundingUp(x, y, d), - } - }) - - await Promise.all( - tests.map(async ({ input: { x, y, d }, floored, ceiled }) => { - if (d.eq(0)) { - await expect(floored).to.be.reverted - await expect(ceiled).to.be.reverted - return - } - - if (x.eq(0) || y.eq(0)) { - await expect(floored).to.eq(0) - await expect(ceiled).to.eq(0) - } else if (x.mul(y).div(d).gt(MaxUint256)) { - await expect(floored).to.be.reverted - await expect(ceiled).to.be.reverted - } else { - expect(await floored).to.eq(x.mul(y).div(d)) - expect(await ceiled).to.eq( - x - .mul(y) - .div(d) - .add(x.mul(y).mod(d).gt(0) ? 1 : 0) - ) - } - }) - ) - }) -}) diff --git a/contract/lib/v3-core/test/LiquidityMath.spec.ts b/contract/lib/v3-core/test/LiquidityMath.spec.ts deleted file mode 100644 index 76f6ac2..0000000 --- a/contract/lib/v3-core/test/LiquidityMath.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { expect } from './shared/expect' -import { LiquidityMathTest } from '../typechain/LiquidityMathTest' -import { ethers, waffle } from 'hardhat' -import snapshotGasCost from './shared/snapshotGasCost' - -const { BigNumber } = ethers - -describe('LiquidityMath', () => { - let liquidityMath: LiquidityMathTest - const fixture = async () => { - const factory = await ethers.getContractFactory('LiquidityMathTest') - return (await factory.deploy()) as LiquidityMathTest - } - beforeEach('deploy LiquidityMathTest', async () => { - liquidityMath = await waffle.loadFixture(fixture) - }) - - describe('#addDelta', () => { - it('1 + 0', async () => { - expect(await liquidityMath.addDelta(1, 0)).to.eq(1) - }) - it('1 + -1', async () => { - expect(await liquidityMath.addDelta(1, -1)).to.eq(0) - }) - it('1 + 1', async () => { - expect(await liquidityMath.addDelta(1, 1)).to.eq(2) - }) - it('2**128-15 + 15 overflows', async () => { - await expect(liquidityMath.addDelta(BigNumber.from(2).pow(128).sub(15), 15)).to.be.revertedWith('LA') - }) - it('0 + -1 underflows', async () => { - await expect(liquidityMath.addDelta(0, -1)).to.be.revertedWith('LS') - }) - it('3 + -4 underflows', async () => { - await expect(liquidityMath.addDelta(3, -4)).to.be.revertedWith('LS') - }) - it('gas add', async () => { - await snapshotGasCost(liquidityMath.getGasCostOfAddDelta(15, 4)) - }) - it('gas sub', async () => { - await snapshotGasCost(liquidityMath.getGasCostOfAddDelta(15, -4)) - }) - }) -}) diff --git a/contract/lib/v3-core/test/NoDelegateCall.spec.ts b/contract/lib/v3-core/test/NoDelegateCall.spec.ts deleted file mode 100644 index cbeb050..0000000 --- a/contract/lib/v3-core/test/NoDelegateCall.spec.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { ethers, waffle } from 'hardhat' -import { NoDelegateCallTest } from '../typechain/NoDelegateCallTest' -import { expect } from './shared/expect' -import snapshotGasCost from './shared/snapshotGasCost' - -describe('NoDelegateCall', () => { - const [wallet, other] = waffle.provider.getWallets() - - let loadFixture: ReturnType - before('create fixture loader', async () => { - loadFixture = waffle.createFixtureLoader([wallet, other]) - }) - - const noDelegateCallFixture = async () => { - const noDelegateCallTestFactory = await ethers.getContractFactory('NoDelegateCallTest') - const noDelegateCallTest = (await noDelegateCallTestFactory.deploy()) as NoDelegateCallTest - const minimalProxyFactory = new ethers.ContractFactory( - noDelegateCallTestFactory.interface, - `3d602d80600a3d3981f3363d3d373d3d3d363d73${noDelegateCallTest.address.slice(2)}5af43d82803e903d91602b57fd5bf3`, - wallet - ) - const proxy = (await minimalProxyFactory.deploy()) as NoDelegateCallTest - return { noDelegateCallTest, proxy } - } - - let base: NoDelegateCallTest - let proxy: NoDelegateCallTest - - beforeEach('deploy test contracts', async () => { - ;({ noDelegateCallTest: base, proxy } = await loadFixture(noDelegateCallFixture)) - }) - - it('runtime overhead', async () => { - await snapshotGasCost( - (await base.getGasCostOfCannotBeDelegateCalled()).sub(await base.getGasCostOfCanBeDelegateCalled()) - ) - }) - - it('proxy can call the method without the modifier', async () => { - await proxy.canBeDelegateCalled() - }) - it('proxy cannot call the method with the modifier', async () => { - await expect(proxy.cannotBeDelegateCalled()).to.be.reverted - }) - - it('can call the method that calls into a private method with the modifier', async () => { - await base.callsIntoNoDelegateCallFunction() - }) - it('proxy cannot call the method that calls a private method with the modifier', async () => { - await expect(proxy.callsIntoNoDelegateCallFunction()).to.be.reverted - }) -}) diff --git a/contract/lib/v3-core/test/Oracle.spec.ts b/contract/lib/v3-core/test/Oracle.spec.ts deleted file mode 100644 index d5f0b1f..0000000 --- a/contract/lib/v3-core/test/Oracle.spec.ts +++ /dev/null @@ -1,799 +0,0 @@ -import { BigNumber, BigNumberish } from 'ethers' -import { ethers, waffle } from 'hardhat' -import { OracleTest } from '../typechain/OracleTest' -import checkObservationEquals from './shared/checkObservationEquals' -import { expect } from './shared/expect' -import { TEST_POOL_START_TIME } from './shared/fixtures' -import snapshotGasCost from './shared/snapshotGasCost' -import { MaxUint128 } from './shared/utilities' - -const Q128 = BigNumber.from(2).pow(128) - -describe('Oracle', () => { - const [wallet, other] = waffle.provider.getWallets() - - let loadFixture: ReturnType - before('create fixture loader', async () => { - loadFixture = waffle.createFixtureLoader([wallet, other]) - }) - - const oracleFixture = async () => { - const oracleTestFactory = await ethers.getContractFactory('OracleTest') - return (await oracleTestFactory.deploy()) as OracleTest - } - - const initializedOracleFixture = async () => { - const oracle = await oracleFixture() - await oracle.initialize({ - time: 0, - tick: 0, - liquidity: 0, - }) - return oracle - } - - describe('#initialize', () => { - let oracle: OracleTest - beforeEach('deploy test oracle', async () => { - oracle = await loadFixture(oracleFixture) - }) - it('index is 0', async () => { - await oracle.initialize({ liquidity: 1, tick: 1, time: 1 }) - expect(await oracle.index()).to.eq(0) - }) - it('cardinality is 1', async () => { - await oracle.initialize({ liquidity: 1, tick: 1, time: 1 }) - expect(await oracle.cardinality()).to.eq(1) - }) - it('cardinality next is 1', async () => { - await oracle.initialize({ liquidity: 1, tick: 1, time: 1 }) - expect(await oracle.cardinalityNext()).to.eq(1) - }) - it('sets first slot timestamp only', async () => { - await oracle.initialize({ liquidity: 1, tick: 1, time: 1 }) - checkObservationEquals(await oracle.observations(0), { - initialized: true, - blockTimestamp: 1, - tickCumulative: 0, - secondsPerLiquidityCumulativeX128: 0, - }) - }) - it('gas', async () => { - await snapshotGasCost(oracle.initialize({ liquidity: 1, tick: 1, time: 1 })) - }) - }) - - describe('#grow', () => { - let oracle: OracleTest - beforeEach('deploy initialized test oracle', async () => { - oracle = await loadFixture(initializedOracleFixture) - }) - - it('increases the cardinality next for the first call', async () => { - await oracle.grow(5) - expect(await oracle.index()).to.eq(0) - expect(await oracle.cardinality()).to.eq(1) - expect(await oracle.cardinalityNext()).to.eq(5) - }) - - it('does not touch the first slot', async () => { - await oracle.grow(5) - checkObservationEquals(await oracle.observations(0), { - secondsPerLiquidityCumulativeX128: 0, - tickCumulative: 0, - blockTimestamp: 0, - initialized: true, - }) - }) - - it('is no op if oracle is already gte that size', async () => { - await oracle.grow(5) - await oracle.grow(3) - expect(await oracle.index()).to.eq(0) - expect(await oracle.cardinality()).to.eq(1) - expect(await oracle.cardinalityNext()).to.eq(5) - }) - - it('adds data to all the slots', async () => { - await oracle.grow(5) - for (let i = 1; i < 5; i++) { - checkObservationEquals(await oracle.observations(i), { - secondsPerLiquidityCumulativeX128: 0, - tickCumulative: 0, - blockTimestamp: 1, - initialized: false, - }) - } - }) - - it('grow after wrap', async () => { - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 2, liquidity: 1, tick: 1 }) // index is now 1 - await oracle.update({ advanceTimeBy: 2, liquidity: 1, tick: 1 }) // index is now 0 again - expect(await oracle.index()).to.eq(0) - await oracle.grow(3) - expect(await oracle.index()).to.eq(0) - expect(await oracle.cardinality()).to.eq(2) - expect(await oracle.cardinalityNext()).to.eq(3) - }) - - it('gas for growing by 1 slot when index == cardinality - 1', async () => { - await snapshotGasCost(oracle.grow(2)) - }) - - it('gas for growing by 10 slots when index == cardinality - 1', async () => { - await snapshotGasCost(oracle.grow(11)) - }) - - it('gas for growing by 1 slot when index != cardinality - 1', async () => { - await oracle.grow(2) - await snapshotGasCost(oracle.grow(3)) - }) - - it('gas for growing by 10 slots when index != cardinality - 1', async () => { - await oracle.grow(2) - await snapshotGasCost(oracle.grow(12)) - }) - }) - - describe('#write', () => { - let oracle: OracleTest - - beforeEach('deploy initialized test oracle', async () => { - oracle = await loadFixture(initializedOracleFixture) - }) - - it('single element array gets overwritten', async () => { - await oracle.update({ advanceTimeBy: 1, tick: 2, liquidity: 5 }) - expect(await oracle.index()).to.eq(0) - checkObservationEquals(await oracle.observations(0), { - initialized: true, - secondsPerLiquidityCumulativeX128: '340282366920938463463374607431768211456', - tickCumulative: 0, - blockTimestamp: 1, - }) - await oracle.update({ advanceTimeBy: 5, tick: -1, liquidity: 8 }) - expect(await oracle.index()).to.eq(0) - checkObservationEquals(await oracle.observations(0), { - initialized: true, - secondsPerLiquidityCumulativeX128: '680564733841876926926749214863536422912', - tickCumulative: 10, - blockTimestamp: 6, - }) - await oracle.update({ advanceTimeBy: 3, tick: 2, liquidity: 3 }) - expect(await oracle.index()).to.eq(0) - checkObservationEquals(await oracle.observations(0), { - initialized: true, - secondsPerLiquidityCumulativeX128: '808170621437228850725514692650449502208', - tickCumulative: 7, - blockTimestamp: 9, - }) - }) - - it('does nothing if time has not changed', async () => { - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 1, tick: 3, liquidity: 2 }) - expect(await oracle.index()).to.eq(1) - await oracle.update({ advanceTimeBy: 0, tick: -5, liquidity: 9 }) - expect(await oracle.index()).to.eq(1) - }) - - it('writes an index if time has changed', async () => { - await oracle.grow(3) - await oracle.update({ advanceTimeBy: 6, tick: 3, liquidity: 2 }) - expect(await oracle.index()).to.eq(1) - await oracle.update({ advanceTimeBy: 4, tick: -5, liquidity: 9 }) - - expect(await oracle.index()).to.eq(2) - checkObservationEquals(await oracle.observations(1), { - tickCumulative: 0, - secondsPerLiquidityCumulativeX128: '2041694201525630780780247644590609268736', - initialized: true, - blockTimestamp: 6, - }) - }) - - it('grows cardinality when writing past', async () => { - await oracle.grow(2) - await oracle.grow(4) - expect(await oracle.cardinality()).to.eq(1) - await oracle.update({ advanceTimeBy: 3, tick: 5, liquidity: 6 }) - expect(await oracle.cardinality()).to.eq(4) - await oracle.update({ advanceTimeBy: 4, tick: 6, liquidity: 4 }) - expect(await oracle.cardinality()).to.eq(4) - expect(await oracle.index()).to.eq(2) - checkObservationEquals(await oracle.observations(2), { - secondsPerLiquidityCumulativeX128: '1247702012043441032699040227249816775338', - tickCumulative: 20, - initialized: true, - blockTimestamp: 7, - }) - }) - - it('wraps around', async () => { - await oracle.grow(3) - await oracle.update({ advanceTimeBy: 3, tick: 1, liquidity: 2 }) - await oracle.update({ advanceTimeBy: 4, tick: 2, liquidity: 3 }) - await oracle.update({ advanceTimeBy: 5, tick: 3, liquidity: 4 }) - - expect(await oracle.index()).to.eq(0) - - checkObservationEquals(await oracle.observations(0), { - secondsPerLiquidityCumulativeX128: '2268549112806256423089164049545121409706', - tickCumulative: 14, - initialized: true, - blockTimestamp: 12, - }) - }) - - it('accumulates liquidity', async () => { - await oracle.grow(4) - - await oracle.update({ advanceTimeBy: 3, tick: 3, liquidity: 2 }) - await oracle.update({ advanceTimeBy: 4, tick: -7, liquidity: 6 }) - await oracle.update({ advanceTimeBy: 5, tick: -2, liquidity: 4 }) - - expect(await oracle.index()).to.eq(3) - - checkObservationEquals(await oracle.observations(1), { - initialized: true, - tickCumulative: 0, - secondsPerLiquidityCumulativeX128: '1020847100762815390390123822295304634368', - blockTimestamp: 3, - }) - checkObservationEquals(await oracle.observations(2), { - initialized: true, - tickCumulative: 12, - secondsPerLiquidityCumulativeX128: '1701411834604692317316873037158841057280', - blockTimestamp: 7, - }) - checkObservationEquals(await oracle.observations(3), { - initialized: true, - tickCumulative: -23, - secondsPerLiquidityCumulativeX128: '1984980473705474370203018543351981233493', - blockTimestamp: 12, - }) - checkObservationEquals(await oracle.observations(4), { - initialized: false, - tickCumulative: 0, - secondsPerLiquidityCumulativeX128: 0, - blockTimestamp: 0, - }) - }) - }) - - describe('#observe', () => { - describe('before initialization', async () => { - let oracle: OracleTest - beforeEach('deploy test oracle', async () => { - oracle = await loadFixture(oracleFixture) - }) - - const observeSingle = async (secondsAgo: number) => { - const { - tickCumulatives: [tickCumulative], - secondsPerLiquidityCumulativeX128s: [secondsPerLiquidityCumulativeX128], - } = await oracle.observe([secondsAgo]) - return { secondsPerLiquidityCumulativeX128, tickCumulative } - } - - it('fails before initialize', async () => { - await expect(observeSingle(0)).to.be.revertedWith('I') - }) - - it('fails if an older observation does not exist', async () => { - await oracle.initialize({ liquidity: 4, tick: 2, time: 5 }) - await expect(observeSingle(1)).to.be.revertedWith('OLD') - }) - - it('does not fail across overflow boundary', async () => { - await oracle.initialize({ liquidity: 4, tick: 2, time: 2 ** 32 - 1 }) - await oracle.advanceTime(2) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(1) - expect(tickCumulative).to.be.eq(2) - expect(secondsPerLiquidityCumulativeX128).to.be.eq('85070591730234615865843651857942052864') - }) - - it('interpolates correctly at max liquidity', async () => { - await oracle.initialize({ liquidity: MaxUint128, tick: 0, time: 0 }) - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 13, tick: 0, liquidity: 0 }) - let { secondsPerLiquidityCumulativeX128 } = await observeSingle(0) - expect(secondsPerLiquidityCumulativeX128).to.eq(13) - ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(6)) - expect(secondsPerLiquidityCumulativeX128).to.eq(7) - ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(12)) - expect(secondsPerLiquidityCumulativeX128).to.eq(1) - ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(13)) - expect(secondsPerLiquidityCumulativeX128).to.eq(0) - }) - - it('interpolates correctly at min liquidity', async () => { - await oracle.initialize({ liquidity: 0, tick: 0, time: 0 }) - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 13, tick: 0, liquidity: MaxUint128 }) - let { secondsPerLiquidityCumulativeX128 } = await observeSingle(0) - expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(13).shl(128)) - ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(6)) - expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(7).shl(128)) - ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(12)) - expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(1).shl(128)) - ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(13)) - expect(secondsPerLiquidityCumulativeX128).to.eq(0) - }) - - it('interpolates the same as 0 liquidity for 1 liquidity', async () => { - await oracle.initialize({ liquidity: 1, tick: 0, time: 0 }) - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 13, tick: 0, liquidity: MaxUint128 }) - let { secondsPerLiquidityCumulativeX128 } = await observeSingle(0) - expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(13).shl(128)) - ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(6)) - expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(7).shl(128)) - ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(12)) - expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(1).shl(128)) - ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(13)) - expect(secondsPerLiquidityCumulativeX128).to.eq(0) - }) - - it('interpolates correctly across uint32 seconds boundaries', async () => { - // setup - await oracle.initialize({ liquidity: 0, tick: 0, time: 0 }) - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 2 ** 32 - 6, tick: 0, liquidity: 0 }) - let { secondsPerLiquidityCumulativeX128 } = await observeSingle(0) - expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(2 ** 32 - 6).shl(128)) - await oracle.update({ advanceTimeBy: 13, tick: 0, liquidity: 0 }) - ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(0)) - expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(7).shl(128)) - - // interpolation checks - ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(3)) - expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(4).shl(128)) - ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(8)) - expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(2 ** 32 - 1).shl(128)) - }) - - it('single observation at current time', async () => { - await oracle.initialize({ liquidity: 4, tick: 2, time: 5 }) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) - expect(tickCumulative).to.eq(0) - expect(secondsPerLiquidityCumulativeX128).to.eq(0) - }) - - it('single observation in past but not earlier than secondsAgo', async () => { - await oracle.initialize({ liquidity: 4, tick: 2, time: 5 }) - await oracle.advanceTime(3) - await expect(observeSingle(4)).to.be.revertedWith('OLD') - }) - - it('single observation in past at exactly seconds ago', async () => { - await oracle.initialize({ liquidity: 4, tick: 2, time: 5 }) - await oracle.advanceTime(3) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(3) - expect(tickCumulative).to.eq(0) - expect(secondsPerLiquidityCumulativeX128).to.eq(0) - }) - - it('single observation in past counterfactual in past', async () => { - await oracle.initialize({ liquidity: 4, tick: 2, time: 5 }) - await oracle.advanceTime(3) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(1) - expect(tickCumulative).to.eq(4) - expect(secondsPerLiquidityCumulativeX128).to.eq('170141183460469231731687303715884105728') - }) - - it('single observation in past counterfactual now', async () => { - await oracle.initialize({ liquidity: 4, tick: 2, time: 5 }) - await oracle.advanceTime(3) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) - expect(tickCumulative).to.eq(6) - expect(secondsPerLiquidityCumulativeX128).to.eq('255211775190703847597530955573826158592') - }) - - it('two observations in chronological order 0 seconds ago exact', async () => { - await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) - expect(tickCumulative).to.eq(-20) - expect(secondsPerLiquidityCumulativeX128).to.eq('272225893536750770770699685945414569164') - }) - - it('two observations in chronological order 0 seconds ago counterfactual', async () => { - await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) - await oracle.advanceTime(7) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) - expect(tickCumulative).to.eq(-13) - expect(secondsPerLiquidityCumulativeX128).to.eq('1463214177760035392892510811956603309260') - }) - - it('two observations in chronological order seconds ago is exactly on first observation', async () => { - await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) - await oracle.advanceTime(7) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(11) - expect(tickCumulative).to.eq(0) - expect(secondsPerLiquidityCumulativeX128).to.eq(0) - }) - - it('two observations in chronological order seconds ago is between first and second', async () => { - await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) - await oracle.advanceTime(7) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(9) - expect(tickCumulative).to.eq(-10) - expect(secondsPerLiquidityCumulativeX128).to.eq('136112946768375385385349842972707284582') - }) - - it('two observations in reverse order 0 seconds ago exact', async () => { - await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) - await oracle.update({ advanceTimeBy: 3, tick: -5, liquidity: 4 }) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) - expect(tickCumulative).to.eq(-17) - expect(secondsPerLiquidityCumulativeX128).to.eq('782649443918158465965761597093066886348') - }) - - it('two observations in reverse order 0 seconds ago counterfactual', async () => { - await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) - await oracle.update({ advanceTimeBy: 3, tick: -5, liquidity: 4 }) - await oracle.advanceTime(7) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) - expect(tickCumulative).to.eq(-52) - expect(secondsPerLiquidityCumulativeX128).to.eq('1378143586029800777026667160098661256396') - }) - - it('two observations in reverse order seconds ago is exactly on first observation', async () => { - await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) - await oracle.update({ advanceTimeBy: 3, tick: -5, liquidity: 4 }) - await oracle.advanceTime(7) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(10) - expect(tickCumulative).to.eq(-20) - expect(secondsPerLiquidityCumulativeX128).to.eq('272225893536750770770699685945414569164') - }) - - it('two observations in reverse order seconds ago is between first and second', async () => { - await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) - await oracle.grow(2) - await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) - await oracle.update({ advanceTimeBy: 3, tick: -5, liquidity: 4 }) - await oracle.advanceTime(7) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(9) - expect(tickCumulative).to.eq(-19) - expect(secondsPerLiquidityCumulativeX128).to.eq('442367076997220002502386989661298674892') - }) - - it('can fetch multiple observations', async () => { - await oracle.initialize({ time: 5, tick: 2, liquidity: BigNumber.from(2).pow(15) }) - await oracle.grow(4) - await oracle.update({ advanceTimeBy: 13, tick: 6, liquidity: BigNumber.from(2).pow(12) }) - await oracle.advanceTime(5) - - const { tickCumulatives, secondsPerLiquidityCumulativeX128s } = await oracle.observe([0, 3, 8, 13, 15, 18]) - expect(tickCumulatives).to.have.lengthOf(6) - expect(tickCumulatives[0]).to.eq(56) - expect(tickCumulatives[1]).to.eq(38) - expect(tickCumulatives[2]).to.eq(20) - expect(tickCumulatives[3]).to.eq(10) - expect(tickCumulatives[4]).to.eq(6) - expect(tickCumulatives[5]).to.eq(0) - expect(secondsPerLiquidityCumulativeX128s).to.have.lengthOf(6) - expect(secondsPerLiquidityCumulativeX128s[0]).to.eq('550383467004691728624232610897330176') - expect(secondsPerLiquidityCumulativeX128s[1]).to.eq('301153217795020002454768787094765568') - expect(secondsPerLiquidityCumulativeX128s[2]).to.eq('103845937170696552570609926584401920') - expect(secondsPerLiquidityCumulativeX128s[3]).to.eq('51922968585348276285304963292200960') - expect(secondsPerLiquidityCumulativeX128s[4]).to.eq('31153781151208965771182977975320576') - expect(secondsPerLiquidityCumulativeX128s[5]).to.eq(0) - }) - - it('gas for observe since most recent', async () => { - await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) - await oracle.advanceTime(2) - await snapshotGasCost(oracle.getGasCostOfObserve([1])) - }) - - it('gas for single observation at current time', async () => { - await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) - await snapshotGasCost(oracle.getGasCostOfObserve([0])) - }) - - it('gas for single observation at current time counterfactually computed', async () => { - await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) - await oracle.advanceTime(5) - await snapshotGasCost(oracle.getGasCostOfObserve([0])) - }) - }) - - for (const startingTime of [5, 2 ** 32 - 5]) { - describe(`initialized with 5 observations with starting time of ${startingTime}`, () => { - const oracleFixture5Observations = async () => { - const oracle = await oracleFixture() - await oracle.initialize({ liquidity: 5, tick: -5, time: startingTime }) - await oracle.grow(5) - await oracle.update({ advanceTimeBy: 3, tick: 1, liquidity: 2 }) - await oracle.update({ advanceTimeBy: 2, tick: -6, liquidity: 4 }) - await oracle.update({ advanceTimeBy: 4, tick: -2, liquidity: 4 }) - await oracle.update({ advanceTimeBy: 1, tick: -2, liquidity: 9 }) - await oracle.update({ advanceTimeBy: 3, tick: 4, liquidity: 2 }) - await oracle.update({ advanceTimeBy: 6, tick: 6, liquidity: 7 }) - return oracle - } - let oracle: OracleTest - beforeEach('set up observations', async () => { - oracle = await loadFixture(oracleFixture5Observations) - }) - - const observeSingle = async (secondsAgo: number) => { - const { - tickCumulatives: [tickCumulative], - secondsPerLiquidityCumulativeX128s: [secondsPerLiquidityCumulativeX128], - } = await oracle.observe([secondsAgo]) - return { secondsPerLiquidityCumulativeX128, tickCumulative } - } - - it('index, cardinality, cardinality next', async () => { - expect(await oracle.index()).to.eq(1) - expect(await oracle.cardinality()).to.eq(5) - expect(await oracle.cardinalityNext()).to.eq(5) - }) - it('latest observation same time as latest', async () => { - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) - expect(tickCumulative).to.eq(-21) - expect(secondsPerLiquidityCumulativeX128).to.eq('2104079302127802832415199655953100107502') - }) - it('latest observation 5 seconds after latest', async () => { - await oracle.advanceTime(5) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(5) - expect(tickCumulative).to.eq(-21) - expect(secondsPerLiquidityCumulativeX128).to.eq('2104079302127802832415199655953100107502') - }) - it('current observation 5 seconds after latest', async () => { - await oracle.advanceTime(5) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) - expect(tickCumulative).to.eq(9) - expect(secondsPerLiquidityCumulativeX128).to.eq('2347138135642758877746181518404363115684') - }) - it('between latest observation and just before latest observation at same time as latest', async () => { - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(3) - expect(tickCumulative).to.eq(-33) - expect(secondsPerLiquidityCumulativeX128).to.eq('1593655751746395137220137744805447790318') - }) - it('between latest observation and just before latest observation after the latest observation', async () => { - await oracle.advanceTime(5) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(8) - expect(tickCumulative).to.eq(-33) - expect(secondsPerLiquidityCumulativeX128).to.eq('1593655751746395137220137744805447790318') - }) - it('older than oldest reverts', async () => { - await expect(observeSingle(15)).to.be.revertedWith('OLD') - await oracle.advanceTime(5) - await expect(observeSingle(20)).to.be.revertedWith('OLD') - }) - it('oldest observation', async () => { - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(14) - expect(tickCumulative).to.eq(-13) - expect(secondsPerLiquidityCumulativeX128).to.eq('544451787073501541541399371890829138329') - }) - it('oldest observation after some time', async () => { - await oracle.advanceTime(6) - const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(20) - expect(tickCumulative).to.eq(-13) - expect(secondsPerLiquidityCumulativeX128).to.eq('544451787073501541541399371890829138329') - }) - - it('fetch many values', async () => { - await oracle.advanceTime(6) - const { tickCumulatives, secondsPerLiquidityCumulativeX128s } = await oracle.observe([ - 20, - 17, - 13, - 10, - 5, - 1, - 0, - ]) - expect({ - tickCumulatives: tickCumulatives.map((tc) => tc.toNumber()), - secondsPerLiquidityCumulativeX128s: secondsPerLiquidityCumulativeX128s.map((lc) => lc.toString()), - }).to.matchSnapshot() - }) - - it('gas all of last 20 seconds', async () => { - await oracle.advanceTime(6) - await snapshotGasCost( - oracle.getGasCostOfObserve([20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) - ) - }) - - it('gas latest equal', async () => { - await snapshotGasCost(oracle.getGasCostOfObserve([0])) - }) - it('gas latest transform', async () => { - await oracle.advanceTime(5) - await snapshotGasCost(oracle.getGasCostOfObserve([0])) - }) - it('gas oldest', async () => { - await snapshotGasCost(oracle.getGasCostOfObserve([14])) - }) - it('gas between oldest and oldest + 1', async () => { - await snapshotGasCost(oracle.getGasCostOfObserve([13])) - }) - it('gas middle', async () => { - await snapshotGasCost(oracle.getGasCostOfObserve([5])) - }) - }) - } - }) - - describe.skip('full oracle', function () { - this.timeout(1_200_000) - - let oracle: OracleTest - - const BATCH_SIZE = 300 - - const STARTING_TIME = TEST_POOL_START_TIME - - const maxedOutOracleFixture = async () => { - const oracle = await oracleFixture() - await oracle.initialize({ liquidity: 0, tick: 0, time: STARTING_TIME }) - let cardinalityNext = await oracle.cardinalityNext() - while (cardinalityNext < 65535) { - const growTo = Math.min(65535, cardinalityNext + BATCH_SIZE) - console.log('growing from', cardinalityNext, 'to', growTo) - await oracle.grow(growTo) - cardinalityNext = growTo - } - - for (let i = 0; i < 65535; i += BATCH_SIZE) { - console.log('batch update starting at', i) - const batch = Array(BATCH_SIZE) - .fill(null) - .map((_, j) => ({ - advanceTimeBy: 13, - tick: -i - j, - liquidity: i + j, - })) - await oracle.batchUpdate(batch) - } - - return oracle - } - - beforeEach('create a full oracle', async () => { - oracle = await loadFixture(maxedOutOracleFixture) - }) - - it('has max cardinality next', async () => { - expect(await oracle.cardinalityNext()).to.eq(65535) - }) - - it('has max cardinality', async () => { - expect(await oracle.cardinality()).to.eq(65535) - }) - - it('index wrapped around', async () => { - expect(await oracle.index()).to.eq(165) - }) - - async function checkObserve( - secondsAgo: number, - expected?: { tickCumulative: BigNumberish; secondsPerLiquidityCumulativeX128: BigNumberish } - ) { - const { tickCumulatives, secondsPerLiquidityCumulativeX128s } = await oracle.observe([secondsAgo]) - const check = { - tickCumulative: tickCumulatives[0].toString(), - secondsPerLiquidityCumulativeX128: secondsPerLiquidityCumulativeX128s[0].toString(), - } - if (typeof expected === 'undefined') { - expect(check).to.matchSnapshot() - } else { - expect(check).to.deep.eq({ - tickCumulative: expected.tickCumulative.toString(), - secondsPerLiquidityCumulativeX128: expected.secondsPerLiquidityCumulativeX128.toString(), - }) - } - } - - it('can observe into the ordered portion with exact seconds ago', async () => { - await checkObserve(100 * 13, { - secondsPerLiquidityCumulativeX128: '60465049086512033878831623038233202591033', - tickCumulative: '-27970560813', - }) - }) - - it('can observe into the ordered portion with unexact seconds ago', async () => { - await checkObserve(100 * 13 + 5, { - secondsPerLiquidityCumulativeX128: '60465023149565257990964350912969670793706', - tickCumulative: '-27970232823', - }) - }) - - it('can observe at exactly the latest observation', async () => { - await checkObserve(0, { - secondsPerLiquidityCumulativeX128: '60471787506468701386237800669810720099776', - tickCumulative: '-28055903863', - }) - }) - - it('can observe at exactly the latest observation after some time passes', async () => { - await oracle.advanceTime(5) - await checkObserve(5, { - secondsPerLiquidityCumulativeX128: '60471787506468701386237800669810720099776', - tickCumulative: '-28055903863', - }) - }) - - it('can observe after the latest observation counterfactual', async () => { - await oracle.advanceTime(5) - await checkObserve(3, { - secondsPerLiquidityCumulativeX128: '60471797865298117996489508104462919730461', - tickCumulative: '-28056035261', - }) - }) - - it('can observe into the unordered portion of array at exact seconds ago of observation', async () => { - await checkObserve(200 * 13, { - secondsPerLiquidityCumulativeX128: '60458300386499273141628780395875293027404', - tickCumulative: '-27885347763', - }) - }) - - it('can observe into the unordered portion of array at seconds ago between observations', async () => { - await checkObserve(200 * 13 + 5, { - secondsPerLiquidityCumulativeX128: '60458274409952896081377821330361274907140', - tickCumulative: '-27885020273', - }) - }) - - it('can observe the oldest observation 13*65534 seconds ago', async () => { - await checkObserve(13 * 65534, { - secondsPerLiquidityCumulativeX128: '33974356747348039873972993881117400879779', - tickCumulative: '-175890', - }) - }) - - it('can observe the oldest observation 13*65534 + 5 seconds ago if time has elapsed', async () => { - await oracle.advanceTime(5) - await checkObserve(13 * 65534 + 5, { - secondsPerLiquidityCumulativeX128: '33974356747348039873972993881117400879779', - tickCumulative: '-175890', - }) - }) - - it('gas cost of observe(0)', async () => { - await snapshotGasCost(oracle.getGasCostOfObserve([0])) - }) - it('gas cost of observe(200 * 13)', async () => { - await snapshotGasCost(oracle.getGasCostOfObserve([200 + 13])) - }) - it('gas cost of observe(200 * 13 + 5)', async () => { - await snapshotGasCost(oracle.getGasCostOfObserve([200 + 13 + 5])) - }) - it('gas cost of observe(0) after 5 seconds', async () => { - await oracle.advanceTime(5) - await snapshotGasCost(oracle.getGasCostOfObserve([0])) - }) - it('gas cost of observe(5) after 5 seconds', async () => { - await oracle.advanceTime(5) - await snapshotGasCost(oracle.getGasCostOfObserve([5])) - }) - it('gas cost of observe(oldest)', async () => { - await snapshotGasCost(oracle.getGasCostOfObserve([65534 * 13])) - }) - it('gas cost of observe(oldest) after 5 seconds', async () => { - await oracle.advanceTime(5) - await snapshotGasCost(oracle.getGasCostOfObserve([65534 * 13 + 5])) - }) - }) -}) diff --git a/contract/lib/v3-core/test/SqrtPriceMath.spec.ts b/contract/lib/v3-core/test/SqrtPriceMath.spec.ts deleted file mode 100644 index ef01245..0000000 --- a/contract/lib/v3-core/test/SqrtPriceMath.spec.ts +++ /dev/null @@ -1,379 +0,0 @@ -import { BigNumber, constants } from 'ethers' -import { ethers } from 'hardhat' -import { SqrtPriceMathTest } from '../typechain/SqrtPriceMathTest' - -import { expect } from './shared/expect' -import snapshotGasCost from './shared/snapshotGasCost' -import { encodePriceSqrt, expandTo18Decimals, MaxUint128 } from './shared/utilities' - -const { - constants: { MaxUint256 }, -} = ethers - -describe('SqrtPriceMath', () => { - let sqrtPriceMath: SqrtPriceMathTest - before(async () => { - const sqrtPriceMathTestFactory = await ethers.getContractFactory('SqrtPriceMathTest') - sqrtPriceMath = (await sqrtPriceMathTestFactory.deploy()) as SqrtPriceMathTest - }) - - describe('#getNextSqrtPriceFromInput', () => { - it('fails if price is zero', async () => { - await expect(sqrtPriceMath.getNextSqrtPriceFromInput(0, 0, expandTo18Decimals(1).div(10), false)).to.be.reverted - }) - - it('fails if liquidity is zero', async () => { - await expect(sqrtPriceMath.getNextSqrtPriceFromInput(1, 0, expandTo18Decimals(1).div(10), true)).to.be.reverted - }) - - it('fails if input amount overflows the price', async () => { - const price = BigNumber.from(2).pow(160).sub(1) - const liquidity = 1024 - const amountIn = 1024 - await expect(sqrtPriceMath.getNextSqrtPriceFromInput(price, liquidity, amountIn, false)).to.be.reverted - }) - - it('any input amount cannot underflow the price', async () => { - const price = 1 - const liquidity = 1 - const amountIn = BigNumber.from(2).pow(255) - expect(await sqrtPriceMath.getNextSqrtPriceFromInput(price, liquidity, amountIn, true)).to.eq(1) - }) - - it('returns input price if amount in is zero and zeroForOne = true', async () => { - const price = encodePriceSqrt(1, 1) - expect(await sqrtPriceMath.getNextSqrtPriceFromInput(price, expandTo18Decimals(1).div(10), 0, true)).to.eq(price) - }) - - it('returns input price if amount in is zero and zeroForOne = false', async () => { - const price = encodePriceSqrt(1, 1) - expect(await sqrtPriceMath.getNextSqrtPriceFromInput(price, expandTo18Decimals(1).div(10), 0, false)).to.eq(price) - }) - - it('returns the minimum price for max inputs', async () => { - const sqrtP = BigNumber.from(2).pow(160).sub(1) - const liquidity = MaxUint128 - const maxAmountNoOverflow = MaxUint256.sub(liquidity.shl(96).div(sqrtP)) - expect(await sqrtPriceMath.getNextSqrtPriceFromInput(sqrtP, liquidity, maxAmountNoOverflow, true)).to.eq('1') - }) - - it('input amount of 0.1 token1', async () => { - const sqrtQ = await sqrtPriceMath.getNextSqrtPriceFromInput( - encodePriceSqrt(1, 1), - expandTo18Decimals(1), - expandTo18Decimals(1).div(10), - false - ) - expect(sqrtQ).to.eq('87150978765690771352898345369') - }) - - it('input amount of 0.1 token0', async () => { - const sqrtQ = await sqrtPriceMath.getNextSqrtPriceFromInput( - encodePriceSqrt(1, 1), - expandTo18Decimals(1), - expandTo18Decimals(1).div(10), - true - ) - expect(sqrtQ).to.eq('72025602285694852357767227579') - }) - - it('amountIn > type(uint96).max and zeroForOne = true', async () => { - expect( - await sqrtPriceMath.getNextSqrtPriceFromInput( - encodePriceSqrt(1, 1), - expandTo18Decimals(10), - BigNumber.from(2).pow(100), - true - ) - // perfect answer: - // https://www.wolframalpha.com/input/?i=624999999995069620+-+%28%281e19+*+1+%2F+%281e19+%2B+2%5E100+*+1%29%29+*+2%5E96%29 - ).to.eq('624999999995069620') - }) - - it('can return 1 with enough amountIn and zeroForOne = true', async () => { - expect( - await sqrtPriceMath.getNextSqrtPriceFromInput(encodePriceSqrt(1, 1), 1, constants.MaxUint256.div(2), true) - ).to.eq(1) - }) - - it('zeroForOne = true gas', async () => { - await snapshotGasCost( - sqrtPriceMath.getGasCostOfGetNextSqrtPriceFromInput( - encodePriceSqrt(1, 1), - expandTo18Decimals(1), - expandTo18Decimals(1).div(10), - true - ) - ) - }) - - it('zeroForOne = false gas', async () => { - await snapshotGasCost( - sqrtPriceMath.getGasCostOfGetNextSqrtPriceFromInput( - encodePriceSqrt(1, 1), - expandTo18Decimals(1), - expandTo18Decimals(1).div(10), - false - ) - ) - }) - }) - - describe('#getNextSqrtPriceFromOutput', () => { - it('fails if price is zero', async () => { - await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(0, 0, expandTo18Decimals(1).div(10), false)).to.be.reverted - }) - - it('fails if liquidity is zero', async () => { - await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(1, 0, expandTo18Decimals(1).div(10), true)).to.be.reverted - }) - - it('fails if output amount is exactly the virtual reserves of token0', async () => { - const price = '20282409603651670423947251286016' - const liquidity = 1024 - const amountOut = 4 - await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(price, liquidity, amountOut, false)).to.be.reverted - }) - - it('fails if output amount is greater than virtual reserves of token0', async () => { - const price = '20282409603651670423947251286016' - const liquidity = 1024 - const amountOut = 5 - await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(price, liquidity, amountOut, false)).to.be.reverted - }) - - it('fails if output amount is greater than virtual reserves of token1', async () => { - const price = '20282409603651670423947251286016' - const liquidity = 1024 - const amountOut = 262145 - await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(price, liquidity, amountOut, true)).to.be.reverted - }) - - it('fails if output amount is exactly the virtual reserves of token1', async () => { - const price = '20282409603651670423947251286016' - const liquidity = 1024 - const amountOut = 262144 - await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(price, liquidity, amountOut, true)).to.be.reverted - }) - - it('succeeds if output amount is just less than the virtual reserves of token1', async () => { - const price = '20282409603651670423947251286016' - const liquidity = 1024 - const amountOut = 262143 - const sqrtQ = await sqrtPriceMath.getNextSqrtPriceFromOutput(price, liquidity, amountOut, true) - expect(sqrtQ).to.eq('77371252455336267181195264') - }) - - it('puzzling echidna test', async () => { - const price = '20282409603651670423947251286016' - const liquidity = 1024 - const amountOut = 4 - - await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(price, liquidity, amountOut, false)).to.be.reverted - }) - - it('returns input price if amount in is zero and zeroForOne = true', async () => { - const price = encodePriceSqrt(1, 1) - expect(await sqrtPriceMath.getNextSqrtPriceFromOutput(price, expandTo18Decimals(1).div(10), 0, true)).to.eq(price) - }) - - it('returns input price if amount in is zero and zeroForOne = false', async () => { - const price = encodePriceSqrt(1, 1) - expect(await sqrtPriceMath.getNextSqrtPriceFromOutput(price, expandTo18Decimals(1).div(10), 0, false)).to.eq( - price - ) - }) - - it('output amount of 0.1 token1', async () => { - const sqrtQ = await sqrtPriceMath.getNextSqrtPriceFromOutput( - encodePriceSqrt(1, 1), - expandTo18Decimals(1), - expandTo18Decimals(1).div(10), - false - ) - expect(sqrtQ).to.eq('88031291682515930659493278152') - }) - - it('output amount of 0.1 token1', async () => { - const sqrtQ = await sqrtPriceMath.getNextSqrtPriceFromOutput( - encodePriceSqrt(1, 1), - expandTo18Decimals(1), - expandTo18Decimals(1).div(10), - true - ) - expect(sqrtQ).to.eq('71305346262837903834189555302') - }) - - it('reverts if amountOut is impossible in zero for one direction', async () => { - await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(encodePriceSqrt(1, 1), 1, constants.MaxUint256, true)).to.be - .reverted - }) - - it('reverts if amountOut is impossible in one for zero direction', async () => { - await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(encodePriceSqrt(1, 1), 1, constants.MaxUint256, false)).to - .be.reverted - }) - - it('zeroForOne = true gas', async () => { - await snapshotGasCost( - sqrtPriceMath.getGasCostOfGetNextSqrtPriceFromOutput( - encodePriceSqrt(1, 1), - expandTo18Decimals(1), - expandTo18Decimals(1).div(10), - true - ) - ) - }) - - it('zeroForOne = false gas', async () => { - await snapshotGasCost( - sqrtPriceMath.getGasCostOfGetNextSqrtPriceFromOutput( - encodePriceSqrt(1, 1), - expandTo18Decimals(1), - expandTo18Decimals(1).div(10), - false - ) - ) - }) - }) - - describe('#getAmount0Delta', () => { - it('returns 0 if liquidity is 0', async () => { - const amount0 = await sqrtPriceMath.getAmount0Delta(encodePriceSqrt(1, 1), encodePriceSqrt(2, 1), 0, true) - - expect(amount0).to.eq(0) - }) - it('returns 0 if prices are equal', async () => { - const amount0 = await sqrtPriceMath.getAmount0Delta(encodePriceSqrt(1, 1), encodePriceSqrt(1, 1), 0, true) - - expect(amount0).to.eq(0) - }) - - it('returns 0.1 amount1 for price of 1 to 1.21', async () => { - const amount0 = await sqrtPriceMath.getAmount0Delta( - encodePriceSqrt(1, 1), - encodePriceSqrt(121, 100), - expandTo18Decimals(1), - true - ) - expect(amount0).to.eq('90909090909090910') - - const amount0RoundedDown = await sqrtPriceMath.getAmount0Delta( - encodePriceSqrt(1, 1), - encodePriceSqrt(121, 100), - expandTo18Decimals(1), - false - ) - - expect(amount0RoundedDown).to.eq(amount0.sub(1)) - }) - - it('works for prices that overflow', async () => { - const amount0Up = await sqrtPriceMath.getAmount0Delta( - encodePriceSqrt(BigNumber.from(2).pow(90), 1), - encodePriceSqrt(BigNumber.from(2).pow(96), 1), - expandTo18Decimals(1), - true - ) - const amount0Down = await sqrtPriceMath.getAmount0Delta( - encodePriceSqrt(BigNumber.from(2).pow(90), 1), - encodePriceSqrt(BigNumber.from(2).pow(96), 1), - expandTo18Decimals(1), - false - ) - expect(amount0Up).to.eq(amount0Down.add(1)) - }) - - it(`gas cost for amount0 where roundUp = true`, async () => { - await snapshotGasCost( - sqrtPriceMath.getGasCostOfGetAmount0Delta( - encodePriceSqrt(100, 121), - encodePriceSqrt(1, 1), - expandTo18Decimals(1), - true - ) - ) - }) - - it(`gas cost for amount0 where roundUp = true`, async () => { - await snapshotGasCost( - sqrtPriceMath.getGasCostOfGetAmount0Delta( - encodePriceSqrt(100, 121), - encodePriceSqrt(1, 1), - expandTo18Decimals(1), - false - ) - ) - }) - }) - - describe('#getAmount1Delta', () => { - it('returns 0 if liquidity is 0', async () => { - const amount1 = await sqrtPriceMath.getAmount1Delta(encodePriceSqrt(1, 1), encodePriceSqrt(2, 1), 0, true) - - expect(amount1).to.eq(0) - }) - it('returns 0 if prices are equal', async () => { - const amount1 = await sqrtPriceMath.getAmount0Delta(encodePriceSqrt(1, 1), encodePriceSqrt(1, 1), 0, true) - - expect(amount1).to.eq(0) - }) - - it('returns 0.1 amount1 for price of 1 to 1.21', async () => { - const amount1 = await sqrtPriceMath.getAmount1Delta( - encodePriceSqrt(1, 1), - encodePriceSqrt(121, 100), - expandTo18Decimals(1), - true - ) - - expect(amount1).to.eq('100000000000000000') - const amount1RoundedDown = await sqrtPriceMath.getAmount1Delta( - encodePriceSqrt(1, 1), - encodePriceSqrt(121, 100), - expandTo18Decimals(1), - false - ) - - expect(amount1RoundedDown).to.eq(amount1.sub(1)) - }) - - it(`gas cost for amount0 where roundUp = true`, async () => { - await snapshotGasCost( - sqrtPriceMath.getGasCostOfGetAmount0Delta( - encodePriceSqrt(100, 121), - encodePriceSqrt(1, 1), - expandTo18Decimals(1), - true - ) - ) - }) - - it(`gas cost for amount0 where roundUp = false`, async () => { - await snapshotGasCost( - sqrtPriceMath.getGasCostOfGetAmount0Delta( - encodePriceSqrt(100, 121), - encodePriceSqrt(1, 1), - expandTo18Decimals(1), - false - ) - ) - }) - }) - - describe('swap computation', () => { - it('sqrtP * sqrtQ overflows', async () => { - // getNextSqrtPriceInvariants(1025574284609383690408304870162715216695788925244,50015962439936049619261659728067971248,406,true) - const sqrtP = '1025574284609383690408304870162715216695788925244' - const liquidity = '50015962439936049619261659728067971248' - const zeroForOne = true - const amountIn = '406' - - const sqrtQ = await sqrtPriceMath.getNextSqrtPriceFromInput(sqrtP, liquidity, amountIn, zeroForOne) - expect(sqrtQ).to.eq('1025574284609383582644711336373707553698163132913') - - const amount0Delta = await sqrtPriceMath.getAmount0Delta(sqrtQ, sqrtP, liquidity, true) - expect(amount0Delta).to.eq('406') - }) - }) -}) diff --git a/contract/lib/v3-core/test/SwapMath.spec.ts b/contract/lib/v3-core/test/SwapMath.spec.ts deleted file mode 100644 index 2dbd920..0000000 --- a/contract/lib/v3-core/test/SwapMath.spec.ts +++ /dev/null @@ -1,324 +0,0 @@ -import { BigNumber } from 'ethers' -import { ethers } from 'hardhat' -import { SwapMathTest } from '../typechain/SwapMathTest' - -import { expect } from './shared/expect' -import snapshotGasCost from './shared/snapshotGasCost' -import { encodePriceSqrt, expandTo18Decimals } from './shared/utilities' -import { SqrtPriceMathTest } from '../typechain/SqrtPriceMathTest' - -describe('SwapMath', () => { - let swapMath: SwapMathTest - let sqrtPriceMath: SqrtPriceMathTest - before(async () => { - const swapMathTestFactory = await ethers.getContractFactory('SwapMathTest') - const sqrtPriceMathTestFactory = await ethers.getContractFactory('SqrtPriceMathTest') - swapMath = (await swapMathTestFactory.deploy()) as SwapMathTest - sqrtPriceMath = (await sqrtPriceMathTestFactory.deploy()) as SqrtPriceMathTest - }) - - describe('#computeSwapStep', () => { - it('exact amount in that gets capped at price target in one for zero', async () => { - const price = encodePriceSqrt(1, 1) - const priceTarget = encodePriceSqrt(101, 100) - const liquidity = expandTo18Decimals(2) - const amount = expandTo18Decimals(1) - const fee = 600 - const zeroForOne = false - - const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( - price, - priceTarget, - liquidity, - amount, - fee - ) - - expect(amountIn).to.eq('9975124224178055') - expect(feeAmount).to.eq('5988667735148') - expect(amountOut).to.eq('9925619580021728') - expect(amountIn.add(feeAmount), 'entire amount is not used').to.lt(amount) - - const priceAfterWholeInputAmount = await sqrtPriceMath.getNextSqrtPriceFromInput( - price, - liquidity, - amount, - zeroForOne - ) - - expect(sqrtQ, 'price is capped at price target').to.eq(priceTarget) - expect(sqrtQ, 'price is less than price after whole input amount').to.lt(priceAfterWholeInputAmount) - }) - - it('exact amount out that gets capped at price target in one for zero', async () => { - const price = encodePriceSqrt(1, 1) - const priceTarget = encodePriceSqrt(101, 100) - const liquidity = expandTo18Decimals(2) - const amount = expandTo18Decimals(1).mul(-1) - const fee = 600 - const zeroForOne = false - - const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( - price, - priceTarget, - liquidity, - amount, - fee - ) - - expect(amountIn).to.eq('9975124224178055') - expect(feeAmount).to.eq('5988667735148') - expect(amountOut).to.eq('9925619580021728') - expect(amountOut, 'entire amount out is not returned').to.lt(amount.mul(-1)) - - const priceAfterWholeOutputAmount = await sqrtPriceMath.getNextSqrtPriceFromOutput( - price, - liquidity, - amount.mul(-1), - zeroForOne - ) - - expect(sqrtQ, 'price is capped at price target').to.eq(priceTarget) - expect(sqrtQ, 'price is less than price after whole output amount').to.lt(priceAfterWholeOutputAmount) - }) - - it('exact amount in that is fully spent in one for zero', async () => { - const price = encodePriceSqrt(1, 1) - const priceTarget = encodePriceSqrt(1000, 100) - const liquidity = expandTo18Decimals(2) - const amount = expandTo18Decimals(1) - const fee = 600 - const zeroForOne = false - - const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( - price, - priceTarget, - liquidity, - amount, - fee - ) - - expect(amountIn).to.eq('999400000000000000') - expect(feeAmount).to.eq('600000000000000') - expect(amountOut).to.eq('666399946655997866') - expect(amountIn.add(feeAmount), 'entire amount is used').to.eq(amount) - - const priceAfterWholeInputAmountLessFee = await sqrtPriceMath.getNextSqrtPriceFromInput( - price, - liquidity, - amount.sub(feeAmount), - zeroForOne - ) - - expect(sqrtQ, 'price does not reach price target').to.be.lt(priceTarget) - expect(sqrtQ, 'price is equal to price after whole input amount').to.eq(priceAfterWholeInputAmountLessFee) - }) - - it('exact amount out that is fully received in one for zero', async () => { - const price = encodePriceSqrt(1, 1) - const priceTarget = encodePriceSqrt(10000, 100) - const liquidity = expandTo18Decimals(2) - const amount = expandTo18Decimals(1).mul(-1) - const fee = 600 - const zeroForOne = false - - const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( - price, - priceTarget, - liquidity, - amount, - fee - ) - - expect(amountIn).to.eq('2000000000000000000') - expect(feeAmount).to.eq('1200720432259356') - expect(amountOut).to.eq(amount.mul(-1)) - - const priceAfterWholeOutputAmount = await sqrtPriceMath.getNextSqrtPriceFromOutput( - price, - liquidity, - amount.mul(-1), - zeroForOne - ) - - expect(sqrtQ, 'price does not reach price target').to.be.lt(priceTarget) - expect(sqrtQ, 'price is less than price after whole output amount').to.eq(priceAfterWholeOutputAmount) - }) - - it('amount out is capped at the desired amount out', async () => { - const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( - BigNumber.from('417332158212080721273783715441582'), - BigNumber.from('1452870262520218020823638996'), - '159344665391607089467575320103', - '-1', - 1 - ) - expect(amountIn).to.eq('1') - expect(feeAmount).to.eq('1') - expect(amountOut).to.eq('1') // would be 2 if not capped - expect(sqrtQ).to.eq('417332158212080721273783715441581') - }) - - it('target price of 1 uses partial input amount', async () => { - const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( - BigNumber.from('2'), - BigNumber.from('1'), - '1', - '3915081100057732413702495386755767', - 1 - ) - expect(amountIn).to.eq('39614081257132168796771975168') - expect(feeAmount).to.eq('39614120871253040049813') - expect(amountIn.add(feeAmount)).to.be.lte('3915081100057732413702495386755767') - expect(amountOut).to.eq('0') - expect(sqrtQ).to.eq('1') - }) - - it('entire input amount taken as fee', async () => { - const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( - '2413', - '79887613182836312', - '1985041575832132834610021537970', - '10', - 1872 - ) - expect(amountIn).to.eq('0') - expect(feeAmount).to.eq('10') - expect(amountOut).to.eq('0') - expect(sqrtQ).to.eq('2413') - }) - - it('handles intermediate insufficient liquidity in zero for one exact output case', async () => { - const sqrtP = BigNumber.from('20282409603651670423947251286016') - const sqrtPTarget = sqrtP.mul(11).div(10) - const liquidity = 1024 - // virtual reserves of one are only 4 - // https://www.wolframalpha.com/input/?i=1024+%2F+%2820282409603651670423947251286016+%2F+2**96%29 - const amountRemaining = -4 - const feePips = 3000 - const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( - sqrtP, - sqrtPTarget, - liquidity, - amountRemaining, - feePips - ) - expect(amountOut).to.eq(0) - expect(sqrtQ).to.eq(sqrtPTarget) - expect(amountIn).to.eq(26215) - expect(feeAmount).to.eq(79) - }) - - it('handles intermediate insufficient liquidity in one for zero exact output case', async () => { - const sqrtP = BigNumber.from('20282409603651670423947251286016') - const sqrtPTarget = sqrtP.mul(9).div(10) - const liquidity = 1024 - // virtual reserves of zero are only 262144 - // https://www.wolframalpha.com/input/?i=1024+*+%2820282409603651670423947251286016+%2F+2**96%29 - const amountRemaining = -263000 - const feePips = 3000 - const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( - sqrtP, - sqrtPTarget, - liquidity, - amountRemaining, - feePips - ) - expect(amountOut).to.eq(26214) - expect(sqrtQ).to.eq(sqrtPTarget) - expect(amountIn).to.eq(1) - expect(feeAmount).to.eq(1) - }) - - describe('gas', () => { - it('swap one for zero exact in capped', async () => { - await snapshotGasCost( - swapMath.getGasCostOfComputeSwapStep( - encodePriceSqrt(1, 1), - encodePriceSqrt(101, 100), - expandTo18Decimals(2), - expandTo18Decimals(1), - 600 - ) - ) - }) - it('swap zero for one exact in capped', async () => { - await snapshotGasCost( - swapMath.getGasCostOfComputeSwapStep( - encodePriceSqrt(1, 1), - encodePriceSqrt(99, 100), - expandTo18Decimals(2), - expandTo18Decimals(1), - 600 - ) - ) - }) - it('swap one for zero exact out capped', async () => { - await snapshotGasCost( - swapMath.getGasCostOfComputeSwapStep( - encodePriceSqrt(1, 1), - encodePriceSqrt(101, 100), - expandTo18Decimals(2), - expandTo18Decimals(1).mul(-1), - 600 - ) - ) - }) - it('swap zero for one exact out capped', async () => { - await snapshotGasCost( - swapMath.getGasCostOfComputeSwapStep( - encodePriceSqrt(1, 1), - encodePriceSqrt(99, 100), - expandTo18Decimals(2), - expandTo18Decimals(1).mul(-1), - 600 - ) - ) - }) - it('swap one for zero exact in partial', async () => { - await snapshotGasCost( - swapMath.getGasCostOfComputeSwapStep( - encodePriceSqrt(1, 1), - encodePriceSqrt(1010, 100), - expandTo18Decimals(2), - 1000, - 600 - ) - ) - }) - it('swap zero for one exact in partial', async () => { - await snapshotGasCost( - swapMath.getGasCostOfComputeSwapStep( - encodePriceSqrt(1, 1), - encodePriceSqrt(99, 1000), - expandTo18Decimals(2), - 1000, - 600 - ) - ) - }) - it('swap one for zero exact out partial', async () => { - await snapshotGasCost( - swapMath.getGasCostOfComputeSwapStep( - encodePriceSqrt(1, 1), - encodePriceSqrt(1010, 100), - expandTo18Decimals(2), - 1000, - 600 - ) - ) - }) - it('swap zero for one exact out partial', async () => { - await snapshotGasCost( - swapMath.getGasCostOfComputeSwapStep( - encodePriceSqrt(1, 1), - encodePriceSqrt(99, 1000), - expandTo18Decimals(2), - 1000, - 600 - ) - ) - }) - }) - }) -}) diff --git a/contract/lib/v3-core/test/Tick.spec.ts b/contract/lib/v3-core/test/Tick.spec.ts deleted file mode 100644 index f4b04dc..0000000 --- a/contract/lib/v3-core/test/Tick.spec.ts +++ /dev/null @@ -1,329 +0,0 @@ -import { ethers } from 'hardhat' -import { BigNumber } from 'ethers' -import { TickTest } from '../typechain/TickTest' -import { expect } from './shared/expect' -import { FeeAmount, getMaxLiquidityPerTick, TICK_SPACINGS } from './shared/utilities' - -const MaxUint128 = BigNumber.from(2).pow(128).sub(1) - -const { constants } = ethers - -describe('Tick', () => { - let tickTest: TickTest - - beforeEach('deploy TickTest', async () => { - const tickTestFactory = await ethers.getContractFactory('TickTest') - tickTest = (await tickTestFactory.deploy()) as TickTest - }) - - describe('#tickSpacingToMaxLiquidityPerTick', () => { - it('returns the correct value for low fee', async () => { - const maxLiquidityPerTick = await tickTest.tickSpacingToMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.LOW]) - expect(maxLiquidityPerTick).to.eq('1917569901783203986719870431555990') // 110.8 bits - expect(maxLiquidityPerTick).to.eq(getMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.LOW])) - }) - it('returns the correct value for medium fee', async () => { - const maxLiquidityPerTick = await tickTest.tickSpacingToMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.MEDIUM]) - expect(maxLiquidityPerTick).to.eq('11505743598341114571880798222544994') // 113.1 bits - expect(maxLiquidityPerTick).to.eq(getMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.MEDIUM])) - }) - it('returns the correct value for high fee', async () => { - const maxLiquidityPerTick = await tickTest.tickSpacingToMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.HIGH]) - expect(maxLiquidityPerTick).to.eq('38350317471085141830651933667504588') // 114.7 bits - expect(maxLiquidityPerTick).to.eq(getMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.HIGH])) - }) - it('returns the correct value for entire range', async () => { - const maxLiquidityPerTick = await tickTest.tickSpacingToMaxLiquidityPerTick(887272) - expect(maxLiquidityPerTick).to.eq(MaxUint128.div(3)) // 126 bits - expect(maxLiquidityPerTick).to.eq(getMaxLiquidityPerTick(887272)) - }) - it('returns the correct value for 2302', async () => { - const maxLiquidityPerTick = await tickTest.tickSpacingToMaxLiquidityPerTick(2302) - expect(maxLiquidityPerTick).to.eq('441351967472034323558203122479595605') // 118 bits - expect(maxLiquidityPerTick).to.eq(getMaxLiquidityPerTick(2302)) - }) - }) - - describe('#getFeeGrowthInside', () => { - it('returns all for two uninitialized ticks if tick is inside', async () => { - const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, 0, 15, 15) - expect(feeGrowthInside0X128).to.eq(15) - expect(feeGrowthInside1X128).to.eq(15) - }) - it('returns 0 for two uninitialized ticks if tick is above', async () => { - const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, 4, 15, 15) - expect(feeGrowthInside0X128).to.eq(0) - expect(feeGrowthInside1X128).to.eq(0) - }) - it('returns 0 for two uninitialized ticks if tick is below', async () => { - const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, -4, 15, 15) - expect(feeGrowthInside0X128).to.eq(0) - expect(feeGrowthInside1X128).to.eq(0) - }) - - it('subtracts upper tick if below', async () => { - await tickTest.setTick(2, { - feeGrowthOutside0X128: 2, - feeGrowthOutside1X128: 3, - liquidityGross: 0, - liquidityNet: 0, - secondsPerLiquidityOutsideX128: 0, - tickCumulativeOutside: 0, - secondsOutside: 0, - initialized: true, - }) - const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, 0, 15, 15) - expect(feeGrowthInside0X128).to.eq(13) - expect(feeGrowthInside1X128).to.eq(12) - }) - - it('subtracts lower tick if above', async () => { - await tickTest.setTick(-2, { - feeGrowthOutside0X128: 2, - feeGrowthOutside1X128: 3, - liquidityGross: 0, - liquidityNet: 0, - secondsPerLiquidityOutsideX128: 0, - tickCumulativeOutside: 0, - secondsOutside: 0, - initialized: true, - }) - const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, 0, 15, 15) - expect(feeGrowthInside0X128).to.eq(13) - expect(feeGrowthInside1X128).to.eq(12) - }) - - it('subtracts upper and lower tick if inside', async () => { - await tickTest.setTick(-2, { - feeGrowthOutside0X128: 2, - feeGrowthOutside1X128: 3, - liquidityGross: 0, - liquidityNet: 0, - secondsPerLiquidityOutsideX128: 0, - tickCumulativeOutside: 0, - secondsOutside: 0, - initialized: true, - }) - await tickTest.setTick(2, { - feeGrowthOutside0X128: 4, - feeGrowthOutside1X128: 1, - liquidityGross: 0, - liquidityNet: 0, - secondsPerLiquidityOutsideX128: 0, - tickCumulativeOutside: 0, - secondsOutside: 0, - initialized: true, - }) - const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, 0, 15, 15) - expect(feeGrowthInside0X128).to.eq(9) - expect(feeGrowthInside1X128).to.eq(11) - }) - - it('works correctly with overflow on inside tick', async () => { - await tickTest.setTick(-2, { - feeGrowthOutside0X128: constants.MaxUint256.sub(3), - feeGrowthOutside1X128: constants.MaxUint256.sub(2), - liquidityGross: 0, - liquidityNet: 0, - secondsPerLiquidityOutsideX128: 0, - tickCumulativeOutside: 0, - secondsOutside: 0, - initialized: true, - }) - await tickTest.setTick(2, { - feeGrowthOutside0X128: 3, - feeGrowthOutside1X128: 5, - liquidityGross: 0, - liquidityNet: 0, - secondsPerLiquidityOutsideX128: 0, - tickCumulativeOutside: 0, - secondsOutside: 0, - initialized: true, - }) - const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, 0, 15, 15) - expect(feeGrowthInside0X128).to.eq(16) - expect(feeGrowthInside1X128).to.eq(13) - }) - }) - - describe('#update', async () => { - it('flips from zero to nonzero', async () => { - expect(await tickTest.callStatic.update(0, 0, 1, 0, 0, 0, 0, 0, false, 3)).to.eq(true) - }) - it('does not flip from nonzero to greater nonzero', async () => { - await tickTest.update(0, 0, 1, 0, 0, 0, 0, 0, false, 3) - expect(await tickTest.callStatic.update(0, 0, 1, 0, 0, 0, 0, 0, false, 3)).to.eq(false) - }) - it('flips from nonzero to zero', async () => { - await tickTest.update(0, 0, 1, 0, 0, 0, 0, 0, false, 3) - expect(await tickTest.callStatic.update(0, 0, -1, 0, 0, 0, 0, 0, false, 3)).to.eq(true) - }) - it('does not flip from nonzero to lesser nonzero', async () => { - await tickTest.update(0, 0, 2, 0, 0, 0, 0, 0, false, 3) - expect(await tickTest.callStatic.update(0, 0, -1, 0, 0, 0, 0, 0, false, 3)).to.eq(false) - }) - it('does not flip from nonzero to lesser nonzero', async () => { - await tickTest.update(0, 0, 2, 0, 0, 0, 0, 0, false, 3) - expect(await tickTest.callStatic.update(0, 0, -1, 0, 0, 0, 0, 0, false, 3)).to.eq(false) - }) - it('reverts if total liquidity gross is greater than max', async () => { - await tickTest.update(0, 0, 2, 0, 0, 0, 0, 0, false, 3) - await tickTest.update(0, 0, 1, 0, 0, 0, 0, 0, true, 3) - await expect(tickTest.update(0, 0, 1, 0, 0, 0, 0, 0, false, 3)).to.be.revertedWith('LO') - }) - it('nets the liquidity based on upper flag', async () => { - await tickTest.update(0, 0, 2, 0, 0, 0, 0, 0, false, 10) - await tickTest.update(0, 0, 1, 0, 0, 0, 0, 0, true, 10) - await tickTest.update(0, 0, 3, 0, 0, 0, 0, 0, true, 10) - await tickTest.update(0, 0, 1, 0, 0, 0, 0, 0, false, 10) - const { liquidityGross, liquidityNet } = await tickTest.ticks(0) - expect(liquidityGross).to.eq(2 + 1 + 3 + 1) - expect(liquidityNet).to.eq(2 - 1 - 3 + 1) - }) - it('reverts on overflow liquidity gross', async () => { - await tickTest.update(0, 0, MaxUint128.div(2).sub(1), 0, 0, 0, 0, 0, false, MaxUint128) - await expect(tickTest.update(0, 0, MaxUint128.div(2).sub(1), 0, 0, 0, 0, 0, false, MaxUint128)).to.be.reverted - }) - it('assumes all growth happens below ticks lte current tick', async () => { - await tickTest.update(1, 1, 1, 1, 2, 3, 4, 5, false, MaxUint128) - const { - feeGrowthOutside0X128, - feeGrowthOutside1X128, - secondsOutside, - secondsPerLiquidityOutsideX128, - tickCumulativeOutside, - initialized, - } = await tickTest.ticks(1) - expect(feeGrowthOutside0X128).to.eq(1) - expect(feeGrowthOutside1X128).to.eq(2) - expect(secondsPerLiquidityOutsideX128).to.eq(3) - expect(tickCumulativeOutside).to.eq(4) - expect(secondsOutside).to.eq(5) - expect(initialized).to.eq(true) - }) - it('does not set any growth fields if tick is already initialized', async () => { - await tickTest.update(1, 1, 1, 1, 2, 3, 4, 5, false, MaxUint128) - await tickTest.update(1, 1, 1, 6, 7, 8, 9, 10, false, MaxUint128) - const { - feeGrowthOutside0X128, - feeGrowthOutside1X128, - secondsOutside, - secondsPerLiquidityOutsideX128, - tickCumulativeOutside, - initialized, - } = await tickTest.ticks(1) - expect(feeGrowthOutside0X128).to.eq(1) - expect(feeGrowthOutside1X128).to.eq(2) - expect(secondsPerLiquidityOutsideX128).to.eq(3) - expect(tickCumulativeOutside).to.eq(4) - expect(secondsOutside).to.eq(5) - expect(initialized).to.eq(true) - }) - it('does not set any growth fields for ticks gt current tick', async () => { - await tickTest.update(2, 1, 1, 1, 2, 3, 4, 5, false, MaxUint128) - const { - feeGrowthOutside0X128, - feeGrowthOutside1X128, - secondsOutside, - secondsPerLiquidityOutsideX128, - tickCumulativeOutside, - initialized, - } = await tickTest.ticks(2) - expect(feeGrowthOutside0X128).to.eq(0) - expect(feeGrowthOutside1X128).to.eq(0) - expect(secondsPerLiquidityOutsideX128).to.eq(0) - expect(tickCumulativeOutside).to.eq(0) - expect(secondsOutside).to.eq(0) - expect(initialized).to.eq(true) - }) - }) - - // this is skipped because the presence of the method causes slither to fail - describe('#clear', async () => { - it('deletes all the data in the tick', async () => { - await tickTest.setTick(2, { - feeGrowthOutside0X128: 1, - feeGrowthOutside1X128: 2, - liquidityGross: 3, - liquidityNet: 4, - secondsPerLiquidityOutsideX128: 5, - tickCumulativeOutside: 6, - secondsOutside: 7, - initialized: true, - }) - await tickTest.clear(2) - const { - feeGrowthOutside0X128, - feeGrowthOutside1X128, - secondsOutside, - secondsPerLiquidityOutsideX128, - liquidityGross, - tickCumulativeOutside, - liquidityNet, - initialized, - } = await tickTest.ticks(2) - expect(feeGrowthOutside0X128).to.eq(0) - expect(feeGrowthOutside1X128).to.eq(0) - expect(secondsOutside).to.eq(0) - expect(secondsPerLiquidityOutsideX128).to.eq(0) - expect(tickCumulativeOutside).to.eq(0) - expect(liquidityGross).to.eq(0) - expect(liquidityNet).to.eq(0) - expect(initialized).to.eq(false) - }) - }) - - describe('#cross', () => { - it('flips the growth variables', async () => { - await tickTest.setTick(2, { - feeGrowthOutside0X128: 1, - feeGrowthOutside1X128: 2, - liquidityGross: 3, - liquidityNet: 4, - secondsPerLiquidityOutsideX128: 5, - tickCumulativeOutside: 6, - secondsOutside: 7, - initialized: true, - }) - await tickTest.cross(2, 7, 9, 8, 15, 10) - const { - feeGrowthOutside0X128, - feeGrowthOutside1X128, - secondsOutside, - tickCumulativeOutside, - secondsPerLiquidityOutsideX128, - } = await tickTest.ticks(2) - expect(feeGrowthOutside0X128).to.eq(6) - expect(feeGrowthOutside1X128).to.eq(7) - expect(secondsPerLiquidityOutsideX128).to.eq(3) - expect(tickCumulativeOutside).to.eq(9) - expect(secondsOutside).to.eq(3) - }) - it('two flips are no op', async () => { - await tickTest.setTick(2, { - feeGrowthOutside0X128: 1, - feeGrowthOutside1X128: 2, - liquidityGross: 3, - liquidityNet: 4, - secondsPerLiquidityOutsideX128: 5, - tickCumulativeOutside: 6, - secondsOutside: 7, - initialized: true, - }) - await tickTest.cross(2, 7, 9, 8, 15, 10) - await tickTest.cross(2, 7, 9, 8, 15, 10) - const { - feeGrowthOutside0X128, - feeGrowthOutside1X128, - secondsOutside, - tickCumulativeOutside, - secondsPerLiquidityOutsideX128, - } = await tickTest.ticks(2) - expect(feeGrowthOutside0X128).to.eq(1) - expect(feeGrowthOutside1X128).to.eq(2) - expect(secondsPerLiquidityOutsideX128).to.eq(5) - expect(tickCumulativeOutside).to.eq(6) - expect(secondsOutside).to.eq(7) - }) - }) -}) diff --git a/contract/lib/v3-core/test/TickBitmap.spec.ts b/contract/lib/v3-core/test/TickBitmap.spec.ts deleted file mode 100644 index 6c50779..0000000 --- a/contract/lib/v3-core/test/TickBitmap.spec.ts +++ /dev/null @@ -1,227 +0,0 @@ -import { ethers } from 'hardhat' -import { TickBitmapTest } from '../typechain/TickBitmapTest' -import { expect } from './shared/expect' -import snapshotGasCost from './shared/snapshotGasCost' - -describe('TickBitmap', () => { - let tickBitmap: TickBitmapTest - - beforeEach('deploy TickBitmapTest', async () => { - const tickBitmapTestFactory = await ethers.getContractFactory('TickBitmapTest') - tickBitmap = (await tickBitmapTestFactory.deploy()) as TickBitmapTest - }) - - async function initTicks(ticks: number[]): Promise { - for (const tick of ticks) { - await tickBitmap.flipTick(tick) - } - } - - describe('#isInitialized', () => { - it('is false at first', async () => { - expect(await tickBitmap.isInitialized(1)).to.eq(false) - }) - it('is flipped by #flipTick', async () => { - await tickBitmap.flipTick(1) - expect(await tickBitmap.isInitialized(1)).to.eq(true) - }) - it('is flipped back by #flipTick', async () => { - await tickBitmap.flipTick(1) - await tickBitmap.flipTick(1) - expect(await tickBitmap.isInitialized(1)).to.eq(false) - }) - it('is not changed by another flip to a different tick', async () => { - await tickBitmap.flipTick(2) - expect(await tickBitmap.isInitialized(1)).to.eq(false) - }) - it('is not changed by another flip to a different tick on another word', async () => { - await tickBitmap.flipTick(1 + 256) - expect(await tickBitmap.isInitialized(257)).to.eq(true) - expect(await tickBitmap.isInitialized(1)).to.eq(false) - }) - }) - - describe('#flipTick', () => { - it('flips only the specified tick', async () => { - await tickBitmap.flipTick(-230) - expect(await tickBitmap.isInitialized(-230)).to.eq(true) - expect(await tickBitmap.isInitialized(-231)).to.eq(false) - expect(await tickBitmap.isInitialized(-229)).to.eq(false) - expect(await tickBitmap.isInitialized(-230 + 256)).to.eq(false) - expect(await tickBitmap.isInitialized(-230 - 256)).to.eq(false) - await tickBitmap.flipTick(-230) - expect(await tickBitmap.isInitialized(-230)).to.eq(false) - expect(await tickBitmap.isInitialized(-231)).to.eq(false) - expect(await tickBitmap.isInitialized(-229)).to.eq(false) - expect(await tickBitmap.isInitialized(-230 + 256)).to.eq(false) - expect(await tickBitmap.isInitialized(-230 - 256)).to.eq(false) - }) - - it('reverts only itself', async () => { - await tickBitmap.flipTick(-230) - await tickBitmap.flipTick(-259) - await tickBitmap.flipTick(-229) - await tickBitmap.flipTick(500) - await tickBitmap.flipTick(-259) - await tickBitmap.flipTick(-229) - await tickBitmap.flipTick(-259) - - expect(await tickBitmap.isInitialized(-259)).to.eq(true) - expect(await tickBitmap.isInitialized(-229)).to.eq(false) - }) - - it('gas cost of flipping first tick in word to initialized', async () => { - await snapshotGasCost(await tickBitmap.getGasCostOfFlipTick(1)) - }) - it('gas cost of flipping second tick in word to initialized', async () => { - await tickBitmap.flipTick(0) - await snapshotGasCost(await tickBitmap.getGasCostOfFlipTick(1)) - }) - it('gas cost of flipping a tick that results in deleting a word', async () => { - await tickBitmap.flipTick(0) - await snapshotGasCost(await tickBitmap.getGasCostOfFlipTick(0)) - }) - }) - - describe('#nextInitializedTickWithinOneWord', () => { - beforeEach('set up some ticks', async () => { - // word boundaries are at multiples of 256 - await initTicks([-200, -55, -4, 70, 78, 84, 139, 240, 535]) - }) - - describe('lte = false', async () => { - it('returns tick to right if at initialized tick', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(78, false) - expect(next).to.eq(84) - expect(initialized).to.eq(true) - }) - it('returns tick to right if at initialized tick', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(-55, false) - expect(next).to.eq(-4) - expect(initialized).to.eq(true) - }) - - it('returns the tick directly to the right', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(77, false) - expect(next).to.eq(78) - expect(initialized).to.eq(true) - }) - it('returns the tick directly to the right', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(-56, false) - expect(next).to.eq(-55) - expect(initialized).to.eq(true) - }) - - it('returns the next words initialized tick if on the right boundary', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(255, false) - expect(next).to.eq(511) - expect(initialized).to.eq(false) - }) - it('returns the next words initialized tick if on the right boundary', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(-257, false) - expect(next).to.eq(-200) - expect(initialized).to.eq(true) - }) - - it('returns the next initialized tick from the next word', async () => { - await tickBitmap.flipTick(340) - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(328, false) - expect(next).to.eq(340) - expect(initialized).to.eq(true) - }) - it('does not exceed boundary', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(508, false) - expect(next).to.eq(511) - expect(initialized).to.eq(false) - }) - it('skips entire word', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(255, false) - expect(next).to.eq(511) - expect(initialized).to.eq(false) - }) - it('skips half word', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(383, false) - expect(next).to.eq(511) - expect(initialized).to.eq(false) - }) - - it('gas cost on boundary', async () => { - await snapshotGasCost(await tickBitmap.getGasCostOfNextInitializedTickWithinOneWord(255, false)) - }) - it('gas cost just below boundary', async () => { - await snapshotGasCost(await tickBitmap.getGasCostOfNextInitializedTickWithinOneWord(254, false)) - }) - it('gas cost for entire word', async () => { - await snapshotGasCost(await tickBitmap.getGasCostOfNextInitializedTickWithinOneWord(768, false)) - }) - }) - - describe('lte = true', () => { - it('returns same tick if initialized', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(78, true) - - expect(next).to.eq(78) - expect(initialized).to.eq(true) - }) - it('returns tick directly to the left of input tick if not initialized', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(79, true) - - expect(next).to.eq(78) - expect(initialized).to.eq(true) - }) - it('will not exceed the word boundary', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(258, true) - - expect(next).to.eq(256) - expect(initialized).to.eq(false) - }) - it('at the word boundary', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(256, true) - - expect(next).to.eq(256) - expect(initialized).to.eq(false) - }) - it('word boundary less 1 (next initialized tick in next word)', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(72, true) - - expect(next).to.eq(70) - expect(initialized).to.eq(true) - }) - it('word boundary', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(-257, true) - - expect(next).to.eq(-512) - expect(initialized).to.eq(false) - }) - it('entire empty word', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(1023, true) - - expect(next).to.eq(768) - expect(initialized).to.eq(false) - }) - it('halfway through empty word', async () => { - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(900, true) - - expect(next).to.eq(768) - expect(initialized).to.eq(false) - }) - it('boundary is initialized', async () => { - await tickBitmap.flipTick(329) - const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(456, true) - - expect(next).to.eq(329) - expect(initialized).to.eq(true) - }) - - it('gas cost on boundary', async () => { - await snapshotGasCost(await tickBitmap.getGasCostOfNextInitializedTickWithinOneWord(256, true)) - }) - it('gas cost just below boundary', async () => { - await snapshotGasCost(await tickBitmap.getGasCostOfNextInitializedTickWithinOneWord(255, true)) - }) - it('gas cost for entire word', async () => { - await snapshotGasCost(await tickBitmap.getGasCostOfNextInitializedTickWithinOneWord(1024, true)) - }) - }) - }) -}) diff --git a/contract/lib/v3-core/test/TickMath.spec.ts b/contract/lib/v3-core/test/TickMath.spec.ts deleted file mode 100644 index 8e03a60..0000000 --- a/contract/lib/v3-core/test/TickMath.spec.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { BigNumber } from 'ethers' -import { ethers } from 'hardhat' -import { TickMathTest } from '../typechain/TickMathTest' -import { expect } from './shared/expect' -import snapshotGasCost from './shared/snapshotGasCost' -import { encodePriceSqrt, MIN_SQRT_RATIO, MAX_SQRT_RATIO } from './shared/utilities' -import Decimal from 'decimal.js' - -const MIN_TICK = -887272 -const MAX_TICK = 887272 - -Decimal.config({ toExpNeg: -500, toExpPos: 500 }) - -describe('TickMath', () => { - let tickMath: TickMathTest - - before('deploy TickMathTest', async () => { - const factory = await ethers.getContractFactory('TickMathTest') - tickMath = (await factory.deploy()) as TickMathTest - }) - - describe('#getSqrtRatioAtTick', () => { - it('throws for too low', async () => { - await expect(tickMath.getSqrtRatioAtTick(MIN_TICK - 1)).to.be.revertedWith('T') - }) - - it('throws for too low', async () => { - await expect(tickMath.getSqrtRatioAtTick(MAX_TICK + 1)).to.be.revertedWith('T') - }) - - it('min tick', async () => { - expect(await tickMath.getSqrtRatioAtTick(MIN_TICK)).to.eq('4295128739') - }) - - it('min tick +1', async () => { - expect(await tickMath.getSqrtRatioAtTick(MIN_TICK + 1)).to.eq('4295343490') - }) - - it('max tick - 1', async () => { - expect(await tickMath.getSqrtRatioAtTick(MAX_TICK - 1)).to.eq('1461373636630004318706518188784493106690254656249') - }) - - it('min tick ratio is less than js implementation', async () => { - expect(await tickMath.getSqrtRatioAtTick(MIN_TICK)).to.be.lt(encodePriceSqrt(1, BigNumber.from(2).pow(127))) - }) - - it('max tick ratio is greater than js implementation', async () => { - expect(await tickMath.getSqrtRatioAtTick(MAX_TICK)).to.be.gt(encodePriceSqrt(BigNumber.from(2).pow(127), 1)) - }) - - it('max tick', async () => { - expect(await tickMath.getSqrtRatioAtTick(MAX_TICK)).to.eq('1461446703485210103287273052203988822378723970342') - }) - - for (const absTick of [ - 50, - 100, - 250, - 500, - 1_000, - 2_500, - 3_000, - 4_000, - 5_000, - 50_000, - 150_000, - 250_000, - 500_000, - 738_203, - ]) { - for (const tick of [-absTick, absTick]) { - describe(`tick ${tick}`, () => { - it('is at most off by 1/100th of a bips', async () => { - const jsResult = new Decimal(1.0001).pow(tick).sqrt().mul(new Decimal(2).pow(96)) - const result = await tickMath.getSqrtRatioAtTick(tick) - const absDiff = new Decimal(result.toString()).sub(jsResult).abs() - expect(absDiff.div(jsResult).toNumber()).to.be.lt(0.000001) - }) - it('result', async () => { - expect((await tickMath.getSqrtRatioAtTick(tick)).toString()).to.matchSnapshot() - }) - it('gas', async () => { - await snapshotGasCost(tickMath.getGasCostOfGetSqrtRatioAtTick(tick)) - }) - }) - } - } - }) - - describe('#MIN_SQRT_RATIO', async () => { - it('equals #getSqrtRatioAtTick(MIN_TICK)', async () => { - const min = await tickMath.getSqrtRatioAtTick(MIN_TICK) - expect(min).to.eq(await tickMath.MIN_SQRT_RATIO()) - expect(min).to.eq(MIN_SQRT_RATIO) - }) - }) - - describe('#MAX_SQRT_RATIO', async () => { - it('equals #getSqrtRatioAtTick(MAX_TICK)', async () => { - const max = await tickMath.getSqrtRatioAtTick(MAX_TICK) - expect(max).to.eq(await tickMath.MAX_SQRT_RATIO()) - expect(max).to.eq(MAX_SQRT_RATIO) - }) - }) - - describe('#getTickAtSqrtRatio', () => { - it('throws for too low', async () => { - await expect(tickMath.getTickAtSqrtRatio(MIN_SQRT_RATIO.sub(1))).to.be.revertedWith('R') - }) - - it('throws for too high', async () => { - await expect(tickMath.getTickAtSqrtRatio(BigNumber.from(MAX_SQRT_RATIO))).to.be.revertedWith('R') - }) - - it('ratio of min tick', async () => { - expect(await tickMath.getTickAtSqrtRatio(MIN_SQRT_RATIO)).to.eq(MIN_TICK) - }) - it('ratio of min tick + 1', async () => { - expect(await tickMath.getTickAtSqrtRatio('4295343490')).to.eq(MIN_TICK + 1) - }) - it('ratio of max tick - 1', async () => { - expect(await tickMath.getTickAtSqrtRatio('1461373636630004318706518188784493106690254656249')).to.eq(MAX_TICK - 1) - }) - it('ratio closest to max tick', async () => { - expect(await tickMath.getTickAtSqrtRatio(MAX_SQRT_RATIO.sub(1))).to.eq(MAX_TICK - 1) - }) - - for (const ratio of [ - MIN_SQRT_RATIO, - encodePriceSqrt(BigNumber.from(10).pow(12), 1), - encodePriceSqrt(BigNumber.from(10).pow(6), 1), - encodePriceSqrt(1, 64), - encodePriceSqrt(1, 8), - encodePriceSqrt(1, 2), - encodePriceSqrt(1, 1), - encodePriceSqrt(2, 1), - encodePriceSqrt(8, 1), - encodePriceSqrt(64, 1), - encodePriceSqrt(1, BigNumber.from(10).pow(6)), - encodePriceSqrt(1, BigNumber.from(10).pow(12)), - MAX_SQRT_RATIO.sub(1), - ]) { - describe(`ratio ${ratio}`, () => { - it('is at most off by 1', async () => { - const jsResult = new Decimal(ratio.toString()).div(new Decimal(2).pow(96)).pow(2).log(1.0001).floor() - const result = await tickMath.getTickAtSqrtRatio(ratio) - const absDiff = new Decimal(result.toString()).sub(jsResult).abs() - expect(absDiff.toNumber()).to.be.lte(1) - }) - it('ratio is between the tick and tick+1', async () => { - const tick = await tickMath.getTickAtSqrtRatio(ratio) - const ratioOfTick = await tickMath.getSqrtRatioAtTick(tick) - const ratioOfTickPlusOne = await tickMath.getSqrtRatioAtTick(tick + 1) - expect(ratio).to.be.gte(ratioOfTick) - expect(ratio).to.be.lt(ratioOfTickPlusOne) - }) - it('result', async () => { - expect(await tickMath.getTickAtSqrtRatio(ratio)).to.matchSnapshot() - }) - it('gas', async () => { - await snapshotGasCost(tickMath.getGasCostOfGetTickAtSqrtRatio(ratio)) - }) - }) - } - }) -}) diff --git a/contract/lib/v3-core/test/UniswapV3Factory.spec.ts b/contract/lib/v3-core/test/UniswapV3Factory.spec.ts deleted file mode 100644 index 326c2b5..0000000 --- a/contract/lib/v3-core/test/UniswapV3Factory.spec.ts +++ /dev/null @@ -1,174 +0,0 @@ -import { ethers, waffle } from 'hardhat' -import { UniswapV3Factory } from '../typechain/UniswapV3Factory' -import { expect } from './shared/expect' -import snapshotGasCost from './shared/snapshotGasCost' - -import { FeeAmount, getCreate2Address, TICK_SPACINGS } from './shared/utilities' - -const { constants } = ethers - -const TEST_ADDRESSES: [string, string] = [ - '0x1000000000000000000000000000000000000000', - '0x2000000000000000000000000000000000000000', -] - -const createFixtureLoader = waffle.createFixtureLoader - -describe('UniswapV3Factory', () => { - const [wallet, other] = waffle.provider.getWallets() - - let factory: UniswapV3Factory - let poolBytecode: string - const fixture = async () => { - const factoryFactory = await ethers.getContractFactory('UniswapV3Factory') - return (await factoryFactory.deploy()) as UniswapV3Factory - } - - let loadFixture: ReturnType - before('create fixture loader', async () => { - loadFixture = createFixtureLoader([wallet, other]) - }) - - before('load pool bytecode', async () => { - poolBytecode = (await ethers.getContractFactory('UniswapV3Pool')).bytecode - }) - - beforeEach('deploy factory', async () => { - factory = await loadFixture(fixture) - }) - - it('owner is deployer', async () => { - expect(await factory.owner()).to.eq(wallet.address) - }) - - it('factory bytecode size', async () => { - expect(((await waffle.provider.getCode(factory.address)).length - 2) / 2).to.matchSnapshot() - }) - - it('pool bytecode size', async () => { - await factory.createPool(TEST_ADDRESSES[0], TEST_ADDRESSES[1], FeeAmount.MEDIUM) - const poolAddress = getCreate2Address(factory.address, TEST_ADDRESSES, FeeAmount.MEDIUM, poolBytecode) - expect(((await waffle.provider.getCode(poolAddress)).length - 2) / 2).to.matchSnapshot() - }) - - it('initial enabled fee amounts', async () => { - expect(await factory.feeAmountTickSpacing(FeeAmount.LOW)).to.eq(TICK_SPACINGS[FeeAmount.LOW]) - expect(await factory.feeAmountTickSpacing(FeeAmount.MEDIUM)).to.eq(TICK_SPACINGS[FeeAmount.MEDIUM]) - expect(await factory.feeAmountTickSpacing(FeeAmount.HIGH)).to.eq(TICK_SPACINGS[FeeAmount.HIGH]) - }) - - async function createAndCheckPool( - tokens: [string, string], - feeAmount: FeeAmount, - tickSpacing: number = TICK_SPACINGS[feeAmount] - ) { - const create2Address = getCreate2Address(factory.address, tokens, feeAmount, poolBytecode) - const create = factory.createPool(tokens[0], tokens[1], feeAmount) - - await expect(create) - .to.emit(factory, 'PoolCreated') - .withArgs(TEST_ADDRESSES[0], TEST_ADDRESSES[1], feeAmount, tickSpacing, create2Address) - - await expect(factory.createPool(tokens[0], tokens[1], feeAmount)).to.be.reverted - await expect(factory.createPool(tokens[1], tokens[0], feeAmount)).to.be.reverted - expect(await factory.getPool(tokens[0], tokens[1], feeAmount), 'getPool in order').to.eq(create2Address) - expect(await factory.getPool(tokens[1], tokens[0], feeAmount), 'getPool in reverse').to.eq(create2Address) - - const poolContractFactory = await ethers.getContractFactory('UniswapV3Pool') - const pool = poolContractFactory.attach(create2Address) - expect(await pool.factory(), 'pool factory address').to.eq(factory.address) - expect(await pool.token0(), 'pool token0').to.eq(TEST_ADDRESSES[0]) - expect(await pool.token1(), 'pool token1').to.eq(TEST_ADDRESSES[1]) - expect(await pool.fee(), 'pool fee').to.eq(feeAmount) - expect(await pool.tickSpacing(), 'pool tick spacing').to.eq(tickSpacing) - } - - describe('#createPool', () => { - it('succeeds for low fee pool', async () => { - await createAndCheckPool(TEST_ADDRESSES, FeeAmount.LOW) - }) - - it('succeeds for medium fee pool', async () => { - await createAndCheckPool(TEST_ADDRESSES, FeeAmount.MEDIUM) - }) - it('succeeds for high fee pool', async () => { - await createAndCheckPool(TEST_ADDRESSES, FeeAmount.HIGH) - }) - - it('succeeds if tokens are passed in reverse', async () => { - await createAndCheckPool([TEST_ADDRESSES[1], TEST_ADDRESSES[0]], FeeAmount.MEDIUM) - }) - - it('fails if token a == token b', async () => { - await expect(factory.createPool(TEST_ADDRESSES[0], TEST_ADDRESSES[0], FeeAmount.LOW)).to.be.reverted - }) - - it('fails if token a is 0 or token b is 0', async () => { - await expect(factory.createPool(TEST_ADDRESSES[0], constants.AddressZero, FeeAmount.LOW)).to.be.reverted - await expect(factory.createPool(constants.AddressZero, TEST_ADDRESSES[0], FeeAmount.LOW)).to.be.reverted - await expect(factory.createPool(constants.AddressZero, constants.AddressZero, FeeAmount.LOW)).to.be.revertedWith( - '' - ) - }) - - it('fails if fee amount is not enabled', async () => { - await expect(factory.createPool(TEST_ADDRESSES[0], TEST_ADDRESSES[1], 250)).to.be.reverted - }) - - it('gas', async () => { - await snapshotGasCost(factory.createPool(TEST_ADDRESSES[0], TEST_ADDRESSES[1], FeeAmount.MEDIUM)) - }) - }) - - describe('#setOwner', () => { - it('fails if caller is not owner', async () => { - await expect(factory.connect(other).setOwner(wallet.address)).to.be.reverted - }) - - it('updates owner', async () => { - await factory.setOwner(other.address) - expect(await factory.owner()).to.eq(other.address) - }) - - it('emits event', async () => { - await expect(factory.setOwner(other.address)) - .to.emit(factory, 'OwnerChanged') - .withArgs(wallet.address, other.address) - }) - - it('cannot be called by original owner', async () => { - await factory.setOwner(other.address) - await expect(factory.setOwner(wallet.address)).to.be.reverted - }) - }) - - describe('#enableFeeAmount', () => { - it('fails if caller is not owner', async () => { - await expect(factory.connect(other).enableFeeAmount(100, 2)).to.be.reverted - }) - it('fails if fee is too great', async () => { - await expect(factory.enableFeeAmount(1000000, 10)).to.be.reverted - }) - it('fails if tick spacing is too small', async () => { - await expect(factory.enableFeeAmount(500, 0)).to.be.reverted - }) - it('fails if tick spacing is too large', async () => { - await expect(factory.enableFeeAmount(500, 16834)).to.be.reverted - }) - it('fails if already initialized', async () => { - await factory.enableFeeAmount(100, 5) - await expect(factory.enableFeeAmount(100, 10)).to.be.reverted - }) - it('sets the fee amount in the mapping', async () => { - await factory.enableFeeAmount(100, 5) - expect(await factory.feeAmountTickSpacing(100)).to.eq(5) - }) - it('emits an event', async () => { - await expect(factory.enableFeeAmount(100, 5)).to.emit(factory, 'FeeAmountEnabled').withArgs(100, 5) - }) - it('enables pool creation', async () => { - await factory.enableFeeAmount(250, 15) - await createAndCheckPool([TEST_ADDRESSES[0], TEST_ADDRESSES[1]], 250, 15) - }) - }) -}) diff --git a/contract/lib/v3-core/test/UniswapV3Pool.arbitrage.spec.ts b/contract/lib/v3-core/test/UniswapV3Pool.arbitrage.spec.ts deleted file mode 100644 index 132c1aa..0000000 --- a/contract/lib/v3-core/test/UniswapV3Pool.arbitrage.spec.ts +++ /dev/null @@ -1,372 +0,0 @@ -import Decimal from 'decimal.js' -import { BigNumber, BigNumberish, Wallet } from 'ethers' -import { ethers, waffle } from 'hardhat' -import { MockTimeUniswapV3Pool } from '../typechain/MockTimeUniswapV3Pool' -import { TickMathTest } from '../typechain/TickMathTest' -import { UniswapV3PoolSwapTest } from '../typechain/UniswapV3PoolSwapTest' -import { expect } from './shared/expect' - -import { poolFixture } from './shared/fixtures' -import { formatPrice, formatTokenAmount } from './shared/format' - -import { - createPoolFunctions, - encodePriceSqrt, - expandTo18Decimals, - FeeAmount, - getMaxLiquidityPerTick, - getMaxTick, - getMinTick, - MAX_SQRT_RATIO, - MaxUint128, - MIN_SQRT_RATIO, - MintFunction, - SwapFunction, - TICK_SPACINGS, -} from './shared/utilities' - -const { - constants: { MaxUint256 }, -} = ethers - -const createFixtureLoader = waffle.createFixtureLoader - -Decimal.config({ toExpNeg: -500, toExpPos: 500 }) - -function applySqrtRatioBipsHundredthsDelta(sqrtRatio: BigNumber, bipsHundredths: number): BigNumber { - return BigNumber.from( - new Decimal( - sqrtRatio - .mul(sqrtRatio) - .mul(1e6 + bipsHundredths) - .div(1e6) - .toString() - ) - .sqrt() - .floor() - .toString() - ) -} - -describe('UniswapV3Pool arbitrage tests', () => { - const [wallet, arbitrageur] = waffle.provider.getWallets() - - let loadFixture: ReturnType - - before('create fixture loader', async () => { - loadFixture = createFixtureLoader([wallet, arbitrageur]) - }) - - for (const feeProtocol of [0, 6]) { - describe(`protocol fee = ${feeProtocol};`, () => { - const startingPrice = encodePriceSqrt(1, 1) - const startingTick = 0 - const feeAmount = FeeAmount.MEDIUM - const tickSpacing = TICK_SPACINGS[feeAmount] - const minTick = getMinTick(tickSpacing) - const maxTick = getMaxTick(tickSpacing) - - for (const passiveLiquidity of [ - expandTo18Decimals(1).div(100), - expandTo18Decimals(1), - expandTo18Decimals(10), - expandTo18Decimals(100), - ]) { - describe(`passive liquidity of ${formatTokenAmount(passiveLiquidity)}`, () => { - const arbTestFixture = async ([wallet, arbitrageur]: Wallet[]) => { - const fix = await poolFixture([wallet], waffle.provider) - - const pool = await fix.createPool(feeAmount, tickSpacing) - - await fix.token0.transfer(arbitrageur.address, BigNumber.from(2).pow(254)) - await fix.token1.transfer(arbitrageur.address, BigNumber.from(2).pow(254)) - - const { - swapExact0For1, - swapToHigherPrice, - swapToLowerPrice, - swapExact1For0, - mint, - } = await createPoolFunctions({ - swapTarget: fix.swapTargetCallee, - token0: fix.token0, - token1: fix.token1, - pool, - }) - - const testerFactory = await ethers.getContractFactory('UniswapV3PoolSwapTest') - const tester = (await testerFactory.deploy()) as UniswapV3PoolSwapTest - - const tickMathFactory = await ethers.getContractFactory('TickMathTest') - const tickMath = (await tickMathFactory.deploy()) as TickMathTest - - await fix.token0.approve(tester.address, MaxUint256) - await fix.token1.approve(tester.address, MaxUint256) - - await pool.initialize(startingPrice) - if (feeProtocol != 0) await pool.setFeeProtocol(feeProtocol, feeProtocol) - await mint(wallet.address, minTick, maxTick, passiveLiquidity) - - expect((await pool.slot0()).tick).to.eq(startingTick) - expect((await pool.slot0()).sqrtPriceX96).to.eq(startingPrice) - - return { pool, swapExact0For1, mint, swapToHigherPrice, swapToLowerPrice, swapExact1For0, tester, tickMath } - } - - let swapExact0For1: SwapFunction - let swapToHigherPrice: SwapFunction - let swapToLowerPrice: SwapFunction - let swapExact1For0: SwapFunction - let pool: MockTimeUniswapV3Pool - let mint: MintFunction - let tester: UniswapV3PoolSwapTest - let tickMath: TickMathTest - - beforeEach('load the fixture', async () => { - ;({ - swapExact0For1, - pool, - mint, - swapToHigherPrice, - swapToLowerPrice, - swapExact1For0, - tester, - tickMath, - } = await loadFixture(arbTestFixture)) - }) - - async function simulateSwap( - zeroForOne: boolean, - amountSpecified: BigNumberish, - sqrtPriceLimitX96?: BigNumber - ): Promise<{ - executionPrice: BigNumber - nextSqrtRatio: BigNumber - amount0Delta: BigNumber - amount1Delta: BigNumber - }> { - const { amount0Delta, amount1Delta, nextSqrtRatio } = await tester.callStatic.getSwapResult( - pool.address, - zeroForOne, - amountSpecified, - sqrtPriceLimitX96 ?? (zeroForOne ? MIN_SQRT_RATIO.add(1) : MAX_SQRT_RATIO.sub(1)) - ) - - const executionPrice = zeroForOne - ? encodePriceSqrt(amount1Delta, amount0Delta.mul(-1)) - : encodePriceSqrt(amount1Delta.mul(-1), amount0Delta) - - return { executionPrice, nextSqrtRatio, amount0Delta, amount1Delta } - } - - for (const { zeroForOne, assumedTruePriceAfterSwap, inputAmount, description } of [ - { - description: 'exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98', - zeroForOne: true, - inputAmount: expandTo18Decimals(10), - assumedTruePriceAfterSwap: encodePriceSqrt(98, 100), - }, - { - description: 'exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01', - zeroForOne: true, - inputAmount: expandTo18Decimals(10), - assumedTruePriceAfterSwap: encodePriceSqrt(101, 100), - }, - ]) { - describe(description, () => { - function valueToken1(arbBalance0: BigNumber, arbBalance1: BigNumber) { - return assumedTruePriceAfterSwap - .mul(assumedTruePriceAfterSwap) - .mul(arbBalance0) - .div(BigNumber.from(2).pow(192)) - .add(arbBalance1) - } - - it('not sandwiched', async () => { - const { executionPrice, amount1Delta, amount0Delta } = await simulateSwap(zeroForOne, inputAmount) - zeroForOne - ? await swapExact0For1(inputAmount, wallet.address) - : await swapExact1For0(inputAmount, wallet.address) - - expect({ - executionPrice: formatPrice(executionPrice), - amount0Delta: formatTokenAmount(amount0Delta), - amount1Delta: formatTokenAmount(amount1Delta), - priceAfter: formatPrice((await pool.slot0()).sqrtPriceX96), - }).to.matchSnapshot() - }) - - it('sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity', async () => { - const { executionPrice } = await simulateSwap(zeroForOne, inputAmount) - - const firstTickAboveMarginalPrice = zeroForOne - ? Math.ceil( - (await tickMath.getTickAtSqrtRatio( - applySqrtRatioBipsHundredthsDelta(executionPrice, feeAmount) - )) / tickSpacing - ) * tickSpacing - : Math.floor( - (await tickMath.getTickAtSqrtRatio( - applySqrtRatioBipsHundredthsDelta(executionPrice, -feeAmount) - )) / tickSpacing - ) * tickSpacing - const tickAfterFirstTickAboveMarginPrice = zeroForOne - ? firstTickAboveMarginalPrice - tickSpacing - : firstTickAboveMarginalPrice + tickSpacing - - const priceSwapStart = await tickMath.getSqrtRatioAtTick(firstTickAboveMarginalPrice) - - let arbBalance0 = BigNumber.from(0) - let arbBalance1 = BigNumber.from(0) - - // first frontrun to the first tick before the execution price - const { - amount0Delta: frontrunDelta0, - amount1Delta: frontrunDelta1, - executionPrice: frontrunExecutionPrice, - } = await simulateSwap(zeroForOne, MaxUint256.div(2), priceSwapStart) - arbBalance0 = arbBalance0.sub(frontrunDelta0) - arbBalance1 = arbBalance1.sub(frontrunDelta1) - zeroForOne - ? await swapToLowerPrice(priceSwapStart, arbitrageur.address) - : await swapToHigherPrice(priceSwapStart, arbitrageur.address) - - const profitToken1AfterFrontRun = valueToken1(arbBalance0, arbBalance1) - - const tickLower = zeroForOne ? tickAfterFirstTickAboveMarginPrice : firstTickAboveMarginalPrice - const tickUpper = zeroForOne ? firstTickAboveMarginalPrice : tickAfterFirstTickAboveMarginPrice - - // deposit max liquidity at the tick - const mintReceipt = await ( - await mint(wallet.address, tickLower, tickUpper, getMaxLiquidityPerTick(tickSpacing)) - ).wait() - // sub the mint costs - const { amount0: amount0Mint, amount1: amount1Mint } = pool.interface.decodeEventLog( - pool.interface.events['Mint(address,address,int24,int24,uint128,uint256,uint256)'], - mintReceipt.events?.[2].data! - ) - arbBalance0 = arbBalance0.sub(amount0Mint) - arbBalance1 = arbBalance1.sub(amount1Mint) - - // execute the user's swap - const { executionPrice: executionPriceAfterFrontrun } = await simulateSwap(zeroForOne, inputAmount) - zeroForOne - ? await swapExact0For1(inputAmount, wallet.address) - : await swapExact1For0(inputAmount, wallet.address) - - // burn the arb's liquidity - const { amount0: amount0Burn, amount1: amount1Burn } = await pool.callStatic.burn( - tickLower, - tickUpper, - getMaxLiquidityPerTick(tickSpacing) - ) - await pool.burn(tickLower, tickUpper, getMaxLiquidityPerTick(tickSpacing)) - arbBalance0 = arbBalance0.add(amount0Burn) - arbBalance1 = arbBalance1.add(amount1Burn) - - // add the fees as well - const { - amount0: amount0CollectAndBurn, - amount1: amount1CollectAndBurn, - } = await pool.callStatic.collect(arbitrageur.address, tickLower, tickUpper, MaxUint128, MaxUint128) - const [amount0Collect, amount1Collect] = [ - amount0CollectAndBurn.sub(amount0Burn), - amount1CollectAndBurn.sub(amount1Burn), - ] - arbBalance0 = arbBalance0.add(amount0Collect) - arbBalance1 = arbBalance1.add(amount1Collect) - - const profitToken1AfterSandwich = valueToken1(arbBalance0, arbBalance1) - - // backrun the swap to true price, i.e. swap to the marginal price = true price - const priceToSwapTo = zeroForOne - ? applySqrtRatioBipsHundredthsDelta(assumedTruePriceAfterSwap, -feeAmount) - : applySqrtRatioBipsHundredthsDelta(assumedTruePriceAfterSwap, feeAmount) - const { - amount0Delta: backrunDelta0, - amount1Delta: backrunDelta1, - executionPrice: backrunExecutionPrice, - } = await simulateSwap(!zeroForOne, MaxUint256.div(2), priceToSwapTo) - await swapToHigherPrice(priceToSwapTo, wallet.address) - arbBalance0 = arbBalance0.sub(backrunDelta0) - arbBalance1 = arbBalance1.sub(backrunDelta1) - - expect({ - sandwichedPrice: formatPrice(executionPriceAfterFrontrun), - arbBalanceDelta0: formatTokenAmount(arbBalance0), - arbBalanceDelta1: formatTokenAmount(arbBalance1), - profit: { - final: formatTokenAmount(valueToken1(arbBalance0, arbBalance1)), - afterFrontrun: formatTokenAmount(profitToken1AfterFrontRun), - afterSandwich: formatTokenAmount(profitToken1AfterSandwich), - }, - backrun: { - executionPrice: formatPrice(backrunExecutionPrice), - delta0: formatTokenAmount(backrunDelta0), - delta1: formatTokenAmount(backrunDelta1), - }, - frontrun: { - executionPrice: formatPrice(frontrunExecutionPrice), - delta0: formatTokenAmount(frontrunDelta0), - delta1: formatTokenAmount(frontrunDelta1), - }, - collect: { - amount0: formatTokenAmount(amount0Collect), - amount1: formatTokenAmount(amount1Collect), - }, - burn: { - amount0: formatTokenAmount(amount0Burn), - amount1: formatTokenAmount(amount1Burn), - }, - mint: { - amount0: formatTokenAmount(amount0Mint), - amount1: formatTokenAmount(amount1Mint), - }, - finalPrice: formatPrice((await pool.slot0()).sqrtPriceX96), - }).to.matchSnapshot() - }) - - it('backrun to true price after swap only', async () => { - let arbBalance0 = BigNumber.from(0) - let arbBalance1 = BigNumber.from(0) - - zeroForOne - ? await swapExact0For1(inputAmount, wallet.address) - : await swapExact1For0(inputAmount, wallet.address) - - // swap to the marginal price = true price - const priceToSwapTo = zeroForOne - ? applySqrtRatioBipsHundredthsDelta(assumedTruePriceAfterSwap, -feeAmount) - : applySqrtRatioBipsHundredthsDelta(assumedTruePriceAfterSwap, feeAmount) - const { - amount0Delta: backrunDelta0, - amount1Delta: backrunDelta1, - executionPrice: backrunExecutionPrice, - } = await simulateSwap(!zeroForOne, MaxUint256.div(2), priceToSwapTo) - zeroForOne - ? await swapToHigherPrice(priceToSwapTo, wallet.address) - : await swapToLowerPrice(priceToSwapTo, wallet.address) - arbBalance0 = arbBalance0.sub(backrunDelta0) - arbBalance1 = arbBalance1.sub(backrunDelta1) - - expect({ - arbBalanceDelta0: formatTokenAmount(arbBalance0), - arbBalanceDelta1: formatTokenAmount(arbBalance1), - profit: { - final: formatTokenAmount(valueToken1(arbBalance0, arbBalance1)), - }, - backrun: { - executionPrice: formatPrice(backrunExecutionPrice), - delta0: formatTokenAmount(backrunDelta0), - delta1: formatTokenAmount(backrunDelta1), - }, - finalPrice: formatPrice((await pool.slot0()).sqrtPriceX96), - }).to.matchSnapshot() - }) - }) - } - }) - } - }) - } -}) diff --git a/contract/lib/v3-core/test/UniswapV3Pool.gas.spec.ts b/contract/lib/v3-core/test/UniswapV3Pool.gas.spec.ts deleted file mode 100644 index 9ba8feb..0000000 --- a/contract/lib/v3-core/test/UniswapV3Pool.gas.spec.ts +++ /dev/null @@ -1,314 +0,0 @@ -import { waffle } from 'hardhat' -import { Wallet } from 'ethers' -import { MockTimeUniswapV3Pool } from '../typechain/MockTimeUniswapV3Pool' -import { expect } from './shared/expect' - -import { poolFixture } from './shared/fixtures' -import snapshotGasCost from './shared/snapshotGasCost' - -import { - expandTo18Decimals, - FeeAmount, - getMinTick, - encodePriceSqrt, - TICK_SPACINGS, - createPoolFunctions, - SwapFunction, - MintFunction, - getMaxTick, - MaxUint128, - SwapToPriceFunction, - MAX_SQRT_RATIO, - MIN_SQRT_RATIO, -} from './shared/utilities' - -const createFixtureLoader = waffle.createFixtureLoader - -describe('UniswapV3Pool gas tests', () => { - const [wallet, other] = waffle.provider.getWallets() - - let loadFixture: ReturnType - - before('create fixture loader', async () => { - loadFixture = createFixtureLoader([wallet, other]) - }) - - for (const feeProtocol of [0, 6]) { - describe(feeProtocol > 0 ? 'fee is on' : 'fee is off', () => { - const startingPrice = encodePriceSqrt(100001, 100000) - const startingTick = 0 - const feeAmount = FeeAmount.MEDIUM - const tickSpacing = TICK_SPACINGS[feeAmount] - const minTick = getMinTick(tickSpacing) - const maxTick = getMaxTick(tickSpacing) - - const gasTestFixture = async ([wallet]: Wallet[]) => { - const fix = await poolFixture([wallet], waffle.provider) - - const pool = await fix.createPool(feeAmount, tickSpacing) - - const { swapExact0For1, swapToHigherPrice, mint, swapToLowerPrice } = await createPoolFunctions({ - swapTarget: fix.swapTargetCallee, - token0: fix.token0, - token1: fix.token1, - pool, - }) - - await pool.initialize(encodePriceSqrt(1, 1)) - await pool.setFeeProtocol(feeProtocol, feeProtocol) - await pool.increaseObservationCardinalityNext(4) - await pool.advanceTime(1) - await mint(wallet.address, minTick, maxTick, expandTo18Decimals(2)) - - await swapExact0For1(expandTo18Decimals(1), wallet.address) - await pool.advanceTime(1) - await swapToHigherPrice(startingPrice, wallet.address) - await pool.advanceTime(1) - expect((await pool.slot0()).tick).to.eq(startingTick) - expect((await pool.slot0()).sqrtPriceX96).to.eq(startingPrice) - - return { pool, swapExact0For1, mint, swapToHigherPrice, swapToLowerPrice } - } - - let swapExact0For1: SwapFunction - let swapToHigherPrice: SwapToPriceFunction - let swapToLowerPrice: SwapToPriceFunction - let pool: MockTimeUniswapV3Pool - let mint: MintFunction - - beforeEach('load the fixture', async () => { - ;({ swapExact0For1, pool, mint, swapToHigherPrice, swapToLowerPrice } = await loadFixture(gasTestFixture)) - }) - - describe('#swapExact0For1', () => { - it('first swap in block with no tick movement', async () => { - await snapshotGasCost(swapExact0For1(2000, wallet.address)) - expect((await pool.slot0()).sqrtPriceX96).to.not.eq(startingPrice) - expect((await pool.slot0()).tick).to.eq(startingTick) - }) - - it('first swap in block moves tick, no initialized crossings', async () => { - await snapshotGasCost(swapExact0For1(expandTo18Decimals(1).div(10000), wallet.address)) - expect((await pool.slot0()).tick).to.eq(startingTick - 1) - }) - - it('second swap in block with no tick movement', async () => { - await swapExact0For1(expandTo18Decimals(1).div(10000), wallet.address) - expect((await pool.slot0()).tick).to.eq(startingTick - 1) - await snapshotGasCost(swapExact0For1(2000, wallet.address)) - expect((await pool.slot0()).tick).to.eq(startingTick - 1) - }) - - it('second swap in block moves tick, no initialized crossings', async () => { - await swapExact0For1(1000, wallet.address) - expect((await pool.slot0()).tick).to.eq(startingTick) - await snapshotGasCost(swapExact0For1(expandTo18Decimals(1).div(10000), wallet.address)) - expect((await pool.slot0()).tick).to.eq(startingTick - 1) - }) - - it('first swap in block, large swap, no initialized crossings', async () => { - await snapshotGasCost(swapExact0For1(expandTo18Decimals(10), wallet.address)) - expect((await pool.slot0()).tick).to.eq(-35787) - }) - - it('first swap in block, large swap crossing several initialized ticks', async () => { - await mint(wallet.address, startingTick - 3 * tickSpacing, startingTick - tickSpacing, expandTo18Decimals(1)) - await mint( - wallet.address, - startingTick - 4 * tickSpacing, - startingTick - 2 * tickSpacing, - expandTo18Decimals(1) - ) - expect((await pool.slot0()).tick).to.eq(startingTick) - await snapshotGasCost(swapExact0For1(expandTo18Decimals(1), wallet.address)) - expect((await pool.slot0()).tick).to.be.lt(startingTick - 4 * tickSpacing) // we crossed the last tick - }) - - it('first swap in block, large swap crossing a single initialized tick', async () => { - await mint(wallet.address, minTick, startingTick - 2 * tickSpacing, expandTo18Decimals(1)) - await snapshotGasCost(swapExact0For1(expandTo18Decimals(1), wallet.address)) - expect((await pool.slot0()).tick).to.be.lt(startingTick - 2 * tickSpacing) // we crossed the last tick - }) - - it('second swap in block, large swap crossing several initialized ticks', async () => { - await mint(wallet.address, startingTick - 3 * tickSpacing, startingTick - tickSpacing, expandTo18Decimals(1)) - await mint( - wallet.address, - startingTick - 4 * tickSpacing, - startingTick - 2 * tickSpacing, - expandTo18Decimals(1) - ) - await swapExact0For1(expandTo18Decimals(1).div(10000), wallet.address) - await snapshotGasCost(swapExact0For1(expandTo18Decimals(1), wallet.address)) - expect((await pool.slot0()).tick).to.be.lt(startingTick - 4 * tickSpacing) - }) - - it('second swap in block, large swap crossing a single initialized tick', async () => { - await mint(wallet.address, minTick, startingTick - 2 * tickSpacing, expandTo18Decimals(1)) - await swapExact0For1(expandTo18Decimals(1).div(10000), wallet.address) - expect((await pool.slot0()).tick).to.be.gt(startingTick - 2 * tickSpacing) // we didn't cross the initialized tick - await snapshotGasCost(swapExact0For1(expandTo18Decimals(1), wallet.address)) - expect((await pool.slot0()).tick).to.be.lt(startingTick - 2 * tickSpacing) // we crossed the last tick - }) - - it('large swap crossing several initialized ticks after some time passes', async () => { - await mint(wallet.address, startingTick - 3 * tickSpacing, startingTick - tickSpacing, expandTo18Decimals(1)) - await mint( - wallet.address, - startingTick - 4 * tickSpacing, - startingTick - 2 * tickSpacing, - expandTo18Decimals(1) - ) - await swapExact0For1(2, wallet.address) - await pool.advanceTime(1) - await snapshotGasCost(swapExact0For1(expandTo18Decimals(1), wallet.address)) - expect((await pool.slot0()).tick).to.be.lt(startingTick - 4 * tickSpacing) - }) - - it('large swap crossing several initialized ticks second time after some time passes', async () => { - await mint(wallet.address, startingTick - 3 * tickSpacing, startingTick - tickSpacing, expandTo18Decimals(1)) - await mint( - wallet.address, - startingTick - 4 * tickSpacing, - startingTick - 2 * tickSpacing, - expandTo18Decimals(1) - ) - await swapExact0For1(expandTo18Decimals(1), wallet.address) - await swapToHigherPrice(startingPrice, wallet.address) - await pool.advanceTime(1) - await snapshotGasCost(swapExact0For1(expandTo18Decimals(1), wallet.address)) - expect((await pool.slot0()).tick).to.be.lt(tickSpacing * -4) - }) - }) - - describe('#mint', () => { - for (const { description, tickLower, tickUpper } of [ - { - description: 'around current price', - tickLower: startingTick - tickSpacing, - tickUpper: startingTick + tickSpacing, - }, - { - description: 'below current price', - tickLower: startingTick - 2 * tickSpacing, - tickUpper: startingTick - tickSpacing, - }, - { - description: 'above current price', - tickLower: startingTick + tickSpacing, - tickUpper: startingTick + 2 * tickSpacing, - }, - ]) { - describe(description, () => { - it('new position mint first in range', async () => { - await snapshotGasCost(mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1))) - }) - it('add to position existing', async () => { - await mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1)) - await snapshotGasCost(mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1))) - }) - it('second position in same range', async () => { - await mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1)) - await snapshotGasCost(mint(other.address, tickLower, tickUpper, expandTo18Decimals(1))) - }) - it('add to position after some time passes', async () => { - await mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1)) - await pool.advanceTime(1) - await snapshotGasCost(mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1))) - }) - }) - } - }) - - describe('#burn', () => { - for (const { description, tickLower, tickUpper } of [ - { - description: 'around current price', - tickLower: startingTick - tickSpacing, - tickUpper: startingTick + tickSpacing, - }, - { - description: 'below current price', - tickLower: startingTick - 2 * tickSpacing, - tickUpper: startingTick - tickSpacing, - }, - { - description: 'above current price', - tickLower: startingTick + tickSpacing, - tickUpper: startingTick + 2 * tickSpacing, - }, - ]) { - describe(description, () => { - const liquidityAmount = expandTo18Decimals(1) - beforeEach('mint a position', async () => { - await mint(wallet.address, tickLower, tickUpper, liquidityAmount) - }) - - it('burn when only position using ticks', async () => { - await snapshotGasCost(pool.burn(tickLower, tickUpper, expandTo18Decimals(1))) - }) - it('partial position burn', async () => { - await snapshotGasCost(pool.burn(tickLower, tickUpper, expandTo18Decimals(1).div(2))) - }) - it('entire position burn but other positions are using the ticks', async () => { - await mint(other.address, tickLower, tickUpper, expandTo18Decimals(1)) - await snapshotGasCost(pool.burn(tickLower, tickUpper, expandTo18Decimals(1))) - }) - it('burn entire position after some time passes', async () => { - await pool.advanceTime(1) - await snapshotGasCost(pool.burn(tickLower, tickUpper, expandTo18Decimals(1))) - }) - }) - } - }) - - describe('#poke', () => { - const tickLower = startingTick - tickSpacing - const tickUpper = startingTick + tickSpacing - - it('best case', async () => { - await mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1)) - await swapExact0For1(expandTo18Decimals(1).div(100), wallet.address) - await pool.burn(tickLower, tickUpper, 0) - await swapExact0For1(expandTo18Decimals(1).div(100), wallet.address) - await snapshotGasCost(pool.burn(tickLower, tickUpper, 0)) - }) - }) - - describe('#collect', () => { - const tickLower = startingTick - tickSpacing - const tickUpper = startingTick + tickSpacing - - it('close to worst case', async () => { - await mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1)) - await swapExact0For1(expandTo18Decimals(1).div(100), wallet.address) - await pool.burn(tickLower, tickUpper, 0) // poke to accumulate fees - await snapshotGasCost(pool.collect(wallet.address, tickLower, tickUpper, MaxUint128, MaxUint128)) - }) - }) - - describe('#increaseObservationCardinalityNext', () => { - it('grow by 1 slot', async () => { - await snapshotGasCost(pool.increaseObservationCardinalityNext(5)) - }) - it('no op', async () => { - await snapshotGasCost(pool.increaseObservationCardinalityNext(3)) - }) - }) - - describe('#snapshotCumulativesInside', () => { - it('tick inside', async () => { - await snapshotGasCost(pool.estimateGas.snapshotCumulativesInside(minTick, maxTick)) - }) - it('tick above', async () => { - await swapToHigherPrice(MAX_SQRT_RATIO.sub(1), wallet.address) - await snapshotGasCost(pool.estimateGas.snapshotCumulativesInside(minTick, maxTick)) - }) - it('tick below', async () => { - await swapToLowerPrice(MIN_SQRT_RATIO.add(1), wallet.address) - await snapshotGasCost(pool.estimateGas.snapshotCumulativesInside(minTick, maxTick)) - }) - }) - }) - } -}) diff --git a/contract/lib/v3-core/test/UniswapV3Pool.spec.ts b/contract/lib/v3-core/test/UniswapV3Pool.spec.ts deleted file mode 100644 index a4767a3..0000000 --- a/contract/lib/v3-core/test/UniswapV3Pool.spec.ts +++ /dev/null @@ -1,2042 +0,0 @@ -import { ethers, waffle } from 'hardhat' -import { BigNumber, BigNumberish, constants } from 'ethers' -import { TestERC20 } from '../typechain/TestERC20' -import { UniswapV3Factory } from '../typechain/UniswapV3Factory' -import { MockTimeUniswapV3Pool } from '../typechain/MockTimeUniswapV3Pool' -import { TestUniswapV3SwapPay } from '../typechain/TestUniswapV3SwapPay' -import checkObservationEquals from './shared/checkObservationEquals' -import { expect } from './shared/expect' - -import { poolFixture, TEST_POOL_START_TIME } from './shared/fixtures' - -import { - expandTo18Decimals, - FeeAmount, - getPositionKey, - getMaxTick, - getMinTick, - encodePriceSqrt, - TICK_SPACINGS, - createPoolFunctions, - SwapFunction, - MintFunction, - getMaxLiquidityPerTick, - FlashFunction, - MaxUint128, - MAX_SQRT_RATIO, - MIN_SQRT_RATIO, - SwapToPriceFunction, -} from './shared/utilities' -import { TestUniswapV3Callee } from '../typechain/TestUniswapV3Callee' -import { TestUniswapV3ReentrantCallee } from '../typechain/TestUniswapV3ReentrantCallee' -import { TickMathTest } from '../typechain/TickMathTest' -import { SwapMathTest } from '../typechain/SwapMathTest' - -const createFixtureLoader = waffle.createFixtureLoader - -type ThenArg = T extends PromiseLike ? U : T - -describe('UniswapV3Pool', () => { - const [wallet, other] = waffle.provider.getWallets() - - let token0: TestERC20 - let token1: TestERC20 - let token2: TestERC20 - - let factory: UniswapV3Factory - let pool: MockTimeUniswapV3Pool - - let swapTarget: TestUniswapV3Callee - - let swapToLowerPrice: SwapToPriceFunction - let swapToHigherPrice: SwapToPriceFunction - let swapExact0For1: SwapFunction - let swap0ForExact1: SwapFunction - let swapExact1For0: SwapFunction - let swap1ForExact0: SwapFunction - - let feeAmount: number - let tickSpacing: number - - let minTick: number - let maxTick: number - - let mint: MintFunction - let flash: FlashFunction - - let loadFixture: ReturnType - let createPool: ThenArg>['createPool'] - - before('create fixture loader', async () => { - loadFixture = createFixtureLoader([wallet, other]) - }) - - beforeEach('deploy fixture', async () => { - ;({ token0, token1, token2, factory, createPool, swapTargetCallee: swapTarget } = await loadFixture(poolFixture)) - - const oldCreatePool = createPool - createPool = async (_feeAmount, _tickSpacing) => { - const pool = await oldCreatePool(_feeAmount, _tickSpacing) - ;({ - swapToLowerPrice, - swapToHigherPrice, - swapExact0For1, - swap0ForExact1, - swapExact1For0, - swap1ForExact0, - mint, - flash, - } = createPoolFunctions({ - token0, - token1, - swapTarget, - pool, - })) - minTick = getMinTick(_tickSpacing) - maxTick = getMaxTick(_tickSpacing) - feeAmount = _feeAmount - tickSpacing = _tickSpacing - return pool - } - - // default to the 30 bips pool - pool = await createPool(FeeAmount.MEDIUM, TICK_SPACINGS[FeeAmount.MEDIUM]) - }) - - it('constructor initializes immutables', async () => { - expect(await pool.factory()).to.eq(factory.address) - expect(await pool.token0()).to.eq(token0.address) - expect(await pool.token1()).to.eq(token1.address) - expect(await pool.maxLiquidityPerTick()).to.eq(getMaxLiquidityPerTick(tickSpacing)) - }) - - describe('#initialize', () => { - it('fails if already initialized', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - await expect(pool.initialize(encodePriceSqrt(1, 1))).to.be.reverted - }) - it('fails if starting price is too low', async () => { - await expect(pool.initialize(1)).to.be.revertedWith('R') - await expect(pool.initialize(MIN_SQRT_RATIO.sub(1))).to.be.revertedWith('R') - }) - it('fails if starting price is too high', async () => { - await expect(pool.initialize(MAX_SQRT_RATIO)).to.be.revertedWith('R') - await expect(pool.initialize(BigNumber.from(2).pow(160).sub(1))).to.be.revertedWith('R') - }) - it('can be initialized at MIN_SQRT_RATIO', async () => { - await pool.initialize(MIN_SQRT_RATIO) - expect((await pool.slot0()).tick).to.eq(getMinTick(1)) - }) - it('can be initialized at MAX_SQRT_RATIO - 1', async () => { - await pool.initialize(MAX_SQRT_RATIO.sub(1)) - expect((await pool.slot0()).tick).to.eq(getMaxTick(1) - 1) - }) - it('sets initial variables', async () => { - const price = encodePriceSqrt(1, 2) - await pool.initialize(price) - - const { sqrtPriceX96, observationIndex } = await pool.slot0() - expect(sqrtPriceX96).to.eq(price) - expect(observationIndex).to.eq(0) - expect((await pool.slot0()).tick).to.eq(-6932) - }) - it('initializes the first observations slot', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - checkObservationEquals(await pool.observations(0), { - secondsPerLiquidityCumulativeX128: 0, - initialized: true, - blockTimestamp: TEST_POOL_START_TIME, - tickCumulative: 0, - }) - }) - it('emits a Initialized event with the input tick', async () => { - const sqrtPriceX96 = encodePriceSqrt(1, 2) - await expect(pool.initialize(sqrtPriceX96)).to.emit(pool, 'Initialize').withArgs(sqrtPriceX96, -6932) - }) - }) - - describe('#increaseObservationCardinalityNext', () => { - it('can only be called after initialize', async () => { - await expect(pool.increaseObservationCardinalityNext(2)).to.be.revertedWith('LOK') - }) - it('emits an event including both old and new', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - await expect(pool.increaseObservationCardinalityNext(2)) - .to.emit(pool, 'IncreaseObservationCardinalityNext') - .withArgs(1, 2) - }) - it('does not emit an event for no op call', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - await pool.increaseObservationCardinalityNext(3) - await expect(pool.increaseObservationCardinalityNext(2)).to.not.emit(pool, 'IncreaseObservationCardinalityNext') - }) - it('does not change cardinality next if less than current', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - await pool.increaseObservationCardinalityNext(3) - await pool.increaseObservationCardinalityNext(2) - expect((await pool.slot0()).observationCardinalityNext).to.eq(3) - }) - it('increases cardinality and cardinality next first time', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - await pool.increaseObservationCardinalityNext(2) - const { observationCardinality, observationCardinalityNext } = await pool.slot0() - expect(observationCardinality).to.eq(1) - expect(observationCardinalityNext).to.eq(2) - }) - }) - - describe('#mint', () => { - it('fails if not initialized', async () => { - await expect(mint(wallet.address, -tickSpacing, tickSpacing, 1)).to.be.revertedWith('LOK') - }) - describe('after initialization', () => { - beforeEach('initialize the pool at price of 10:1', async () => { - await pool.initialize(encodePriceSqrt(1, 10)) - await mint(wallet.address, minTick, maxTick, 3161) - }) - - describe('failure cases', () => { - it('fails if tickLower greater than tickUpper', async () => { - // should be TLU but...hardhat - await expect(mint(wallet.address, 1, 0, 1)).to.be.reverted - }) - it('fails if tickLower less than min tick', async () => { - // should be TLM but...hardhat - await expect(mint(wallet.address, -887273, 0, 1)).to.be.reverted - }) - it('fails if tickUpper greater than max tick', async () => { - // should be TUM but...hardhat - await expect(mint(wallet.address, 0, 887273, 1)).to.be.reverted - }) - it('fails if amount exceeds the max', async () => { - // these should fail with 'LO' but hardhat is bugged - const maxLiquidityGross = await pool.maxLiquidityPerTick() - await expect(mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, maxLiquidityGross.add(1))).to - .be.reverted - await expect(mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, maxLiquidityGross)).to.not.be - .reverted - }) - it('fails if total amount at tick exceeds the max', async () => { - // these should fail with 'LO' but hardhat is bugged - await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 1000) - - const maxLiquidityGross = await pool.maxLiquidityPerTick() - await expect( - mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, maxLiquidityGross.sub(1000).add(1)) - ).to.be.reverted - await expect( - mint(wallet.address, minTick + tickSpacing * 2, maxTick - tickSpacing, maxLiquidityGross.sub(1000).add(1)) - ).to.be.reverted - await expect( - mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing * 2, maxLiquidityGross.sub(1000).add(1)) - ).to.be.reverted - await expect(mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, maxLiquidityGross.sub(1000))) - .to.not.be.reverted - }) - it('fails if amount is 0', async () => { - await expect(mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 0)).to.be.reverted - }) - }) - - describe('success cases', () => { - it('initial balances', async () => { - expect(await token0.balanceOf(pool.address)).to.eq(9996) - expect(await token1.balanceOf(pool.address)).to.eq(1000) - }) - - it('initial tick', async () => { - expect((await pool.slot0()).tick).to.eq(-23028) - }) - - describe('above current price', () => { - it('transfers token0 only', async () => { - await expect(mint(wallet.address, -22980, 0, 10000)) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pool.address, 21549) - .to.not.emit(token1, 'Transfer') - expect(await token0.balanceOf(pool.address)).to.eq(9996 + 21549) - expect(await token1.balanceOf(pool.address)).to.eq(1000) - }) - - it('max tick with max leverage', async () => { - await mint(wallet.address, maxTick - tickSpacing, maxTick, BigNumber.from(2).pow(102)) - expect(await token0.balanceOf(pool.address)).to.eq(9996 + 828011525) - expect(await token1.balanceOf(pool.address)).to.eq(1000) - }) - - it('works for max tick', async () => { - await expect(mint(wallet.address, -22980, maxTick, 10000)) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pool.address, 31549) - expect(await token0.balanceOf(pool.address)).to.eq(9996 + 31549) - expect(await token1.balanceOf(pool.address)).to.eq(1000) - }) - - it('removing works', async () => { - await mint(wallet.address, -240, 0, 10000) - await pool.burn(-240, 0, 10000) - const { amount0, amount1 } = await pool.callStatic.collect(wallet.address, -240, 0, MaxUint128, MaxUint128) - expect(amount0, 'amount0').to.eq(120) - expect(amount1, 'amount1').to.eq(0) - }) - - it('adds liquidity to liquidityGross', async () => { - await mint(wallet.address, -240, 0, 100) - expect((await pool.ticks(-240)).liquidityGross).to.eq(100) - expect((await pool.ticks(0)).liquidityGross).to.eq(100) - expect((await pool.ticks(tickSpacing)).liquidityGross).to.eq(0) - expect((await pool.ticks(tickSpacing * 2)).liquidityGross).to.eq(0) - await mint(wallet.address, -240, tickSpacing, 150) - expect((await pool.ticks(-240)).liquidityGross).to.eq(250) - expect((await pool.ticks(0)).liquidityGross).to.eq(100) - expect((await pool.ticks(tickSpacing)).liquidityGross).to.eq(150) - expect((await pool.ticks(tickSpacing * 2)).liquidityGross).to.eq(0) - await mint(wallet.address, 0, tickSpacing * 2, 60) - expect((await pool.ticks(-240)).liquidityGross).to.eq(250) - expect((await pool.ticks(0)).liquidityGross).to.eq(160) - expect((await pool.ticks(tickSpacing)).liquidityGross).to.eq(150) - expect((await pool.ticks(tickSpacing * 2)).liquidityGross).to.eq(60) - }) - - it('removes liquidity from liquidityGross', async () => { - await mint(wallet.address, -240, 0, 100) - await mint(wallet.address, -240, 0, 40) - await pool.burn(-240, 0, 90) - expect((await pool.ticks(-240)).liquidityGross).to.eq(50) - expect((await pool.ticks(0)).liquidityGross).to.eq(50) - }) - - it('clears tick lower if last position is removed', async () => { - await mint(wallet.address, -240, 0, 100) - await pool.burn(-240, 0, 100) - const { liquidityGross, feeGrowthOutside0X128, feeGrowthOutside1X128 } = await pool.ticks(-240) - expect(liquidityGross).to.eq(0) - expect(feeGrowthOutside0X128).to.eq(0) - expect(feeGrowthOutside1X128).to.eq(0) - }) - - it('clears tick upper if last position is removed', async () => { - await mint(wallet.address, -240, 0, 100) - await pool.burn(-240, 0, 100) - const { liquidityGross, feeGrowthOutside0X128, feeGrowthOutside1X128 } = await pool.ticks(0) - expect(liquidityGross).to.eq(0) - expect(feeGrowthOutside0X128).to.eq(0) - expect(feeGrowthOutside1X128).to.eq(0) - }) - it('only clears the tick that is not used at all', async () => { - await mint(wallet.address, -240, 0, 100) - await mint(wallet.address, -tickSpacing, 0, 250) - await pool.burn(-240, 0, 100) - - let { liquidityGross, feeGrowthOutside0X128, feeGrowthOutside1X128 } = await pool.ticks(-240) - expect(liquidityGross).to.eq(0) - expect(feeGrowthOutside0X128).to.eq(0) - expect(feeGrowthOutside1X128).to.eq(0) - ;({ liquidityGross, feeGrowthOutside0X128, feeGrowthOutside1X128 } = await pool.ticks(-tickSpacing)) - expect(liquidityGross).to.eq(250) - expect(feeGrowthOutside0X128).to.eq(0) - expect(feeGrowthOutside1X128).to.eq(0) - }) - - it('does not write an observation', async () => { - checkObservationEquals(await pool.observations(0), { - tickCumulative: 0, - blockTimestamp: TEST_POOL_START_TIME, - initialized: true, - secondsPerLiquidityCumulativeX128: 0, - }) - await pool.advanceTime(1) - await mint(wallet.address, -240, 0, 100) - checkObservationEquals(await pool.observations(0), { - tickCumulative: 0, - blockTimestamp: TEST_POOL_START_TIME, - initialized: true, - secondsPerLiquidityCumulativeX128: 0, - }) - }) - }) - - describe('including current price', () => { - it('price within range: transfers current price of both tokens', async () => { - await expect(mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 100)) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pool.address, 317) - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, pool.address, 32) - expect(await token0.balanceOf(pool.address)).to.eq(9996 + 317) - expect(await token1.balanceOf(pool.address)).to.eq(1000 + 32) - }) - - it('initializes lower tick', async () => { - await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 100) - const { liquidityGross } = await pool.ticks(minTick + tickSpacing) - expect(liquidityGross).to.eq(100) - }) - - it('initializes upper tick', async () => { - await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 100) - const { liquidityGross } = await pool.ticks(maxTick - tickSpacing) - expect(liquidityGross).to.eq(100) - }) - - it('works for min/max tick', async () => { - await expect(mint(wallet.address, minTick, maxTick, 10000)) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pool.address, 31623) - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, pool.address, 3163) - expect(await token0.balanceOf(pool.address)).to.eq(9996 + 31623) - expect(await token1.balanceOf(pool.address)).to.eq(1000 + 3163) - }) - - it('removing works', async () => { - await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 100) - await pool.burn(minTick + tickSpacing, maxTick - tickSpacing, 100) - const { amount0, amount1 } = await pool.callStatic.collect( - wallet.address, - minTick + tickSpacing, - maxTick - tickSpacing, - MaxUint128, - MaxUint128 - ) - expect(amount0, 'amount0').to.eq(316) - expect(amount1, 'amount1').to.eq(31) - }) - - it('writes an observation', async () => { - checkObservationEquals(await pool.observations(0), { - tickCumulative: 0, - blockTimestamp: TEST_POOL_START_TIME, - initialized: true, - secondsPerLiquidityCumulativeX128: 0, - }) - await pool.advanceTime(1) - await mint(wallet.address, minTick, maxTick, 100) - checkObservationEquals(await pool.observations(0), { - tickCumulative: -23028, - blockTimestamp: TEST_POOL_START_TIME + 1, - initialized: true, - secondsPerLiquidityCumulativeX128: '107650226801941937191829992860413859', - }) - }) - }) - - describe('below current price', () => { - it('transfers token1 only', async () => { - await expect(mint(wallet.address, -46080, -23040, 10000)) - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, pool.address, 2162) - .to.not.emit(token0, 'Transfer') - expect(await token0.balanceOf(pool.address)).to.eq(9996) - expect(await token1.balanceOf(pool.address)).to.eq(1000 + 2162) - }) - - it('min tick with max leverage', async () => { - await mint(wallet.address, minTick, minTick + tickSpacing, BigNumber.from(2).pow(102)) - expect(await token0.balanceOf(pool.address)).to.eq(9996) - expect(await token1.balanceOf(pool.address)).to.eq(1000 + 828011520) - }) - - it('works for min tick', async () => { - await expect(mint(wallet.address, minTick, -23040, 10000)) - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, pool.address, 3161) - expect(await token0.balanceOf(pool.address)).to.eq(9996) - expect(await token1.balanceOf(pool.address)).to.eq(1000 + 3161) - }) - - it('removing works', async () => { - await mint(wallet.address, -46080, -46020, 10000) - await pool.burn(-46080, -46020, 10000) - const { amount0, amount1 } = await pool.callStatic.collect( - wallet.address, - -46080, - -46020, - MaxUint128, - MaxUint128 - ) - expect(amount0, 'amount0').to.eq(0) - expect(amount1, 'amount1').to.eq(3) - }) - - it('does not write an observation', async () => { - checkObservationEquals(await pool.observations(0), { - tickCumulative: 0, - blockTimestamp: TEST_POOL_START_TIME, - initialized: true, - secondsPerLiquidityCumulativeX128: 0, - }) - await pool.advanceTime(1) - await mint(wallet.address, -46080, -23040, 100) - checkObservationEquals(await pool.observations(0), { - tickCumulative: 0, - blockTimestamp: TEST_POOL_START_TIME, - initialized: true, - secondsPerLiquidityCumulativeX128: 0, - }) - }) - }) - }) - - it('protocol fees accumulate as expected during swap', async () => { - await pool.setFeeProtocol(6, 6) - - await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, expandTo18Decimals(1)) - await swapExact0For1(expandTo18Decimals(1).div(10), wallet.address) - await swapExact1For0(expandTo18Decimals(1).div(100), wallet.address) - - let { token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees() - expect(token0ProtocolFees).to.eq('50000000000000') - expect(token1ProtocolFees).to.eq('5000000000000') - }) - - it('positions are protected before protocol fee is turned on', async () => { - await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, expandTo18Decimals(1)) - await swapExact0For1(expandTo18Decimals(1).div(10), wallet.address) - await swapExact1For0(expandTo18Decimals(1).div(100), wallet.address) - - let { token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees() - expect(token0ProtocolFees).to.eq(0) - expect(token1ProtocolFees).to.eq(0) - - await pool.setFeeProtocol(6, 6) - ;({ token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees()) - expect(token0ProtocolFees).to.eq(0) - expect(token1ProtocolFees).to.eq(0) - }) - - it('poke is not allowed on uninitialized position', async () => { - await mint(other.address, minTick + tickSpacing, maxTick - tickSpacing, expandTo18Decimals(1)) - await swapExact0For1(expandTo18Decimals(1).div(10), wallet.address) - await swapExact1For0(expandTo18Decimals(1).div(100), wallet.address) - - // missing revert reason due to hardhat - await expect(pool.burn(minTick + tickSpacing, maxTick - tickSpacing, 0)).to.be.reverted - - await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 1) - let { - liquidity, - feeGrowthInside0LastX128, - feeGrowthInside1LastX128, - tokensOwed1, - tokensOwed0, - } = await pool.positions(getPositionKey(wallet.address, minTick + tickSpacing, maxTick - tickSpacing)) - expect(liquidity).to.eq(1) - expect(feeGrowthInside0LastX128).to.eq('102084710076281216349243831104605583') - expect(feeGrowthInside1LastX128).to.eq('10208471007628121634924383110460558') - expect(tokensOwed0, 'tokens owed 0 before').to.eq(0) - expect(tokensOwed1, 'tokens owed 1 before').to.eq(0) - - await pool.burn(minTick + tickSpacing, maxTick - tickSpacing, 1) - ;({ - liquidity, - feeGrowthInside0LastX128, - feeGrowthInside1LastX128, - tokensOwed1, - tokensOwed0, - } = await pool.positions(getPositionKey(wallet.address, minTick + tickSpacing, maxTick - tickSpacing))) - expect(liquidity).to.eq(0) - expect(feeGrowthInside0LastX128).to.eq('102084710076281216349243831104605583') - expect(feeGrowthInside1LastX128).to.eq('10208471007628121634924383110460558') - expect(tokensOwed0, 'tokens owed 0 after').to.eq(3) - expect(tokensOwed1, 'tokens owed 1 after').to.eq(0) - }) - }) - }) - - describe('#burn', () => { - beforeEach('initialize at zero tick', () => initializeAtZeroTick(pool)) - - async function checkTickIsClear(tick: number) { - const { liquidityGross, feeGrowthOutside0X128, feeGrowthOutside1X128, liquidityNet } = await pool.ticks(tick) - expect(liquidityGross).to.eq(0) - expect(feeGrowthOutside0X128).to.eq(0) - expect(feeGrowthOutside1X128).to.eq(0) - expect(liquidityNet).to.eq(0) - } - - async function checkTickIsNotClear(tick: number) { - const { liquidityGross } = await pool.ticks(tick) - expect(liquidityGross).to.not.eq(0) - } - - it('does not clear the position fee growth snapshot if no more liquidity', async () => { - // some activity that would make the ticks non-zero - await pool.advanceTime(10) - await mint(other.address, minTick, maxTick, expandTo18Decimals(1)) - await swapExact0For1(expandTo18Decimals(1), wallet.address) - await swapExact1For0(expandTo18Decimals(1), wallet.address) - await pool.connect(other).burn(minTick, maxTick, expandTo18Decimals(1)) - const { - liquidity, - tokensOwed0, - tokensOwed1, - feeGrowthInside0LastX128, - feeGrowthInside1LastX128, - } = await pool.positions(getPositionKey(other.address, minTick, maxTick)) - expect(liquidity).to.eq(0) - expect(tokensOwed0).to.not.eq(0) - expect(tokensOwed1).to.not.eq(0) - expect(feeGrowthInside0LastX128).to.eq('340282366920938463463374607431768211') - expect(feeGrowthInside1LastX128).to.eq('340282366920938576890830247744589365') - }) - - it('clears the tick if its the last position using it', async () => { - const tickLower = minTick + tickSpacing - const tickUpper = maxTick - tickSpacing - // some activity that would make the ticks non-zero - await pool.advanceTime(10) - await mint(wallet.address, tickLower, tickUpper, 1) - await swapExact0For1(expandTo18Decimals(1), wallet.address) - await pool.burn(tickLower, tickUpper, 1) - await checkTickIsClear(tickLower) - await checkTickIsClear(tickUpper) - }) - - it('clears only the lower tick if upper is still used', async () => { - const tickLower = minTick + tickSpacing - const tickUpper = maxTick - tickSpacing - // some activity that would make the ticks non-zero - await pool.advanceTime(10) - await mint(wallet.address, tickLower, tickUpper, 1) - await mint(wallet.address, tickLower + tickSpacing, tickUpper, 1) - await swapExact0For1(expandTo18Decimals(1), wallet.address) - await pool.burn(tickLower, tickUpper, 1) - await checkTickIsClear(tickLower) - await checkTickIsNotClear(tickUpper) - }) - - it('clears only the upper tick if lower is still used', async () => { - const tickLower = minTick + tickSpacing - const tickUpper = maxTick - tickSpacing - // some activity that would make the ticks non-zero - await pool.advanceTime(10) - await mint(wallet.address, tickLower, tickUpper, 1) - await mint(wallet.address, tickLower, tickUpper - tickSpacing, 1) - await swapExact0For1(expandTo18Decimals(1), wallet.address) - await pool.burn(tickLower, tickUpper, 1) - await checkTickIsNotClear(tickLower) - await checkTickIsClear(tickUpper) - }) - }) - - // the combined amount of liquidity that the pool is initialized with (including the 1 minimum liquidity that is burned) - const initializeLiquidityAmount = expandTo18Decimals(2) - async function initializeAtZeroTick(pool: MockTimeUniswapV3Pool): Promise { - await pool.initialize(encodePriceSqrt(1, 1)) - const tickSpacing = await pool.tickSpacing() - const [min, max] = [getMinTick(tickSpacing), getMaxTick(tickSpacing)] - await mint(wallet.address, min, max, initializeLiquidityAmount) - } - - describe('#observe', () => { - beforeEach(() => initializeAtZeroTick(pool)) - - // zero tick - it('current tick accumulator increases by tick over time', async () => { - let { - tickCumulatives: [tickCumulative], - } = await pool.observe([0]) - expect(tickCumulative).to.eq(0) - await pool.advanceTime(10) - ;({ - tickCumulatives: [tickCumulative], - } = await pool.observe([0])) - expect(tickCumulative).to.eq(0) - }) - - it('current tick accumulator after single swap', async () => { - // moves to tick -1 - await swapExact0For1(1000, wallet.address) - await pool.advanceTime(4) - let { - tickCumulatives: [tickCumulative], - } = await pool.observe([0]) - expect(tickCumulative).to.eq(-4) - }) - - it('current tick accumulator after two swaps', async () => { - await swapExact0For1(expandTo18Decimals(1).div(2), wallet.address) - expect((await pool.slot0()).tick).to.eq(-4452) - await pool.advanceTime(4) - await swapExact1For0(expandTo18Decimals(1).div(4), wallet.address) - expect((await pool.slot0()).tick).to.eq(-1558) - await pool.advanceTime(6) - let { - tickCumulatives: [tickCumulative], - } = await pool.observe([0]) - // -4452*4 + -1558*6 - expect(tickCumulative).to.eq(-27156) - }) - }) - - describe('miscellaneous mint tests', () => { - beforeEach('initialize at zero tick', async () => { - pool = await createPool(FeeAmount.LOW, TICK_SPACINGS[FeeAmount.LOW]) - await initializeAtZeroTick(pool) - }) - - it('mint to the right of the current price', async () => { - const liquidityDelta = 1000 - const lowerTick = tickSpacing - const upperTick = tickSpacing * 2 - - const liquidityBefore = await pool.liquidity() - - const b0 = await token0.balanceOf(pool.address) - const b1 = await token1.balanceOf(pool.address) - - await mint(wallet.address, lowerTick, upperTick, liquidityDelta) - - const liquidityAfter = await pool.liquidity() - expect(liquidityAfter).to.be.gte(liquidityBefore) - - expect((await token0.balanceOf(pool.address)).sub(b0)).to.eq(1) - expect((await token1.balanceOf(pool.address)).sub(b1)).to.eq(0) - }) - - it('mint to the left of the current price', async () => { - const liquidityDelta = 1000 - const lowerTick = -tickSpacing * 2 - const upperTick = -tickSpacing - - const liquidityBefore = await pool.liquidity() - - const b0 = await token0.balanceOf(pool.address) - const b1 = await token1.balanceOf(pool.address) - - await mint(wallet.address, lowerTick, upperTick, liquidityDelta) - - const liquidityAfter = await pool.liquidity() - expect(liquidityAfter).to.be.gte(liquidityBefore) - - expect((await token0.balanceOf(pool.address)).sub(b0)).to.eq(0) - expect((await token1.balanceOf(pool.address)).sub(b1)).to.eq(1) - }) - - it('mint within the current price', async () => { - const liquidityDelta = 1000 - const lowerTick = -tickSpacing - const upperTick = tickSpacing - - const liquidityBefore = await pool.liquidity() - - const b0 = await token0.balanceOf(pool.address) - const b1 = await token1.balanceOf(pool.address) - - await mint(wallet.address, lowerTick, upperTick, liquidityDelta) - - const liquidityAfter = await pool.liquidity() - expect(liquidityAfter).to.be.gte(liquidityBefore) - - expect((await token0.balanceOf(pool.address)).sub(b0)).to.eq(1) - expect((await token1.balanceOf(pool.address)).sub(b1)).to.eq(1) - }) - - it('cannot remove more than the entire position', async () => { - const lowerTick = -tickSpacing - const upperTick = tickSpacing - await mint(wallet.address, lowerTick, upperTick, expandTo18Decimals(1000)) - // should be 'LS', hardhat is bugged - await expect(pool.burn(lowerTick, upperTick, expandTo18Decimals(1001))).to.be.reverted - }) - - it('collect fees within the current price after swap', async () => { - const liquidityDelta = expandTo18Decimals(100) - const lowerTick = -tickSpacing * 100 - const upperTick = tickSpacing * 100 - - await mint(wallet.address, lowerTick, upperTick, liquidityDelta) - - const liquidityBefore = await pool.liquidity() - - const amount0In = expandTo18Decimals(1) - await swapExact0For1(amount0In, wallet.address) - - const liquidityAfter = await pool.liquidity() - expect(liquidityAfter, 'k increases').to.be.gte(liquidityBefore) - - const token0BalanceBeforePool = await token0.balanceOf(pool.address) - const token1BalanceBeforePool = await token1.balanceOf(pool.address) - const token0BalanceBeforeWallet = await token0.balanceOf(wallet.address) - const token1BalanceBeforeWallet = await token1.balanceOf(wallet.address) - - await pool.burn(lowerTick, upperTick, 0) - await pool.collect(wallet.address, lowerTick, upperTick, MaxUint128, MaxUint128) - - await pool.burn(lowerTick, upperTick, 0) - const { amount0: fees0, amount1: fees1 } = await pool.callStatic.collect( - wallet.address, - lowerTick, - upperTick, - MaxUint128, - MaxUint128 - ) - expect(fees0).to.be.eq(0) - expect(fees1).to.be.eq(0) - - const token0BalanceAfterWallet = await token0.balanceOf(wallet.address) - const token1BalanceAfterWallet = await token1.balanceOf(wallet.address) - const token0BalanceAfterPool = await token0.balanceOf(pool.address) - const token1BalanceAfterPool = await token1.balanceOf(pool.address) - - expect(token0BalanceAfterWallet).to.be.gt(token0BalanceBeforeWallet) - expect(token1BalanceAfterWallet).to.be.eq(token1BalanceBeforeWallet) - - expect(token0BalanceAfterPool).to.be.lt(token0BalanceBeforePool) - expect(token1BalanceAfterPool).to.be.eq(token1BalanceBeforePool) - }) - }) - - describe('post-initialize at medium fee', () => { - describe('k (implicit)', () => { - it('returns 0 before initialization', async () => { - expect(await pool.liquidity()).to.eq(0) - }) - describe('post initialized', () => { - beforeEach(() => initializeAtZeroTick(pool)) - - it('returns initial liquidity', async () => { - expect(await pool.liquidity()).to.eq(expandTo18Decimals(2)) - }) - it('returns in supply in range', async () => { - await mint(wallet.address, -tickSpacing, tickSpacing, expandTo18Decimals(3)) - expect(await pool.liquidity()).to.eq(expandTo18Decimals(5)) - }) - it('excludes supply at tick above current tick', async () => { - await mint(wallet.address, tickSpacing, tickSpacing * 2, expandTo18Decimals(3)) - expect(await pool.liquidity()).to.eq(expandTo18Decimals(2)) - }) - it('excludes supply at tick below current tick', async () => { - await mint(wallet.address, -tickSpacing * 2, -tickSpacing, expandTo18Decimals(3)) - expect(await pool.liquidity()).to.eq(expandTo18Decimals(2)) - }) - it('updates correctly when exiting range', async () => { - const kBefore = await pool.liquidity() - expect(kBefore).to.be.eq(expandTo18Decimals(2)) - - // add liquidity at and above current tick - const liquidityDelta = expandTo18Decimals(1) - const lowerTick = 0 - const upperTick = tickSpacing - await mint(wallet.address, lowerTick, upperTick, liquidityDelta) - - // ensure virtual supply has increased appropriately - const kAfter = await pool.liquidity() - expect(kAfter).to.be.eq(expandTo18Decimals(3)) - - // swap toward the left (just enough for the tick transition function to trigger) - await swapExact0For1(1, wallet.address) - const { tick } = await pool.slot0() - expect(tick).to.be.eq(-1) - - const kAfterSwap = await pool.liquidity() - expect(kAfterSwap).to.be.eq(expandTo18Decimals(2)) - }) - it('updates correctly when entering range', async () => { - const kBefore = await pool.liquidity() - expect(kBefore).to.be.eq(expandTo18Decimals(2)) - - // add liquidity below the current tick - const liquidityDelta = expandTo18Decimals(1) - const lowerTick = -tickSpacing - const upperTick = 0 - await mint(wallet.address, lowerTick, upperTick, liquidityDelta) - - // ensure virtual supply hasn't changed - const kAfter = await pool.liquidity() - expect(kAfter).to.be.eq(kBefore) - - // swap toward the left (just enough for the tick transition function to trigger) - await swapExact0For1(1, wallet.address) - const { tick } = await pool.slot0() - expect(tick).to.be.eq(-1) - - const kAfterSwap = await pool.liquidity() - expect(kAfterSwap).to.be.eq(expandTo18Decimals(3)) - }) - }) - }) - }) - - describe('limit orders', () => { - beforeEach('initialize at tick 0', () => initializeAtZeroTick(pool)) - - it('limit selling 0 for 1 at tick 0 thru 1', async () => { - await expect(mint(wallet.address, 0, 120, expandTo18Decimals(1))) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pool.address, '5981737760509663') - // somebody takes the limit order - await swapExact1For0(expandTo18Decimals(2), other.address) - await expect(pool.burn(0, 120, expandTo18Decimals(1))) - .to.emit(pool, 'Burn') - .withArgs(wallet.address, 0, 120, expandTo18Decimals(1), 0, '6017734268818165') - .to.not.emit(token0, 'Transfer') - .to.not.emit(token1, 'Transfer') - await expect(pool.collect(wallet.address, 0, 120, MaxUint128, MaxUint128)) - .to.emit(token1, 'Transfer') - .withArgs(pool.address, wallet.address, BigNumber.from('6017734268818165').add('18107525382602')) // roughly 0.3% despite other liquidity - .to.not.emit(token0, 'Transfer') - expect((await pool.slot0()).tick).to.be.gte(120) - }) - it('limit selling 1 for 0 at tick 0 thru -1', async () => { - await expect(mint(wallet.address, -120, 0, expandTo18Decimals(1))) - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, pool.address, '5981737760509663') - // somebody takes the limit order - await swapExact0For1(expandTo18Decimals(2), other.address) - await expect(pool.burn(-120, 0, expandTo18Decimals(1))) - .to.emit(pool, 'Burn') - .withArgs(wallet.address, -120, 0, expandTo18Decimals(1), '6017734268818165', 0) - .to.not.emit(token0, 'Transfer') - .to.not.emit(token1, 'Transfer') - await expect(pool.collect(wallet.address, -120, 0, MaxUint128, MaxUint128)) - .to.emit(token0, 'Transfer') - .withArgs(pool.address, wallet.address, BigNumber.from('6017734268818165').add('18107525382602')) // roughly 0.3% despite other liquidity - expect((await pool.slot0()).tick).to.be.lt(-120) - }) - - describe('fee is on', () => { - beforeEach(() => pool.setFeeProtocol(6, 6)) - it('limit selling 0 for 1 at tick 0 thru 1', async () => { - await expect(mint(wallet.address, 0, 120, expandTo18Decimals(1))) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pool.address, '5981737760509663') - // somebody takes the limit order - await swapExact1For0(expandTo18Decimals(2), other.address) - await expect(pool.burn(0, 120, expandTo18Decimals(1))) - .to.emit(pool, 'Burn') - .withArgs(wallet.address, 0, 120, expandTo18Decimals(1), 0, '6017734268818165') - .to.not.emit(token0, 'Transfer') - .to.not.emit(token1, 'Transfer') - await expect(pool.collect(wallet.address, 0, 120, MaxUint128, MaxUint128)) - .to.emit(token1, 'Transfer') - .withArgs(pool.address, wallet.address, BigNumber.from('6017734268818165').add('15089604485501')) // roughly 0.25% despite other liquidity - .to.not.emit(token0, 'Transfer') - expect((await pool.slot0()).tick).to.be.gte(120) - }) - it('limit selling 1 for 0 at tick 0 thru -1', async () => { - await expect(mint(wallet.address, -120, 0, expandTo18Decimals(1))) - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, pool.address, '5981737760509663') - // somebody takes the limit order - await swapExact0For1(expandTo18Decimals(2), other.address) - await expect(pool.burn(-120, 0, expandTo18Decimals(1))) - .to.emit(pool, 'Burn') - .withArgs(wallet.address, -120, 0, expandTo18Decimals(1), '6017734268818165', 0) - .to.not.emit(token0, 'Transfer') - .to.not.emit(token1, 'Transfer') - await expect(pool.collect(wallet.address, -120, 0, MaxUint128, MaxUint128)) - .to.emit(token0, 'Transfer') - .withArgs(pool.address, wallet.address, BigNumber.from('6017734268818165').add('15089604485501')) // roughly 0.25% despite other liquidity - expect((await pool.slot0()).tick).to.be.lt(-120) - }) - }) - }) - - describe('#collect', () => { - beforeEach(async () => { - pool = await createPool(FeeAmount.LOW, TICK_SPACINGS[FeeAmount.LOW]) - await pool.initialize(encodePriceSqrt(1, 1)) - }) - - it('works with multiple LPs', async () => { - await mint(wallet.address, minTick, maxTick, expandTo18Decimals(1)) - await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, expandTo18Decimals(2)) - - await swapExact0For1(expandTo18Decimals(1), wallet.address) - - // poke positions - await pool.burn(minTick, maxTick, 0) - await pool.burn(minTick + tickSpacing, maxTick - tickSpacing, 0) - - const { tokensOwed0: tokensOwed0Position0 } = await pool.positions( - getPositionKey(wallet.address, minTick, maxTick) - ) - const { tokensOwed0: tokensOwed0Position1 } = await pool.positions( - getPositionKey(wallet.address, minTick + tickSpacing, maxTick - tickSpacing) - ) - - expect(tokensOwed0Position0).to.be.eq('166666666666667') - expect(tokensOwed0Position1).to.be.eq('333333333333334') - }) - - describe('works across large increases', () => { - beforeEach(async () => { - await mint(wallet.address, minTick, maxTick, expandTo18Decimals(1)) - }) - - // type(uint128).max * 2**128 / 1e18 - // https://www.wolframalpha.com/input/?i=%282**128+-+1%29+*+2**128+%2F+1e18 - const magicNumber = BigNumber.from('115792089237316195423570985008687907852929702298719625575994') - - it('works just before the cap binds', async () => { - await pool.setFeeGrowthGlobal0X128(magicNumber) - await pool.burn(minTick, maxTick, 0) - - const { tokensOwed0, tokensOwed1 } = await pool.positions(getPositionKey(wallet.address, minTick, maxTick)) - - expect(tokensOwed0).to.be.eq(MaxUint128.sub(1)) - expect(tokensOwed1).to.be.eq(0) - }) - - it('works just after the cap binds', async () => { - await pool.setFeeGrowthGlobal0X128(magicNumber.add(1)) - await pool.burn(minTick, maxTick, 0) - - const { tokensOwed0, tokensOwed1 } = await pool.positions(getPositionKey(wallet.address, minTick, maxTick)) - - expect(tokensOwed0).to.be.eq(MaxUint128) - expect(tokensOwed1).to.be.eq(0) - }) - - it('works well after the cap binds', async () => { - await pool.setFeeGrowthGlobal0X128(constants.MaxUint256) - await pool.burn(minTick, maxTick, 0) - - const { tokensOwed0, tokensOwed1 } = await pool.positions(getPositionKey(wallet.address, minTick, maxTick)) - - expect(tokensOwed0).to.be.eq(MaxUint128) - expect(tokensOwed1).to.be.eq(0) - }) - }) - - describe('works across overflow boundaries', () => { - beforeEach(async () => { - await pool.setFeeGrowthGlobal0X128(constants.MaxUint256) - await pool.setFeeGrowthGlobal1X128(constants.MaxUint256) - await mint(wallet.address, minTick, maxTick, expandTo18Decimals(10)) - }) - - it('token0', async () => { - await swapExact0For1(expandTo18Decimals(1), wallet.address) - await pool.burn(minTick, maxTick, 0) - const { amount0, amount1 } = await pool.callStatic.collect( - wallet.address, - minTick, - maxTick, - MaxUint128, - MaxUint128 - ) - expect(amount0).to.be.eq('499999999999999') - expect(amount1).to.be.eq(0) - }) - it('token1', async () => { - await swapExact1For0(expandTo18Decimals(1), wallet.address) - await pool.burn(minTick, maxTick, 0) - const { amount0, amount1 } = await pool.callStatic.collect( - wallet.address, - minTick, - maxTick, - MaxUint128, - MaxUint128 - ) - expect(amount0).to.be.eq(0) - expect(amount1).to.be.eq('499999999999999') - }) - it('token0 and token1', async () => { - await swapExact0For1(expandTo18Decimals(1), wallet.address) - await swapExact1For0(expandTo18Decimals(1), wallet.address) - await pool.burn(minTick, maxTick, 0) - const { amount0, amount1 } = await pool.callStatic.collect( - wallet.address, - minTick, - maxTick, - MaxUint128, - MaxUint128 - ) - expect(amount0).to.be.eq('499999999999999') - expect(amount1).to.be.eq('500000000000000') - }) - }) - }) - - describe('#feeProtocol', () => { - const liquidityAmount = expandTo18Decimals(1000) - - beforeEach(async () => { - pool = await createPool(FeeAmount.LOW, TICK_SPACINGS[FeeAmount.LOW]) - await pool.initialize(encodePriceSqrt(1, 1)) - await mint(wallet.address, minTick, maxTick, liquidityAmount) - }) - - it('is initially set to 0', async () => { - expect((await pool.slot0()).feeProtocol).to.eq(0) - }) - - it('can be changed by the owner', async () => { - await pool.setFeeProtocol(6, 6) - expect((await pool.slot0()).feeProtocol).to.eq(102) - }) - - it('cannot be changed out of bounds', async () => { - await expect(pool.setFeeProtocol(3, 3)).to.be.reverted - await expect(pool.setFeeProtocol(11, 11)).to.be.reverted - }) - - it('cannot be changed by addresses that are not owner', async () => { - await expect(pool.connect(other).setFeeProtocol(6, 6)).to.be.reverted - }) - - async function swapAndGetFeesOwed({ - amount, - zeroForOne, - poke, - }: { - amount: BigNumberish - zeroForOne: boolean - poke: boolean - }) { - await (zeroForOne ? swapExact0For1(amount, wallet.address) : swapExact1For0(amount, wallet.address)) - - if (poke) await pool.burn(minTick, maxTick, 0) - - const { amount0: fees0, amount1: fees1 } = await pool.callStatic.collect( - wallet.address, - minTick, - maxTick, - MaxUint128, - MaxUint128 - ) - - expect(fees0, 'fees owed in token0 are greater than 0').to.be.gte(0) - expect(fees1, 'fees owed in token1 are greater than 0').to.be.gte(0) - - return { token0Fees: fees0, token1Fees: fees1 } - } - - it('position owner gets full fees when protocol fee is off', async () => { - const { token0Fees, token1Fees } = await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: true, - poke: true, - }) - - // 6 bips * 1e18 - expect(token0Fees).to.eq('499999999999999') - expect(token1Fees).to.eq(0) - }) - - it('swap fees accumulate as expected (0 for 1)', async () => { - let token0Fees - let token1Fees - ;({ token0Fees, token1Fees } = await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: true, - poke: true, - })) - expect(token0Fees).to.eq('499999999999999') - expect(token1Fees).to.eq(0) - ;({ token0Fees, token1Fees } = await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: true, - poke: true, - })) - expect(token0Fees).to.eq('999999999999998') - expect(token1Fees).to.eq(0) - ;({ token0Fees, token1Fees } = await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: true, - poke: true, - })) - expect(token0Fees).to.eq('1499999999999997') - expect(token1Fees).to.eq(0) - }) - - it('swap fees accumulate as expected (1 for 0)', async () => { - let token0Fees - let token1Fees - ;({ token0Fees, token1Fees } = await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: false, - poke: true, - })) - expect(token0Fees).to.eq(0) - expect(token1Fees).to.eq('499999999999999') - ;({ token0Fees, token1Fees } = await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: false, - poke: true, - })) - expect(token0Fees).to.eq(0) - expect(token1Fees).to.eq('999999999999998') - ;({ token0Fees, token1Fees } = await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: false, - poke: true, - })) - expect(token0Fees).to.eq(0) - expect(token1Fees).to.eq('1499999999999997') - }) - - it('position owner gets partial fees when protocol fee is on', async () => { - await pool.setFeeProtocol(6, 6) - - const { token0Fees, token1Fees } = await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: true, - poke: true, - }) - - expect(token0Fees).to.be.eq('416666666666666') - expect(token1Fees).to.be.eq(0) - }) - - describe('#collectProtocol', () => { - it('returns 0 if no fees', async () => { - await pool.setFeeProtocol(6, 6) - const { amount0, amount1 } = await pool.callStatic.collectProtocol(wallet.address, MaxUint128, MaxUint128) - expect(amount0).to.be.eq(0) - expect(amount1).to.be.eq(0) - }) - - it('can collect fees', async () => { - await pool.setFeeProtocol(6, 6) - - await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: true, - poke: true, - }) - - await expect(pool.collectProtocol(other.address, MaxUint128, MaxUint128)) - .to.emit(token0, 'Transfer') - .withArgs(pool.address, other.address, '83333333333332') - }) - - it('fees collected can differ between token0 and token1', async () => { - await pool.setFeeProtocol(8, 5) - - await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: true, - poke: false, - }) - await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: false, - poke: false, - }) - - await expect(pool.collectProtocol(other.address, MaxUint128, MaxUint128)) - .to.emit(token0, 'Transfer') - // more token0 fees because it's 1/5th the swap fees - .withArgs(pool.address, other.address, '62499999999999') - .to.emit(token1, 'Transfer') - // less token1 fees because it's 1/8th the swap fees - .withArgs(pool.address, other.address, '99999999999998') - }) - }) - - it('fees collected by lp after two swaps should be double one swap', async () => { - await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: true, - poke: true, - }) - const { token0Fees, token1Fees } = await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: true, - poke: true, - }) - - // 6 bips * 2e18 - expect(token0Fees).to.eq('999999999999998') - expect(token1Fees).to.eq(0) - }) - - it('fees collected after two swaps with fee turned on in middle are fees from last swap (not confiscatory)', async () => { - await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: true, - poke: false, - }) - - await pool.setFeeProtocol(6, 6) - - const { token0Fees, token1Fees } = await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: true, - poke: true, - }) - - expect(token0Fees).to.eq('916666666666666') - expect(token1Fees).to.eq(0) - }) - - it('fees collected by lp after two swaps with intermediate withdrawal', async () => { - await pool.setFeeProtocol(6, 6) - - const { token0Fees, token1Fees } = await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: true, - poke: true, - }) - - expect(token0Fees).to.eq('416666666666666') - expect(token1Fees).to.eq(0) - - // collect the fees - await pool.collect(wallet.address, minTick, maxTick, MaxUint128, MaxUint128) - - const { token0Fees: token0FeesNext, token1Fees: token1FeesNext } = await swapAndGetFeesOwed({ - amount: expandTo18Decimals(1), - zeroForOne: true, - poke: false, - }) - - expect(token0FeesNext).to.eq(0) - expect(token1FeesNext).to.eq(0) - - let { token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees() - expect(token0ProtocolFees).to.eq('166666666666666') - expect(token1ProtocolFees).to.eq(0) - - await pool.burn(minTick, maxTick, 0) // poke to update fees - await expect(pool.collect(wallet.address, minTick, maxTick, MaxUint128, MaxUint128)) - .to.emit(token0, 'Transfer') - .withArgs(pool.address, wallet.address, '416666666666666') - ;({ token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees()) - expect(token0ProtocolFees).to.eq('166666666666666') - expect(token1ProtocolFees).to.eq(0) - }) - }) - - describe('#tickSpacing', () => { - describe('tickSpacing = 12', () => { - beforeEach('deploy pool', async () => { - pool = await createPool(FeeAmount.MEDIUM, 12) - }) - describe('post initialize', () => { - beforeEach('initialize pool', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - }) - it('mint can only be called for multiples of 12', async () => { - await expect(mint(wallet.address, -6, 0, 1)).to.be.reverted - await expect(mint(wallet.address, 0, 6, 1)).to.be.reverted - }) - it('mint can be called with multiples of 12', async () => { - await mint(wallet.address, 12, 24, 1) - await mint(wallet.address, -144, -120, 1) - }) - it('swapping across gaps works in 1 for 0 direction', async () => { - const liquidityAmount = expandTo18Decimals(1).div(4) - await mint(wallet.address, 120000, 121200, liquidityAmount) - await swapExact1For0(expandTo18Decimals(1), wallet.address) - await expect(pool.burn(120000, 121200, liquidityAmount)) - .to.emit(pool, 'Burn') - .withArgs(wallet.address, 120000, 121200, liquidityAmount, '30027458295511', '996999999999999999') - .to.not.emit(token0, 'Transfer') - .to.not.emit(token1, 'Transfer') - expect((await pool.slot0()).tick).to.eq(120196) - }) - it('swapping across gaps works in 0 for 1 direction', async () => { - const liquidityAmount = expandTo18Decimals(1).div(4) - await mint(wallet.address, -121200, -120000, liquidityAmount) - await swapExact0For1(expandTo18Decimals(1), wallet.address) - await expect(pool.burn(-121200, -120000, liquidityAmount)) - .to.emit(pool, 'Burn') - .withArgs(wallet.address, -121200, -120000, liquidityAmount, '996999999999999999', '30027458295511') - .to.not.emit(token0, 'Transfer') - .to.not.emit(token1, 'Transfer') - expect((await pool.slot0()).tick).to.eq(-120197) - }) - }) - }) - }) - - // https://github.com/Uniswap/uniswap-v3-core/issues/214 - it('tick transition cannot run twice if zero for one swap ends at fractional price just below tick', async () => { - pool = await createPool(FeeAmount.MEDIUM, 1) - const sqrtTickMath = (await (await ethers.getContractFactory('TickMathTest')).deploy()) as TickMathTest - const swapMath = (await (await ethers.getContractFactory('SwapMathTest')).deploy()) as SwapMathTest - const p0 = (await sqrtTickMath.getSqrtRatioAtTick(-24081)).add(1) - // initialize at a price of ~0.3 token1/token0 - // meaning if you swap in 2 token0, you should end up getting 0 token1 - await pool.initialize(p0) - expect(await pool.liquidity(), 'current pool liquidity is 1').to.eq(0) - expect((await pool.slot0()).tick, 'pool tick is -24081').to.eq(-24081) - - // add a bunch of liquidity around current price - const liquidity = expandTo18Decimals(1000) - await mint(wallet.address, -24082, -24080, liquidity) - expect(await pool.liquidity(), 'current pool liquidity is now liquidity + 1').to.eq(liquidity) - - await mint(wallet.address, -24082, -24081, liquidity) - expect(await pool.liquidity(), 'current pool liquidity is still liquidity + 1').to.eq(liquidity) - - // check the math works out to moving the price down 1, sending no amount out, and having some amount remaining - { - const { feeAmount, amountIn, amountOut, sqrtQ } = await swapMath.computeSwapStep( - p0, - p0.sub(1), - liquidity, - 3, - FeeAmount.MEDIUM - ) - expect(sqrtQ, 'price moves').to.eq(p0.sub(1)) - expect(feeAmount, 'fee amount is 1').to.eq(1) - expect(amountIn, 'amount in is 1').to.eq(1) - expect(amountOut, 'zero amount out').to.eq(0) - } - - // swap 2 amount in, should get 0 amount out - await expect(swapExact0For1(3, wallet.address)) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pool.address, 3) - .to.not.emit(token1, 'Transfer') - - const { tick, sqrtPriceX96 } = await pool.slot0() - - expect(tick, 'pool is at the next tick').to.eq(-24082) - expect(sqrtPriceX96, 'pool price is still on the p0 boundary').to.eq(p0.sub(1)) - expect(await pool.liquidity(), 'pool has run tick transition and liquidity changed').to.eq(liquidity.mul(2)) - }) - - describe('#flash', () => { - it('fails if not initialized', async () => { - await expect(flash(100, 200, other.address)).to.be.reverted - await expect(flash(100, 0, other.address)).to.be.reverted - await expect(flash(0, 200, other.address)).to.be.reverted - }) - it('fails if no liquidity', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - await expect(flash(100, 200, other.address)).to.be.revertedWith('L') - await expect(flash(100, 0, other.address)).to.be.revertedWith('L') - await expect(flash(0, 200, other.address)).to.be.revertedWith('L') - }) - describe('after liquidity added', () => { - let balance0: BigNumber - let balance1: BigNumber - beforeEach('add some tokens', async () => { - await initializeAtZeroTick(pool) - ;[balance0, balance1] = await Promise.all([token0.balanceOf(pool.address), token1.balanceOf(pool.address)]) - }) - - describe('fee off', () => { - it('emits an event', async () => { - await expect(flash(1001, 2001, other.address)) - .to.emit(pool, 'Flash') - .withArgs(swapTarget.address, other.address, 1001, 2001, 4, 7) - }) - - it('transfers the amount0 to the recipient', async () => { - await expect(flash(100, 200, other.address)) - .to.emit(token0, 'Transfer') - .withArgs(pool.address, other.address, 100) - }) - it('transfers the amount1 to the recipient', async () => { - await expect(flash(100, 200, other.address)) - .to.emit(token1, 'Transfer') - .withArgs(pool.address, other.address, 200) - }) - it('can flash only token0', async () => { - await expect(flash(101, 0, other.address)) - .to.emit(token0, 'Transfer') - .withArgs(pool.address, other.address, 101) - .to.not.emit(token1, 'Transfer') - }) - it('can flash only token1', async () => { - await expect(flash(0, 102, other.address)) - .to.emit(token1, 'Transfer') - .withArgs(pool.address, other.address, 102) - .to.not.emit(token0, 'Transfer') - }) - it('can flash entire token balance', async () => { - await expect(flash(balance0, balance1, other.address)) - .to.emit(token0, 'Transfer') - .withArgs(pool.address, other.address, balance0) - .to.emit(token1, 'Transfer') - .withArgs(pool.address, other.address, balance1) - }) - it('no-op if both amounts are 0', async () => { - await expect(flash(0, 0, other.address)).to.not.emit(token0, 'Transfer').to.not.emit(token1, 'Transfer') - }) - it('fails if flash amount is greater than token balance', async () => { - await expect(flash(balance0.add(1), balance1, other.address)).to.be.reverted - await expect(flash(balance0, balance1.add(1), other.address)).to.be.reverted - }) - it('calls the flash callback on the sender with correct fee amounts', async () => { - await expect(flash(1001, 2002, other.address)).to.emit(swapTarget, 'FlashCallback').withArgs(4, 7) - }) - it('increases the fee growth by the expected amount', async () => { - await flash(1001, 2002, other.address) - expect(await pool.feeGrowthGlobal0X128()).to.eq( - BigNumber.from(4).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) - ) - expect(await pool.feeGrowthGlobal1X128()).to.eq( - BigNumber.from(7).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) - ) - }) - it('fails if original balance not returned in either token', async () => { - await expect(flash(1000, 0, other.address, 999, 0)).to.be.reverted - await expect(flash(0, 1000, other.address, 0, 999)).to.be.reverted - }) - it('fails if underpays either token', async () => { - await expect(flash(1000, 0, other.address, 1002, 0)).to.be.reverted - await expect(flash(0, 1000, other.address, 0, 1002)).to.be.reverted - }) - it('allows donating token0', async () => { - await expect(flash(0, 0, constants.AddressZero, 567, 0)) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pool.address, 567) - .to.not.emit(token1, 'Transfer') - expect(await pool.feeGrowthGlobal0X128()).to.eq( - BigNumber.from(567).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) - ) - }) - it('allows donating token1', async () => { - await expect(flash(0, 0, constants.AddressZero, 0, 678)) - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, pool.address, 678) - .to.not.emit(token0, 'Transfer') - expect(await pool.feeGrowthGlobal1X128()).to.eq( - BigNumber.from(678).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) - ) - }) - it('allows donating token0 and token1 together', async () => { - await expect(flash(0, 0, constants.AddressZero, 789, 1234)) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pool.address, 789) - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, pool.address, 1234) - - expect(await pool.feeGrowthGlobal0X128()).to.eq( - BigNumber.from(789).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) - ) - expect(await pool.feeGrowthGlobal1X128()).to.eq( - BigNumber.from(1234).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) - ) - }) - }) - - describe('fee on', () => { - beforeEach('turn protocol fee on', async () => { - await pool.setFeeProtocol(6, 6) - }) - - it('emits an event', async () => { - await expect(flash(1001, 2001, other.address)) - .to.emit(pool, 'Flash') - .withArgs(swapTarget.address, other.address, 1001, 2001, 4, 7) - }) - - it('increases the fee growth by the expected amount', async () => { - await flash(2002, 4004, other.address) - - const { token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees() - expect(token0ProtocolFees).to.eq(1) - expect(token1ProtocolFees).to.eq(2) - - expect(await pool.feeGrowthGlobal0X128()).to.eq( - BigNumber.from(6).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) - ) - expect(await pool.feeGrowthGlobal1X128()).to.eq( - BigNumber.from(11).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) - ) - }) - it('allows donating token0', async () => { - await expect(flash(0, 0, constants.AddressZero, 567, 0)) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pool.address, 567) - .to.not.emit(token1, 'Transfer') - - const { token0: token0ProtocolFees } = await pool.protocolFees() - expect(token0ProtocolFees).to.eq(94) - - expect(await pool.feeGrowthGlobal0X128()).to.eq( - BigNumber.from(473).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) - ) - }) - it('allows donating token1', async () => { - await expect(flash(0, 0, constants.AddressZero, 0, 678)) - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, pool.address, 678) - .to.not.emit(token0, 'Transfer') - - const { token1: token1ProtocolFees } = await pool.protocolFees() - expect(token1ProtocolFees).to.eq(113) - - expect(await pool.feeGrowthGlobal1X128()).to.eq( - BigNumber.from(565).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) - ) - }) - it('allows donating token0 and token1 together', async () => { - await expect(flash(0, 0, constants.AddressZero, 789, 1234)) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pool.address, 789) - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, pool.address, 1234) - - const { token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees() - expect(token0ProtocolFees).to.eq(131) - expect(token1ProtocolFees).to.eq(205) - - expect(await pool.feeGrowthGlobal0X128()).to.eq( - BigNumber.from(658).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) - ) - expect(await pool.feeGrowthGlobal1X128()).to.eq( - BigNumber.from(1029).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) - ) - }) - }) - }) - }) - - describe('#increaseObservationCardinalityNext', () => { - it('cannot be called before initialization', async () => { - await expect(pool.increaseObservationCardinalityNext(2)).to.be.reverted - }) - describe('after initialization', () => { - beforeEach('initialize the pool', () => pool.initialize(encodePriceSqrt(1, 1))) - it('oracle starting state after initialization', async () => { - const { observationCardinality, observationIndex, observationCardinalityNext } = await pool.slot0() - expect(observationCardinality).to.eq(1) - expect(observationIndex).to.eq(0) - expect(observationCardinalityNext).to.eq(1) - const { - secondsPerLiquidityCumulativeX128, - tickCumulative, - initialized, - blockTimestamp, - } = await pool.observations(0) - expect(secondsPerLiquidityCumulativeX128).to.eq(0) - expect(tickCumulative).to.eq(0) - expect(initialized).to.eq(true) - expect(blockTimestamp).to.eq(TEST_POOL_START_TIME) - }) - it('increases observation cardinality next', async () => { - await pool.increaseObservationCardinalityNext(2) - const { observationCardinality, observationIndex, observationCardinalityNext } = await pool.slot0() - expect(observationCardinality).to.eq(1) - expect(observationIndex).to.eq(0) - expect(observationCardinalityNext).to.eq(2) - }) - it('is no op if target is already exceeded', async () => { - await pool.increaseObservationCardinalityNext(5) - await pool.increaseObservationCardinalityNext(3) - const { observationCardinality, observationIndex, observationCardinalityNext } = await pool.slot0() - expect(observationCardinality).to.eq(1) - expect(observationIndex).to.eq(0) - expect(observationCardinalityNext).to.eq(5) - }) - }) - }) - - describe('#setFeeProtocol', () => { - beforeEach('initialize the pool', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - }) - - it('can only be called by factory owner', async () => { - await expect(pool.connect(other).setFeeProtocol(5, 5)).to.be.reverted - }) - it('fails if fee is lt 4 or gt 10', async () => { - await expect(pool.setFeeProtocol(3, 3)).to.be.reverted - await expect(pool.setFeeProtocol(6, 3)).to.be.reverted - await expect(pool.setFeeProtocol(3, 6)).to.be.reverted - await expect(pool.setFeeProtocol(11, 11)).to.be.reverted - await expect(pool.setFeeProtocol(6, 11)).to.be.reverted - await expect(pool.setFeeProtocol(11, 6)).to.be.reverted - }) - it('succeeds for fee of 4', async () => { - await pool.setFeeProtocol(4, 4) - }) - it('succeeds for fee of 10', async () => { - await pool.setFeeProtocol(10, 10) - }) - it('sets protocol fee', async () => { - await pool.setFeeProtocol(7, 7) - expect((await pool.slot0()).feeProtocol).to.eq(119) - }) - it('can change protocol fee', async () => { - await pool.setFeeProtocol(7, 7) - await pool.setFeeProtocol(5, 8) - expect((await pool.slot0()).feeProtocol).to.eq(133) - }) - it('can turn off protocol fee', async () => { - await pool.setFeeProtocol(4, 4) - await pool.setFeeProtocol(0, 0) - expect((await pool.slot0()).feeProtocol).to.eq(0) - }) - it('emits an event when turned on', async () => { - await expect(pool.setFeeProtocol(7, 7)).to.be.emit(pool, 'SetFeeProtocol').withArgs(0, 0, 7, 7) - }) - it('emits an event when turned off', async () => { - await pool.setFeeProtocol(7, 5) - await expect(pool.setFeeProtocol(0, 0)).to.be.emit(pool, 'SetFeeProtocol').withArgs(7, 5, 0, 0) - }) - it('emits an event when changed', async () => { - await pool.setFeeProtocol(4, 10) - await expect(pool.setFeeProtocol(6, 8)).to.be.emit(pool, 'SetFeeProtocol').withArgs(4, 10, 6, 8) - }) - it('emits an event when unchanged', async () => { - await pool.setFeeProtocol(5, 9) - await expect(pool.setFeeProtocol(5, 9)).to.be.emit(pool, 'SetFeeProtocol').withArgs(5, 9, 5, 9) - }) - }) - - describe('#lock', () => { - beforeEach('initialize the pool', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - await mint(wallet.address, minTick, maxTick, expandTo18Decimals(1)) - }) - - it('cannot reenter from swap callback', async () => { - const reentrant = (await ( - await ethers.getContractFactory('TestUniswapV3ReentrantCallee') - ).deploy()) as TestUniswapV3ReentrantCallee - - // the tests happen in solidity - await expect(reentrant.swapToReenter(pool.address)).to.be.revertedWith('Unable to reenter') - }) - }) - - describe('#snapshotCumulativesInside', () => { - const tickLower = -TICK_SPACINGS[FeeAmount.MEDIUM] - const tickUpper = TICK_SPACINGS[FeeAmount.MEDIUM] - const tickSpacing = TICK_SPACINGS[FeeAmount.MEDIUM] - beforeEach(async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - await mint(wallet.address, tickLower, tickUpper, 10) - }) - it('throws if ticks are in reverse order', async () => { - await expect(pool.snapshotCumulativesInside(tickUpper, tickLower)).to.be.reverted - }) - it('throws if ticks are the same', async () => { - await expect(pool.snapshotCumulativesInside(tickUpper, tickUpper)).to.be.reverted - }) - it('throws if tick lower is too low', async () => { - await expect(pool.snapshotCumulativesInside(getMinTick(tickSpacing) - 1, tickUpper)).be.reverted - }) - it('throws if tick upper is too high', async () => { - await expect(pool.snapshotCumulativesInside(tickLower, getMaxTick(tickSpacing) + 1)).be.reverted - }) - it('throws if tick lower is not initialized', async () => { - await expect(pool.snapshotCumulativesInside(tickLower - tickSpacing, tickUpper)).to.be.reverted - }) - it('throws if tick upper is not initialized', async () => { - await expect(pool.snapshotCumulativesInside(tickLower, tickUpper + tickSpacing)).to.be.reverted - }) - it('is zero immediately after initialize', async () => { - const { - secondsPerLiquidityInsideX128, - tickCumulativeInside, - secondsInside, - } = await pool.snapshotCumulativesInside(tickLower, tickUpper) - expect(secondsPerLiquidityInsideX128).to.eq(0) - expect(tickCumulativeInside).to.eq(0) - expect(secondsInside).to.eq(0) - }) - it('increases by expected amount when time elapses in the range', async () => { - await pool.advanceTime(5) - const { - secondsPerLiquidityInsideX128, - tickCumulativeInside, - secondsInside, - } = await pool.snapshotCumulativesInside(tickLower, tickUpper) - expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(5).shl(128).div(10)) - expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(0) - expect(secondsInside).to.eq(5) - }) - it('does not account for time increase above range', async () => { - await pool.advanceTime(5) - await swapToHigherPrice(encodePriceSqrt(2, 1), wallet.address) - await pool.advanceTime(7) - const { - secondsPerLiquidityInsideX128, - tickCumulativeInside, - secondsInside, - } = await pool.snapshotCumulativesInside(tickLower, tickUpper) - expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(5).shl(128).div(10)) - expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(0) - expect(secondsInside).to.eq(5) - }) - it('does not account for time increase below range', async () => { - await pool.advanceTime(5) - await swapToLowerPrice(encodePriceSqrt(1, 2), wallet.address) - await pool.advanceTime(7) - const { - secondsPerLiquidityInsideX128, - tickCumulativeInside, - secondsInside, - } = await pool.snapshotCumulativesInside(tickLower, tickUpper) - expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(5).shl(128).div(10)) - // tick is 0 for 5 seconds, then not in range - expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(0) - expect(secondsInside).to.eq(5) - }) - it('time increase below range is not counted', async () => { - await swapToLowerPrice(encodePriceSqrt(1, 2), wallet.address) - await pool.advanceTime(5) - await swapToHigherPrice(encodePriceSqrt(1, 1), wallet.address) - await pool.advanceTime(7) - const { - secondsPerLiquidityInsideX128, - tickCumulativeInside, - secondsInside, - } = await pool.snapshotCumulativesInside(tickLower, tickUpper) - expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(7).shl(128).div(10)) - // tick is not in range then tick is 0 for 7 seconds - expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(0) - expect(secondsInside).to.eq(7) - }) - it('time increase above range is not counted', async () => { - await swapToHigherPrice(encodePriceSqrt(2, 1), wallet.address) - await pool.advanceTime(5) - await swapToLowerPrice(encodePriceSqrt(1, 1), wallet.address) - await pool.advanceTime(7) - const { - secondsPerLiquidityInsideX128, - tickCumulativeInside, - secondsInside, - } = await pool.snapshotCumulativesInside(tickLower, tickUpper) - expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(7).shl(128).div(10)) - expect((await pool.slot0()).tick).to.eq(-1) // justify the -7 tick cumulative inside value - expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(-7) - expect(secondsInside).to.eq(7) - }) - it('positions minted after time spent', async () => { - await pool.advanceTime(5) - await mint(wallet.address, tickUpper, getMaxTick(tickSpacing), 15) - await swapToHigherPrice(encodePriceSqrt(2, 1), wallet.address) - await pool.advanceTime(8) - const { - secondsPerLiquidityInsideX128, - tickCumulativeInside, - secondsInside, - } = await pool.snapshotCumulativesInside(tickUpper, getMaxTick(tickSpacing)) - expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(8).shl(128).div(15)) - // the tick of 2/1 is 6931 - // 8 seconds * 6931 = 55448 - expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(55448) - expect(secondsInside).to.eq(8) - }) - it('overlapping liquidity is aggregated', async () => { - await mint(wallet.address, tickLower, getMaxTick(tickSpacing), 15) - await pool.advanceTime(5) - await swapToHigherPrice(encodePriceSqrt(2, 1), wallet.address) - await pool.advanceTime(8) - const { - secondsPerLiquidityInsideX128, - tickCumulativeInside, - secondsInside, - } = await pool.snapshotCumulativesInside(tickLower, tickUpper) - expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(5).shl(128).div(25)) - expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(0) - expect(secondsInside).to.eq(5) - }) - it('relative behavior of snapshots', async () => { - await pool.advanceTime(5) - await mint(wallet.address, getMinTick(tickSpacing), tickLower, 15) - const { - secondsPerLiquidityInsideX128: secondsPerLiquidityInsideX128Start, - tickCumulativeInside: tickCumulativeInsideStart, - secondsInside: secondsInsideStart, - } = await pool.snapshotCumulativesInside(getMinTick(tickSpacing), tickLower) - await pool.advanceTime(8) - // 13 seconds in starting range, then 3 seconds in newly minted range - await swapToLowerPrice(encodePriceSqrt(1, 2), wallet.address) - await pool.advanceTime(3) - const { - secondsPerLiquidityInsideX128, - tickCumulativeInside, - secondsInside, - } = await pool.snapshotCumulativesInside(getMinTick(tickSpacing), tickLower) - const expectedDiffSecondsPerLiquidity = BigNumber.from(3).shl(128).div(15) - expect(secondsPerLiquidityInsideX128.sub(secondsPerLiquidityInsideX128Start)).to.eq( - expectedDiffSecondsPerLiquidity - ) - expect(secondsPerLiquidityInsideX128).to.not.eq(expectedDiffSecondsPerLiquidity) - // the tick is the one corresponding to the price of 1/2, or log base 1.0001 of 0.5 - // this is -6932, and 3 seconds have passed, so the cumulative computed from the diff equals 6932 * 3 - expect(tickCumulativeInside.sub(tickCumulativeInsideStart), 'tickCumulativeInside').to.eq(-20796) - expect(secondsInside - secondsInsideStart).to.eq(3) - expect(secondsInside).to.not.eq(3) - }) - }) - - describe('fees overflow scenarios', async () => { - it('up to max uint 128', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - await mint(wallet.address, minTick, maxTick, 1) - await flash(0, 0, wallet.address, MaxUint128, MaxUint128) - - const [feeGrowthGlobal0X128, feeGrowthGlobal1X128] = await Promise.all([ - pool.feeGrowthGlobal0X128(), - pool.feeGrowthGlobal1X128(), - ]) - // all 1s in first 128 bits - expect(feeGrowthGlobal0X128).to.eq(MaxUint128.shl(128)) - expect(feeGrowthGlobal1X128).to.eq(MaxUint128.shl(128)) - await pool.burn(minTick, maxTick, 0) - const { amount0, amount1 } = await pool.callStatic.collect( - wallet.address, - minTick, - maxTick, - MaxUint128, - MaxUint128 - ) - expect(amount0).to.eq(MaxUint128) - expect(amount1).to.eq(MaxUint128) - }) - - it('overflow max uint 128', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - await mint(wallet.address, minTick, maxTick, 1) - await flash(0, 0, wallet.address, MaxUint128, MaxUint128) - await flash(0, 0, wallet.address, 1, 1) - - const [feeGrowthGlobal0X128, feeGrowthGlobal1X128] = await Promise.all([ - pool.feeGrowthGlobal0X128(), - pool.feeGrowthGlobal1X128(), - ]) - // all 1s in first 128 bits - expect(feeGrowthGlobal0X128).to.eq(0) - expect(feeGrowthGlobal1X128).to.eq(0) - await pool.burn(minTick, maxTick, 0) - const { amount0, amount1 } = await pool.callStatic.collect( - wallet.address, - minTick, - maxTick, - MaxUint128, - MaxUint128 - ) - // fees burned - expect(amount0).to.eq(0) - expect(amount1).to.eq(0) - }) - - it('overflow max uint 128 after poke burns fees owed to 0', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - await mint(wallet.address, minTick, maxTick, 1) - await flash(0, 0, wallet.address, MaxUint128, MaxUint128) - await pool.burn(minTick, maxTick, 0) - await flash(0, 0, wallet.address, 1, 1) - await pool.burn(minTick, maxTick, 0) - - const { amount0, amount1 } = await pool.callStatic.collect( - wallet.address, - minTick, - maxTick, - MaxUint128, - MaxUint128 - ) - // fees burned - expect(amount0).to.eq(0) - expect(amount1).to.eq(0) - }) - - it('two positions at the same snapshot', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - await mint(wallet.address, minTick, maxTick, 1) - await mint(other.address, minTick, maxTick, 1) - await flash(0, 0, wallet.address, MaxUint128, 0) - await flash(0, 0, wallet.address, MaxUint128, 0) - const feeGrowthGlobal0X128 = await pool.feeGrowthGlobal0X128() - expect(feeGrowthGlobal0X128).to.eq(MaxUint128.shl(128)) - await flash(0, 0, wallet.address, 2, 0) - await pool.burn(minTick, maxTick, 0) - await pool.connect(other).burn(minTick, maxTick, 0) - let { amount0 } = await pool.callStatic.collect(wallet.address, minTick, maxTick, MaxUint128, MaxUint128) - expect(amount0, 'amount0 of wallet').to.eq(0) - ;({ amount0 } = await pool - .connect(other) - .callStatic.collect(other.address, minTick, maxTick, MaxUint128, MaxUint128)) - expect(amount0, 'amount0 of other').to.eq(0) - }) - - it('two positions 1 wei of fees apart overflows exactly once', async () => { - await pool.initialize(encodePriceSqrt(1, 1)) - await mint(wallet.address, minTick, maxTick, 1) - await flash(0, 0, wallet.address, 1, 0) - await mint(other.address, minTick, maxTick, 1) - await flash(0, 0, wallet.address, MaxUint128, 0) - await flash(0, 0, wallet.address, MaxUint128, 0) - const feeGrowthGlobal0X128 = await pool.feeGrowthGlobal0X128() - expect(feeGrowthGlobal0X128).to.eq(0) - await flash(0, 0, wallet.address, 2, 0) - await pool.burn(minTick, maxTick, 0) - await pool.connect(other).burn(minTick, maxTick, 0) - let { amount0 } = await pool.callStatic.collect(wallet.address, minTick, maxTick, MaxUint128, MaxUint128) - expect(amount0, 'amount0 of wallet').to.eq(1) - ;({ amount0 } = await pool - .connect(other) - .callStatic.collect(other.address, minTick, maxTick, MaxUint128, MaxUint128)) - expect(amount0, 'amount0 of other').to.eq(0) - }) - }) - - describe('swap underpayment tests', () => { - let underpay: TestUniswapV3SwapPay - beforeEach('deploy swap test', async () => { - const underpayFactory = await ethers.getContractFactory('TestUniswapV3SwapPay') - underpay = (await underpayFactory.deploy()) as TestUniswapV3SwapPay - await token0.approve(underpay.address, constants.MaxUint256) - await token1.approve(underpay.address, constants.MaxUint256) - await pool.initialize(encodePriceSqrt(1, 1)) - await mint(wallet.address, minTick, maxTick, expandTo18Decimals(1)) - }) - - it('underpay zero for one and exact in', async () => { - await expect( - underpay.swap(pool.address, wallet.address, true, MIN_SQRT_RATIO.add(1), 1000, 1, 0) - ).to.be.revertedWith('IIA') - }) - it('pay in the wrong token zero for one and exact in', async () => { - await expect( - underpay.swap(pool.address, wallet.address, true, MIN_SQRT_RATIO.add(1), 1000, 0, 2000) - ).to.be.revertedWith('IIA') - }) - it('overpay zero for one and exact in', async () => { - await expect( - underpay.swap(pool.address, wallet.address, true, MIN_SQRT_RATIO.add(1), 1000, 2000, 0) - ).to.not.be.revertedWith('IIA') - }) - it('underpay zero for one and exact out', async () => { - await expect( - underpay.swap(pool.address, wallet.address, true, MIN_SQRT_RATIO.add(1), -1000, 1, 0) - ).to.be.revertedWith('IIA') - }) - it('pay in the wrong token zero for one and exact out', async () => { - await expect( - underpay.swap(pool.address, wallet.address, true, MIN_SQRT_RATIO.add(1), -1000, 0, 2000) - ).to.be.revertedWith('IIA') - }) - it('overpay zero for one and exact out', async () => { - await expect( - underpay.swap(pool.address, wallet.address, true, MIN_SQRT_RATIO.add(1), -1000, 2000, 0) - ).to.not.be.revertedWith('IIA') - }) - it('underpay one for zero and exact in', async () => { - await expect( - underpay.swap(pool.address, wallet.address, false, MAX_SQRT_RATIO.sub(1), 1000, 0, 1) - ).to.be.revertedWith('IIA') - }) - it('pay in the wrong token one for zero and exact in', async () => { - await expect( - underpay.swap(pool.address, wallet.address, false, MAX_SQRT_RATIO.sub(1), 1000, 2000, 0) - ).to.be.revertedWith('IIA') - }) - it('overpay one for zero and exact in', async () => { - await expect( - underpay.swap(pool.address, wallet.address, false, MAX_SQRT_RATIO.sub(1), 1000, 0, 2000) - ).to.not.be.revertedWith('IIA') - }) - it('underpay one for zero and exact out', async () => { - await expect( - underpay.swap(pool.address, wallet.address, false, MAX_SQRT_RATIO.sub(1), -1000, 0, 1) - ).to.be.revertedWith('IIA') - }) - it('pay in the wrong token one for zero and exact out', async () => { - await expect( - underpay.swap(pool.address, wallet.address, false, MAX_SQRT_RATIO.sub(1), -1000, 2000, 0) - ).to.be.revertedWith('IIA') - }) - it('overpay one for zero and exact out', async () => { - await expect( - underpay.swap(pool.address, wallet.address, false, MAX_SQRT_RATIO.sub(1), -1000, 0, 2000) - ).to.not.be.revertedWith('IIA') - }) - }) -}) diff --git a/contract/lib/v3-core/test/UniswapV3Pool.swaps.spec.ts b/contract/lib/v3-core/test/UniswapV3Pool.swaps.spec.ts deleted file mode 100644 index e7b28eb..0000000 --- a/contract/lib/v3-core/test/UniswapV3Pool.swaps.spec.ts +++ /dev/null @@ -1,586 +0,0 @@ -import { Decimal } from 'decimal.js' -import { BigNumber, BigNumberish, ContractTransaction } from 'ethers' -import { ethers, waffle } from 'hardhat' -import { MockTimeUniswapV3Pool } from '../typechain/MockTimeUniswapV3Pool' -import { TestERC20 } from '../typechain/TestERC20' - -import { TestUniswapV3Callee } from '../typechain/TestUniswapV3Callee' -import { expect } from './shared/expect' -import { poolFixture } from './shared/fixtures' -import { formatPrice, formatTokenAmount } from './shared/format' -import { - createPoolFunctions, - encodePriceSqrt, - expandTo18Decimals, - FeeAmount, - getMaxLiquidityPerTick, - getMaxTick, - getMinTick, - MAX_SQRT_RATIO, - MaxUint128, - MIN_SQRT_RATIO, - TICK_SPACINGS, -} from './shared/utilities' - -Decimal.config({ toExpNeg: -500, toExpPos: 500 }) - -const createFixtureLoader = waffle.createFixtureLoader -const { constants } = ethers - -interface BaseSwapTestCase { - zeroForOne: boolean - sqrtPriceLimit?: BigNumber -} -interface SwapExact0For1TestCase extends BaseSwapTestCase { - zeroForOne: true - exactOut: false - amount0: BigNumberish - sqrtPriceLimit?: BigNumber -} -interface SwapExact1For0TestCase extends BaseSwapTestCase { - zeroForOne: false - exactOut: false - amount1: BigNumberish - sqrtPriceLimit?: BigNumber -} -interface Swap0ForExact1TestCase extends BaseSwapTestCase { - zeroForOne: true - exactOut: true - amount1: BigNumberish - sqrtPriceLimit?: BigNumber -} -interface Swap1ForExact0TestCase extends BaseSwapTestCase { - zeroForOne: false - exactOut: true - amount0: BigNumberish - sqrtPriceLimit?: BigNumber -} -interface SwapToHigherPrice extends BaseSwapTestCase { - zeroForOne: false - sqrtPriceLimit: BigNumber -} -interface SwapToLowerPrice extends BaseSwapTestCase { - zeroForOne: true - sqrtPriceLimit: BigNumber -} -type SwapTestCase = - | SwapExact0For1TestCase - | Swap0ForExact1TestCase - | SwapExact1For0TestCase - | Swap1ForExact0TestCase - | SwapToHigherPrice - | SwapToLowerPrice - -function swapCaseToDescription(testCase: SwapTestCase): string { - const priceClause = testCase?.sqrtPriceLimit ? ` to price ${formatPrice(testCase.sqrtPriceLimit)}` : '' - if ('exactOut' in testCase) { - if (testCase.exactOut) { - if (testCase.zeroForOne) { - return `swap token0 for exactly ${formatTokenAmount(testCase.amount1)} token1${priceClause}` - } else { - return `swap token1 for exactly ${formatTokenAmount(testCase.amount0)} token0${priceClause}` - } - } else { - if (testCase.zeroForOne) { - return `swap exactly ${formatTokenAmount(testCase.amount0)} token0 for token1${priceClause}` - } else { - return `swap exactly ${formatTokenAmount(testCase.amount1)} token1 for token0${priceClause}` - } - } - } else { - if (testCase.zeroForOne) { - return `swap token0 for token1${priceClause}` - } else { - return `swap token1 for token0${priceClause}` - } - } -} - -type PoolFunctions = ReturnType - -// can't use address zero because the ERC20 token does not allow it -const SWAP_RECIPIENT_ADDRESS = constants.AddressZero.slice(0, -1) + '1' -const POSITION_PROCEEDS_OUTPUT_ADDRESS = constants.AddressZero.slice(0, -1) + '2' - -async function executeSwap( - pool: MockTimeUniswapV3Pool, - testCase: SwapTestCase, - poolFunctions: PoolFunctions -): Promise { - let swap: ContractTransaction - if ('exactOut' in testCase) { - if (testCase.exactOut) { - if (testCase.zeroForOne) { - swap = await poolFunctions.swap0ForExact1(testCase.amount1, SWAP_RECIPIENT_ADDRESS, testCase.sqrtPriceLimit) - } else { - swap = await poolFunctions.swap1ForExact0(testCase.amount0, SWAP_RECIPIENT_ADDRESS, testCase.sqrtPriceLimit) - } - } else { - if (testCase.zeroForOne) { - swap = await poolFunctions.swapExact0For1(testCase.amount0, SWAP_RECIPIENT_ADDRESS, testCase.sqrtPriceLimit) - } else { - swap = await poolFunctions.swapExact1For0(testCase.amount1, SWAP_RECIPIENT_ADDRESS, testCase.sqrtPriceLimit) - } - } - } else { - if (testCase.zeroForOne) { - swap = await poolFunctions.swapToLowerPrice(testCase.sqrtPriceLimit, SWAP_RECIPIENT_ADDRESS) - } else { - swap = await poolFunctions.swapToHigherPrice(testCase.sqrtPriceLimit, SWAP_RECIPIENT_ADDRESS) - } - } - return swap -} - -const DEFAULT_POOL_SWAP_TESTS: SwapTestCase[] = [ - // swap large amounts in/out - { - zeroForOne: true, - exactOut: false, - amount0: expandTo18Decimals(1), - }, - { - zeroForOne: false, - exactOut: false, - amount1: expandTo18Decimals(1), - }, - { - zeroForOne: true, - exactOut: true, - amount1: expandTo18Decimals(1), - }, - { - zeroForOne: false, - exactOut: true, - amount0: expandTo18Decimals(1), - }, - // swap large amounts in/out with a price limit - { - zeroForOne: true, - exactOut: false, - amount0: expandTo18Decimals(1), - sqrtPriceLimit: encodePriceSqrt(50, 100), - }, - { - zeroForOne: false, - exactOut: false, - amount1: expandTo18Decimals(1), - sqrtPriceLimit: encodePriceSqrt(200, 100), - }, - { - zeroForOne: true, - exactOut: true, - amount1: expandTo18Decimals(1), - sqrtPriceLimit: encodePriceSqrt(50, 100), - }, - { - zeroForOne: false, - exactOut: true, - amount0: expandTo18Decimals(1), - sqrtPriceLimit: encodePriceSqrt(200, 100), - }, - // swap small amounts in/out - { - zeroForOne: true, - exactOut: false, - amount0: 1000, - }, - { - zeroForOne: false, - exactOut: false, - amount1: 1000, - }, - { - zeroForOne: true, - exactOut: true, - amount1: 1000, - }, - { - zeroForOne: false, - exactOut: true, - amount0: 1000, - }, - // swap arbitrary input to price - { - sqrtPriceLimit: encodePriceSqrt(5, 2), - zeroForOne: false, - }, - { - sqrtPriceLimit: encodePriceSqrt(2, 5), - zeroForOne: true, - }, - { - sqrtPriceLimit: encodePriceSqrt(5, 2), - zeroForOne: true, - }, - { - sqrtPriceLimit: encodePriceSqrt(2, 5), - zeroForOne: false, - }, -] - -interface Position { - tickLower: number - tickUpper: number - liquidity: BigNumberish -} - -interface PoolTestCase { - description: string - feeAmount: number - tickSpacing: number - startingPrice: BigNumber - positions: Position[] - swapTests?: SwapTestCase[] -} - -const TEST_POOLS: PoolTestCase[] = [ - { - description: 'low fee, 1:1 price, 2e18 max range liquidity', - feeAmount: FeeAmount.LOW, - tickSpacing: TICK_SPACINGS[FeeAmount.LOW], - startingPrice: encodePriceSqrt(1, 1), - positions: [ - { - tickLower: getMinTick(TICK_SPACINGS[FeeAmount.LOW]), - tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.LOW]), - liquidity: expandTo18Decimals(2), - }, - ], - }, - { - description: 'medium fee, 1:1 price, 2e18 max range liquidity', - feeAmount: FeeAmount.MEDIUM, - tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], - startingPrice: encodePriceSqrt(1, 1), - positions: [ - { - tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - liquidity: expandTo18Decimals(2), - }, - ], - }, - { - description: 'high fee, 1:1 price, 2e18 max range liquidity', - feeAmount: FeeAmount.HIGH, - tickSpacing: TICK_SPACINGS[FeeAmount.HIGH], - startingPrice: encodePriceSqrt(1, 1), - positions: [ - { - tickLower: getMinTick(TICK_SPACINGS[FeeAmount.HIGH]), - tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.HIGH]), - liquidity: expandTo18Decimals(2), - }, - ], - }, - { - description: 'medium fee, 10:1 price, 2e18 max range liquidity', - feeAmount: FeeAmount.MEDIUM, - tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], - startingPrice: encodePriceSqrt(10, 1), - positions: [ - { - tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - liquidity: expandTo18Decimals(2), - }, - ], - }, - { - description: 'medium fee, 1:10 price, 2e18 max range liquidity', - feeAmount: FeeAmount.MEDIUM, - tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], - startingPrice: encodePriceSqrt(1, 10), - positions: [ - { - tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - liquidity: expandTo18Decimals(2), - }, - ], - }, - { - description: 'medium fee, 1:1 price, 0 liquidity, all liquidity around current price', - feeAmount: FeeAmount.MEDIUM, - tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], - startingPrice: encodePriceSqrt(1, 1), - positions: [ - { - tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - tickUpper: -TICK_SPACINGS[FeeAmount.MEDIUM], - liquidity: expandTo18Decimals(2), - }, - { - tickLower: TICK_SPACINGS[FeeAmount.MEDIUM], - tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - liquidity: expandTo18Decimals(2), - }, - ], - }, - { - description: 'medium fee, 1:1 price, additional liquidity around current price', - feeAmount: FeeAmount.MEDIUM, - tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], - startingPrice: encodePriceSqrt(1, 1), - positions: [ - { - tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - liquidity: expandTo18Decimals(2), - }, - { - tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - tickUpper: -TICK_SPACINGS[FeeAmount.MEDIUM], - liquidity: expandTo18Decimals(2), - }, - { - tickLower: TICK_SPACINGS[FeeAmount.MEDIUM], - tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - liquidity: expandTo18Decimals(2), - }, - ], - }, - { - description: 'low fee, large liquidity around current price (stable swap)', - feeAmount: FeeAmount.LOW, - tickSpacing: TICK_SPACINGS[FeeAmount.LOW], - startingPrice: encodePriceSqrt(1, 1), - positions: [ - { - tickLower: -TICK_SPACINGS[FeeAmount.LOW], - tickUpper: TICK_SPACINGS[FeeAmount.LOW], - liquidity: expandTo18Decimals(2), - }, - ], - }, - { - description: 'medium fee, token0 liquidity only', - feeAmount: FeeAmount.MEDIUM, - tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], - startingPrice: encodePriceSqrt(1, 1), - positions: [ - { - tickLower: 0, - tickUpper: 2000 * TICK_SPACINGS[FeeAmount.MEDIUM], - liquidity: expandTo18Decimals(2), - }, - ], - }, - { - description: 'medium fee, token1 liquidity only', - feeAmount: FeeAmount.MEDIUM, - tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], - startingPrice: encodePriceSqrt(1, 1), - positions: [ - { - tickLower: -2000 * TICK_SPACINGS[FeeAmount.MEDIUM], - tickUpper: 0, - liquidity: expandTo18Decimals(2), - }, - ], - }, - { - description: 'close to max price', - feeAmount: FeeAmount.MEDIUM, - tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], - startingPrice: encodePriceSqrt(BigNumber.from(2).pow(127), 1), - positions: [ - { - tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - liquidity: expandTo18Decimals(2), - }, - ], - }, - { - description: 'close to min price', - feeAmount: FeeAmount.MEDIUM, - tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], - startingPrice: encodePriceSqrt(1, BigNumber.from(2).pow(127)), - positions: [ - { - tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - liquidity: expandTo18Decimals(2), - }, - ], - }, - { - description: 'max full range liquidity at 1:1 price with default fee', - feeAmount: FeeAmount.MEDIUM, - tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], - startingPrice: encodePriceSqrt(1, 1), - positions: [ - { - tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - liquidity: getMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - }, - ], - }, - { - description: 'initialized at the max ratio', - feeAmount: FeeAmount.MEDIUM, - tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], - startingPrice: MAX_SQRT_RATIO.sub(1), - positions: [ - { - tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - liquidity: expandTo18Decimals(2), - }, - ], - }, - { - description: 'initialized at the min ratio', - feeAmount: FeeAmount.MEDIUM, - tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], - startingPrice: MIN_SQRT_RATIO, - positions: [ - { - tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), - liquidity: expandTo18Decimals(2), - }, - ], - }, -] - -describe('UniswapV3Pool swap tests', () => { - const [wallet] = waffle.provider.getWallets() - - let loadFixture: ReturnType - - before('create fixture loader', async () => { - loadFixture = createFixtureLoader([wallet]) - }) - - for (const poolCase of TEST_POOLS) { - describe(poolCase.description, () => { - const poolCaseFixture = async () => { - const { createPool, token0, token1, swapTargetCallee: swapTarget } = await poolFixture( - [wallet], - waffle.provider - ) - const pool = await createPool(poolCase.feeAmount, poolCase.tickSpacing) - const poolFunctions = createPoolFunctions({ swapTarget, token0, token1, pool }) - await pool.initialize(poolCase.startingPrice) - // mint all positions - for (const position of poolCase.positions) { - await poolFunctions.mint(wallet.address, position.tickLower, position.tickUpper, position.liquidity) - } - - const [poolBalance0, poolBalance1] = await Promise.all([ - token0.balanceOf(pool.address), - token1.balanceOf(pool.address), - ]) - - return { token0, token1, pool, poolFunctions, poolBalance0, poolBalance1, swapTarget } - } - - let token0: TestERC20 - let token1: TestERC20 - - let poolBalance0: BigNumber - let poolBalance1: BigNumber - - let pool: MockTimeUniswapV3Pool - let swapTarget: TestUniswapV3Callee - let poolFunctions: PoolFunctions - - beforeEach('load fixture', async () => { - ;({ token0, token1, pool, poolFunctions, poolBalance0, poolBalance1, swapTarget } = await loadFixture( - poolCaseFixture - )) - }) - - afterEach('check can burn positions', async () => { - for (const { liquidity, tickUpper, tickLower } of poolCase.positions) { - await pool.burn(tickLower, tickUpper, liquidity) - await pool.collect(POSITION_PROCEEDS_OUTPUT_ADDRESS, tickLower, tickUpper, MaxUint128, MaxUint128) - } - }) - - for (const testCase of poolCase.swapTests ?? DEFAULT_POOL_SWAP_TESTS) { - it(swapCaseToDescription(testCase), async () => { - const slot0 = await pool.slot0() - const tx = executeSwap(pool, testCase, poolFunctions) - try { - await tx - } catch (error) { - expect({ - swapError: error.message, - poolBalance0: poolBalance0.toString(), - poolBalance1: poolBalance1.toString(), - poolPriceBefore: formatPrice(slot0.sqrtPriceX96), - tickBefore: slot0.tick, - }).to.matchSnapshot('swap error') - return - } - const [ - poolBalance0After, - poolBalance1After, - slot0After, - liquidityAfter, - feeGrowthGlobal0X128, - feeGrowthGlobal1X128, - ] = await Promise.all([ - token0.balanceOf(pool.address), - token1.balanceOf(pool.address), - pool.slot0(), - pool.liquidity(), - pool.feeGrowthGlobal0X128(), - pool.feeGrowthGlobal1X128(), - ]) - const poolBalance0Delta = poolBalance0After.sub(poolBalance0) - const poolBalance1Delta = poolBalance1After.sub(poolBalance1) - - // check all the events were emitted corresponding to balance changes - if (poolBalance0Delta.eq(0)) await expect(tx).to.not.emit(token0, 'Transfer') - else if (poolBalance0Delta.lt(0)) - await expect(tx) - .to.emit(token0, 'Transfer') - .withArgs(pool.address, SWAP_RECIPIENT_ADDRESS, poolBalance0Delta.mul(-1)) - else await expect(tx).to.emit(token0, 'Transfer').withArgs(wallet.address, pool.address, poolBalance0Delta) - - if (poolBalance1Delta.eq(0)) await expect(tx).to.not.emit(token1, 'Transfer') - else if (poolBalance1Delta.lt(0)) - await expect(tx) - .to.emit(token1, 'Transfer') - .withArgs(pool.address, SWAP_RECIPIENT_ADDRESS, poolBalance1Delta.mul(-1)) - else await expect(tx).to.emit(token1, 'Transfer').withArgs(wallet.address, pool.address, poolBalance1Delta) - - // check that the swap event was emitted too - await expect(tx) - .to.emit(pool, 'Swap') - .withArgs( - swapTarget.address, - SWAP_RECIPIENT_ADDRESS, - poolBalance0Delta, - poolBalance1Delta, - slot0After.sqrtPriceX96, - liquidityAfter, - slot0After.tick - ) - - const executionPrice = new Decimal(poolBalance1Delta.toString()).div(poolBalance0Delta.toString()).mul(-1) - - expect({ - amount0Before: poolBalance0.toString(), - amount1Before: poolBalance1.toString(), - amount0Delta: poolBalance0Delta.toString(), - amount1Delta: poolBalance1Delta.toString(), - feeGrowthGlobal0X128Delta: feeGrowthGlobal0X128.toString(), - feeGrowthGlobal1X128Delta: feeGrowthGlobal1X128.toString(), - tickBefore: slot0.tick, - poolPriceBefore: formatPrice(slot0.sqrtPriceX96), - tickAfter: slot0After.tick, - poolPriceAfter: formatPrice(slot0After.sqrtPriceX96), - executionPrice: executionPrice.toPrecision(5), - }).to.matchSnapshot('balances') - }) - } - }) - } -}) diff --git a/contract/lib/v3-core/test/UniswapV3Router.spec.ts b/contract/lib/v3-core/test/UniswapV3Router.spec.ts deleted file mode 100644 index efe52b9..0000000 --- a/contract/lib/v3-core/test/UniswapV3Router.spec.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { waffle } from 'hardhat' -import { TestERC20 } from '../typechain/TestERC20' -import { UniswapV3Factory } from '../typechain/UniswapV3Factory' -import { MockTimeUniswapV3Pool } from '../typechain/MockTimeUniswapV3Pool' -import { expect } from './shared/expect' - -import { poolFixture } from './shared/fixtures' - -import { - FeeAmount, - TICK_SPACINGS, - createPoolFunctions, - PoolFunctions, - createMultiPoolFunctions, - encodePriceSqrt, - getMinTick, - getMaxTick, - expandTo18Decimals, -} from './shared/utilities' -import { TestUniswapV3Router } from '../typechain/TestUniswapV3Router' -import { TestUniswapV3Callee } from '../typechain/TestUniswapV3Callee' - -const feeAmount = FeeAmount.MEDIUM -const tickSpacing = TICK_SPACINGS[feeAmount] - -const createFixtureLoader = waffle.createFixtureLoader - -type ThenArg = T extends PromiseLike ? U : T - -describe('UniswapV3Pool', () => { - const [wallet, other] = waffle.provider.getWallets() - - let token0: TestERC20 - let token1: TestERC20 - let token2: TestERC20 - let factory: UniswapV3Factory - let pool0: MockTimeUniswapV3Pool - let pool1: MockTimeUniswapV3Pool - - let pool0Functions: PoolFunctions - let pool1Functions: PoolFunctions - - let minTick: number - let maxTick: number - - let swapTargetCallee: TestUniswapV3Callee - let swapTargetRouter: TestUniswapV3Router - - let loadFixture: ReturnType - let createPool: ThenArg>['createPool'] - - before('create fixture loader', async () => { - loadFixture = createFixtureLoader([wallet, other]) - }) - - beforeEach('deploy first fixture', async () => { - ;({ token0, token1, token2, factory, createPool, swapTargetCallee, swapTargetRouter } = await loadFixture( - poolFixture - )) - - const createPoolWrapped = async ( - amount: number, - spacing: number, - firstToken: TestERC20, - secondToken: TestERC20 - ): Promise<[MockTimeUniswapV3Pool, any]> => { - const pool = await createPool(amount, spacing, firstToken, secondToken) - const poolFunctions = createPoolFunctions({ - swapTarget: swapTargetCallee, - token0: firstToken, - token1: secondToken, - pool, - }) - minTick = getMinTick(spacing) - maxTick = getMaxTick(spacing) - return [pool, poolFunctions] - } - - // default to the 30 bips pool - ;[pool0, pool0Functions] = await createPoolWrapped(feeAmount, tickSpacing, token0, token1) - ;[pool1, pool1Functions] = await createPoolWrapped(feeAmount, tickSpacing, token1, token2) - }) - - it('constructor initializes immutables', async () => { - expect(await pool0.factory()).to.eq(factory.address) - expect(await pool0.token0()).to.eq(token0.address) - expect(await pool0.token1()).to.eq(token1.address) - expect(await pool1.factory()).to.eq(factory.address) - expect(await pool1.token0()).to.eq(token1.address) - expect(await pool1.token1()).to.eq(token2.address) - }) - - describe('multi-swaps', () => { - let inputToken: TestERC20 - let outputToken: TestERC20 - - beforeEach('initialize both pools', async () => { - inputToken = token0 - outputToken = token2 - - await pool0.initialize(encodePriceSqrt(1, 1)) - await pool1.initialize(encodePriceSqrt(1, 1)) - - await pool0Functions.mint(wallet.address, minTick, maxTick, expandTo18Decimals(1)) - await pool1Functions.mint(wallet.address, minTick, maxTick, expandTo18Decimals(1)) - }) - - it('multi-swap', async () => { - const token0OfPoolOutput = await pool1.token0() - const ForExact0 = outputToken.address === token0OfPoolOutput - - const { swapForExact0Multi, swapForExact1Multi } = createMultiPoolFunctions({ - inputToken: token0, - swapTarget: swapTargetRouter, - poolInput: pool0, - poolOutput: pool1, - }) - - const method = ForExact0 ? swapForExact0Multi : swapForExact1Multi - - await expect(method(100, wallet.address)) - .to.emit(outputToken, 'Transfer') - .withArgs(pool1.address, wallet.address, 100) - .to.emit(token1, 'Transfer') - .withArgs(pool0.address, pool1.address, 102) - .to.emit(inputToken, 'Transfer') - .withArgs(wallet.address, pool0.address, 104) - }) - }) -}) diff --git a/contract/lib/v3-core/test/__snapshots__/BitMath.spec.ts.snap b/contract/lib/v3-core/test/__snapshots__/BitMath.spec.ts.snap deleted file mode 100644 index fe68ee6..0000000 --- a/contract/lib/v3-core/test/__snapshots__/BitMath.spec.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`BitMath #leastSignificantBit gas cost of max uint128 1`] = `431`; - -exports[`BitMath #leastSignificantBit gas cost of max uint256 1`] = `431`; - -exports[`BitMath #leastSignificantBit gas cost of smaller number 1`] = `429`; - -exports[`BitMath #mostSignificantBit gas cost of max uint128 1`] = `367`; - -exports[`BitMath #mostSignificantBit gas cost of max uint256 1`] = `385`; - -exports[`BitMath #mostSignificantBit gas cost of smaller number 1`] = `295`; diff --git a/contract/lib/v3-core/test/__snapshots__/LiquidityMath.spec.ts.snap b/contract/lib/v3-core/test/__snapshots__/LiquidityMath.spec.ts.snap deleted file mode 100644 index 6b942a3..0000000 --- a/contract/lib/v3-core/test/__snapshots__/LiquidityMath.spec.ts.snap +++ /dev/null @@ -1,5 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`LiquidityMath #addDelta gas add 1`] = `162`; - -exports[`LiquidityMath #addDelta gas sub 1`] = `176`; diff --git a/contract/lib/v3-core/test/__snapshots__/NoDelegateCall.spec.ts.snap b/contract/lib/v3-core/test/__snapshots__/NoDelegateCall.spec.ts.snap deleted file mode 100644 index 636990a..0000000 --- a/contract/lib/v3-core/test/__snapshots__/NoDelegateCall.spec.ts.snap +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`NoDelegateCall runtime overhead 1`] = `30`; diff --git a/contract/lib/v3-core/test/__snapshots__/Oracle.spec.ts.snap b/contract/lib/v3-core/test/__snapshots__/Oracle.spec.ts.snap deleted file mode 100644 index cd67254..0000000 --- a/contract/lib/v3-core/test/__snapshots__/Oracle.spec.ts.snap +++ /dev/null @@ -1,87 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Oracle #grow gas for growing by 1 slot when index != cardinality - 1 1`] = `49081`; - -exports[`Oracle #grow gas for growing by 1 slot when index == cardinality - 1 1`] = `49081`; - -exports[`Oracle #grow gas for growing by 10 slots when index != cardinality - 1 1`] = `249223`; - -exports[`Oracle #grow gas for growing by 10 slots when index == cardinality - 1 1`] = `249223`; - -exports[`Oracle #initialize gas 1`] = `67770`; - -exports[`Oracle #observe before initialization gas for observe since most recent 1`] = `4746`; - -exports[`Oracle #observe before initialization gas for single observation at current time 1`] = `3565`; - -exports[`Oracle #observe before initialization gas for single observation at current time counterfactually computed 1`] = `4067`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 5 fetch many values 1`] = ` -Object { - "secondsPerLiquidityCumulativeX128s": Array [ - "544451787073501541541399371890829138329", - "799663562264205389138930327464655296921", - "1045423049484883168306923099498710116305", - "1423514568285925905488450441089563684590", - "2152691068830794041481396028443352709138", - "2347138135642758877746181518404363115684", - "2395749902345750086812377890894615717321", - ], - "tickCumulatives": Array [ - -13, - -31, - -43, - -37, - -15, - 9, - 15, - ], -} -`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 5 gas all of last 20 seconds 1`] = `91193`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 5 gas between oldest and oldest + 1 1`] = `15811`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 5 gas latest equal 1`] = `3565`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 5 gas latest transform 1`] = `4067`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 5 gas middle 1`] = `13986`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 5 gas oldest 1`] = `15538`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 fetch many values 1`] = ` -Object { - "secondsPerLiquidityCumulativeX128s": Array [ - "544451787073501541541399371890829138329", - "799663562264205389138930327464655296921", - "1045423049484883168306923099498710116305", - "1423514568285925905488450441089563684590", - "2152691068830794041481396028443352709138", - "2347138135642758877746181518404363115684", - "2395749902345750086812377890894615717321", - ], - "tickCumulatives": Array [ - -13, - -31, - -43, - -37, - -15, - 9, - 15, - ], -} -`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 gas all of last 20 seconds 1`] = `91193`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 gas between oldest and oldest + 1 1`] = `15811`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 gas latest equal 1`] = `3565`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 gas latest transform 1`] = `4067`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 gas middle 1`] = `13986`; - -exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 gas oldest 1`] = `15538`; diff --git a/contract/lib/v3-core/test/__snapshots__/SqrtPriceMath.spec.ts.snap b/contract/lib/v3-core/test/__snapshots__/SqrtPriceMath.spec.ts.snap deleted file mode 100644 index 11308cc..0000000 --- a/contract/lib/v3-core/test/__snapshots__/SqrtPriceMath.spec.ts.snap +++ /dev/null @@ -1,17 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`SqrtPriceMath #getAmount0Delta gas cost for amount0 where roundUp = true 1`] = `610`; - -exports[`SqrtPriceMath #getAmount0Delta gas cost for amount0 where roundUp = true 2`] = `478`; - -exports[`SqrtPriceMath #getAmount1Delta gas cost for amount0 where roundUp = false 1`] = `478`; - -exports[`SqrtPriceMath #getAmount1Delta gas cost for amount0 where roundUp = true 1`] = `610`; - -exports[`SqrtPriceMath #getNextSqrtPriceFromInput zeroForOne = false gas 1`] = `536`; - -exports[`SqrtPriceMath #getNextSqrtPriceFromInput zeroForOne = true gas 1`] = `753`; - -exports[`SqrtPriceMath #getNextSqrtPriceFromOutput zeroForOne = false gas 1`] = `848`; - -exports[`SqrtPriceMath #getNextSqrtPriceFromOutput zeroForOne = true gas 1`] = `441`; diff --git a/contract/lib/v3-core/test/__snapshots__/SwapMath.spec.ts.snap b/contract/lib/v3-core/test/__snapshots__/SwapMath.spec.ts.snap deleted file mode 100644 index df10cbd..0000000 --- a/contract/lib/v3-core/test/__snapshots__/SwapMath.spec.ts.snap +++ /dev/null @@ -1,17 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`SwapMath #computeSwapStep gas swap one for zero exact in capped 1`] = `2103`; - -exports[`SwapMath #computeSwapStep gas swap one for zero exact in partial 1`] = `2802`; - -exports[`SwapMath #computeSwapStep gas swap one for zero exact out capped 1`] = `1855`; - -exports[`SwapMath #computeSwapStep gas swap one for zero exact out partial 1`] = `2802`; - -exports[`SwapMath #computeSwapStep gas swap zero for one exact in capped 1`] = `2104`; - -exports[`SwapMath #computeSwapStep gas swap zero for one exact in partial 1`] = `3106`; - -exports[`SwapMath #computeSwapStep gas swap zero for one exact out capped 1`] = `1856`; - -exports[`SwapMath #computeSwapStep gas swap zero for one exact out partial 1`] = `3106`; diff --git a/contract/lib/v3-core/test/__snapshots__/TickBitmap.spec.ts.snap b/contract/lib/v3-core/test/__snapshots__/TickBitmap.spec.ts.snap deleted file mode 100644 index 9d040d1..0000000 --- a/contract/lib/v3-core/test/__snapshots__/TickBitmap.spec.ts.snap +++ /dev/null @@ -1,19 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`TickBitmap #flipTick gas cost of flipping a tick that results in deleting a word 1`] = `13427`; - -exports[`TickBitmap #flipTick gas cost of flipping first tick in word to initialized 1`] = `43965`; - -exports[`TickBitmap #flipTick gas cost of flipping second tick in word to initialized 1`] = `26865`; - -exports[`TickBitmap #nextInitializedTickWithinOneWord lte = false gas cost for entire word 1`] = `2627`; - -exports[`TickBitmap #nextInitializedTickWithinOneWord lte = false gas cost just below boundary 1`] = `2627`; - -exports[`TickBitmap #nextInitializedTickWithinOneWord lte = false gas cost on boundary 1`] = `2627`; - -exports[`TickBitmap #nextInitializedTickWithinOneWord lte = true gas cost for entire word 1`] = `2618`; - -exports[`TickBitmap #nextInitializedTickWithinOneWord lte = true gas cost just below boundary 1`] = `2928`; - -exports[`TickBitmap #nextInitializedTickWithinOneWord lte = true gas cost on boundary 1`] = `2618`; diff --git a/contract/lib/v3-core/test/__snapshots__/TickMath.spec.ts.snap b/contract/lib/v3-core/test/__snapshots__/TickMath.spec.ts.snap deleted file mode 100644 index 57e13fd..0000000 --- a/contract/lib/v3-core/test/__snapshots__/TickMath.spec.ts.snap +++ /dev/null @@ -1,165 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`TickMath #getSqrtRatioAtTick tick -50 gas 1`] = `823`; - -exports[`TickMath #getSqrtRatioAtTick tick -50 result 1`] = `"79030349367926598376800521322"`; - -exports[`TickMath #getSqrtRatioAtTick tick -100 gas 1`] = `823`; - -exports[`TickMath #getSqrtRatioAtTick tick -100 result 1`] = `"78833030112140176575862854579"`; - -exports[`TickMath #getSqrtRatioAtTick tick -250 gas 1`] = `865`; - -exports[`TickMath #getSqrtRatioAtTick tick -250 result 1`] = `"78244023372248365697264290337"`; - -exports[`TickMath #getSqrtRatioAtTick tick -500 gas 1`] = `865`; - -exports[`TickMath #getSqrtRatioAtTick tick -500 result 1`] = `"77272108795590369356373805297"`; - -exports[`TickMath #getSqrtRatioAtTick tick -1000 gas 1`] = `865`; - -exports[`TickMath #getSqrtRatioAtTick tick -1000 result 1`] = `"75364347830767020784054125655"`; - -exports[`TickMath #getSqrtRatioAtTick tick -2500 gas 1`] = `851`; - -exports[`TickMath #getSqrtRatioAtTick tick -2500 result 1`] = `"69919044979842180277688105136"`; - -exports[`TickMath #getSqrtRatioAtTick tick -3000 gas 1`] = `879`; - -exports[`TickMath #getSqrtRatioAtTick tick -3000 result 1`] = `"68192822843687888778582228483"`; - -exports[`TickMath #getSqrtRatioAtTick tick -4000 gas 1`] = `865`; - -exports[`TickMath #getSqrtRatioAtTick tick -4000 result 1`] = `"64867181785621769311890333195"`; - -exports[`TickMath #getSqrtRatioAtTick tick -5000 gas 1`] = `851`; - -exports[`TickMath #getSqrtRatioAtTick tick -5000 result 1`] = `"61703726247759831737814779831"`; - -exports[`TickMath #getSqrtRatioAtTick tick -50000 gas 1`] = `865`; - -exports[`TickMath #getSqrtRatioAtTick tick -50000 result 1`] = `"6504256538020985011912221507"`; - -exports[`TickMath #getSqrtRatioAtTick tick -150000 gas 1`] = `893`; - -exports[`TickMath #getSqrtRatioAtTick tick -150000 result 1`] = `"43836292794701720435367485"`; - -exports[`TickMath #getSqrtRatioAtTick tick -250000 gas 1`] = `879`; - -exports[`TickMath #getSqrtRatioAtTick tick -250000 result 1`] = `"295440463448801648376846"`; - -exports[`TickMath #getSqrtRatioAtTick tick -500000 gas 1`] = `879`; - -exports[`TickMath #getSqrtRatioAtTick tick -500000 result 1`] = `"1101692437043807371"`; - -exports[`TickMath #getSqrtRatioAtTick tick -738203 gas 1`] = `911`; - -exports[`TickMath #getSqrtRatioAtTick tick -738203 result 1`] = `"7409801140451"`; - -exports[`TickMath #getSqrtRatioAtTick tick 50 gas 1`] = `863`; - -exports[`TickMath #getSqrtRatioAtTick tick 50 result 1`] = `"79426470787362580746886972461"`; - -exports[`TickMath #getSqrtRatioAtTick tick 100 gas 1`] = `863`; - -exports[`TickMath #getSqrtRatioAtTick tick 100 result 1`] = `"79625275426524748796330556128"`; - -exports[`TickMath #getSqrtRatioAtTick tick 250 gas 1`] = `905`; - -exports[`TickMath #getSqrtRatioAtTick tick 250 result 1`] = `"80224679980005306637834519095"`; - -exports[`TickMath #getSqrtRatioAtTick tick 500 gas 1`] = `905`; - -exports[`TickMath #getSqrtRatioAtTick tick 500 result 1`] = `"81233731461783161732293370115"`; - -exports[`TickMath #getSqrtRatioAtTick tick 1000 gas 1`] = `905`; - -exports[`TickMath #getSqrtRatioAtTick tick 1000 result 1`] = `"83290069058676223003182343270"`; - -exports[`TickMath #getSqrtRatioAtTick tick 2500 gas 1`] = `891`; - -exports[`TickMath #getSqrtRatioAtTick tick 2500 result 1`] = `"89776708723587163891445672585"`; - -exports[`TickMath #getSqrtRatioAtTick tick 3000 gas 1`] = `919`; - -exports[`TickMath #getSqrtRatioAtTick tick 3000 result 1`] = `"92049301871182272007977902845"`; - -exports[`TickMath #getSqrtRatioAtTick tick 4000 gas 1`] = `905`; - -exports[`TickMath #getSqrtRatioAtTick tick 4000 result 1`] = `"96768528593268422080558758223"`; - -exports[`TickMath #getSqrtRatioAtTick tick 5000 gas 1`] = `891`; - -exports[`TickMath #getSqrtRatioAtTick tick 5000 result 1`] = `"101729702841318637793976746270"`; - -exports[`TickMath #getSqrtRatioAtTick tick 50000 gas 1`] = `905`; - -exports[`TickMath #getSqrtRatioAtTick tick 50000 result 1`] = `"965075977353221155028623082916"`; - -exports[`TickMath #getSqrtRatioAtTick tick 150000 gas 1`] = `933`; - -exports[`TickMath #getSqrtRatioAtTick tick 150000 result 1`] = `"143194173941309278083010301478497"`; - -exports[`TickMath #getSqrtRatioAtTick tick 250000 gas 1`] = `919`; - -exports[`TickMath #getSqrtRatioAtTick tick 250000 result 1`] = `"21246587762933397357449903968194344"`; - -exports[`TickMath #getSqrtRatioAtTick tick 500000 gas 1`] = `919`; - -exports[`TickMath #getSqrtRatioAtTick tick 500000 result 1`] = `"5697689776495288729098254600827762987878"`; - -exports[`TickMath #getSqrtRatioAtTick tick 738203 gas 1`] = `951`; - -exports[`TickMath #getSqrtRatioAtTick tick 738203 result 1`] = `"847134979253254120489401328389043031315994541"`; - -exports[`TickMath #getTickAtSqrtRatio ratio 4295128739 gas 1`] = `2371`; - -exports[`TickMath #getTickAtSqrtRatio ratio 4295128739 result 1`] = `-887272`; - -exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543 gas 1`] = `2367`; - -exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543 result 1`] = `-276325`; - -exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950 gas 1`] = `2367`; - -exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950 result 1`] = `-138163`; - -exports[`TickMath #getTickAtSqrtRatio ratio 9903520314283042199192993792 gas 1`] = `1389`; - -exports[`TickMath #getTickAtSqrtRatio ratio 9903520314283042199192993792 result 1`] = `-41591`; - -exports[`TickMath #getTickAtSqrtRatio ratio 28011385487393069959365969113 gas 1`] = `2329`; - -exports[`TickMath #getTickAtSqrtRatio ratio 28011385487393069959365969113 result 1`] = `-20796`; - -exports[`TickMath #getTickAtSqrtRatio ratio 56022770974786139918731938227 gas 1`] = `2315`; - -exports[`TickMath #getTickAtSqrtRatio ratio 56022770974786139918731938227 result 1`] = `-6932`; - -exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950336 gas 1`] = `2235`; - -exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950336 result 1`] = `0`; - -exports[`TickMath #getTickAtSqrtRatio ratio 112045541949572279837463876454 gas 1`] = `2355`; - -exports[`TickMath #getTickAtSqrtRatio ratio 112045541949572279837463876454 result 1`] = `6931`; - -exports[`TickMath #getTickAtSqrtRatio ratio 224091083899144559674927752909 gas 1`] = `2369`; - -exports[`TickMath #getTickAtSqrtRatio ratio 224091083899144559674927752909 result 1`] = `20795`; - -exports[`TickMath #getTickAtSqrtRatio ratio 633825300114114700748351602688 gas 1`] = `2393`; - -exports[`TickMath #getTickAtSqrtRatio ratio 633825300114114700748351602688 result 1`] = `41590`; - -exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950336000 gas 1`] = `2407`; - -exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950336000 result 1`] = `138162`; - -exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950336000000 gas 1`] = `2407`; - -exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950336000000 result 1`] = `276324`; - -exports[`TickMath #getTickAtSqrtRatio ratio 1461446703485210103287273052203988822378723970341 gas 1`] = `2431`; - -exports[`TickMath #getTickAtSqrtRatio ratio 1461446703485210103287273052203988822378723970341 result 1`] = `887271`; diff --git a/contract/lib/v3-core/test/__snapshots__/UniswapV3Factory.spec.ts.snap b/contract/lib/v3-core/test/__snapshots__/UniswapV3Factory.spec.ts.snap deleted file mode 100644 index 109b0c9..0000000 --- a/contract/lib/v3-core/test/__snapshots__/UniswapV3Factory.spec.ts.snap +++ /dev/null @@ -1,7 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`UniswapV3Factory #createPool gas 1`] = `4557092`; - -exports[`UniswapV3Factory factory bytecode size 1`] = `24535`; - -exports[`UniswapV3Factory pool bytecode size 1`] = `22142`; diff --git a/contract/lib/v3-core/test/__snapshots__/UniswapV3Pool.arbitrage.spec.ts.snap b/contract/lib/v3-core/test/__snapshots__/UniswapV3Pool.arbitrage.spec.ts.snap deleted file mode 100644 index 2e4e465..0000000 --- a/contract/lib/v3-core/test/__snapshots__/UniswapV3Pool.arbitrage.spec.ts.snap +++ /dev/null @@ -1,977 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "9.9699", - "arbBalanceDelta1": "-0.0099043", - "backrun": Object { - "delta0": "-9.9699", - "delta1": "0.0099043", - "executionPrice": "0.00099342", - }, - "finalPrice": "0.97706", - "profit": Object { - "final": "9.7606", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-0.0099900", - "executionPrice": "0.00099900", - "priceAfter": "0.0000010040", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "9.9990", - "arbBalanceDelta1": "-0.0099044", - "backrun": Object { - "delta0": "-0.30578", - "delta1": "0.0095969", - "executionPrice": "0.031385", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "1.0910e+12", - }, - "collect": Object { - "amount0": "0.030000", - "amount1": "0.0000", - }, - "finalPrice": "0.97706", - "frontrun": Object { - "delta0": "0.30682", - "delta1": "-0.0096834", - "executionPrice": "0.031561", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "1.0910e+12", - }, - "profit": Object { - "afterFrontrun": "-0.29100", - "afterSandwich": "9.4990", - "final": "9.7891", - }, - "sandwichedPrice": "0.00099910", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "9.9700", - "arbBalanceDelta1": "-0.010055", - "backrun": Object { - "delta0": "-9.9700", - "delta1": "0.010055", - "executionPrice": "0.0010085", - }, - "finalPrice": "1.0070", - "profit": Object { - "final": "10.060", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-0.0099900", - "executionPrice": "0.00099900", - "priceAfter": "0.0000010040", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "9.9991", - "arbBalanceDelta1": "-0.010055", - "backrun": Object { - "delta0": "-0.30593", - "delta1": "0.0097475", - "executionPrice": "0.031862", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "1.0910e+12", - }, - "collect": Object { - "amount0": "0.030000", - "amount1": "0.0000", - }, - "finalPrice": "1.0070", - "frontrun": Object { - "delta0": "0.30682", - "delta1": "-0.0096834", - "executionPrice": "0.031561", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "1.0910e+12", - }, - "profit": Object { - "afterFrontrun": "-0.30020", - "afterSandwich": "9.7898", - "final": "10.089", - }, - "sandwichedPrice": "0.00099910", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "9.9583", - "arbBalanceDelta1": "-0.90001", - "backrun": Object { - "delta0": "-9.9583", - "delta1": "0.90001", - "executionPrice": "0.090377", - }, - "finalPrice": "0.97706", - "profit": Object { - "final": "8.8592", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-0.90884", - "executionPrice": "0.090884", - "priceAfter": "0.0083097", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "9.9814", - "arbBalanceDelta1": "-0.90054", - "backrun": Object { - "delta0": "-2.2983", - "delta1": "0.68841", - "executionPrice": "0.29953", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "1.0412e+13", - }, - "collect": Object { - "amount0": "0.030000", - "amount1": "0.0000", - }, - "finalPrice": "0.97706", - "frontrun": Object { - "delta0": "2.3169", - "delta1": "-0.69788", - "executionPrice": "0.30121", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "1.0412e+13", - }, - "profit": Object { - "afterFrontrun": "-1.5727", - "afterSandwich": "7.3173", - "final": "8.8812", - }, - "sandwichedPrice": "0.091001", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "9.9735", - "arbBalanceDelta1": "-0.91507", - "backrun": Object { - "delta0": "-9.9735", - "delta1": "0.91507", - "executionPrice": "0.091750", - }, - "finalPrice": "1.0070", - "profit": Object { - "final": "9.1581", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-0.90884", - "executionPrice": "0.090884", - "priceAfter": "0.0083097", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "9.9965", - "arbBalanceDelta1": "-0.91560", - "backrun": Object { - "delta0": "-2.3134", - "delta1": "0.70347", - "executionPrice": "0.30408", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "1.0412e+13", - }, - "collect": Object { - "amount0": "0.030000", - "amount1": "0.0000", - }, - "finalPrice": "1.0070", - "frontrun": Object { - "delta0": "2.3169", - "delta1": "-0.69788", - "executionPrice": "0.30121", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "1.0412e+13", - }, - "profit": Object { - "afterFrontrun": "-1.6422", - "afterSandwich": "7.5478", - "final": "9.1809", - }, - "sandwichedPrice": "0.091001", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "9.8533", - "arbBalanceDelta1": "-4.8918", - "backrun": Object { - "delta0": "-9.8533", - "delta1": "4.8918", - "executionPrice": "0.49646", - }, - "finalPrice": "0.97706", - "profit": Object { - "final": "4.7644", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-4.9925", - "executionPrice": "0.49925", - "priceAfter": "0.25075", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "9.8709", - "arbBalanceDelta1": "-4.8940", - "backrun": Object { - "delta0": "-4.0029", - "delta1": "2.8107", - "executionPrice": "0.70217", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "2.4408e+13", - }, - "collect": Object { - "amount0": "0.030000", - "amount1": "0.0000", - }, - "finalPrice": "0.97706", - "frontrun": Object { - "delta0": "4.1321", - "delta1": "-2.9177", - "executionPrice": "0.70611", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "2.4408e+13", - }, - "profit": Object { - "afterFrontrun": "-1.1317", - "afterSandwich": "3.6674", - "final": "4.7795", - }, - "sandwichedPrice": "0.50009", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "10.005", - "arbBalanceDelta1": "-5.0424", - "backrun": Object { - "delta0": "-10.005", - "delta1": "5.0424", - "executionPrice": "0.50401", - }, - "finalPrice": "1.0070", - "profit": Object { - "final": "5.0623", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-4.9925", - "executionPrice": "0.49925", - "priceAfter": "0.25075", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "10.022", - "arbBalanceDelta1": "-5.0446", - "backrun": Object { - "delta0": "-4.1543", - "delta1": "2.9613", - "executionPrice": "0.71283", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "2.4408e+13", - }, - "collect": Object { - "amount0": "0.030000", - "amount1": "0.0000", - }, - "finalPrice": "1.0070", - "frontrun": Object { - "delta0": "4.1321", - "delta1": "-2.9177", - "executionPrice": "0.70611", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "2.4408e+13", - }, - "profit": Object { - "afterFrontrun": "-1.2557", - "afterSandwich": "3.8434", - "final": "5.0779", - }, - "sandwichedPrice": "0.50009", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "8.8029", - "arbBalanceDelta1": "-7.9363", - "backrun": Object { - "delta0": "-8.8029", - "delta1": "7.9363", - "executionPrice": "0.90155", - }, - "finalPrice": "0.97706", - "profit": Object { - "final": "0.69056", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-9.0661", - "executionPrice": "0.90661", - "priceAfter": "0.82690", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "8.8190", - "arbBalanceDelta1": "-7.9680", - "backrun": Object { - "delta0": "-3.4354", - "delta1": "3.2562", - "executionPrice": "0.94781", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "3.2947e+13", - }, - "collect": Object { - "amount0": "0.030000", - "amount1": "0.0000", - }, - "finalPrice": "0.97706", - "frontrun": Object { - "delta0": "4.6164", - "delta1": "-4.4000", - "executionPrice": "0.95313", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "3.2947e+13", - }, - "profit": Object { - "afterFrontrun": "-0.12404", - "afterSandwich": "0.56403", - "final": "0.67460", - }, - "sandwichedPrice": "0.91119", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "10.317", - "arbBalanceDelta1": "-9.4423", - "backrun": Object { - "delta0": "-10.317", - "delta1": "9.4423", - "executionPrice": "0.91525", - }, - "finalPrice": "1.0070", - "profit": Object { - "final": "0.97752", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-9.0661", - "executionPrice": "0.90661", - "priceAfter": "0.82690", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "10.333", - "arbBalanceDelta1": "-9.4741", - "backrun": Object { - "delta0": "-4.9492", - "delta1": "4.7622", - "executionPrice": "0.96221", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "3.2947e+13", - }, - "collect": Object { - "amount0": "0.030000", - "amount1": "0.0000", - }, - "finalPrice": "1.0070", - "frontrun": Object { - "delta0": "4.6164", - "delta1": "-4.4000", - "executionPrice": "0.95313", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "3.2947e+13", - }, - "profit": Object { - "afterFrontrun": "-0.26253", - "afterSandwich": "0.72554", - "final": "0.96205", - }, - "sandwichedPrice": "0.91119", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "9.9699", - "arbBalanceDelta1": "-0.0099043", - "backrun": Object { - "delta0": "-9.9699", - "delta1": "0.0099043", - "executionPrice": "0.00099342", - }, - "finalPrice": "0.97706", - "profit": Object { - "final": "9.7606", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-0.0099900", - "executionPrice": "0.00099900", - "priceAfter": "0.0000010040", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "9.9940", - "arbBalanceDelta1": "-0.0099044", - "backrun": Object { - "delta0": "-0.30578", - "delta1": "0.0095969", - "executionPrice": "0.031385", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "1.0910e+12", - }, - "collect": Object { - "amount0": "0.025000", - "amount1": "0.0000", - }, - "finalPrice": "0.97706", - "frontrun": Object { - "delta0": "0.30682", - "delta1": "-0.0096834", - "executionPrice": "0.031561", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "1.0910e+12", - }, - "profit": Object { - "afterFrontrun": "-0.29100", - "afterSandwich": "9.4941", - "final": "9.7842", - }, - "sandwichedPrice": "0.00099910", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "9.9700", - "arbBalanceDelta1": "-0.010055", - "backrun": Object { - "delta0": "-9.9700", - "delta1": "0.010055", - "executionPrice": "0.0010085", - }, - "finalPrice": "1.0070", - "profit": Object { - "final": "10.060", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-0.0099900", - "executionPrice": "0.00099900", - "priceAfter": "0.0000010040", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "9.9941", - "arbBalanceDelta1": "-0.010055", - "backrun": Object { - "delta0": "-0.30593", - "delta1": "0.0097475", - "executionPrice": "0.031862", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "1.0910e+12", - }, - "collect": Object { - "amount0": "0.025000", - "amount1": "0.0000", - }, - "finalPrice": "1.0070", - "frontrun": Object { - "delta0": "0.30682", - "delta1": "-0.0096834", - "executionPrice": "0.031561", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "1.0910e+12", - }, - "profit": Object { - "afterFrontrun": "-0.30020", - "afterSandwich": "9.7848", - "final": "10.084", - }, - "sandwichedPrice": "0.00099910", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "9.9583", - "arbBalanceDelta1": "-0.90001", - "backrun": Object { - "delta0": "-9.9583", - "delta1": "0.90001", - "executionPrice": "0.090377", - }, - "finalPrice": "0.97706", - "profit": Object { - "final": "8.8592", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-0.90884", - "executionPrice": "0.090884", - "priceAfter": "0.0083097", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "9.9764", - "arbBalanceDelta1": "-0.90054", - "backrun": Object { - "delta0": "-2.2983", - "delta1": "0.68841", - "executionPrice": "0.29953", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "1.0412e+13", - }, - "collect": Object { - "amount0": "0.025000", - "amount1": "0.0000", - }, - "finalPrice": "0.97706", - "frontrun": Object { - "delta0": "2.3169", - "delta1": "-0.69788", - "executionPrice": "0.30121", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "1.0412e+13", - }, - "profit": Object { - "afterFrontrun": "-1.5727", - "afterSandwich": "7.3124", - "final": "8.8763", - }, - "sandwichedPrice": "0.091001", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "9.9735", - "arbBalanceDelta1": "-0.91507", - "backrun": Object { - "delta0": "-9.9735", - "delta1": "0.91507", - "executionPrice": "0.091750", - }, - "finalPrice": "1.0070", - "profit": Object { - "final": "9.1581", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-0.90884", - "executionPrice": "0.090884", - "priceAfter": "0.0083097", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "9.9915", - "arbBalanceDelta1": "-0.91560", - "backrun": Object { - "delta0": "-2.3134", - "delta1": "0.70347", - "executionPrice": "0.30408", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "1.0412e+13", - }, - "collect": Object { - "amount0": "0.025000", - "amount1": "0.0000", - }, - "finalPrice": "1.0070", - "frontrun": Object { - "delta0": "2.3169", - "delta1": "-0.69788", - "executionPrice": "0.30121", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "1.0412e+13", - }, - "profit": Object { - "afterFrontrun": "-1.6422", - "afterSandwich": "7.5427", - "final": "9.1758", - }, - "sandwichedPrice": "0.091001", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "9.8533", - "arbBalanceDelta1": "-4.8918", - "backrun": Object { - "delta0": "-9.8533", - "delta1": "4.8918", - "executionPrice": "0.49646", - }, - "finalPrice": "0.97706", - "profit": Object { - "final": "4.7644", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-4.9925", - "executionPrice": "0.49925", - "priceAfter": "0.25075", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "9.8659", - "arbBalanceDelta1": "-4.8940", - "backrun": Object { - "delta0": "-4.0029", - "delta1": "2.8107", - "executionPrice": "0.70217", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "2.4408e+13", - }, - "collect": Object { - "amount0": "0.025000", - "amount1": "0.0000", - }, - "finalPrice": "0.97706", - "frontrun": Object { - "delta0": "4.1321", - "delta1": "-2.9177", - "executionPrice": "0.70611", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "2.4408e+13", - }, - "profit": Object { - "afterFrontrun": "-1.1317", - "afterSandwich": "3.6625", - "final": "4.7746", - }, - "sandwichedPrice": "0.50009", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "10.005", - "arbBalanceDelta1": "-5.0424", - "backrun": Object { - "delta0": "-10.005", - "delta1": "5.0424", - "executionPrice": "0.50401", - }, - "finalPrice": "1.0070", - "profit": Object { - "final": "5.0623", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-4.9925", - "executionPrice": "0.49925", - "priceAfter": "0.25075", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "10.017", - "arbBalanceDelta1": "-5.0446", - "backrun": Object { - "delta0": "-4.1543", - "delta1": "2.9613", - "executionPrice": "0.71283", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "2.4408e+13", - }, - "collect": Object { - "amount0": "0.025000", - "amount1": "0.0000", - }, - "finalPrice": "1.0070", - "frontrun": Object { - "delta0": "4.1321", - "delta1": "-2.9177", - "executionPrice": "0.70611", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "2.4408e+13", - }, - "profit": Object { - "afterFrontrun": "-1.2557", - "afterSandwich": "3.8384", - "final": "5.0729", - }, - "sandwichedPrice": "0.50009", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "8.8029", - "arbBalanceDelta1": "-7.9363", - "backrun": Object { - "delta0": "-8.8029", - "delta1": "7.9363", - "executionPrice": "0.90155", - }, - "finalPrice": "0.97706", - "profit": Object { - "final": "0.69056", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-9.0661", - "executionPrice": "0.90661", - "priceAfter": "0.82690", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "8.8140", - "arbBalanceDelta1": "-7.9680", - "backrun": Object { - "delta0": "-3.4354", - "delta1": "3.2562", - "executionPrice": "0.94781", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "3.2947e+13", - }, - "collect": Object { - "amount0": "0.025000", - "amount1": "0.0000", - }, - "finalPrice": "0.97706", - "frontrun": Object { - "delta0": "4.6164", - "delta1": "-4.4000", - "executionPrice": "0.95313", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "3.2947e+13", - }, - "profit": Object { - "afterFrontrun": "-0.12404", - "afterSandwich": "0.55913", - "final": "0.66970", - }, - "sandwichedPrice": "0.91119", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` -Object { - "arbBalanceDelta0": "10.317", - "arbBalanceDelta1": "-9.4423", - "backrun": Object { - "delta0": "-10.317", - "delta1": "9.4423", - "executionPrice": "0.91525", - }, - "finalPrice": "1.0070", - "profit": Object { - "final": "0.97752", - }, -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` -Object { - "amount0Delta": "10.000", - "amount1Delta": "-9.0661", - "executionPrice": "0.90661", - "priceAfter": "0.82690", -} -`; - -exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` -Object { - "arbBalanceDelta0": "10.328", - "arbBalanceDelta1": "-9.4741", - "backrun": Object { - "delta0": "-4.9492", - "delta1": "4.7622", - "executionPrice": "0.96221", - }, - "burn": Object { - "amount0": "9.9700", - "amount1": "3.2947e+13", - }, - "collect": Object { - "amount0": "0.025000", - "amount1": "0.0000", - }, - "finalPrice": "1.0070", - "frontrun": Object { - "delta0": "4.6164", - "delta1": "-4.4000", - "executionPrice": "0.95313", - }, - "mint": Object { - "amount0": "0.0000", - "amount1": "3.2947e+13", - }, - "profit": Object { - "afterFrontrun": "-0.26253", - "afterSandwich": "0.72049", - "final": "0.95700", - }, - "sandwichedPrice": "0.91119", -} -`; diff --git a/contract/lib/v3-core/test/__snapshots__/UniswapV3Pool.gas.spec.ts.snap b/contract/lib/v3-core/test/__snapshots__/UniswapV3Pool.gas.spec.ts.snap deleted file mode 100644 index 37bc657..0000000 --- a/contract/lib/v3-core/test/__snapshots__/UniswapV3Pool.gas.spec.ts.snap +++ /dev/null @@ -1,169 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`UniswapV3Pool gas tests fee is off #burn above current price burn entire position after some time passes 1`] = `58703`; - -exports[`UniswapV3Pool gas tests fee is off #burn above current price burn when only position using ticks 1`] = `58703`; - -exports[`UniswapV3Pool gas tests fee is off #burn above current price entire position burn but other positions are using the ticks 1`] = `82740`; - -exports[`UniswapV3Pool gas tests fee is off #burn above current price partial position burn 1`] = `97740`; - -exports[`UniswapV3Pool gas tests fee is off #burn around current price burn entire position after some time passes 1`] = `69498`; - -exports[`UniswapV3Pool gas tests fee is off #burn around current price burn when only position using ticks 1`] = `66309`; - -exports[`UniswapV3Pool gas tests fee is off #burn around current price entire position burn but other positions are using the ticks 1`] = `87551`; - -exports[`UniswapV3Pool gas tests fee is off #burn around current price partial position burn 1`] = `102551`; - -exports[`UniswapV3Pool gas tests fee is off #burn below current price burn entire position after some time passes 1`] = `64624`; - -exports[`UniswapV3Pool gas tests fee is off #burn below current price burn when only position using ticks 1`] = `64624`; - -exports[`UniswapV3Pool gas tests fee is off #burn below current price entire position burn but other positions are using the ticks 1`] = `83381`; - -exports[`UniswapV3Pool gas tests fee is off #burn below current price partial position burn 1`] = `98381`; - -exports[`UniswapV3Pool gas tests fee is off #collect close to worst case 1`] = `35816`; - -exports[`UniswapV3Pool gas tests fee is off #increaseObservationCardinalityNext grow by 1 slot 1`] = `51098`; - -exports[`UniswapV3Pool gas tests fee is off #increaseObservationCardinalityNext no op 1`] = `24677`; - -exports[`UniswapV3Pool gas tests fee is off #mint above current price add to position after some time passes 1`] = `109351`; - -exports[`UniswapV3Pool gas tests fee is off #mint above current price add to position existing 1`] = `109351`; - -exports[`UniswapV3Pool gas tests fee is off #mint above current price new position mint first in range 1`] = `228025`; - -exports[`UniswapV3Pool gas tests fee is off #mint above current price second position in same range 1`] = `126451`; - -exports[`UniswapV3Pool gas tests fee is off #mint around current price add to position after some time passes 1`] = `147718`; - -exports[`UniswapV3Pool gas tests fee is off #mint around current price add to position existing 1`] = `138539`; - -exports[`UniswapV3Pool gas tests fee is off #mint around current price new position mint first in range 1`] = `328848`; - -exports[`UniswapV3Pool gas tests fee is off #mint around current price second position in same range 1`] = `155639`; - -exports[`UniswapV3Pool gas tests fee is off #mint below current price add to position after some time passes 1`] = `109943`; - -exports[`UniswapV3Pool gas tests fee is off #mint below current price add to position existing 1`] = `109943`; - -exports[`UniswapV3Pool gas tests fee is off #mint below current price new position mint first in range 1`] = `309729`; - -exports[`UniswapV3Pool gas tests fee is off #mint below current price second position in same range 1`] = `127043`; - -exports[`UniswapV3Pool gas tests fee is off #poke best case 1`] = `52006`; - -exports[`UniswapV3Pool gas tests fee is off #snapshotCumulativesInside tick above 1`] = `29643`; - -exports[`UniswapV3Pool gas tests fee is off #snapshotCumulativesInside tick below 1`] = `29605`; - -exports[`UniswapV3Pool gas tests fee is off #snapshotCumulativesInside tick inside 1`] = `37053`; - -exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 first swap in block moves tick, no initialized crossings 1`] = `114858`; - -exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 first swap in block with no tick movement 1`] = `99004`; - -exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 first swap in block, large swap crossing a single initialized tick 1`] = `129871`; - -exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 first swap in block, large swap crossing several initialized ticks 1`] = `152706`; - -exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 first swap in block, large swap, no initialized crossings 1`] = `129469`; - -exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 large swap crossing several initialized ticks after some time passes 1`] = `152706`; - -exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 large swap crossing several initialized ticks second time after some time passes 1`] = `212706`; - -exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 second swap in block moves tick, no initialized crossings 1`] = `114858`; - -exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 second swap in block with no tick movement 1`] = `99115`; - -exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 second swap in block, large swap crossing a single initialized tick 1`] = `116454`; - -exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 second swap in block, large swap crossing several initialized ticks 1`] = `139267`; - -exports[`UniswapV3Pool gas tests fee is on #burn above current price burn entire position after some time passes 1`] = `58703`; - -exports[`UniswapV3Pool gas tests fee is on #burn above current price burn when only position using ticks 1`] = `58703`; - -exports[`UniswapV3Pool gas tests fee is on #burn above current price entire position burn but other positions are using the ticks 1`] = `82740`; - -exports[`UniswapV3Pool gas tests fee is on #burn above current price partial position burn 1`] = `97740`; - -exports[`UniswapV3Pool gas tests fee is on #burn around current price burn entire position after some time passes 1`] = `69498`; - -exports[`UniswapV3Pool gas tests fee is on #burn around current price burn when only position using ticks 1`] = `66309`; - -exports[`UniswapV3Pool gas tests fee is on #burn around current price entire position burn but other positions are using the ticks 1`] = `87551`; - -exports[`UniswapV3Pool gas tests fee is on #burn around current price partial position burn 1`] = `102551`; - -exports[`UniswapV3Pool gas tests fee is on #burn below current price burn entire position after some time passes 1`] = `64624`; - -exports[`UniswapV3Pool gas tests fee is on #burn below current price burn when only position using ticks 1`] = `64624`; - -exports[`UniswapV3Pool gas tests fee is on #burn below current price entire position burn but other positions are using the ticks 1`] = `83381`; - -exports[`UniswapV3Pool gas tests fee is on #burn below current price partial position burn 1`] = `98381`; - -exports[`UniswapV3Pool gas tests fee is on #collect close to worst case 1`] = `35816`; - -exports[`UniswapV3Pool gas tests fee is on #increaseObservationCardinalityNext grow by 1 slot 1`] = `51098`; - -exports[`UniswapV3Pool gas tests fee is on #increaseObservationCardinalityNext no op 1`] = `24677`; - -exports[`UniswapV3Pool gas tests fee is on #mint above current price add to position after some time passes 1`] = `109363`; - -exports[`UniswapV3Pool gas tests fee is on #mint above current price add to position existing 1`] = `109363`; - -exports[`UniswapV3Pool gas tests fee is on #mint above current price new position mint first in range 1`] = `228037`; - -exports[`UniswapV3Pool gas tests fee is on #mint above current price second position in same range 1`] = `126463`; - -exports[`UniswapV3Pool gas tests fee is on #mint around current price add to position after some time passes 1`] = `147730`; - -exports[`UniswapV3Pool gas tests fee is on #mint around current price add to position existing 1`] = `138551`; - -exports[`UniswapV3Pool gas tests fee is on #mint around current price new position mint first in range 1`] = `328860`; - -exports[`UniswapV3Pool gas tests fee is on #mint around current price second position in same range 1`] = `155651`; - -exports[`UniswapV3Pool gas tests fee is on #mint below current price add to position after some time passes 1`] = `109955`; - -exports[`UniswapV3Pool gas tests fee is on #mint below current price add to position existing 1`] = `109955`; - -exports[`UniswapV3Pool gas tests fee is on #mint below current price new position mint first in range 1`] = `309741`; - -exports[`UniswapV3Pool gas tests fee is on #mint below current price second position in same range 1`] = `127055`; - -exports[`UniswapV3Pool gas tests fee is on #poke best case 1`] = `52006`; - -exports[`UniswapV3Pool gas tests fee is on #snapshotCumulativesInside tick above 1`] = `29643`; - -exports[`UniswapV3Pool gas tests fee is on #snapshotCumulativesInside tick below 1`] = `29605`; - -exports[`UniswapV3Pool gas tests fee is on #snapshotCumulativesInside tick inside 1`] = `37053`; - -exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 first swap in block moves tick, no initialized crossings 1`] = `120257`; - -exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 first swap in block with no tick movement 1`] = `104256`; - -exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 first swap in block, large swap crossing a single initialized tick 1`] = `135417`; - -exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 first swap in block, large swap crossing several initialized ticks 1`] = `158693`; - -exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 first swap in block, large swap, no initialized crossings 1`] = `135162`; - -exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 large swap crossing several initialized ticks after some time passes 1`] = `158693`; - -exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 large swap crossing several initialized ticks second time after some time passes 1`] = `218693`; - -exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 second swap in block moves tick, no initialized crossings 1`] = `120257`; - -exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 second swap in block with no tick movement 1`] = `104367`; - -exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 second swap in block, large swap crossing a single initialized tick 1`] = `121853`; - -exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 second swap in block, large swap crossing several initialized ticks 1`] = `145107`; diff --git a/contract/lib/v3-core/test/__snapshots__/UniswapV3Pool.swaps.spec.ts.snap b/contract/lib/v3-core/test/__snapshots__/UniswapV3Pool.swaps.spec.ts.snap deleted file mode 100644 index e36c7c0..0000000 --- a/contract/lib/v3-core/test/__snapshots__/UniswapV3Pool.swaps.spec.ts.snap +++ /dev/null @@ -1,3541 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`UniswapV3Pool swap tests close to max price swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "1", - "amount0Delta": "1000", - "amount1Before": "26087635650665564424699143612505016738", - "amount1Delta": "-26083549850867114346332688477747755628", - "executionPrice": "2.6084e+34", - "feeGrowthGlobal0X128Delta": "2381976568446569244235", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "4.1734e+30", - "poolPriceBefore": "1.7014e+38", - "tickAfter": 705098, - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "1", - "amount0Delta": "0", - "amount1Before": "26087635650665564424699143612505016738", - "amount1Delta": "1000", - "executionPrice": "-Infinity", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407695195", - "poolPriceAfter": "1.7014e+38", - "poolPriceBefore": "1.7014e+38", - "tickAfter": 880340, - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "1", - "amount0Delta": "1000000000000000000", - "amount1Before": "26087635650665564424699143612505016738", - "amount1Delta": "-26087635650665564420687107504180041533", - "executionPrice": "2.6088e+19", - "feeGrowthGlobal0X128Delta": "510423550381413479995299567101531162", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "4.0241", - "poolPriceBefore": "1.7014e+38", - "tickAfter": 13923, - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "1", - "amount0Delta": "1000000000000000000", - "amount1Before": "26087635650665564424699143612505016738", - "amount1Delta": "-26087635650665564420687107504180041533", - "executionPrice": "2.6088e+19", - "feeGrowthGlobal0X128Delta": "510423550381413479995299567101531162", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "4.0241", - "poolPriceBefore": "1.7014e+38", - "tickAfter": 13923, - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "1", - "amount0Delta": "0", - "amount1Before": "26087635650665564424699143612505016738", - "amount1Delta": "1000000000000000000", - "executionPrice": "-Infinity", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407695195061911147652317", - "poolPriceAfter": "1.7014e+38", - "poolPriceBefore": "1.7014e+38", - "tickAfter": 880340, - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "poolBalance0": "1", - "poolBalance1": "26087635650665564424699143612505016738", - "poolPriceBefore": "1.7014e+38", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "1", - "amount0Delta": "2", - "amount1Before": "26087635650665564424699143612505016738", - "amount1Delta": "-1000", - "executionPrice": "500.00", - "feeGrowthGlobal0X128Delta": "170141183460469231731", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.7014e+38", - "poolPriceBefore": "1.7014e+38", - "tickAfter": 880340, - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "1", - "amount0Delta": "2", - "amount1Before": "26087635650665564424699143612505016738", - "amount1Delta": "-1000000000000000000", - "executionPrice": "5.0000e+17", - "feeGrowthGlobal0X128Delta": "170141183460469231731", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.7014e+38", - "poolPriceBefore": "1.7014e+38", - "tickAfter": 880340, - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "1", - "amount0Delta": "2", - "amount1Before": "26087635650665564424699143612505016738", - "amount1Delta": "-1000000000000000000", - "executionPrice": "5.0000e+17", - "feeGrowthGlobal0X128Delta": "170141183460469231731", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.7014e+38", - "poolPriceBefore": "1.7014e+38", - "tickAfter": 880340, - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap token0 for token1 to price 0.40000 1`] = ` -Object { - "amount0Before": "1", - "amount0Delta": "3171793039286238109", - "amount1Before": "26087635650665564424699143612505016738", - "amount1Delta": "-26087635650665564423434232548437664977", - "executionPrice": "8.2249e+18", - "feeGrowthGlobal0X128Delta": "1618957864187523123655042148763283097", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "1.7014e+38", - "tickAfter": -9164, - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap token0 for token1 to price 2.5000 1`] = ` -Object { - "amount0Before": "1", - "amount0Delta": "1268717215714495281", - "amount1Before": "26087635650665564424699143612505016738", - "amount1Delta": "-26087635650665564421536865952336637378", - "executionPrice": "2.0562e+19", - "feeGrowthGlobal0X128Delta": "647583145675012618257449376796101507", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "1.7014e+38", - "tickAfter": 9163, - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "1", - "amount0Delta": "0", - "amount1Before": "26087635650665564424699143612505016738", - "amount1Delta": "10740898373457544742072477595619363803", - "executionPrice": "-Infinity", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "5482407482066087054477299856254072312542046383926535301", - "poolPriceAfter": "3.4026e+38", - "poolPriceBefore": "1.7014e+38", - "tickAfter": 887271, - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "1", - "amount0Delta": "0", - "amount1Before": "26087635650665564424699143612505016738", - "amount1Delta": "10740898373457544742072477595619363803", - "executionPrice": "-Infinity", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "5482407482066087054477299856254072312542046383926535301", - "poolPriceAfter": "3.4026e+38", - "poolPriceBefore": "1.7014e+38", - "tickAfter": 887271, - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "poolBalance0": "1", - "poolBalance1": "26087635650665564424699143612505016738", - "poolPriceBefore": "1.7014e+38", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap token1 for token0 to price 0.40000 1`] = ` -Object { - "poolBalance0": "1", - "poolBalance1": "26087635650665564424699143612505016738", - "poolPriceBefore": "1.7014e+38", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to max price swap token1 for token0 to price 2.5000 1`] = ` -Object { - "poolBalance0": "1", - "poolBalance1": "26087635650665564424699143612505016738", - "poolPriceBefore": "1.7014e+38", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 880340, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "26037782196502120275425782622539039026", - "amount0Delta": "1000", - "amount1Before": "1", - "amount1Delta": "0", - "executionPrice": "0.0000", - "feeGrowthGlobal0X128Delta": "170141183460469231731687", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.0000000000000000000000000000000000000059000", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "tickAfter": -880303, - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "26037782196502120275425782622539039026", - "amount0Delta": "-26033697540846965126433148994127431276", - "amount1Before": "1", - "amount1Delta": "1000", - "executionPrice": "0.000000000000000000000000000000000038412", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "2381976568446569244235", - "poolPriceAfter": "0.00000000000000000000000000000023974", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "tickAfter": -705093, - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "26037782196502120275425782622539039026", - "amount0Delta": "1000000000000000000", - "amount1Before": "1", - "amount1Delta": "0", - "executionPrice": "0.0000", - "feeGrowthGlobal0X128Delta": "170141183460469231731687303715884105728", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.0000000000000000000000000000000000000059000", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "tickAfter": -880303, - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "poolBalance0": "26037782196502120275425782622539039026", - "poolBalance1": "1", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "26037782196502120275425782622539039026", - "amount0Delta": "-26037782196502120271413746514214063808", - "amount1Before": "1", - "amount1Delta": "1000000000000000000", - "executionPrice": "0.000000000000000000038406", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381413820277666488039994629", - "poolPriceAfter": "0.24850", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "tickAfter": -13924, - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "26037782196502120275425782622539039026", - "amount0Delta": "-26037782196502120271413746514214063808", - "amount1Before": "1", - "amount1Delta": "1000000000000000000", - "executionPrice": "0.000000000000000000038406", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381413820277666488039994629", - "poolPriceAfter": "0.24850", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "tickAfter": -13924, - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "26037782196502120275425782622539039026", - "amount0Delta": "10790901831095468191587263901270792610", - "amount1Before": "1", - "amount1Delta": "0", - "executionPrice": "0.0000", - "feeGrowthGlobal0X128Delta": "5507930424444982259736347157352787128931407551935325049", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.0000000000000000000000000000000000000029390", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "tickAfter": -887272, - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "26037782196502120275425782622539039026", - "amount0Delta": "10790901831095468191587263901270792610", - "amount1Before": "1", - "amount1Delta": "0", - "executionPrice": "0.0000", - "feeGrowthGlobal0X128Delta": "5507930424444982259736347157352787128931407551935325049", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.0000000000000000000000000000000000000029390", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "tickAfter": -887272, - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "poolBalance0": "26037782196502120275425782622539039026", - "poolBalance1": "1", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap token0 for token1 to price 0.40000 1`] = ` -Object { - "poolBalance0": "26037782196502120275425782622539039026", - "poolBalance1": "1", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap token0 for token1 to price 2.5000 1`] = ` -Object { - "poolBalance0": "26037782196502120275425782622539039026", - "poolBalance1": "1", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "26037782196502120275425782622539039026", - "amount0Delta": "-1000", - "amount1Before": "1", - "amount1Delta": "2", - "executionPrice": "0.0020000", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "170141183460469231731", - "poolPriceAfter": "0.0000000000000000000000000000000000000059000", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "tickAfter": -880303, - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "26037782196502120275425782622539039026", - "amount0Delta": "-1000000000000000000", - "amount1Before": "1", - "amount1Delta": "2", - "executionPrice": "0.0000000000000000020000", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "170141183460469231731", - "poolPriceAfter": "0.0000000000000000000000000000000000000059000", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "tickAfter": -880303, - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "26037782196502120275425782622539039026", - "amount0Delta": "-1000000000000000000", - "amount1Before": "1", - "amount1Delta": "2", - "executionPrice": "0.0000000000000000020000", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "170141183460469231731", - "poolPriceAfter": "0.0000000000000000000000000000000000000059000", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "tickAfter": -880303, - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap token1 for token0 to price 0.40000 1`] = ` -Object { - "amount0Before": "26037782196502120275425782622539039026", - "amount0Delta": "-26037782196502120272263504962370659661", - "amount1Before": "1", - "amount1Delta": "1268717215714495283", - "executionPrice": "0.000000000000000000048726", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "647583145675012958539816297734564973", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "tickAfter": -9164, - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests close to min price swap token1 for token0 to price 2.5000 1`] = ` -Object { - "amount0Before": "26037782196502120275425782622539039026", - "amount0Delta": "-26037782196502120274160871558471687260", - "amount1Before": "1", - "amount1Delta": "3171793039286238112", - "executionPrice": "0.00000000000000000012182", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "1618957864187523634078592530170978294", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "tickAfter": 9163, - "tickBefore": -880303, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "1000", - "amount1Before": "2000000000000000000", - "amount1Delta": "-989", - "executionPrice": "0.98900", - "feeGrowthGlobal0X128Delta": "1701411834604692317316", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-989", - "amount1Before": "2000000000000000000", - "amount1Delta": "1000", - "executionPrice": "1.0111", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "1701411834604692317316", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "1000000000000000000", - "amount1Before": "2000000000000000000", - "amount1Delta": "-662207357859531772", - "executionPrice": "0.66221", - "feeGrowthGlobal0X128Delta": "1701411834604692317316873037158841057", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.44742", - "poolPriceBefore": "1.0000", - "tickAfter": -8043, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "836795075501202120", - "amount1Before": "2000000000000000000", - "amount1Delta": "-585786437626904951", - "executionPrice": "0.70004", - "feeGrowthGlobal0X128Delta": "1423733044596672457631004491657125052", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-662207357859531772", - "amount1Before": "2000000000000000000", - "amount1Delta": "1000000000000000000", - "executionPrice": "1.5101", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "1701411834604692317316873037158841057", - "poolPriceAfter": "2.2350", - "poolPriceBefore": "1.0000", - "tickAfter": 8042, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-585786437626904951", - "amount1Before": "2000000000000000000", - "amount1Delta": "836795075501202120", - "executionPrice": "1.4285", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "1423733044596672457631004491657125052", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "1012", - "amount1Before": "2000000000000000000", - "amount1Delta": "-1000", - "executionPrice": "0.98814", - "feeGrowthGlobal0X128Delta": "1871553018065161549048", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "2020202020202020203", - "amount1Before": "2000000000000000000", - "amount1Delta": "-1000000000000000000", - "executionPrice": "0.49500", - "feeGrowthGlobal0X128Delta": "3437195625464025050172418213103875650", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.25000", - "poolPriceBefore": "1.0000", - "tickAfter": -13864, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "836795075501202120", - "amount1Before": "2000000000000000000", - "amount1Delta": "-585786437626904951", - "executionPrice": "0.70004", - "feeGrowthGlobal0X128Delta": "1423733044596672457631004491657125052", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token0 for token1 to price 0.40000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "1174017838553918518", - "amount1Before": "2000000000000000000", - "amount1Delta": "-735088935932648267", - "executionPrice": "0.62613", - "feeGrowthGlobal0X128Delta": "1997487844552658120479227965844634309", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "1.0000", - "tickAfter": -9164, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token0 for token1 to price 2.5000 1`] = ` -Object { - "poolBalance0": "2000000000000000000", - "poolBalance1": "2000000000000000000", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-1000", - "amount1Before": "2000000000000000000", - "amount1Delta": "1012", - "executionPrice": "1.0120", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "1871553018065161549048", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-1000000000000000000", - "amount1Before": "2000000000000000000", - "amount1Delta": "2020202020202020203", - "executionPrice": "2.0202", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "3437195625464025050172418213103875650", - "poolPriceAfter": "4.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 13863, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-585786437626904951", - "amount1Before": "2000000000000000000", - "amount1Delta": "836795075501202120", - "executionPrice": "1.4285", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "1423733044596672457631004491657125052", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token1 for token0 to price 0.40000 1`] = ` -Object { - "poolBalance0": "2000000000000000000", - "poolBalance1": "2000000000000000000", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token1 for token0 to price 2.5000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-735088935932648267", - "amount1Before": "2000000000000000000", - "amount1Delta": "1174017838553918518", - "executionPrice": "1.5971", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "1997487844552658120479227965844634309", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "1.0000", - "tickAfter": 9163, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "1000", - "amount1Before": "36796311329002736532545403775337522448", - "amount1Delta": "-36792225529204286454178948640580261338", - "executionPrice": "3.6792e+34", - "feeGrowthGlobal0X128Delta": "2381976568446569244235", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "4.1734e+30", - "poolPriceBefore": "3.4026e+38", - "tickAfter": 705098, - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "poolBalance0": "0", - "poolBalance1": "36796311329002736532545403775337522448", - "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "1000000000000000000", - "amount1Before": "36796311329002736532545403775337522448", - "amount1Delta": "-36796311329002736528533367667012547243", - "executionPrice": "3.6796e+19", - "feeGrowthGlobal0X128Delta": "510423550381413479995299567101531162", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "4.0241", - "poolPriceBefore": "3.4026e+38", - "tickAfter": 13923, - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "1000000000000000000", - "amount1Before": "36796311329002736532545403775337522448", - "amount1Delta": "-36796311329002736528533367667012547243", - "executionPrice": "3.6796e+19", - "feeGrowthGlobal0X128Delta": "510423550381413479995299567101531162", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "4.0241", - "poolPriceBefore": "3.4026e+38", - "tickAfter": 13923, - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "poolBalance0": "0", - "poolBalance1": "36796311329002736532545403775337522448", - "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "poolBalance0": "0", - "poolBalance1": "36796311329002736532545403775337522448", - "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "2", - "amount1Before": "36796311329002736532545403775337522448", - "amount1Delta": "-1000", - "executionPrice": "500.00", - "feeGrowthGlobal0X128Delta": "170141183460469231731", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "3.3849e+38", - "poolPriceBefore": "3.4026e+38", - "tickAfter": 887219, - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "2", - "amount1Before": "36796311329002736532545403775337522448", - "amount1Delta": "-1000000000000000000", - "executionPrice": "5.0000e+17", - "feeGrowthGlobal0X128Delta": "170141183460469231731", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "3.3849e+38", - "poolPriceBefore": "3.4026e+38", - "tickAfter": 887219, - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "2", - "amount1Before": "36796311329002736532545403775337522448", - "amount1Delta": "-1000000000000000000", - "executionPrice": "5.0000e+17", - "feeGrowthGlobal0X128Delta": "170141183460469231731", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "3.3849e+38", - "poolPriceBefore": "3.4026e+38", - "tickAfter": 887219, - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap token0 for token1 to price 0.40000 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "3171793039286238109", - "amount1Before": "36796311329002736532545403775337522448", - "amount1Delta": "-36796311329002736531280492711270170687", - "executionPrice": "1.1601e+19", - "feeGrowthGlobal0X128Delta": "1618957864187523123655042148763283097", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "3.4026e+38", - "tickAfter": -9164, - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap token0 for token1 to price 2.5000 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "1268717215714495281", - "amount1Before": "36796311329002736532545403775337522448", - "amount1Delta": "-36796311329002736529383126115169143088", - "executionPrice": "2.9003e+19", - "feeGrowthGlobal0X128Delta": "647583145675012618257449376796101507", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "3.4026e+38", - "tickAfter": 9163, - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "poolBalance0": "0", - "poolBalance1": "36796311329002736532545403775337522448", - "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "poolBalance0": "0", - "poolBalance1": "36796311329002736532545403775337522448", - "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "poolBalance0": "0", - "poolBalance1": "36796311329002736532545403775337522448", - "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap token1 for token0 to price 0.40000 1`] = ` -Object { - "poolBalance0": "0", - "poolBalance1": "36796311329002736532545403775337522448", - "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the max ratio swap token1 for token0 to price 2.5000 1`] = ` -Object { - "poolBalance0": "0", - "poolBalance1": "36796311329002736532545403775337522448", - "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 887271, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "poolBalance0": "36796311322104302062438284732106019258", - "poolBalance1": "0", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "36796311322104302062438284732106019258", - "amount0Delta": "-36792226666449146913445651103694411508", - "amount1Before": "0", - "amount1Delta": "1000", - "executionPrice": "0.000000000000000000000000000000000027180", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "2381976568446569244235", - "poolPriceAfter": "0.00000000000000000000000000000023974", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "tickAfter": -705093, - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "poolBalance0": "36796311322104302062438284732106019258", - "poolBalance1": "0", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "poolBalance0": "36796311322104302062438284732106019258", - "poolBalance1": "0", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "36796311322104302062438284732106019258", - "amount0Delta": "-36796311322104302058426248623781044040", - "amount1Before": "0", - "amount1Delta": "1000000000000000000", - "executionPrice": "0.000000000000000000027177", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381413820277666488039994629", - "poolPriceAfter": "0.24850", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "tickAfter": -13924, - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "36796311322104302062438284732106019258", - "amount0Delta": "-36796311322104302058426248623781044040", - "amount1Before": "0", - "amount1Delta": "1000000000000000000", - "executionPrice": "0.000000000000000000027177", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381413820277666488039994629", - "poolPriceAfter": "0.24850", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "tickAfter": -13924, - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "poolBalance0": "36796311322104302062438284732106019258", - "poolBalance1": "0", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "poolBalance0": "36796311322104302062438284732106019258", - "poolBalance1": "0", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "poolBalance0": "36796311322104302062438284732106019258", - "poolBalance1": "0", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap token0 for token1 to price 0.40000 1`] = ` -Object { - "poolBalance0": "36796311322104302062438284732106019258", - "poolBalance1": "0", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap token0 for token1 to price 2.5000 1`] = ` -Object { - "poolBalance0": "36796311322104302062438284732106019258", - "poolBalance1": "0", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "36796311322104302062438284732106019258", - "amount0Delta": "-1000", - "amount1Before": "0", - "amount1Delta": "2", - "executionPrice": "0.0020000", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "170141183460469231731", - "poolPriceAfter": "0.0000000000000000000000000000000000000029543", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "tickAfter": -887220, - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "36796311322104302062438284732106019258", - "amount0Delta": "-1000000000000000000", - "amount1Before": "0", - "amount1Delta": "2", - "executionPrice": "0.0000000000000000020000", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "170141183460469231731", - "poolPriceAfter": "0.0000000000000000000000000000000000000029543", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "tickAfter": -887220, - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "36796311322104302062438284732106019258", - "amount0Delta": "-1000000000000000000", - "amount1Before": "0", - "amount1Delta": "2", - "executionPrice": "0.0000000000000000020000", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "170141183460469231731", - "poolPriceAfter": "0.0000000000000000000000000000000000000029543", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "tickAfter": -887220, - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap token1 for token0 to price 0.40000 1`] = ` -Object { - "amount0Before": "36796311322104302062438284732106019258", - "amount0Delta": "-36796311322104302059276007071937639893", - "amount1Before": "0", - "amount1Delta": "1268717215714495283", - "executionPrice": "0.000000000000000000034479", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "647583145675012958539816297734564973", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "tickAfter": -9164, - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests initialized at the min ratio swap token1 for token0 to price 2.5000 1`] = ` -Object { - "amount0Before": "36796311322104302062438284732106019258", - "amount0Delta": "-36796311322104302061173373668038667492", - "amount1Before": "0", - "amount1Delta": "3171793039286238112", - "executionPrice": "0.000000000000000000086199", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "1618957864187523634078592530170978294", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "tickAfter": 9163, - "tickBefore": -887272, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "1000", - "amount1Before": "2000000000000000000", - "amount1Delta": "-998", - "executionPrice": "0.99800", - "feeGrowthGlobal0X128Delta": "170141183460469231731", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-998", - "amount1Before": "2000000000000000000", - "amount1Delta": "1000", - "executionPrice": "1.0020", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "170141183460469231731", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "1000000000000000000", - "amount1Before": "2000000000000000000", - "amount1Delta": "-666444407401233536", - "executionPrice": "0.66644", - "feeGrowthGlobal0X128Delta": "85070591730234956148210572796405514", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.44459", - "poolPriceBefore": "1.0000", - "tickAfter": -8107, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "828841545518949575", - "amount1Before": "2000000000000000000", - "amount1Delta": "-585786437626904950", - "executionPrice": "0.70675", - "feeGrowthGlobal0X128Delta": "70510040727899606087499539976421836", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-666444407401233536", - "amount1Before": "2000000000000000000", - "amount1Delta": "1000000000000000000", - "executionPrice": "1.5005", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "85070591730234956148210572796405515", - "poolPriceAfter": "2.2493", - "poolPriceBefore": "1.0000", - "tickAfter": 8106, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-585786437626904950", - "amount1Before": "2000000000000000000", - "amount1Delta": "828841545518949574", - "executionPrice": "1.4149", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "70510040727899435946316079507190105", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "1002", - "amount1Before": "2000000000000000000", - "amount1Delta": "-1000", - "executionPrice": "0.99800", - "feeGrowthGlobal0X128Delta": "170141183460469231731", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "2001000500250125077", - "amount1Before": "2000000000000000000", - "amount1Delta": "-1000000000000000000", - "executionPrice": "0.49975", - "feeGrowthGlobal0X128Delta": "170226296608774038574344664756091446", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.25000", - "poolPriceBefore": "1.0000", - "tickAfter": -13864, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "828841545518949575", - "amount1Before": "2000000000000000000", - "amount1Delta": "-585786437626904950", - "executionPrice": "0.70675", - "feeGrowthGlobal0X128Delta": "70510040727899606087499539976421836", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token0 for token1 to price 0.40000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "1162859089713235953", - "amount1Before": "2000000000000000000", - "amount1Delta": "-735088935932648266", - "executionPrice": "0.63214", - "feeGrowthGlobal0X128Delta": "98925110860787308007692432636113977", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "1.0000", - "tickAfter": -9164, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token0 for token1 to price 2.5000 1`] = ` -Object { - "poolBalance0": "2000000000000000000", - "poolBalance1": "2000000000000000000", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-1000", - "amount1Before": "2000000000000000000", - "amount1Delta": "1002", - "executionPrice": "1.0020", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "170141183460469231731", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-1000000000000000000", - "amount1Before": "2000000000000000000", - "amount1Delta": "2001000500250125079", - "executionPrice": "2.0010", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "170226296608774378856711585694554910", - "poolPriceAfter": "4.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 13863, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-585786437626904950", - "amount1Before": "2000000000000000000", - "amount1Delta": "828841545518949574", - "executionPrice": "1.4149", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "70510040727899435946316079507190105", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token1 for token0 to price 0.40000 1`] = ` -Object { - "poolBalance0": "2000000000000000000", - "poolBalance1": "2000000000000000000", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token1 for token0 to price 2.5000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-735088935932648266", - "amount1Before": "2000000000000000000", - "amount1Delta": "1162859089713235954", - "executionPrice": "1.5819", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "98925110860787308007692432636113978", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "1.0000", - "tickAfter": 9163, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "1000", - "amount1Before": "999700069986003", - "amount1Delta": "-998", - "executionPrice": "0.99800", - "feeGrowthGlobal0X128Delta": "170141183460469231731", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "-998", - "amount1Before": "999700069986003", - "amount1Delta": "1000", - "executionPrice": "1.0020", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "170141183460469231731", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "1000700370186095", - "amount1Before": "999700069986003", - "amount1Delta": "-999700069986002", - "executionPrice": "0.99900", - "feeGrowthGlobal0X128Delta": "85130172636557991529041720559172", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.0000000000000000000000000000000000000029390", - "poolPriceBefore": "1.0000", - "tickAfter": -887272, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "1000700370186095", - "amount1Before": "999700069986003", - "amount1Delta": "-999700069986002", - "executionPrice": "0.99900", - "feeGrowthGlobal0X128Delta": "85130172636557991529041720559172", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "-999700069986002", - "amount1Before": "999700069986003", - "amount1Delta": "1000700370186095", - "executionPrice": "1.0010", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "85130172636557991529041720559172", - "poolPriceAfter": "3.4026e+38", - "poolPriceBefore": "1.0000", - "tickAfter": 887271, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "-999700069986002", - "amount1Before": "999700069986003", - "amount1Delta": "1000700370186095", - "executionPrice": "1.0010", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "85130172636557991529041720559172", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "1002", - "amount1Before": "999700069986003", - "amount1Delta": "-1000", - "executionPrice": "0.99800", - "feeGrowthGlobal0X128Delta": "170141183460469231731", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "1000700370186095", - "amount1Before": "999700069986003", - "amount1Delta": "-999700069986002", - "executionPrice": "0.99900", - "feeGrowthGlobal0X128Delta": "85130172636557991529041720559172", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.0000000000000000000000000000000000000029390", - "poolPriceBefore": "1.0000", - "tickAfter": -887272, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "1000700370186095", - "amount1Before": "999700069986003", - "amount1Delta": "-999700069986002", - "executionPrice": "0.99900", - "feeGrowthGlobal0X128Delta": "85130172636557991529041720559172", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for token1 to price 0.40000 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "1000700370186095", - "amount1Before": "999700069986003", - "amount1Delta": "-999700069986002", - "executionPrice": "0.99900", - "feeGrowthGlobal0X128Delta": "85130172636557991529041720559172", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "1.0000", - "tickAfter": -9164, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for token1 to price 2.5000 1`] = ` -Object { - "poolBalance0": "999700069986003", - "poolBalance1": "999700069986003", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "-1000", - "amount1Before": "999700069986003", - "amount1Delta": "1002", - "executionPrice": "1.0020", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "170141183460469231731", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "-999700069986002", - "amount1Before": "999700069986003", - "amount1Delta": "1000700370186095", - "executionPrice": "1.0010", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "85130172636557991529041720559172", - "poolPriceAfter": "3.4026e+38", - "poolPriceBefore": "1.0000", - "tickAfter": 887271, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "-999700069986002", - "amount1Before": "999700069986003", - "amount1Delta": "1000700370186095", - "executionPrice": "1.0010", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "85130172636557991529041720559172", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for token0 to price 0.40000 1`] = ` -Object { - "poolBalance0": "999700069986003", - "poolBalance1": "999700069986003", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for token0 to price 2.5000 1`] = ` -Object { - "amount0Before": "999700069986003", - "amount0Delta": "-999700069986002", - "amount1Before": "999700069986003", - "amount1Delta": "1000700370186095", - "executionPrice": "1.0010", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "85130172636557991529041720559172", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "1.0000", - "tickAfter": 9163, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "1000", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "0", - "executionPrice": "0.0000", - "feeGrowthGlobal0X128Delta": "29575000", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "0", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "1000", - "executionPrice": "-Infinity", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "29575000", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "1000000000000000000", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "-996999999999999318", - "executionPrice": "0.99700", - "feeGrowthGlobal0X128Delta": "88725000000017597125", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "1000000000000000000", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "-996999999999999318", - "executionPrice": "0.99700", - "feeGrowthGlobal0X128Delta": "88725000000017597125", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "-996999999999999232", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "1000000000000000000", - "executionPrice": "1.0030", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "88725000000020140575", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "-996999999999999232", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "1000000000000000000", - "executionPrice": "1.0030", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "88725000000020140575", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "145660", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "-1000", - "executionPrice": "0.0068653", - "feeGrowthGlobal0X128Delta": "12924275", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "1003009027081361181", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "-1000000000000000000", - "executionPrice": "0.99700", - "feeGrowthGlobal0X128Delta": "88991975927793784300", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "1003009027081361181", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "-1000000000000000000", - "executionPrice": "0.99700", - "feeGrowthGlobal0X128Delta": "88991975927793784300", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token0 for token1 to price 0.40000 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "6706554036096900675845906992672697", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "-4228872409409224753601131225116702", - "executionPrice": "0.63056", - "feeGrowthGlobal0X128Delta": "595039006852697512464428097924911949", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "1.0000", - "tickAfter": -9164, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token0 for token1 to price 2.5000 1`] = ` -Object { - "poolBalance0": "11505743598341114571255423385623647", - "poolBalance1": "11505743598341114571255423385506404", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "-1000", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "145660", - "executionPrice": "145.66", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "12924275", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "-1000000000000000000", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "1003009027081361094", - "executionPrice": "1.0030", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "88991975927793784300", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "-1000000000000000000", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "1003009027081361094", - "executionPrice": "1.0030", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "88991975927793784300", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token1 for token0 to price 0.40000 1`] = ` -Object { - "poolBalance0": "11505743598341114571255423385623647", - "poolBalance1": "11505743598341114571255423385506404", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token1 for token0 to price 2.5000 1`] = ` -Object { - "amount0Before": "11505743598341114571255423385623647", - "amount0Delta": "-4228872409409224753601131224936259", - "amount1Before": "11505743598341114571255423385506404", - "amount1Delta": "6706554036096900675845906992220230", - "executionPrice": "1.5859", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "595039006852697512464428097884749099", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "1.0000", - "tickAfter": 9163, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "1000", - "amount1Before": "1994009290088178439", - "amount1Delta": "-991", - "executionPrice": "0.99100", - "feeGrowthGlobal0X128Delta": "510423550381407695195", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.99402", - "poolPriceBefore": "1.0000", - "tickAfter": -61, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "-991", - "amount1Before": "1994009290088178439", - "amount1Delta": "1000", - "executionPrice": "1.0091", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407695195", - "poolPriceAfter": "1.0060", - "poolPriceBefore": "1.0000", - "tickAfter": 60, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "1000000000000000000", - "amount1Before": "1994009290088178439", - "amount1Delta": "-662011820624678025", - "executionPrice": "0.66201", - "feeGrowthGlobal0X128Delta": "510423550381407695195061911147652317", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.44355", - "poolPriceBefore": "1.0000", - "tickAfter": -8130, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "824893095908431542", - "amount1Before": "1994009290088178439", - "amount1Delta": "-579795727715083389", - "executionPrice": "0.70287", - "feeGrowthGlobal0X128Delta": "421044862698692740725170743495410672", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "-662011820624678025", - "amount1Before": "1994009290088178439", - "amount1Delta": "1000000000000000000", - "executionPrice": "1.5105", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407695195061911147652317", - "poolPriceAfter": "2.2545", - "poolPriceBefore": "1.0000", - "tickAfter": 8129, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "-579795727715083389", - "amount1Before": "1994009290088178439", - "amount1Delta": "824893095908431542", - "executionPrice": "1.4227", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "421044862698692740725170743495410672", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "1011", - "amount1Before": "1994009290088178439", - "amount1Delta": "-1000", - "executionPrice": "0.98912", - "feeGrowthGlobal0X128Delta": "680564733841876926926", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.99402", - "poolPriceBefore": "1.0000", - "tickAfter": -61, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "2024171064311638316", - "amount1Before": "1994009290088178439", - "amount1Delta": "-1000000000000000000", - "executionPrice": "0.49403", - "feeGrowthGlobal0X128Delta": "1033184581225259164735720748018047287", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.24701", - "poolPriceBefore": "1.0000", - "tickAfter": -13984, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "824893095908431542", - "amount1Before": "1994009290088178439", - "amount1Delta": "-579795727715083389", - "executionPrice": "0.70287", - "feeGrowthGlobal0X128Delta": "421044862698692740725170743495410672", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token0 for token1 to price 0.40000 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "1159748196632793863", - "amount1Before": "1994009290088178439", - "amount1Delta": "-729098226020826705", - "executionPrice": "0.62867", - "feeGrowthGlobal0X128Delta": "591962792073745646583043420635066071", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "1.0000", - "tickAfter": -9164, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token0 for token1 to price 2.5000 1`] = ` -Object { - "poolBalance0": "1994009290088178439", - "poolBalance1": "1994009290088178439", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "-1000", - "amount1Before": "1994009290088178439", - "amount1Delta": "1011", - "executionPrice": "1.0110", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "680564733841876926926", - "poolPriceAfter": "1.0060", - "poolPriceBefore": "1.0000", - "tickAfter": 60, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "-1000000000000000000", - "amount1Before": "1994009290088178439", - "amount1Delta": "2024171064311638316", - "executionPrice": "2.0242", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "1033184581225259164735720748018047287", - "poolPriceAfter": "4.0484", - "poolPriceBefore": "1.0000", - "tickAfter": 13983, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "-579795727715083389", - "amount1Before": "1994009290088178439", - "amount1Delta": "824893095908431542", - "executionPrice": "1.4227", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "421044862698692740725170743495410672", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token1 for token0 to price 0.40000 1`] = ` -Object { - "poolBalance0": "1994009290088178439", - "poolBalance1": "1994009290088178439", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token1 for token0 to price 2.5000 1`] = ` -Object { - "amount0Before": "1994009290088178439", - "amount0Delta": "-729098226020826705", - "amount1Before": "1994009290088178439", - "amount1Delta": "1159748196632793863", - "executionPrice": "1.5907", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "591962792073745646583043420635066071", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "1.0000", - "tickAfter": 9163, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "1000", - "amount1Before": "2000000000000000000", - "amount1Delta": "-996", - "executionPrice": "0.99600", - "feeGrowthGlobal0X128Delta": "510423550381407695195", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-996", - "amount1Before": "2000000000000000000", - "amount1Delta": "1000", - "executionPrice": "1.0040", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407695195", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "1000000000000000000", - "amount1Before": "2000000000000000000", - "amount1Delta": "-665331998665331998", - "executionPrice": "0.66533", - "feeGrowthGlobal0X128Delta": "510423550381407695195061911147652317", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.44533", - "poolPriceBefore": "1.0000", - "tickAfter": -8090, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "830919884399388263", - "amount1Before": "2000000000000000000", - "amount1Delta": "-585786437626904951", - "executionPrice": "0.70499", - "feeGrowthGlobal0X128Delta": "424121077477644648929101317621422688", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-665331998665331998", - "amount1Before": "2000000000000000000", - "amount1Delta": "1000000000000000000", - "executionPrice": "1.5030", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407695195061911147652317", - "poolPriceAfter": "2.2455", - "poolPriceBefore": "1.0000", - "tickAfter": 8089, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-585786437626904951", - "amount1Before": "2000000000000000000", - "amount1Delta": "830919884399388263", - "executionPrice": "1.4185", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "424121077477644648929101317621422688", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "1005", - "amount1Before": "2000000000000000000", - "amount1Delta": "-1000", - "executionPrice": "0.99502", - "feeGrowthGlobal0X128Delta": "680564733841876926926", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "2006018054162487463", - "amount1Before": "2000000000000000000", - "amount1Delta": "-1000000000000000000", - "executionPrice": "0.49850", - "feeGrowthGlobal0X128Delta": "1023918857334819954209013958517557896", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.25000", - "poolPriceBefore": "1.0000", - "tickAfter": -13864, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "830919884399388263", - "amount1Before": "2000000000000000000", - "amount1Delta": "-585786437626904951", - "executionPrice": "0.70499", - "feeGrowthGlobal0X128Delta": "424121077477644648929101317621422688", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token0 for token1 to price 0.40000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "1165774985123750584", - "amount1Before": "2000000000000000000", - "amount1Delta": "-735088935932648267", - "executionPrice": "0.63056", - "feeGrowthGlobal0X128Delta": "595039006852697554786973994761078087", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "1.0000", - "tickAfter": -9164, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token0 for token1 to price 2.5000 1`] = ` -Object { - "poolBalance0": "2000000000000000000", - "poolBalance1": "2000000000000000000", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-1000", - "amount1Before": "2000000000000000000", - "amount1Delta": "1005", - "executionPrice": "1.0050", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "680564733841876926926", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-1000000000000000000", - "amount1Before": "2000000000000000000", - "amount1Delta": "2006018054162487463", - "executionPrice": "2.0060", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "1023918857334819954209013958517557896", - "poolPriceAfter": "4.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 13863, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-585786437626904951", - "amount1Before": "2000000000000000000", - "amount1Delta": "830919884399388263", - "executionPrice": "1.4185", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "424121077477644648929101317621422688", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token1 for token0 to price 0.40000 1`] = ` -Object { - "poolBalance0": "2000000000000000000", - "poolBalance1": "2000000000000000000", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token1 for token0 to price 2.5000 1`] = ` -Object { - "amount0Before": "2000000000000000000", - "amount0Delta": "-735088935932648267", - "amount1Before": "2000000000000000000", - "amount1Delta": "1165774985123750584", - "executionPrice": "1.5859", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "595039006852697554786973994761078087", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "1.0000", - "tickAfter": 9163, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "1000", - "amount1Before": "3994009290088178439", - "amount1Delta": "-996", - "executionPrice": "0.99600", - "feeGrowthGlobal0X128Delta": "510423550381407695195", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "-996", - "amount1Before": "3994009290088178439", - "amount1Delta": "1000", - "executionPrice": "1.0040", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407695195", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "1000000000000000000", - "amount1Before": "3994009290088178439", - "amount1Delta": "-795933705287758544", - "executionPrice": "0.79593", - "feeGrowthGlobal0X128Delta": "256749882580179971840679703106063897", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.63923", - "poolPriceBefore": "1.0000", - "tickAfter": -4476, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "1000000000000000000", - "amount1Before": "3994009290088178439", - "amount1Delta": "-795933705287758544", - "executionPrice": "0.79593", - "feeGrowthGlobal0X128Delta": "256749882580179971840679703106063897", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.63923", - "poolPriceBefore": "1.0000", - "tickAfter": -4476, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "-795933705287758544", - "amount1Before": "3994009290088178439", - "amount1Delta": "1000000000000000000", - "executionPrice": "1.2564", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "256749882580179971840679703106063897", - "poolPriceAfter": "1.5644", - "poolPriceBefore": "1.0000", - "tickAfter": 4475, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "-795933705287758544", - "amount1Before": "3994009290088178439", - "amount1Delta": "1000000000000000000", - "executionPrice": "1.2564", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "256749882580179971840679703106063897", - "poolPriceAfter": "1.5644", - "poolPriceBefore": "1.0000", - "tickAfter": 4475, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "1005", - "amount1Before": "3994009290088178439", - "amount1Delta": "-1000", - "executionPrice": "0.99502", - "feeGrowthGlobal0X128Delta": "680564733841876926926", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "1342022152495072924", - "amount1Before": "3994009290088178439", - "amount1Delta": "-1000000000000000000", - "executionPrice": "0.74514", - "feeGrowthGlobal0X128Delta": "344037963272993171369654596359692757", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.56026", - "poolPriceBefore": "1.0000", - "tickAfter": -5794, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "1342022152495072924", - "amount1Before": "3994009290088178439", - "amount1Delta": "-1000000000000000000", - "executionPrice": "0.74514", - "feeGrowthGlobal0X128Delta": "344037963272993171369654596359692757", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.56026", - "poolPriceBefore": "1.0000", - "tickAfter": -5794, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for token1 to price 0.40000 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "2325523181756544449", - "amount1Before": "3994009290088178439", - "amount1Delta": "-1464187161953474971", - "executionPrice": "0.62962", - "feeGrowthGlobal0X128Delta": "595039006852697724928157455230309818", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "1.0000", - "tickAfter": -9164, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for token1 to price 2.5000 1`] = ` -Object { - "poolBalance0": "3994009290088178439", - "poolBalance1": "3994009290088178439", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "-1000", - "amount1Before": "3994009290088178439", - "amount1Delta": "1005", - "executionPrice": "1.0050", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "680564733841876926926", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "-1000000000000000000", - "amount1Before": "3994009290088178439", - "amount1Delta": "1342022152495072924", - "executionPrice": "1.3420", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "344037963272993171369654596359692757", - "poolPriceAfter": "1.7849", - "poolPriceBefore": "1.0000", - "tickAfter": 5793, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "-1000000000000000000", - "amount1Before": "3994009290088178439", - "amount1Delta": "1342022152495072924", - "executionPrice": "1.3420", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "344037963272993171369654596359692757", - "poolPriceAfter": "1.7849", - "poolPriceBefore": "1.0000", - "tickAfter": 5793, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for token0 to price 0.40000 1`] = ` -Object { - "poolBalance0": "3994009290088178439", - "poolBalance1": "3994009290088178439", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for token0 to price 2.5000 1`] = ` -Object { - "amount0Before": "3994009290088178439", - "amount0Delta": "-1464187161953474971", - "amount1Before": "3994009290088178439", - "amount1Delta": "2325523181756544449", - "executionPrice": "1.5883", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "595039006852697724928157455230309818", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "1.0000", - "tickAfter": 9163, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "6324555320336758664", - "amount0Delta": "1000", - "amount1Before": "632455532033675867", - "amount1Delta": "-99", - "executionPrice": "0.099000", - "feeGrowthGlobal0X128Delta": "510423550381407695195", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.10000", - "poolPriceBefore": "0.10000", - "tickAfter": -23028, - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "6324555320336758664", - "amount0Delta": "-9969", - "amount1Before": "632455532033675867", - "amount1Delta": "1000", - "executionPrice": "0.10031", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407695195", - "poolPriceAfter": "0.10000", - "poolPriceBefore": "0.10000", - "tickAfter": -23028, - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "6324555320336758664", - "amount0Delta": "1000000000000000000", - "amount1Before": "632455532033675867", - "amount1Delta": "-86123526743846551", - "executionPrice": "0.086124", - "feeGrowthGlobal0X128Delta": "510423550381407695195061911147652317", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.074620", - "poolPriceBefore": "0.10000", - "tickAfter": -25955, - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "poolBalance0": "6324555320336758664", - "poolBalance1": "632455532033675867", - "poolPriceBefore": "0.10000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "6324555320336758664", - "amount0Delta": "-3869747612262812753", - "amount1Before": "632455532033675867", - "amount1Delta": "1000000000000000000", - "executionPrice": "0.25841", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407865336245371616884047", - "poolPriceAfter": "0.66378", - "poolPriceBefore": "0.10000", - "tickAfter": -4099, - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "6324555320336758664", - "amount0Delta": "-3869747612262812753", - "amount1Before": "632455532033675867", - "amount1Delta": "1000000000000000000", - "executionPrice": "0.25841", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407865336245371616884047", - "poolPriceAfter": "0.66378", - "poolPriceBefore": "0.10000", - "tickAfter": -4099, - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "6324555320336758664", - "amount0Delta": "10032", - "amount1Before": "632455532033675867", - "amount1Delta": "-1000", - "executionPrice": "0.099681", - "feeGrowthGlobal0X128Delta": "5274376687274546183682", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.10000", - "poolPriceBefore": "0.10000", - "tickAfter": -23028, - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "6324555320336758664", - "amount0Delta": "36907032419362389223785084665766560335", - "amount1Before": "632455532033675867", - "amount1Delta": "-632455532033675838", - "executionPrice": "0.000000000000000000017136", - "feeGrowthGlobal0X128Delta": "18838218521532665615644565874197034349094564536667752274", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.0000000000000000000000000000000000000029390", - "poolPriceBefore": "0.10000", - "tickAfter": -887272, - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "poolBalance0": "6324555320336758664", - "poolBalance1": "632455532033675867", - "poolPriceBefore": "0.10000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token0 for token1 to price 0.40000 1`] = ` -Object { - "poolBalance0": "6324555320336758664", - "poolBalance1": "632455532033675867", - "poolPriceBefore": "0.10000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token0 for token1 to price 2.5000 1`] = ` -Object { - "poolBalance0": "6324555320336758664", - "poolBalance1": "632455532033675867", - "poolPriceBefore": "0.10000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "6324555320336758664", - "amount0Delta": "-1000", - "amount1Before": "632455532033675867", - "amount1Delta": "102", - "executionPrice": "0.10200", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "170141183460469231731", - "poolPriceAfter": "0.10000", - "poolPriceBefore": "0.10000", - "tickAfter": -23028, - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "6324555320336758664", - "amount0Delta": "-1000000000000000000", - "amount1Before": "632455532033675867", - "amount1Delta": "119138326055954425", - "executionPrice": "0.11914", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "60811007371978153949466126675899993", - "poolPriceAfter": "0.14109", - "poolPriceBefore": "0.10000", - "tickAfter": -19585, - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "6324555320336758664", - "amount0Delta": "-1000000000000000000", - "amount1Before": "632455532033675867", - "amount1Delta": "119138326055954425", - "executionPrice": "0.11914", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "60811007371978153949466126675899993", - "poolPriceAfter": "0.14109", - "poolPriceBefore": "0.10000", - "tickAfter": -19585, - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token1 for token0 to price 0.40000 1`] = ` -Object { - "amount0Before": "6324555320336758664", - "amount0Delta": "-3162277660168379331", - "amount1Before": "632455532033675867", - "amount1Delta": "634358607857247611", - "executionPrice": "0.20060", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "323791572837503501799197590655727195", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "0.10000", - "tickAfter": -9164, - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token1 for token0 to price 2.5000 1`] = ` -Object { - "amount0Before": "6324555320336758664", - "amount0Delta": "-5059644256269406930", - "amount1Before": "632455532033675867", - "amount1Delta": "2537434431428990440", - "executionPrice": "0.50150", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "1295166291350014177337973823092140516", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "0.10000", - "tickAfter": 9163, - "tickBefore": -23028, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "632455532033675867", - "amount0Delta": "1000", - "amount1Before": "6324555320336758664", - "amount1Delta": "-9969", - "executionPrice": "9.9690", - "feeGrowthGlobal0X128Delta": "510423550381407695195", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "10.000", - "poolPriceBefore": "10.000", - "tickAfter": 23027, - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "632455532033675867", - "amount0Delta": "-99", - "amount1Before": "6324555320336758664", - "amount1Delta": "1000", - "executionPrice": "10.101", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407695195", - "poolPriceAfter": "10.000", - "poolPriceBefore": "10.000", - "tickAfter": 23027, - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "632455532033675867", - "amount0Delta": "1000000000000000000", - "amount1Before": "6324555320336758664", - "amount1Delta": "-3869747612262812754", - "executionPrice": "3.8697", - "feeGrowthGlobal0X128Delta": "510423550381407865336245371616884048", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.5065", - "poolPriceBefore": "10.000", - "tickAfter": 4098, - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "632455532033675867", - "amount0Delta": "1000000000000000000", - "amount1Before": "6324555320336758664", - "amount1Delta": "-3869747612262812754", - "executionPrice": "3.8697", - "feeGrowthGlobal0X128Delta": "510423550381407865336245371616884048", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.5065", - "poolPriceBefore": "10.000", - "tickAfter": 4098, - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "632455532033675867", - "amount0Delta": "-86123526743846551", - "amount1Before": "6324555320336758664", - "amount1Delta": "1000000000000000000", - "executionPrice": "11.611", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407695195061911147652317", - "poolPriceAfter": "13.401", - "poolPriceBefore": "10.000", - "tickAfter": 25954, - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "poolBalance0": "632455532033675867", - "poolBalance1": "6324555320336758664", - "poolPriceBefore": "10.000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "632455532033675867", - "amount0Delta": "102", - "amount1Before": "6324555320336758664", - "amount1Delta": "-1000", - "executionPrice": "9.8039", - "feeGrowthGlobal0X128Delta": "170141183460469231731", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "10.000", - "poolPriceBefore": "10.000", - "tickAfter": 23027, - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "632455532033675867", - "amount0Delta": "119138326055954425", - "amount1Before": "6324555320336758664", - "amount1Delta": "-1000000000000000000", - "executionPrice": "8.3936", - "feeGrowthGlobal0X128Delta": "60811007371978153949466126675899993", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "7.0877", - "poolPriceBefore": "10.000", - "tickAfter": 19584, - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "632455532033675867", - "amount0Delta": "119138326055954425", - "amount1Before": "6324555320336758664", - "amount1Delta": "-1000000000000000000", - "executionPrice": "8.3936", - "feeGrowthGlobal0X128Delta": "60811007371978153949466126675899993", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "7.0877", - "poolPriceBefore": "10.000", - "tickAfter": 19584, - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token0 for token1 to price 0.40000 1`] = ` -Object { - "amount0Before": "632455532033675867", - "amount0Delta": "2537434431428990438", - "amount1Before": "6324555320336758664", - "amount1Delta": "-5059644256269406930", - "executionPrice": "1.9940", - "feeGrowthGlobal0X128Delta": "1295166291350014007196790362622908786", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "10.000", - "tickAfter": -9164, - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token0 for token1 to price 2.5000 1`] = ` -Object { - "amount0Before": "632455532033675867", - "amount0Delta": "634358607857247610", - "amount1Before": "6324555320336758664", - "amount1Delta": "-3162277660168379331", - "executionPrice": "4.9850", - "feeGrowthGlobal0X128Delta": "323791572837503501799197590655727196", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "10.000", - "tickAfter": 9163, - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "632455532033675867", - "amount0Delta": "-1000", - "amount1Before": "6324555320336758664", - "amount1Delta": "10032", - "executionPrice": "10.032", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "5274376687274546183682", - "poolPriceAfter": "10.000", - "poolPriceBefore": "10.000", - "tickAfter": 23027, - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "632455532033675867", - "amount0Delta": "-632455532033675838", - "amount1Before": "6324555320336758664", - "amount1Delta": "36907032426281581270030941278837275671", - "executionPrice": "5.8355e+19", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "18838218525064384185660173270402201838945341643205005201", - "poolPriceAfter": "3.4026e+38", - "poolPriceBefore": "10.000", - "tickAfter": 887271, - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "poolBalance0": "632455532033675867", - "poolBalance1": "6324555320336758664", - "poolPriceBefore": "10.000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token1 for token0 to price 0.40000 1`] = ` -Object { - "poolBalance0": "632455532033675867", - "poolBalance1": "6324555320336758664", - "poolPriceBefore": "10.000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token1 for token0 to price 2.5000 1`] = ` -Object { - "poolBalance0": "632455532033675867", - "poolBalance1": "6324555320336758664", - "poolPriceBefore": "10.000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 23027, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "0", - "amount1Before": "0", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.0000000000000000000000000000000000000029390", - "poolPriceBefore": "1.0000", - "tickAfter": -887272, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "-996", - "amount1Before": "0", - "amount1Delta": "1000", - "executionPrice": "1.0040", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407695195", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "0", - "amount1Before": "0", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.0000000000000000000000000000000000000029390", - "poolPriceBefore": "1.0000", - "tickAfter": -887272, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "0", - "amount1Before": "0", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "-665331998665331998", - "amount1Before": "0", - "amount1Delta": "1000000000000000000", - "executionPrice": "1.5030", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "510423550381407695195061911147652317", - "poolPriceAfter": "2.2455", - "poolPriceBefore": "1.0000", - "tickAfter": 8089, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "-585786437626904951", - "amount1Before": "0", - "amount1Delta": "830919884399388263", - "executionPrice": "1.4185", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "424121077477644648929101317621422688", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "0", - "amount1Before": "0", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.0000000000000000000000000000000000000029390", - "poolPriceBefore": "1.0000", - "tickAfter": -887272, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "0", - "amount1Before": "0", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.0000000000000000000000000000000000000029390", - "poolPriceBefore": "1.0000", - "tickAfter": -887272, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "0", - "amount1Before": "0", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for token1 to price 0.40000 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "0", - "amount1Before": "0", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "1.0000", - "tickAfter": -9164, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for token1 to price 2.5000 1`] = ` -Object { - "poolBalance0": "1995041008271423675", - "poolBalance1": "0", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "-1000", - "amount1Before": "0", - "amount1Delta": "1005", - "executionPrice": "1.0050", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "680564733841876926926", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 0, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "-1000000000000000000", - "amount1Before": "0", - "amount1Delta": "2006018054162487463", - "executionPrice": "2.0060", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "1023918857334819954209013958517557896", - "poolPriceAfter": "4.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 13863, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "-585786437626904951", - "amount1Before": "0", - "amount1Delta": "830919884399388263", - "executionPrice": "1.4185", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "424121077477644648929101317621422688", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for token0 to price 0.40000 1`] = ` -Object { - "poolBalance0": "1995041008271423675", - "poolBalance1": "0", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for token0 to price 2.5000 1`] = ` -Object { - "amount0Before": "1995041008271423675", - "amount0Delta": "-735088935932648267", - "amount1Before": "0", - "amount1Delta": "1165774985123750584", - "executionPrice": "1.5859", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "595039006852697554786973994761078087", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "1.0000", - "tickAfter": 9163, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap exactly 0.0000000000000010000 token0 for token1 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "1000", - "amount1Before": "1995041008271423675", - "amount1Delta": "-996", - "executionPrice": "0.99600", - "feeGrowthGlobal0X128Delta": "510423550381407695195", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap exactly 0.0000000000000010000 token1 for token0 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "0", - "amount1Before": "1995041008271423675", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "3.4026e+38", - "poolPriceBefore": "1.0000", - "tickAfter": 887271, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap exactly 1.0000 token0 for token1 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "1000000000000000000", - "amount1Before": "1995041008271423675", - "amount1Delta": "-665331998665331998", - "executionPrice": "0.66533", - "feeGrowthGlobal0X128Delta": "510423550381407695195061911147652317", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.44533", - "poolPriceBefore": "1.0000", - "tickAfter": -8090, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "830919884399388263", - "amount1Before": "1995041008271423675", - "amount1Delta": "-585786437626904951", - "executionPrice": "0.70499", - "feeGrowthGlobal0X128Delta": "424121077477644648929101317621422688", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap exactly 1.0000 token1 for token0 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "0", - "amount1Before": "1995041008271423675", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "3.4026e+38", - "poolPriceBefore": "1.0000", - "tickAfter": 887271, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "0", - "amount1Before": "1995041008271423675", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token0 for exactly 0.0000000000000010000 token1 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "1005", - "amount1Before": "1995041008271423675", - "amount1Delta": "-1000", - "executionPrice": "0.99502", - "feeGrowthGlobal0X128Delta": "680564733841876926926", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "1.0000", - "poolPriceBefore": "1.0000", - "tickAfter": -1, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token0 for exactly 1.0000 token1 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "2006018054162487463", - "amount1Before": "1995041008271423675", - "amount1Delta": "-1000000000000000000", - "executionPrice": "0.49850", - "feeGrowthGlobal0X128Delta": "1023918857334819954209013958517557896", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.25000", - "poolPriceBefore": "1.0000", - "tickAfter": -13864, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "830919884399388263", - "amount1Before": "1995041008271423675", - "amount1Delta": "-585786437626904951", - "executionPrice": "0.70499", - "feeGrowthGlobal0X128Delta": "424121077477644648929101317621422688", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.50000", - "poolPriceBefore": "1.0000", - "tickAfter": -6932, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token0 for token1 to price 0.40000 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "1165774985123750584", - "amount1Before": "1995041008271423675", - "amount1Delta": "-735088935932648267", - "executionPrice": "0.63056", - "feeGrowthGlobal0X128Delta": "595039006852697554786973994761078087", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "0.40000", - "poolPriceBefore": "1.0000", - "tickAfter": -9164, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token0 for token1 to price 2.5000 1`] = ` -Object { - "poolBalance0": "0", - "poolBalance1": "1995041008271423675", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token1 for exactly 0.0000000000000010000 token0 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "0", - "amount1Before": "1995041008271423675", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "3.4026e+38", - "poolPriceBefore": "1.0000", - "tickAfter": 887271, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token1 for exactly 1.0000 token0 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "0", - "amount1Before": "1995041008271423675", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "3.4026e+38", - "poolPriceBefore": "1.0000", - "tickAfter": 887271, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "0", - "amount1Before": "1995041008271423675", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "2.0000", - "poolPriceBefore": "1.0000", - "tickAfter": 6931, - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token1 for token0 to price 0.40000 1`] = ` -Object { - "poolBalance0": "0", - "poolBalance1": "1995041008271423675", - "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL", - "tickBefore": 0, -} -`; - -exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token1 for token0 to price 2.5000 1`] = ` -Object { - "amount0Before": "0", - "amount0Delta": "0", - "amount1Before": "1995041008271423675", - "amount1Delta": "0", - "executionPrice": "NaN", - "feeGrowthGlobal0X128Delta": "0", - "feeGrowthGlobal1X128Delta": "0", - "poolPriceAfter": "2.5000", - "poolPriceBefore": "1.0000", - "tickAfter": 9163, - "tickBefore": 0, -} -`; diff --git a/contract/lib/v3-core/test/shared/checkObservationEquals.ts b/contract/lib/v3-core/test/shared/checkObservationEquals.ts deleted file mode 100644 index 744116c..0000000 --- a/contract/lib/v3-core/test/shared/checkObservationEquals.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { BigNumber, BigNumberish } from 'ethers' -import { expect } from './expect' - -// helper function because we cannot do a simple deep equals with the -// observation result object returned from ethers because it extends array -export default function checkObservationEquals( - { - tickCumulative, - blockTimestamp, - initialized, - secondsPerLiquidityCumulativeX128, - }: { - tickCumulative: BigNumber - secondsPerLiquidityCumulativeX128: BigNumber - initialized: boolean - blockTimestamp: number - }, - expected: { - tickCumulative: BigNumberish - secondsPerLiquidityCumulativeX128: BigNumberish - initialized: boolean - blockTimestamp: number - } -) { - expect( - { - initialized, - blockTimestamp, - tickCumulative: tickCumulative.toString(), - secondsPerLiquidityCumulativeX128: secondsPerLiquidityCumulativeX128.toString(), - }, - `observation is equivalent` - ).to.deep.eq({ - ...expected, - tickCumulative: expected.tickCumulative.toString(), - secondsPerLiquidityCumulativeX128: expected.secondsPerLiquidityCumulativeX128.toString(), - }) -} diff --git a/contract/lib/v3-core/test/shared/expect.ts b/contract/lib/v3-core/test/shared/expect.ts deleted file mode 100644 index ac8f19b..0000000 --- a/contract/lib/v3-core/test/shared/expect.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { expect, use } from 'chai' -import { solidity } from 'ethereum-waffle' -import { jestSnapshotPlugin } from 'mocha-chai-jest-snapshot' - -use(solidity) -use(jestSnapshotPlugin()) - -export { expect } diff --git a/contract/lib/v3-core/test/shared/fixtures.ts b/contract/lib/v3-core/test/shared/fixtures.ts deleted file mode 100644 index 11c84bb..0000000 --- a/contract/lib/v3-core/test/shared/fixtures.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { BigNumber } from 'ethers' -import { ethers } from 'hardhat' -import { MockTimeUniswapV3Pool } from '../../typechain/MockTimeUniswapV3Pool' -import { TestERC20 } from '../../typechain/TestERC20' -import { UniswapV3Factory } from '../../typechain/UniswapV3Factory' -import { TestUniswapV3Callee } from '../../typechain/TestUniswapV3Callee' -import { TestUniswapV3Router } from '../../typechain/TestUniswapV3Router' -import { MockTimeUniswapV3PoolDeployer } from '../../typechain/MockTimeUniswapV3PoolDeployer' - -import { Fixture } from 'ethereum-waffle' - -interface FactoryFixture { - factory: UniswapV3Factory -} - -async function factoryFixture(): Promise { - const factoryFactory = await ethers.getContractFactory('UniswapV3Factory') - const factory = (await factoryFactory.deploy()) as UniswapV3Factory - return { factory } -} - -interface TokensFixture { - token0: TestERC20 - token1: TestERC20 - token2: TestERC20 -} - -async function tokensFixture(): Promise { - const tokenFactory = await ethers.getContractFactory('TestERC20') - const tokenA = (await tokenFactory.deploy(BigNumber.from(2).pow(255))) as TestERC20 - const tokenB = (await tokenFactory.deploy(BigNumber.from(2).pow(255))) as TestERC20 - const tokenC = (await tokenFactory.deploy(BigNumber.from(2).pow(255))) as TestERC20 - - const [token0, token1, token2] = [tokenA, tokenB, tokenC].sort((tokenA, tokenB) => - tokenA.address.toLowerCase() < tokenB.address.toLowerCase() ? -1 : 1 - ) - - return { token0, token1, token2 } -} - -type TokensAndFactoryFixture = FactoryFixture & TokensFixture - -interface PoolFixture extends TokensAndFactoryFixture { - swapTargetCallee: TestUniswapV3Callee - swapTargetRouter: TestUniswapV3Router - createPool( - fee: number, - tickSpacing: number, - firstToken?: TestERC20, - secondToken?: TestERC20 - ): Promise -} - -// Monday, October 5, 2020 9:00:00 AM GMT-05:00 -export const TEST_POOL_START_TIME = 1601906400 - -export const poolFixture: Fixture = async function (): Promise { - const { factory } = await factoryFixture() - const { token0, token1, token2 } = await tokensFixture() - - const MockTimeUniswapV3PoolDeployerFactory = await ethers.getContractFactory('MockTimeUniswapV3PoolDeployer') - const MockTimeUniswapV3PoolFactory = await ethers.getContractFactory('MockTimeUniswapV3Pool') - - const calleeContractFactory = await ethers.getContractFactory('TestUniswapV3Callee') - const routerContractFactory = await ethers.getContractFactory('TestUniswapV3Router') - - const swapTargetCallee = (await calleeContractFactory.deploy()) as TestUniswapV3Callee - const swapTargetRouter = (await routerContractFactory.deploy()) as TestUniswapV3Router - - return { - token0, - token1, - token2, - factory, - swapTargetCallee, - swapTargetRouter, - createPool: async (fee, tickSpacing, firstToken = token0, secondToken = token1) => { - const mockTimePoolDeployer = (await MockTimeUniswapV3PoolDeployerFactory.deploy()) as MockTimeUniswapV3PoolDeployer - const tx = await mockTimePoolDeployer.deploy( - factory.address, - firstToken.address, - secondToken.address, - fee, - tickSpacing - ) - - const receipt = await tx.wait() - const poolAddress = receipt.events?.[0].args?.pool as string - return MockTimeUniswapV3PoolFactory.attach(poolAddress) as MockTimeUniswapV3Pool - }, - } -} diff --git a/contract/lib/v3-core/test/shared/format.ts b/contract/lib/v3-core/test/shared/format.ts deleted file mode 100644 index 8d23da5..0000000 --- a/contract/lib/v3-core/test/shared/format.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Decimal } from 'decimal.js' -import { BigNumberish } from 'ethers' - -export function formatTokenAmount(num: BigNumberish): string { - return new Decimal(num.toString()).dividedBy(new Decimal(10).pow(18)).toPrecision(5) -} - -export function formatPrice(price: BigNumberish): string { - return new Decimal(price.toString()).dividedBy(new Decimal(2).pow(96)).pow(2).toPrecision(5) -} diff --git a/contract/lib/v3-core/test/shared/snapshotGasCost.ts b/contract/lib/v3-core/test/shared/snapshotGasCost.ts deleted file mode 100644 index 5a606d2..0000000 --- a/contract/lib/v3-core/test/shared/snapshotGasCost.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { TransactionReceipt, TransactionResponse } from '@ethersproject/abstract-provider' -import { expect } from './expect' -import { Contract, BigNumber, ContractTransaction } from 'ethers' - -export default async function snapshotGasCost( - x: - | TransactionResponse - | Promise - | ContractTransaction - | Promise - | TransactionReceipt - | Promise - | BigNumber - | Contract - | Promise -): Promise { - const resolved = await x - if ('deployTransaction' in resolved) { - const receipt = await resolved.deployTransaction.wait() - expect(receipt.gasUsed.toNumber()).toMatchSnapshot() - } else if ('wait' in resolved) { - const waited = await resolved.wait() - expect(waited.gasUsed.toNumber()).toMatchSnapshot() - } else if (BigNumber.isBigNumber(resolved)) { - expect(resolved.toNumber()).toMatchSnapshot() - } -} diff --git a/contract/lib/v3-core/test/shared/utilities.ts b/contract/lib/v3-core/test/shared/utilities.ts deleted file mode 100644 index 098149f..0000000 --- a/contract/lib/v3-core/test/shared/utilities.ts +++ /dev/null @@ -1,258 +0,0 @@ -import bn from 'bignumber.js' -import { BigNumber, BigNumberish, constants, Contract, ContractTransaction, utils, Wallet } from 'ethers' -import { TestUniswapV3Callee } from '../../typechain/TestUniswapV3Callee' -import { TestUniswapV3Router } from '../../typechain/TestUniswapV3Router' -import { MockTimeUniswapV3Pool } from '../../typechain/MockTimeUniswapV3Pool' -import { TestERC20 } from '../../typechain/TestERC20' - -export const MaxUint128 = BigNumber.from(2).pow(128).sub(1) - -export const getMinTick = (tickSpacing: number) => Math.ceil(-887272 / tickSpacing) * tickSpacing -export const getMaxTick = (tickSpacing: number) => Math.floor(887272 / tickSpacing) * tickSpacing -export const getMaxLiquidityPerTick = (tickSpacing: number) => - BigNumber.from(2) - .pow(128) - .sub(1) - .div((getMaxTick(tickSpacing) - getMinTick(tickSpacing)) / tickSpacing + 1) - -export const MIN_SQRT_RATIO = BigNumber.from('4295128739') -export const MAX_SQRT_RATIO = BigNumber.from('1461446703485210103287273052203988822378723970342') - -export enum FeeAmount { - LOW = 500, - MEDIUM = 3000, - HIGH = 10000, -} - -export const TICK_SPACINGS: { [amount in FeeAmount]: number } = { - [FeeAmount.LOW]: 10, - [FeeAmount.MEDIUM]: 60, - [FeeAmount.HIGH]: 200, -} - -export function expandTo18Decimals(n: number): BigNumber { - return BigNumber.from(n).mul(BigNumber.from(10).pow(18)) -} - -export function getCreate2Address( - factoryAddress: string, - [tokenA, tokenB]: [string, string], - fee: number, - bytecode: string -): string { - const [token0, token1] = tokenA.toLowerCase() < tokenB.toLowerCase() ? [tokenA, tokenB] : [tokenB, tokenA] - const constructorArgumentsEncoded = utils.defaultAbiCoder.encode( - ['address', 'address', 'uint24'], - [token0, token1, fee] - ) - const create2Inputs = [ - '0xff', - factoryAddress, - // salt - utils.keccak256(constructorArgumentsEncoded), - // init code. bytecode + constructor arguments - utils.keccak256(bytecode), - ] - const sanitizedInputs = `0x${create2Inputs.map((i) => i.slice(2)).join('')}` - return utils.getAddress(`0x${utils.keccak256(sanitizedInputs).slice(-40)}`) -} - -bn.config({ EXPONENTIAL_AT: 999999, DECIMAL_PLACES: 40 }) - -// returns the sqrt price as a 64x96 -export function encodePriceSqrt(reserve1: BigNumberish, reserve0: BigNumberish): BigNumber { - return BigNumber.from( - new bn(reserve1.toString()) - .div(reserve0.toString()) - .sqrt() - .multipliedBy(new bn(2).pow(96)) - .integerValue(3) - .toString() - ) -} - -export function getPositionKey(address: string, lowerTick: number, upperTick: number): string { - return utils.keccak256(utils.solidityPack(['address', 'int24', 'int24'], [address, lowerTick, upperTick])) -} - -export type SwapFunction = ( - amount: BigNumberish, - to: Wallet | string, - sqrtPriceLimitX96?: BigNumberish -) => Promise -export type SwapToPriceFunction = (sqrtPriceX96: BigNumberish, to: Wallet | string) => Promise -export type FlashFunction = ( - amount0: BigNumberish, - amount1: BigNumberish, - to: Wallet | string, - pay0?: BigNumberish, - pay1?: BigNumberish -) => Promise -export type MintFunction = ( - recipient: string, - tickLower: BigNumberish, - tickUpper: BigNumberish, - liquidity: BigNumberish -) => Promise -export interface PoolFunctions { - swapToLowerPrice: SwapToPriceFunction - swapToHigherPrice: SwapToPriceFunction - swapExact0For1: SwapFunction - swap0ForExact1: SwapFunction - swapExact1For0: SwapFunction - swap1ForExact0: SwapFunction - flash: FlashFunction - mint: MintFunction -} -export function createPoolFunctions({ - swapTarget, - token0, - token1, - pool, -}: { - swapTarget: TestUniswapV3Callee - token0: TestERC20 - token1: TestERC20 - pool: MockTimeUniswapV3Pool -}): PoolFunctions { - async function swapToSqrtPrice( - inputToken: Contract, - targetPrice: BigNumberish, - to: Wallet | string - ): Promise { - const method = inputToken === token0 ? swapTarget.swapToLowerSqrtPrice : swapTarget.swapToHigherSqrtPrice - - await inputToken.approve(swapTarget.address, constants.MaxUint256) - - const toAddress = typeof to === 'string' ? to : to.address - - return method(pool.address, targetPrice, toAddress) - } - - async function swap( - inputToken: Contract, - [amountIn, amountOut]: [BigNumberish, BigNumberish], - to: Wallet | string, - sqrtPriceLimitX96?: BigNumberish - ): Promise { - const exactInput = amountOut === 0 - - const method = - inputToken === token0 - ? exactInput - ? swapTarget.swapExact0For1 - : swapTarget.swap0ForExact1 - : exactInput - ? swapTarget.swapExact1For0 - : swapTarget.swap1ForExact0 - - if (typeof sqrtPriceLimitX96 === 'undefined') { - if (inputToken === token0) { - sqrtPriceLimitX96 = MIN_SQRT_RATIO.add(1) - } else { - sqrtPriceLimitX96 = MAX_SQRT_RATIO.sub(1) - } - } - await inputToken.approve(swapTarget.address, constants.MaxUint256) - - const toAddress = typeof to === 'string' ? to : to.address - - return method(pool.address, exactInput ? amountIn : amountOut, toAddress, sqrtPriceLimitX96) - } - - const swapToLowerPrice: SwapToPriceFunction = (sqrtPriceX96, to) => { - return swapToSqrtPrice(token0, sqrtPriceX96, to) - } - - const swapToHigherPrice: SwapToPriceFunction = (sqrtPriceX96, to) => { - return swapToSqrtPrice(token1, sqrtPriceX96, to) - } - - const swapExact0For1: SwapFunction = (amount, to, sqrtPriceLimitX96) => { - return swap(token0, [amount, 0], to, sqrtPriceLimitX96) - } - - const swap0ForExact1: SwapFunction = (amount, to, sqrtPriceLimitX96) => { - return swap(token0, [0, amount], to, sqrtPriceLimitX96) - } - - const swapExact1For0: SwapFunction = (amount, to, sqrtPriceLimitX96) => { - return swap(token1, [amount, 0], to, sqrtPriceLimitX96) - } - - const swap1ForExact0: SwapFunction = (amount, to, sqrtPriceLimitX96) => { - return swap(token1, [0, amount], to, sqrtPriceLimitX96) - } - - const mint: MintFunction = async (recipient, tickLower, tickUpper, liquidity) => { - await token0.approve(swapTarget.address, constants.MaxUint256) - await token1.approve(swapTarget.address, constants.MaxUint256) - return swapTarget.mint(pool.address, recipient, tickLower, tickUpper, liquidity) - } - - const flash: FlashFunction = async (amount0, amount1, to, pay0?: BigNumberish, pay1?: BigNumberish) => { - const fee = await pool.fee() - if (typeof pay0 === 'undefined') { - pay0 = BigNumber.from(amount0) - .mul(fee) - .add(1e6 - 1) - .div(1e6) - .add(amount0) - } - if (typeof pay1 === 'undefined') { - pay1 = BigNumber.from(amount1) - .mul(fee) - .add(1e6 - 1) - .div(1e6) - .add(amount1) - } - return swapTarget.flash(pool.address, typeof to === 'string' ? to : to.address, amount0, amount1, pay0, pay1) - } - - return { - swapToLowerPrice, - swapToHigherPrice, - swapExact0For1, - swap0ForExact1, - swapExact1For0, - swap1ForExact0, - mint, - flash, - } -} - -export interface MultiPoolFunctions { - swapForExact0Multi: SwapFunction - swapForExact1Multi: SwapFunction -} - -export function createMultiPoolFunctions({ - inputToken, - swapTarget, - poolInput, - poolOutput, -}: { - inputToken: TestERC20 - swapTarget: TestUniswapV3Router - poolInput: MockTimeUniswapV3Pool - poolOutput: MockTimeUniswapV3Pool -}): MultiPoolFunctions { - async function swapForExact0Multi(amountOut: BigNumberish, to: Wallet | string): Promise { - const method = swapTarget.swapForExact0Multi - await inputToken.approve(swapTarget.address, constants.MaxUint256) - const toAddress = typeof to === 'string' ? to : to.address - return method(toAddress, poolInput.address, poolOutput.address, amountOut) - } - - async function swapForExact1Multi(amountOut: BigNumberish, to: Wallet | string): Promise { - const method = swapTarget.swapForExact1Multi - await inputToken.approve(swapTarget.address, constants.MaxUint256) - const toAddress = typeof to === 'string' ? to : to.address - return method(toAddress, poolInput.address, poolOutput.address, amountOut) - } - - return { - swapForExact0Multi, - swapForExact1Multi, - } -} diff --git a/contract/lib/v3-core/tsconfig.json b/contract/lib/v3-core/tsconfig.json deleted file mode 100644 index 1522f0b..0000000 --- a/contract/lib/v3-core/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "target": "es2018", - "module": "commonjs", - "strict": true, - "esModuleInterop": true, - "outDir": "dist", - "typeRoots": ["./typechain", "./node_modules/@types"], - "types": ["@nomiclabs/hardhat-ethers", "@nomiclabs/hardhat-waffle"] - }, - "include": ["./test"], - "files": ["./hardhat.config.ts"] -} diff --git a/contract/lib/v3-core/yarn.lock b/contract/lib/v3-core/yarn.lock deleted file mode 100644 index c07ef55..0000000 --- a/contract/lib/v3-core/yarn.lock +++ /dev/null @@ -1,9222 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/code-frame@^7.0.0": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" - -"@babel/helper-validator-identifier@^7.10.4", "@babel/helper-validator-identifier@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" - integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== - -"@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" - -"@babel/types@^7.0.0", "@babel/types@^7.3.0": - version "7.12.12" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.12.tgz#4608a6ec313abbd87afa55004d373ad04a96c299" - integrity sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ== - dependencies: - "@babel/helper-validator-identifier" "^7.12.11" - lodash "^4.17.19" - to-fast-properties "^2.0.0" - -"@cnakazawa/watch@^1.0.3": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" - integrity sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ== - dependencies: - exec-sh "^0.3.2" - minimist "^1.2.0" - -"@ensdomains/ens@^0.4.4": - version "0.4.5" - resolved "https://registry.yarnpkg.com/@ensdomains/ens/-/ens-0.4.5.tgz#e0aebc005afdc066447c6e22feb4eda89a5edbfc" - integrity sha512-JSvpj1iNMFjK6K+uVl4unqMoa9rf5jopb8cya5UGBWz23Nw8hSNT7efgUx4BTlAPAgpNlEioUfeTyQ6J9ZvTVw== - dependencies: - bluebird "^3.5.2" - eth-ens-namehash "^2.0.8" - solc "^0.4.20" - testrpc "0.0.1" - web3-utils "^1.0.0-beta.31" - -"@ensdomains/resolver@^0.2.4": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@ensdomains/resolver/-/resolver-0.2.4.tgz#c10fe28bf5efbf49bff4666d909aed0265efbc89" - integrity sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA== - -"@ethereum-waffle/chai@^3.2.1": - version "3.2.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/chai/-/chai-3.2.1.tgz#5cb542b2a323adf0bc2dda00f48b0eb85944d8ab" - integrity sha512-0aG946J1+2Gg7WnEjtwPEWe+xwLTeBTy6LpCnGecosMf3YINkaf9Xv3Sd7CrXBR88ihCoUhfzfmOloMHIAQPAg== - dependencies: - "@ethereum-waffle/provider" "^3.2.1" - ethers "^5.0.0" - -"@ethereum-waffle/compiler@^3.2.1": - version "3.2.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/compiler/-/compiler-3.2.1.tgz#612a9056285a94ce28eb57b895770ad10e438bf9" - integrity sha512-URSsbTp4g8HPHAaA4KiAD6Aya9WPx/TULfOr+YpjCJ6YWXqE9wwi3ubf9qJUQxu6W6PsiczBaQhVhpI9RLoVUA== - dependencies: - "@resolver-engine/imports" "^0.3.3" - "@resolver-engine/imports-fs" "^0.3.3" - "@types/mkdirp" "^0.5.2" - "@types/node-fetch" "^2.5.5" - ethers "^5.0.1" - mkdirp "^0.5.1" - node-fetch "^2.6.0" - solc "^0.6.3" - -"@ethereum-waffle/ens@^3.2.1": - version "3.2.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/ens/-/ens-3.2.1.tgz#9f369112d62f7aa88d010be4d133b6d0f5e8c492" - integrity sha512-dXv/Mb8EgEYOKv2jjmkFNFCmSjNv8nPk1Gaegc0J/KXWuTU6CBOhWet7YS5joGO8ORK21MvN2qVgcQj+FYw0Dw== - dependencies: - "@ensdomains/ens" "^0.4.4" - "@ensdomains/resolver" "^0.2.4" - ethers "^5.0.1" - -"@ethereum-waffle/mock-contract@^3.2.1": - version "3.2.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/mock-contract/-/mock-contract-3.2.1.tgz#bf5f63f61c9749eb3270108893a88ff161e68f58" - integrity sha512-39GMp/IqsHF+3j3XK38cWA+nX7Q6ABfMsYkuAjtfpTguTFQKXx2C1/VJZwGOyb4de2pl4bssmN37VEraB3NWbQ== - dependencies: - "@ethersproject/abi" "^5.0.1" - ethers "^5.0.1" - -"@ethereum-waffle/provider@^3.2.1": - version "3.2.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/provider/-/provider-3.2.1.tgz#d84c0603936f09afa69ecb671d56f527e9818e71" - integrity sha512-doG18hThqldsYcZIIO0YoiwV+ERx0dCVY6bkg4FKZtoymNelf15zNycb881c6QD9RnLuz6A2Jp9lmnrAD+IvYQ== - dependencies: - "@ethereum-waffle/ens" "^3.2.1" - ethers "^5.0.1" - ganache-core "^2.10.2" - patch-package "^6.2.2" - postinstall-postinstall "^2.1.0" - -"@ethereumjs/block@^3.2.0", "@ethereumjs/block@^3.2.1": - version "3.2.1" - resolved "https://registry.yarnpkg.com/@ethereumjs/block/-/block-3.2.1.tgz#c24c345e6dd6299efa4bed40979280b7dda96d3a" - integrity sha512-FCxo5KwwULne2A2Yuae4iaGGqSsRjwzXOlDhGalOFiBbLfP3hE04RHaHGw4c8vh1PfOrLauwi0dQNUBkOG3zIA== - dependencies: - "@ethereumjs/common" "^2.2.0" - "@ethereumjs/tx" "^3.1.3" - ethereumjs-util "^7.0.10" - merkle-patricia-tree "^4.1.0" - -"@ethereumjs/blockchain@^5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@ethereumjs/blockchain/-/blockchain-5.2.1.tgz#83ed83647667265f1666f111caf065ef9d1e82b5" - integrity sha512-+hshP2qSOOFsiYvZCbaDQFG7jYTWafE8sfBi+pAsdhAHfP7BN7VLyob7qoQISgwS1s7NTR4c4+2t/woU9ahItw== - dependencies: - "@ethereumjs/block" "^3.2.0" - "@ethereumjs/common" "^2.2.0" - "@ethereumjs/ethash" "^1.0.0" - debug "^2.2.0" - ethereumjs-util "^7.0.9" - level-mem "^5.0.1" - lru-cache "^5.1.1" - rlp "^2.2.4" - semaphore-async-await "^1.5.1" - -"@ethereumjs/common@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.2.0.tgz#850a3e3e594ee707ad8d44a11e8152fb62450535" - integrity sha512-PyQiTG00MJtBRkJmv46ChZL8u2XWxNBeAthznAUIUiefxPAXjbkuiCZOuncgJS34/XkMbNc9zMt/PlgKRBElig== - dependencies: - crc-32 "^1.2.0" - ethereumjs-util "^7.0.9" - -"@ethereumjs/ethash@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/ethash/-/ethash-1.0.0.tgz#4e77f85b37be1ade5393e8719bdabac3e796ddaa" - integrity sha512-iIqnGG6NMKesyOxv2YctB2guOVX18qMAWlj3QlZyrc+GqfzLqoihti+cVNQnyNxr7eYuPdqwLQOFuPe6g/uKjw== - dependencies: - "@types/levelup" "^4.3.0" - buffer-xor "^2.0.1" - ethereumjs-util "^7.0.7" - miller-rabin "^4.0.0" - -"@ethereumjs/tx@^3.1.3": - version "3.1.3" - resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.1.3.tgz#0e4b0ccec2f12b1f0bbbb0e7542dd79d9ec25d87" - integrity sha512-DJBu6cbwYtiPTFeCUR8DF5p+PF0jxs+0rALJZiEcTz2tiRPIEkM72GEbrkGuqzENLCzBrJHT43O0DxSYTqeo+g== - dependencies: - "@ethereumjs/common" "^2.2.0" - ethereumjs-util "^7.0.10" - -"@ethereumjs/vm@^5.3.2": - version "5.3.2" - resolved "https://registry.yarnpkg.com/@ethereumjs/vm/-/vm-5.3.2.tgz#b4d83a3d50a7ad22d6d412cc21bbde221b3e2871" - integrity sha512-QmCUQrW6xbhgEbQh9njue4kAJdM056C+ytBFUTF/kDYa3kNDm4Qxp9HUyTlt1OCSXvDhws0qqlh8+q+pmXpN7g== - dependencies: - "@ethereumjs/block" "^3.2.1" - "@ethereumjs/blockchain" "^5.2.1" - "@ethereumjs/common" "^2.2.0" - "@ethereumjs/tx" "^3.1.3" - async-eventemitter "^0.2.4" - core-js-pure "^3.0.1" - debug "^2.2.0" - ethereumjs-util "^7.0.10" - functional-red-black-tree "^1.0.1" - mcl-wasm "^0.7.1" - merkle-patricia-tree "^4.1.0" - rustbn.js "~0.2.0" - util.promisify "^1.0.1" - -"@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/abi@5.0.9", "@ethersproject/abi@^5.0.1", "@ethersproject/abi@^5.0.5": - version "5.0.9" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.9.tgz#738c1c557e56d8f395a5a27caef9b0449bc85a10" - integrity sha512-ily2OufA2DTrxkiHQw5GqbkMSnNKuwZBqKsajtT0ERhZy1r9w2CpW1bmtRMIGzaqQxCdn/GEoFogexk72cBBZQ== - dependencies: - "@ethersproject/address" "^5.0.4" - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/constants" "^5.0.4" - "@ethersproject/hash" "^5.0.4" - "@ethersproject/keccak256" "^5.0.3" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/properties" "^5.0.3" - "@ethersproject/strings" "^5.0.4" - -"@ethersproject/abi@^5.0.2": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.1.1.tgz#79525f582338d98660ac709c65b44c3c081ed2fc" - integrity sha512-UNmhRL4ngm1nCWvhJWRd55PvP1JWojGD4BR63JxyiiWZQAszYzaHHeYdRcj+NY3S0kV6SmAS2dZWSBOZPnXbSw== - dependencies: - "@ethersproject/address" "^5.1.0" - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/constants" "^5.1.0" - "@ethersproject/hash" "^5.1.0" - "@ethersproject/keccak256" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/strings" "^5.1.0" - -"@ethersproject/abstract-provider@5.0.7", "@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-provider@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.1.0.tgz#1f24c56cda5524ef4ed3cfc562a01d6b6f8eeb0b" - integrity sha512-8dJUnT8VNvPwWhYIau4dwp7qe1g+KgdRm4XTWvjkI9gAT2zZa90WF5ApdZ3vl1r6NDmnn6vUVvyphClRZRteTQ== - dependencies: - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/networks" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/transactions" "^5.1.0" - "@ethersproject/web" "^5.1.0" - -"@ethersproject/abstract-signer@5.0.9", "@ethersproject/abstract-signer@^5.0.4", "@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/abstract-signer@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.1.0.tgz#744c7a2d0ebe3cc0bc38294d0f53d5ca3f4e49e3" - integrity sha512-qQDMkjGZSSJSKl6AnfTgmz9FSnzq3iEoEbHTYwjDlEAv+LNP7zd4ixCcVWlWyk+2siud856M5CRhAmPdupeN9w== - dependencies: - "@ethersproject/abstract-provider" "^5.1.0" - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - -"@ethersproject/address@5.0.8", "@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/address@^5.0.2", "@ethersproject/address@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.1.0.tgz#3854fd7ebcb6af7597de66f847c3345dae735b58" - integrity sha512-rfWQR12eHn2cpstCFS4RF7oGjfbkZb0oqep+BfrT+gWEGWG2IowJvIsacPOvzyS1jhNF4MQ4BS59B04Mbovteg== - dependencies: - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/keccak256" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/rlp" "^5.1.0" - -"@ethersproject/base64@5.0.6", "@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/base64@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.1.0.tgz#27240c174d0a4e13f6eae87416fd876caf7f42b6" - integrity sha512-npD1bLvK4Bcxz+m4EMkx+F8Rd7CnqS9DYnhNu0/GlQBXhWjvfoAZzk5HJ0f1qeyp8d+A86PTuzLOGOXf4/CN8g== - dependencies: - "@ethersproject/bytes" "^5.1.0" - -"@ethersproject/basex@5.0.6", "@ethersproject/basex@^5.0.3": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.0.6.tgz#ab95c32e48288a3d868726463506641cb1e9fb6b" - integrity sha512-Y/8dowRxBF3bsKkqEp7XN4kcFFQ0o5xxP1YyopfqkXejaOEGiD7ToQdQ0pIZpAJ5GreW56oFOTDDSO6ZcUCNYg== - dependencies: - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/properties" "^5.0.3" - -"@ethersproject/bignumber@5.0.12", "@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/bignumber@^5.1.0": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.1.1.tgz#84812695253ccbc639117f7ac49ee1529b68e637" - integrity sha512-AVz5iqz7+70RIqoQTznsdJ6DOVBYciNlvO+AlQmPTB6ofCvoihI9bQdr6wljsX+d5W7Yc4nyvQvP4JMzg0Agig== - dependencies: - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - bn.js "^4.4.0" - -"@ethersproject/bytes@5.0.8", "@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/bytes@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.1.0.tgz#55dfa9c4c21df1b1b538be3accb50fb76d5facfd" - integrity sha512-sGTxb+LVjFxJcJeUswAIK6ncgOrh3D8c192iEJd7mLr95V6du119rRfYT/b87WPkZ5I3gRBUYIYXtdgCWACe8g== - dependencies: - "@ethersproject/logger" "^5.1.0" - -"@ethersproject/constants@5.0.7", "@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/constants@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.1.0.tgz#4e7da6367ea0e9be87585d8b09f3fccf384b1452" - integrity sha512-0/SuHrxc8R8k+JiLmJymxHJbojUDWBQqO+b+XFdwaP0jGzqC09YDy/CAlSZB6qHsBifY8X3I89HcK/oMqxRdBw== - dependencies: - "@ethersproject/bignumber" "^5.1.0" - -"@ethersproject/contracts@5.0.8": - version "5.0.8" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.0.8.tgz#71d3ba16853a1555be2e161a6741df186f81c73b" - integrity sha512-PecBL4vnsrpuks2lzzkRsOts8csJy338HNDKDIivbFmx92BVzh3ohOOv3XsoYPSXIHQvobF959W+aSk3RCZL/g== - dependencies: - "@ethersproject/abi" "^5.0.5" - "@ethersproject/abstract-provider" "^5.0.4" - "@ethersproject/abstract-signer" "^5.0.4" - "@ethersproject/address" "^5.0.4" - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/constants" "^5.0.4" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/properties" "^5.0.3" - -"@ethersproject/hash@5.0.9", "@ethersproject/hash@>=5.0.0-beta.128", "@ethersproject/hash@^5.0.4": - 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/hash@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.1.0.tgz#40961d64837d57f580b7b055e0d74174876d891e" - integrity sha512-fNwry20yLLPpnRRwm3fBL+2ksgO+KMadxM44WJmRIoTKzy4269+rbq9KFoe2LTqq2CXJM2CE70beGaNrpuqflQ== - dependencies: - "@ethersproject/abstract-signer" "^5.1.0" - "@ethersproject/address" "^5.1.0" - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/keccak256" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/strings" "^5.1.0" - -"@ethersproject/hdnode@5.0.7", "@ethersproject/hdnode@^5.0.4": - version "5.0.7" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.0.7.tgz#c7bce94a337ea65e37c46bab09a83e1c1a555d99" - integrity sha512-89tphqlji4y/LNE1cSaMQ3hrBtJ4lO1qWGi2hn54LiHym85DTw+zAKbA8QgmdSdJDLGR/kc9VHaIPQ+vZQ2LkQ== - dependencies: - "@ethersproject/abstract-signer" "^5.0.4" - "@ethersproject/basex" "^5.0.3" - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/pbkdf2" "^5.0.3" - "@ethersproject/properties" "^5.0.3" - "@ethersproject/sha2" "^5.0.3" - "@ethersproject/signing-key" "^5.0.4" - "@ethersproject/strings" "^5.0.4" - "@ethersproject/transactions" "^5.0.5" - "@ethersproject/wordlists" "^5.0.4" - -"@ethersproject/json-wallets@5.0.9", "@ethersproject/json-wallets@^5.0.6": - version "5.0.9" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.0.9.tgz#2e1708c2854c4ab764e35920bd1f44c948b95434" - integrity sha512-EWuFvJd8nu90dkmJwmJddxOYCvFvMkKBsZi8rxTme2XEZsHKOFnybVkoL23u7ZtApuEfTKmVcR2PTwgZwqDsKw== - dependencies: - "@ethersproject/abstract-signer" "^5.0.4" - "@ethersproject/address" "^5.0.4" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/hdnode" "^5.0.4" - "@ethersproject/keccak256" "^5.0.3" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/pbkdf2" "^5.0.3" - "@ethersproject/properties" "^5.0.3" - "@ethersproject/random" "^5.0.3" - "@ethersproject/strings" "^5.0.4" - "@ethersproject/transactions" "^5.0.5" - aes-js "3.0.0" - scrypt-js "3.0.1" - -"@ethersproject/keccak256@5.0.6", "@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/keccak256@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.1.0.tgz#fdcd88fb13bfef4271b225cdd8dec4d315c8e60e" - integrity sha512-vrTB1W6AEYoadww5c9UyVJ2YcSiyIUTNDRccZIgwTmFFoSHwBtcvG1hqy9RzJ1T0bMdATbM9Hfx2mJ6H0i7Hig== - dependencies: - "@ethersproject/bytes" "^5.1.0" - js-sha3 "0.5.7" - -"@ethersproject/logger@5.0.8", "@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/logger@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.1.0.tgz#4cdeeefac029373349d5818f39c31b82cc6d9bbf" - integrity sha512-wtUaD1lBX10HBXjjKV9VHCBnTdUaKQnQ2XSET1ezglqLdPdllNOIlLfhyCRqXm5xwcjExVI5ETokOYfjPtaAlw== - -"@ethersproject/networks@5.0.6", "@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/networks@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.1.0.tgz#f537290cb05aa6dc5e81e910926c04cfd5814bca" - integrity sha512-A/NIrIED/G/IgU1XUukOA3WcFRxn2I4O5GxsYGA5nFlIi+UZWdGojs85I1VXkR1gX9eFnDXzjE6OtbgZHjFhIA== - dependencies: - "@ethersproject/logger" "^5.1.0" - -"@ethersproject/pbkdf2@5.0.6", "@ethersproject/pbkdf2@^5.0.3": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.0.6.tgz#105dbfb08cd5fcf33869b42bfdc35a3ebd978cbd" - integrity sha512-CUYciSxR/AaCoKMJk3WUW+BDhR41G3C+O9lOeZ4bR1wDhLKL2Z8p0ciF5XDEiVbmI4CToW6boVKybeVMdngRrg== - dependencies: - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/sha2" "^5.0.3" - -"@ethersproject/properties@5.0.6", "@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/properties@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.1.0.tgz#9484bd6def16595fc6e4bdc26f29dff4d3f6ac42" - integrity sha512-519KKTwgmH42AQL3+GFV3SX6khYEfHsvI6v8HYejlkigSDuqttdgVygFTDsGlofNFchhDwuclrxQnD5B0YLNMg== - dependencies: - "@ethersproject/logger" "^5.1.0" - -"@ethersproject/providers@5.0.17": - version "5.0.17" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.0.17.tgz#f380e7831149e24e7a1c6c9b5fb1d6dfc729d024" - integrity sha512-bJnvs5X7ttU5x2ekGJYG7R3Z+spZawLFfR0IDsbaMDLiCwZOyrgk+VTBU7amSFLT0WUhWFv8WwSUB+AryCQG1Q== - dependencies: - "@ethersproject/abstract-provider" "^5.0.4" - "@ethersproject/abstract-signer" "^5.0.4" - "@ethersproject/address" "^5.0.4" - "@ethersproject/basex" "^5.0.3" - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/constants" "^5.0.4" - "@ethersproject/hash" "^5.0.4" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/networks" "^5.0.3" - "@ethersproject/properties" "^5.0.3" - "@ethersproject/random" "^5.0.3" - "@ethersproject/rlp" "^5.0.3" - "@ethersproject/sha2" "^5.0.3" - "@ethersproject/strings" "^5.0.4" - "@ethersproject/transactions" "^5.0.5" - "@ethersproject/web" "^5.0.6" - bech32 "1.1.4" - ws "7.2.3" - -"@ethersproject/random@5.0.6", "@ethersproject/random@^5.0.3": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.0.6.tgz#9be80a1065f2b8e6f321dccb3ebeb4886cac9ea4" - integrity sha512-8nsVNaZvZ9OD5NXfzE4mmz8IH/1DYJbAR95xpRxZkIuNmfn6QlMp49ccJYZWGhs6m0Zj2+FXjx3pzXfYlo9/dA== - dependencies: - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/logger" "^5.0.5" - -"@ethersproject/rlp@5.0.6", "@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/rlp@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.1.0.tgz#700f4f071c27fa298d3c1d637485fefe919dd084" - integrity sha512-vDTyHIwNPrecy55gKGZ47eJZhBm8LLBxihzi5ou+zrSvYTpkSTWRcKUlXFDFQVwfWB+P5PGyERAdiDEI76clxw== - dependencies: - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - -"@ethersproject/sha2@5.0.6", "@ethersproject/sha2@^5.0.3": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.0.6.tgz#175116dc10b866a0a381f6316d094bcc510bee3c" - integrity sha512-30gypDLkfkP5gE3llqi0jEuRV8m4/nvzeqmqMxiihZ7veFQHqDaGpyFeHzFim+qGeH9fq0lgYjavLvwW69+Fkw== - dependencies: - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/logger" "^5.0.5" - hash.js "1.1.3" - -"@ethersproject/signing-key@5.0.7", "@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/signing-key@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.1.0.tgz#6eddfbddb6826b597b9650e01acf817bf8991b9c" - integrity sha512-tE5LFlbmdObG8bY04NpuwPWSRPgEswfxweAI1sH7TbP0ml1elNfqcq7ii/3AvIN05i5U0Pkm3Tf8bramt8MmLw== - dependencies: - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - bn.js "^4.4.0" - elliptic "6.5.4" - -"@ethersproject/solidity@5.0.7": - version "5.0.7" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.0.7.tgz#72a3455f47a454db2dcf363992d42e9045dc7fce" - integrity sha512-dUevKUZ06p/VMLP/+cz4QUV+lA17NixucDJfm0ioWF0B3R0Lf+6wqwPchcqiAXlxkNFGIax7WNLgGMh4CkQ8iw== - dependencies: - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/keccak256" "^5.0.3" - "@ethersproject/sha2" "^5.0.3" - "@ethersproject/strings" "^5.0.4" - -"@ethersproject/strings@5.0.7", "@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/strings@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.1.0.tgz#0f95a56c3c8c9d5510a06c241d818779750e2da5" - integrity sha512-perBZy0RrmmL0ejiFGUOlBVjMsUceqLut3OBP3zP96LhiJWWbS8u1NqQVgN4/Gyrbziuda66DxiQocXhsvx+Sw== - dependencies: - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/constants" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - -"@ethersproject/transactions@5.0.8", "@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/transactions@^5.1.0": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.1.1.tgz#5a6bbb25fb062c3cc75eb0db12faefcdd3870813" - integrity sha512-Nwgbp09ttIVN0OoUBatCXaHxR7grWPHbozJN8v7AXDLrl6nnOIBEMDh+yJTnosSQlFhcyjfTGGN+Mx6R8HdvMw== - dependencies: - "@ethersproject/address" "^5.1.0" - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/constants" "^5.1.0" - "@ethersproject/keccak256" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/rlp" "^5.1.0" - "@ethersproject/signing-key" "^5.1.0" - -"@ethersproject/units@5.0.8": - version "5.0.8" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.0.8.tgz#563325b20fe1eceff7b61857711d5e2b3f38fd09" - integrity sha512-3O4MaNHFs05vC5v2ZGqVFVWtO1WyqFejO78M7Qh16njo282aoMlENtVI6cn2B36zOLFXRvYt2pYx6xCG53qKzg== - dependencies: - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/constants" "^5.0.4" - "@ethersproject/logger" "^5.0.5" - -"@ethersproject/wallet@5.0.9": - version "5.0.9" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.0.9.tgz#976c7d950489c40308d676869d24e59ab7b82ad1" - integrity sha512-GfpQF56PO/945SJq7Wdg5F5U6wkxaDgkAzcgGbCW6Joz8oW8MzKItkvYCzMh+j/8gJMzFncsuqX4zg2gq3J6nQ== - dependencies: - "@ethersproject/abstract-provider" "^5.0.4" - "@ethersproject/abstract-signer" "^5.0.4" - "@ethersproject/address" "^5.0.4" - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/hash" "^5.0.4" - "@ethersproject/hdnode" "^5.0.4" - "@ethersproject/json-wallets" "^5.0.6" - "@ethersproject/keccak256" "^5.0.3" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/properties" "^5.0.3" - "@ethersproject/random" "^5.0.3" - "@ethersproject/signing-key" "^5.0.4" - "@ethersproject/transactions" "^5.0.5" - "@ethersproject/wordlists" "^5.0.4" - -"@ethersproject/web@5.0.11", "@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" - -"@ethersproject/web@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.1.0.tgz#ed56bbe4e3d9a8ffe3b2ed882da5c62d3551381b" - integrity sha512-LTeluWgTq04+RNqAkVhpydPcRZK/kKxD2Vy7PYGrAD27ABO9kTqTBKwiOuzTyAHKUQHfnvZbXmxBXJAGViSDcA== - dependencies: - "@ethersproject/base64" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/strings" "^5.1.0" - -"@ethersproject/wordlists@5.0.7", "@ethersproject/wordlists@^5.0.4": - version "5.0.7" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.0.7.tgz#4e5ad38cfbef746b196a3290c0d41696eb7ab468" - integrity sha512-ZjQtYxm41FmHfYgpkdQG++EDcBPQWv9O6FfP6NndYRVaXaQZh6eq3sy7HQP8zCZ8dznKgy6ZyKECS8qdvnGHwA== - dependencies: - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/hash" "^5.0.4" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/properties" "^5.0.3" - "@ethersproject/strings" "^5.0.4" - -"@jest/console@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.6.2.tgz#4e04bc464014358b03ab4937805ee36a0aeb98f2" - integrity sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g== - dependencies: - "@jest/types" "^26.6.2" - "@types/node" "*" - chalk "^4.0.0" - jest-message-util "^26.6.2" - jest-util "^26.6.2" - slash "^3.0.0" - -"@jest/test-result@^26.5.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.6.2.tgz#55da58b62df134576cc95476efa5f7949e3f5f18" - integrity sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ== - dependencies: - "@jest/console" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/istanbul-lib-coverage" "^2.0.0" - collect-v8-coverage "^1.0.0" - -"@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" - -"@nomiclabs/hardhat-ethers@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.2.tgz#c472abcba0c5185aaa4ad4070146e95213c68511" - integrity sha512-6quxWe8wwS4X5v3Au8q1jOvXYEPkS1Fh+cME5u6AwNdnI4uERvPlVjlgRWzpnb+Rrt1l/cEqiNRH9GlsBMSDQg== - -"@nomiclabs/hardhat-etherscan@^2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-2.1.1.tgz#186f3fa652a0ca20fb77aa857cfad2da845d5cbf" - integrity sha512-8TNUFsO5DpAfwNlXMDhcEtFAMOYsVNaQL2vq5vuCD45kUKBgL8H21++zOk231ha9D7LQWBMCIg7A7iPxw6Jwmg== - dependencies: - "@ethersproject/abi" "^5.0.2" - "@ethersproject/address" "^5.0.2" - cbor "^5.0.2" - debug "^4.1.1" - fs-extra "^7.0.1" - node-fetch "^2.6.0" - semver "^6.3.0" - -"@nomiclabs/hardhat-waffle@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.1.tgz#5d43654fba780720c5033dea240fe14f70ef4bd2" - integrity sha512-2YR2V5zTiztSH9n8BYWgtv3Q+EL0N5Ltm1PAr5z20uAY4SkkfylJ98CIqt18XFvxTD5x4K2wKBzddjV9ViDAZQ== - dependencies: - "@types/sinon-chai" "^3.2.3" - "@types/web3" "1.0.19" - -"@resolver-engine/core@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967" - integrity sha512-eB8nEbKDJJBi5p5SrvrvILn4a0h42bKtbCTri3ZxCGt6UvoQyp7HnGOfki944bUjBSHKK3RvgfViHn+kqdXtnQ== - dependencies: - debug "^3.1.0" - is-url "^1.2.4" - request "^2.85.0" - -"@resolver-engine/fs@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/fs/-/fs-0.3.3.tgz#fbf83fa0c4f60154a82c817d2fe3f3b0c049a973" - integrity sha512-wQ9RhPUcny02Wm0IuJwYMyAG8fXVeKdmhm8xizNByD4ryZlx6PP6kRen+t/haF43cMfmaV7T3Cx6ChOdHEhFUQ== - dependencies: - "@resolver-engine/core" "^0.3.3" - debug "^3.1.0" - -"@resolver-engine/imports-fs@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/imports-fs/-/imports-fs-0.3.3.tgz#4085db4b8d3c03feb7a425fbfcf5325c0d1e6c1b" - integrity sha512-7Pjg/ZAZtxpeyCFlZR5zqYkz+Wdo84ugB5LApwriT8XFeQoLwGUj4tZFFvvCuxaNCcqZzCYbonJgmGObYBzyCA== - dependencies: - "@resolver-engine/fs" "^0.3.3" - "@resolver-engine/imports" "^0.3.3" - debug "^3.1.0" - -"@resolver-engine/imports@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@resolver-engine/imports/-/imports-0.3.3.tgz#badfb513bb3ff3c1ee9fd56073e3144245588bcc" - integrity sha512-anHpS4wN4sRMwsAbMXhMfOD/y4a4Oo0Cw/5+rue7hSwGWsDOQaAU1ClK1OxjUC35/peazxEl8JaSRRS+Xb8t3Q== - dependencies: - "@resolver-engine/core" "^0.3.3" - debug "^3.1.0" - hosted-git-info "^2.6.0" - path-browserify "^1.0.0" - url "^0.11.0" - -"@sentry/core@5.29.2": - version "5.29.2" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.29.2.tgz#9e05fe197234161d57aabaf52fab336a7c520d81" - integrity sha512-7WYkoxB5IdlNEbwOwqSU64erUKH4laavPsM0/yQ+jojM76ErxlgEF0u//p5WaLPRzh3iDSt6BH+9TL45oNZeZw== - dependencies: - "@sentry/hub" "5.29.2" - "@sentry/minimal" "5.29.2" - "@sentry/types" "5.29.2" - "@sentry/utils" "5.29.2" - tslib "^1.9.3" - -"@sentry/hub@5.29.2": - version "5.29.2" - resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.29.2.tgz#208f10fe6674695575ad74182a1151f71d6df00a" - integrity sha512-LaAIo2hwUk9ykeh9RF0cwLy6IRw+DjEee8l1HfEaDFUM6TPGlNNGObMJNXb9/95jzWp7jWwOpQjoIE3jepdQJQ== - dependencies: - "@sentry/types" "5.29.2" - "@sentry/utils" "5.29.2" - tslib "^1.9.3" - -"@sentry/minimal@5.29.2": - version "5.29.2" - resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.29.2.tgz#420bebac8d03d30980fdb05c72d7b253d8aa541b" - integrity sha512-0aINSm8fGA1KyM7PavOBe1GDZDxrvnKt+oFnU0L+bTcw8Lr+of+v6Kwd97rkLRNOLw621xP076dL/7LSIzMuhw== - dependencies: - "@sentry/hub" "5.29.2" - "@sentry/types" "5.29.2" - tslib "^1.9.3" - -"@sentry/node@^5.18.1": - version "5.29.2" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.29.2.tgz#f0f0b4b2be63c9ddd702729fab998cead271dff1" - integrity sha512-98m1ZejmJgA+eiz6jEFyYYfp6kJZQnx6d6KrJDMxGfss4YTmmJY57bE4xStnjjk7WINDGzlCiHuk+wJFMBjuoA== - dependencies: - "@sentry/core" "5.29.2" - "@sentry/hub" "5.29.2" - "@sentry/tracing" "5.29.2" - "@sentry/types" "5.29.2" - "@sentry/utils" "5.29.2" - cookie "^0.4.1" - https-proxy-agent "^5.0.0" - lru_map "^0.3.3" - tslib "^1.9.3" - -"@sentry/tracing@5.29.2": - version "5.29.2" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.29.2.tgz#6012788547d2ab7893799d82c4941bda145dcd47" - integrity sha512-iumYbVRpvoU3BUuIooxibydeaOOjl5ysc+mzsqhRs2NGW/C3uKAsFXdvyNfqt3bxtRQwJEhwJByLP2u3pLThpw== - dependencies: - "@sentry/hub" "5.29.2" - "@sentry/minimal" "5.29.2" - "@sentry/types" "5.29.2" - "@sentry/utils" "5.29.2" - tslib "^1.9.3" - -"@sentry/types@5.29.2": - version "5.29.2" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.29.2.tgz#ac87383df1222c2d9b9f8f9ed7a6b86ea41a098a" - integrity sha512-dM9wgt8wy4WRty75QkqQgrw9FV9F+BOMfmc0iaX13Qos7i6Qs2Q0dxtJ83SoR4YGtW8URaHzlDtWlGs5egBiMA== - -"@sentry/utils@5.29.2": - version "5.29.2" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.29.2.tgz#99a5cdda2ea19d34a41932f138d470adcb3ee673" - integrity sha512-nEwQIDjtFkeE4k6yIk4Ka5XjGRklNLThWLs2xfXlL7uwrYOH2B9UBBOOIRUraBm/g/Xrra3xsam/kRxuiwtXZQ== - dependencies: - "@sentry/types" "5.29.2" - tslib "^1.9.3" - -"@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== - -"@solidity-parser/parser@^0.10.1": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.10.1.tgz#d3680d1ebebed21eee67f58a41eb92175204f0c7" - integrity sha512-tHDPCRMEBFDxBz5rioQRoKgOQGa/K2digdfR68cd5vO6IufAqoNt1sfjssQDf2KPqHPftICBQOqlcu0w5/Jisg== - -"@solidity-parser/parser@^0.11.0": - version "0.11.1" - resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.11.1.tgz#fa840af64840c930f24a9c82c08d4a092a068add" - integrity sha512-H8BSBoKE8EubJa0ONqecA2TviT3TnHeC4NpgnAHSUiuhZoQBfPB4L2P9bs8R6AoTW10Endvh3vc+fomVMIDIYQ== - -"@solidity-parser/parser@^0.8.2": - version "0.8.2" - resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.8.2.tgz#a6a5e93ac8dca6884a99a532f133beba59b87b69" - integrity sha512-8LySx3qrNXPgB5JiULfG10O3V7QTxI/TLzSw5hFQhXWSkVxZBAv4rZQ0sYgLEbc8g3L2lmnujj1hKul38Eu5NQ== - -"@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" - -"@typechain/ethers-v5@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-4.0.0.tgz#2a8be5e108d23f3b8e6354d1618fdc2abcb00b07" - integrity sha512-Rw4WHPIuwTXWcHfmn9ICQISQhmJa6Ug5IjqPYLpsKqlED2L4W2JgQ6S9hYt4IKVmT//1yxIxD+iaa5tSQEEx1A== - -"@types/abstract-leveldown@*": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@types/abstract-leveldown/-/abstract-leveldown-5.0.1.tgz#3c7750d0186b954c7f2d2f6acc8c3c7ba0c3412e" - integrity sha512-wYxU3kp5zItbxKmeRYCEplS2MW7DzyBnxPGj+GJVHZEUZiK/nn5Ei1sUFgURDh+X051+zsGe28iud3oHjrYWQQ== - -"@types/babel__traverse@^7.0.4": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.11.0.tgz#b9a1efa635201ba9bc850323a8793ee2d36c04a0" - integrity sha512-kSjgDMZONiIfSH1Nxcr5JIRMwUetDki63FSQfpTCz8ogF3Ulqm8+mr5f78dUYs6vMiB6gBusQqfQmBvHZj/lwg== - dependencies: - "@babel/types" "^7.3.0" - -"@types/bn.js@*", "@types/bn.js@^4.11.3", "@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/bn.js@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" - integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== - dependencies: - "@types/node" "*" - -"@types/chai@*", "@types/chai@^4.2.6": - 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/graceful-fs@^4.1.2": - version "4.1.4" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.4.tgz#4ff9f641a7c6d1a3508ff88bc3141b152772e753" - integrity sha512-mWA/4zFQhfvOA8zWkXobwJvBD7vzcxgrOQ0J5CH1votGqdq9m7+FwtGaqyCZqC3NyyBkc9z4m+iry4LlqcMWJg== - dependencies: - "@types/node" "*" - -"@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/levelup@^4.3.0": - version "4.3.1" - resolved "https://registry.yarnpkg.com/@types/levelup/-/levelup-4.3.1.tgz#7a53b9fd510716e11b2065332790fdf5f9b950b9" - integrity sha512-n//PeTpbHLjMLTIgW5B/g06W/6iuTBHuvUka2nFL9APMSVMNe2r4enADfu3CIE9IyV9E+uquf9OEQQqrDeg24A== - dependencies: - "@types/abstract-leveldown" "*" - "@types/node" "*" - -"@types/lru-cache@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.0.tgz#57f228f2b80c046b4a1bd5cac031f81f207f4f03" - integrity sha512-RaE0B+14ToE4l6UqdarKPnXwVDuigfFv+5j9Dze/Nqr23yyuqdNvzcZi3xB+3Agvi5R4EOgAksfv3lXX4vBt9w== - -"@types/mkdirp@^0.5.2": - version "0.5.2" - resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" - integrity sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg== - dependencies: - "@types/node" "*" - -"@types/mocha@^5.2.7": - version "5.2.7" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea" - integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ== - -"@types/node-fetch@^2.5.5": - version "2.5.7" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.7.tgz#20a2afffa882ab04d44ca786449a276f9f6bbf3c" - integrity sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - -"@types/node@*": - version "14.14.14" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.14.tgz#f7fd5f3cc8521301119f63910f0fb965c7d761ae" - integrity sha512-UHnOPWVWV1z+VV8k6L1HhG7UbGBgIdghqF3l9Ny9ApPghbjICXkUJSd/b9gOgQfjM1r+37cipdw/HJ3F6ICEnQ== - -"@types/node@^12.12.6": - version "12.19.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.9.tgz#990ad687ad8b26ef6dcc34a4f69c33d40c95b679" - integrity sha512-yj0DOaQeUrk3nJ0bd3Y5PeDRJ6W0r+kilosLA+dzF3dola/o9hxhMSg2sFvVcA2UHS5JSOsZp4S0c1OEXc4m1Q== - -"@types/normalize-package-data@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" - integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== - -"@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/prettier@^2.0.0", "@types/prettier@^2.1.1": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.1.5.tgz#b6ab3bba29e16b821d84e09ecfaded462b816b00" - integrity sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ== - -"@types/resolve@^0.0.8": - version "0.0.8" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" - integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== - 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/sinon-chai@^3.2.3": - version "3.2.5" - resolved "https://registry.yarnpkg.com/@types/sinon-chai/-/sinon-chai-3.2.5.tgz#df21ae57b10757da0b26f512145c065f2ad45c48" - integrity sha512-bKQqIpew7mmIGNRlxW6Zli/QVyc3zikpGzCa797B/tRnD9OtHvZ/ts8sYXV+Ilj9u3QRaUEM8xrjgd1gwm1BpQ== - dependencies: - "@types/chai" "*" - "@types/sinon" "*" - -"@types/sinon@*": - version "9.0.10" - resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-9.0.10.tgz#7fb9bcb6794262482859cab66d59132fca18fcf7" - integrity sha512-/faDC0erR06wMdybwI/uR8wEKV/E83T0k4sepIpB7gXuy2gzx2xiOjmztq6a2Y6rIGJ04D+6UU0VBmWy+4HEMA== - dependencies: - "@types/sinonjs__fake-timers" "*" - -"@types/sinonjs__fake-timers@*": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.2.tgz#3a84cf5ec3249439015e14049bd3161419bf9eae" - integrity sha512-dIPoZ3g5gcx9zZEszaxLSVTvMReD3xxyyDnQUjA6IYDG9Ba2AV0otMPs+77sG9ojB4Qr2N2Vk5RnKeuA0X/0bg== - -"@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/underscore@*": - version "1.10.24" - resolved "https://registry.yarnpkg.com/@types/underscore/-/underscore-1.10.24.tgz#dede004deed3b3f99c4db0bdb9ee21cae25befdd" - integrity sha512-T3NQD8hXNW2sRsSbLNjF/aBo18MyJlbw0lSpQHB/eZZtScPdexN4HSa8cByYwTw9Wy7KuOFr81mlDQcQQaZ79w== - -"@types/web3@1.0.19": - version "1.0.19" - resolved "https://registry.yarnpkg.com/@types/web3/-/web3-1.0.19.tgz#46b85d91d398ded9ab7c85a5dd57cb33ac558924" - integrity sha512-fhZ9DyvDYDwHZUp5/STa9XW2re0E8GxoioYJ4pEUZ13YHpApSagixj7IAdoYH5uAK+UalGq6Ml8LYzmgRA/q+A== - dependencies: - "@types/bn.js" "*" - "@types/underscore" "*" - -"@types/yargs-parser@*": - version "20.2.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" - integrity sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA== - -"@types/yargs@^15.0.0": - version "15.0.12" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.12.tgz#6234ce3e3e3fa32c5db301a170f96a599c960d74" - integrity sha512-f+fD/fQAo3BCbCDlrUpznF1A5Zp9rB0noS5vnoormHSIPFKL0Z2DcUJ3Gxp5ytH4uLRNxy7AwYUC9exZzqGMAw== - dependencies: - "@types/yargs-parser" "*" - -"@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== - -abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - -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@^6.2.1: - version "6.3.0" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz#d25221d1e6612f820c35963ba4bd739928f6026a" - integrity sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ== - dependencies: - buffer "^5.5.0" - immediate "^3.2.3" - level-concat-iterator "~2.0.0" - level-supports "~1.0.0" - 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" - -abstract-leveldown@~6.2.1: - version "6.2.3" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz#036543d87e3710f2528e47040bc3261b77a9a8eb" - integrity sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ== - dependencies: - buffer "^5.5.0" - immediate "^3.2.3" - level-concat-iterator "~2.0.0" - level-supports "~1.0.0" - 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" - -acorn-jsx@^5.0.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" - integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== - -acorn@^6.0.7: - version "6.4.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" - integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== - -adm-zip@^0.4.16: - version "0.4.16" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" - integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== - -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== - -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -ajv@^6.10.2, ajv@^6.12.3, ajv@^6.6.1, ajv@^6.9.1: - 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@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-escapes@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - -ansi-escapes@^4.3.0: - version "4.3.1" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" - integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA== - dependencies: - type-fest "^0.11.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" - -antlr4@4.7.1: - version "4.7.1" - resolved "https://registry.yarnpkg.com/antlr4/-/antlr4-4.7.1.tgz#69984014f096e9e775f53dd9744bf994d8959773" - integrity sha512-haHyTW7Y9joE5MVs37P2lNYfU2RWBLfcRDD8OWldcdZm5TiCE91B5Xl1oWSwiDUSd4rlExpt2pu1fksYQjRBYQ== - -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.0.3, 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" - -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-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-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-back@^1.0.3, array-back@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/array-back/-/array-back-1.0.4.tgz#644ba7f095f7ffcf7c43b5f0dc39d3c1f03c063b" - integrity sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs= - dependencies: - typical "^2.6.0" - -array-back@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/array-back/-/array-back-2.0.0.tgz#6877471d51ecc9c9bfa6136fb6c7d5fe69748022" - integrity sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw== - dependencies: - typical "^2.6.1" - -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-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= - -ast-parents@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/ast-parents/-/ast-parents-0.0.1.tgz#508fd0f05d0c48775d9eccda2e174423261e8dd3" - integrity sha1-UI/Q8F0MSHddnszaLhdEIyYejdM= - -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - -async-eventemitter@^0.2.2, async-eventemitter@^0.2.4: - 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@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== - -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" - -bech32@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" - integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== - -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@^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== - -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" - -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, bluebird@^3.5.2: - 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.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: - 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, brorand@^1.1.0: - 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.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" - -bser@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" - integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== - dependencies: - node-int64 "^0.4.0" - -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" - -call-bind@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -caller-callsite@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" - integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= - dependencies: - callsites "^2.0.0" - -caller-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" - integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= - dependencies: - caller-callsite "^2.0.0" - -callsites@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" - integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -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.30001170" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001170.tgz#0088bfecc6a14694969e391cc29d7eb6362ca6a7" - integrity sha512-Dd4d/+0tsK0UNLrZs3CvNukqalnVTRrxb5mcQm8rHL49t7V5ZaTygwXkrq+FB+dVDf++4ri8eJnFEJAB8332PA== - -capture-exit@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" - integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== - dependencies: - rsvp "^4.8.4" - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - -cbor@^5.0.2: - version "5.2.0" - resolved "https://registry.yarnpkg.com/cbor/-/cbor-5.2.0.tgz#4cca67783ccd6de7b50ab4ed62636712f287a67c" - integrity sha512-5IMhi9e1QU76ppa5/ajP1BmMWZ2FHkhAhjeVKQ/EFCgYSEaeVaoGtL7cxJskf9oCCk+XjzaIdc3IuU/dbA/o2A== - dependencies: - bignumber.js "^9.0.1" - nofilter "^1.0.4" - -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.0.1, chalk@^2.1.0, chalk@^2.4.1, 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, chalk@^4.1.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" - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -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@^3.4.0: - version "3.4.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" - integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== - 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.5.0" - optionalDependencies: - fsevents "~2.1.2" - -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" - -cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= - dependencies: - restore-cursor "^2.0.0" - -cli-width@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" - integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== - -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" - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -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@2.1.2, clone@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= - -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= - -collect-v8-coverage@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" - integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== - -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== - -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" - -command-exists@^1.2.8: - version "1.2.9" - resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" - integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== - -command-line-args@^4.0.7: - version "4.0.7" - resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-4.0.7.tgz#f8d1916ecb90e9e121eda6428e41300bfb64cc46" - integrity sha512-aUdPvQRAyBvQd2n7jXcsMDz68ckBJELXNzBybCHOibUWEg0mWTnaYCSRU8h9R+aNRSvDihJtssSRCiDRpLaezA== - dependencies: - array-back "^2.0.0" - find-replace "^1.0.3" - typical "^2.6.1" - -commander@2.18.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" - integrity sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ== - -commander@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" - integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== - -component-emitter@^1.2.1: - 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: - 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.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== - -cookie@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" - integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== - -cookiejar@^2.1.1: - 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= - -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" - -cosmiconfig@^5.0.7: - version "5.2.1" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" - integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== - dependencies: - import-fresh "^2.0.0" - is-directory "^0.3.1" - js-yaml "^3.13.1" - parse-json "^4.0.0" - -crc-32@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.0.tgz#cb2db6e29b88508e32d9dd0ec1693e7b41a18208" - integrity sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA== - dependencies: - exit-on-epipe "~1.0.1" - printj "~1.1.0" - -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" - -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" - -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.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, debug@^4.0.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" - -debug@^3.1.0: - version "3.2.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" - integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== - dependencies: - ms "^2.1.1" - -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= - -decimal.js@^10.2.1: - version "10.2.1" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" - integrity sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw== - -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" - -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" - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= - -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" - -deferred-leveldown@~5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz#27a997ad95408b61161aa69bd489b86c71b78058" - integrity sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw== - dependencies: - abstract-leveldown "~6.2.1" - 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-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" - -dir-to-object@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/dir-to-object/-/dir-to-object-2.0.0.tgz#29723e9bd1c3e58e4f307bd04ff634c0370c8f8a" - integrity sha512-sXs0JKIhymON7T1UZuO2Ud6VTNAx/VTBXIl4+3mjb2RgfOpt+hectX0x04YqPOPdkeOAKoJuKqwqnXXURNPNEA== - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -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== - -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" - -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= - -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.633" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.633.tgz#16dd5aec9de03894e8d14a1db4cda8a369b9b7fe" - integrity sha512-bsVCsONiVX1abkWdH7KtpuDAhsQ3N3bjPYhROSAXE78roJKet0Y5wznA14JE9pzbwSZmSMAW6KiKYf1RvbTJkA== - -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" - -elliptic@6.5.4: - version "6.5.4" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - -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== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -emoji-regex@^9.0.0: - version "9.2.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.0.tgz#a26da8e832b16a9753309f25e35e3c0efb9a066a" - integrity sha512-DNc3KFPK18bPdElMJnf/Pkv5TXhxFU3YFDEuGLDRtPmV4rkmCjBkCSEp22u6rBHdSN9Vlp/GK7k98prmE1Jgug== - -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-down@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-6.3.0.tgz#b1c4eb0e1728c146ecaef8e32963c549e76d082b" - integrity sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw== - dependencies: - abstract-leveldown "^6.2.1" - inherits "^2.0.3" - level-codec "^9.0.0" - level-errors "^2.0.0" - -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.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" - -enquirer@^2.3.0: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - -env-paths@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.0.tgz#cdca557dc009152917d6166e2febe1f039685e43" - integrity sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA== - -errno@~0.1.1: - version "0.1.8" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" - integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A== - dependencies: - prr "~1.0.1" - -error-ex@^1.2.0, error-ex@^1.3.1: - 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-abstract@^1.18.0-next.2: - version "1.18.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0.tgz#ab80b359eecb7ede4c298000390bc5ac3ec7b5a4" - integrity sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw== - dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - get-intrinsic "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.2" - is-callable "^1.2.3" - is-negative-zero "^2.0.1" - is-regex "^1.1.2" - is-string "^1.0.5" - object-inspect "^1.9.0" - object-keys "^1.1.1" - object.assign "^4.1.2" - string.prototype.trimend "^1.0.4" - string.prototype.trimstart "^1.0.4" - unbox-primitive "^1.0.0" - -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.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.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" - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -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== - -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -eslint-scope@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" - integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-utils@^1.3.1: - version "1.4.3" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" - integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== - dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - -eslint@^5.6.0: - version "5.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" - integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== - dependencies: - "@babel/code-frame" "^7.0.0" - ajv "^6.9.1" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^4.0.1" - doctrine "^3.0.0" - eslint-scope "^4.0.3" - eslint-utils "^1.3.1" - eslint-visitor-keys "^1.0.0" - espree "^5.0.1" - esquery "^1.0.1" - esutils "^2.0.2" - file-entry-cache "^5.0.1" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.7.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - inquirer "^6.2.2" - js-yaml "^3.13.0" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.11" - minimatch "^3.0.4" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - progress "^2.0.0" - regexpp "^2.0.1" - semver "^5.5.1" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" - table "^5.2.3" - text-table "^0.2.0" - -espree@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" - integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== - dependencies: - acorn "^6.0.7" - acorn-jsx "^5.0.0" - eslint-visitor-keys "^1.0.0" - -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== - -esquery@^1.0.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" - integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== - -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, 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.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@^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, eth-sig-util@^2.5.2: - 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.2, 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" - -ethereum-waffle@^3.0.2: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-3.2.1.tgz#9d6d6b93484c5e1b77dfdeb646c050ed877e836e" - integrity sha512-Fhg7BaBuV+Xo5XT+NEC3UTKGunvpq+iQPglZbIAJF6ZcwQwkiKfJUDuB0ZSkg5ntbRS4gpahfoXj1nTzdtx8UA== - dependencies: - "@ethereum-waffle/chai" "^3.2.1" - "@ethereum-waffle/compiler" "^3.2.1" - "@ethereum-waffle/mock-contract" "^3.2.1" - "@ethereum-waffle/provider" "^3.2.1" - ethers "^5.0.1" - -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.8, ethereumjs-abi@^0.6.8: - version "0.6.8" - resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" - integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== - dependencies: - bn.js "^4.11.8" - ethereumjs-util "^6.0.0" - -"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.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.10, ethereumjs-util@^7.0.7, ethereumjs-util@^7.0.8, ethereumjs-util@^7.0.9: - version "7.0.10" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.10.tgz#5fb7b69fa1fda0acc59634cf39d6b0291180fc1f" - integrity sha512-c/xThw6A+EAnej5Xk5kOzFzyoSnw0WX0tSlZ6pAsfGVvQj3TItaDg9b1+Fz1RJXA+y2YksKwQnuzgt1eY6LKzw== - dependencies: - "@types/bn.js" "^5.1.0" - 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-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.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.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@^5.0.0, ethers@^5.0.1, ethers@^5.0.8: - version "5.0.24" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.0.24.tgz#fbb8e4d35070d134f2eb846c07500b8c0eaef6d3" - integrity sha512-77CEtVC88fJGEhxGXRvQqAEH6e2A+ZFiv2FBT6ikXndlty5sw6vMatAhg1v+w3CaaGZOf1CP81jl4Mc8Zrj08A== - dependencies: - "@ethersproject/abi" "5.0.9" - "@ethersproject/abstract-provider" "5.0.7" - "@ethersproject/abstract-signer" "5.0.9" - "@ethersproject/address" "5.0.8" - "@ethersproject/base64" "5.0.6" - "@ethersproject/basex" "5.0.6" - "@ethersproject/bignumber" "5.0.12" - "@ethersproject/bytes" "5.0.8" - "@ethersproject/constants" "5.0.7" - "@ethersproject/contracts" "5.0.8" - "@ethersproject/hash" "5.0.9" - "@ethersproject/hdnode" "5.0.7" - "@ethersproject/json-wallets" "5.0.9" - "@ethersproject/keccak256" "5.0.6" - "@ethersproject/logger" "5.0.8" - "@ethersproject/networks" "5.0.6" - "@ethersproject/pbkdf2" "5.0.6" - "@ethersproject/properties" "5.0.6" - "@ethersproject/providers" "5.0.17" - "@ethersproject/random" "5.0.6" - "@ethersproject/rlp" "5.0.6" - "@ethersproject/sha2" "5.0.6" - "@ethersproject/signing-key" "5.0.7" - "@ethersproject/solidity" "5.0.7" - "@ethersproject/strings" "5.0.7" - "@ethersproject/transactions" "5.0.8" - "@ethersproject/units" "5.0.8" - "@ethersproject/wallet" "5.0.9" - "@ethersproject/web" "5.0.11" - "@ethersproject/wordlists" "5.0.7" - -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" - -event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - -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" - -exec-sh@^0.3.2: - version "0.3.4" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.4.tgz#3a018ceb526cc6f6df2bb504b2bfe8e3a4934ec5" - integrity sha512-sEFIkc61v75sWeOe72qyrqg2Qg0OuLESziUDk/O/z2qgS15y2gWVFrI6f2Qn/qw/0/NCfCEsmNA4zOjkwEZT1A== - -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" - -exit-on-epipe@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692" - integrity sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw== - -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" - -expect@^26.6.2: - 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.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -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" - -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-diff@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" - integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== - -fast-json-stable-stringify@^2.0.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@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - -fb-watchman@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" - integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== - dependencies: - bser "2.1.1" - -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" - -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= - dependencies: - escape-string-regexp "^1.0.5" - -file-entry-cache@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" - integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== - dependencies: - flat-cache "^2.0.1" - -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-package-json@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/find-package-json/-/find-package-json-1.2.0.tgz#4057d1b943f82d8445fe52dc9cf456f6b8b58083" - integrity sha512-+SOGcLGYDJHtyqHd87ysBhmaeQ95oWspDKnMXBrnQ9Eq4OkLNqejgoaD8xVWu6GPa0B6roa6KinCMEMcVeqONw== - -find-replace@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-1.0.3.tgz#b88e7364d2d9c959559f388c66670d6130441fa0" - integrity sha1-uI5zZNLZyVlVnziMZmcNYTBEH6A= - dependencies: - array-back "^1.0.4" - test-value "^2.1.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-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= - dependencies: - locate-path "^2.0.0" - -find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.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" - -flat-cache@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" - integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== - dependencies: - flatted "^2.0.0" - rimraf "2.6.3" - write "1.0.3" - -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" - -flatted@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" - integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== - -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= - -follow-redirects@^1.12.1: - version "1.13.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.1.tgz#5f69b813376cee4fd0474a3aba835df04ab763b7" - integrity sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg== - -for-each@^0.3.3, 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.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -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" - -forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= - -fp-ts@1.19.3: - version "1.19.3" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" - integrity sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg== - -fp-ts@^1.0.0: - version "1.19.5" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" - integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== - -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-extra@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - path-is-absolute "^1.0.0" - rimraf "^2.2.8" - -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.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.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@^2.1.2: - version "2.2.1" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.2.1.tgz#1fb02ded2036a8ac288d507a65962bd87b97628d" - integrity sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA== - -fsevents@~2.1.1, fsevents@~2.1.2: - 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-core@^2.10.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, get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-func-name@^2.0.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.2" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.2.tgz#6820da226e50b24894e08859469dc68361545d49" - integrity sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -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@~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@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.2, 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@~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@^11.7.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -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== - -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.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, 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== - -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" - -hardhat-typechain@^0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/hardhat-typechain/-/hardhat-typechain-0.3.5.tgz#8e50616a9da348b33bd001168c8fda9c66b7b4af" - integrity sha512-w9lm8sxqTJACY+V7vijiH+NkPExnmtiQEjsV9JKD1KgMdVk2q8y+RhvU/c4B7+7b1+HylRUCxpOIvFuB3rE4+w== - -hardhat@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.2.0.tgz#7d569d29678e5f786a228390b4c0b0cc9fd8ae32" - integrity sha512-3g0qFoQTkR4gfcHDZr59vPfbSH2PiAyxzYblkAAHUNTPBadO5W26z5RWzDv6/lRu8SqZZ9/8AdGZX4IZEa8EDg== - dependencies: - "@ethereumjs/block" "^3.2.1" - "@ethereumjs/blockchain" "^5.2.1" - "@ethereumjs/common" "^2.2.0" - "@ethereumjs/tx" "^3.1.3" - "@ethereumjs/vm" "^5.3.2" - "@sentry/node" "^5.18.1" - "@solidity-parser/parser" "^0.11.0" - "@types/bn.js" "^5.1.0" - "@types/lru-cache" "^5.1.0" - abort-controller "^3.0.0" - adm-zip "^0.4.16" - ansi-escapes "^4.3.0" - chalk "^2.4.2" - chokidar "^3.4.0" - ci-info "^2.0.0" - debug "^4.1.1" - enquirer "^2.3.0" - env-paths "^2.2.0" - eth-sig-util "^2.5.2" - ethereum-cryptography "^0.1.2" - ethereumjs-abi "^0.6.8" - ethereumjs-util "^7.0.10" - find-up "^2.1.0" - fp-ts "1.19.3" - fs-extra "^7.0.1" - glob "^7.1.3" - immutable "^4.0.0-rc.12" - io-ts "1.10.4" - lodash "^4.17.11" - merkle-patricia-tree "^4.1.0" - mnemonist "^0.38.0" - mocha "^7.1.2" - node-fetch "^2.6.0" - qs "^6.7.0" - raw-body "^2.4.1" - resolve "1.17.0" - semver "^6.3.0" - slash "^3.0.0" - solc "0.7.3" - source-map-support "^0.5.13" - stacktrace-parser "^0.1.10" - "true-case-path" "^2.2.1" - tsort "0.0.1" - uuid "^3.3.2" - ws "^7.2.1" - -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-bigints@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" - integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== - -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-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== - -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" - -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, hmac-drbg@^1.0.1: - 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" - -hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: - 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.3, 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" - -https-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== - dependencies: - agent-base "6" - debug "4" - -iconv-lite@0.4.24, 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== - -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -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= - -immutable@^4.0.0-rc.12: - version "4.0.0-rc.12" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.0.0-rc.12.tgz#ca59a7e4c19ae8d9bf74a97bdf0f6e2f2a5d0217" - integrity sha512-0M2XxkZLx/mi3t8NVwIm1g8nHoEmM9p9UBl/G9k4+hm0kBgOVdMV/B3CY5dQ8qG8qc80NN4gDV4HQv6FTJ5q7A== - -import-fresh@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" - integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= - dependencies: - caller-path "^2.0.0" - resolve-from "^3.0.0" - -import-fresh@^3.0.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -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= - -inquirer@^6.2.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" - integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== - dependencies: - ansi-escapes "^3.2.0" - chalk "^2.4.2" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^2.0.0" - lodash "^4.17.12" - mute-stream "0.0.7" - run-async "^2.2.0" - rxjs "^6.4.0" - string-width "^2.1.0" - strip-ansi "^5.1.0" - through "^2.3.6" - -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= - -io-ts@1.10.4: - version "1.10.4" - resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" - integrity sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g== - dependencies: - fp-ts "^1.0.0" - -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-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-bigint@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.1.tgz#6923051dfcbc764278540b9ce0e6b3213aa5ebc2" - integrity sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg== - -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-boolean-object@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.0.tgz#e2aaad3a3a8fca34c28f6eee135b156ed2587ff0" - integrity sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA== - dependencies: - call-bind "^1.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-callable@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" - integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== - -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-directory@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" - integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= - -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.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-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-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@^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-negative-zero@^2.0.0, is-negative-zero@^2.0.1: - 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-object@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197" - integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw== - -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@^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.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.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.2.tgz#81c8ebde4db142f2cf1c53fc86d6a45788266251" - integrity sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg== - dependencies: - call-bind "^1.0.2" - 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-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-string@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" - integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== - -is-symbol@^1.0.2, is-symbol@^1.0.3: - 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-url@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" - integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww== - -is-utf8@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= - -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-haste-map@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.6.2.tgz#dd7e60fe7dc0e9f911a23d79c5ff7fb5c2cafeaa" - integrity sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w== - dependencies: - "@jest/types" "^26.6.2" - "@types/graceful-fs" "^4.1.2" - "@types/node" "*" - anymatch "^3.0.3" - fb-watchman "^2.0.0" - graceful-fs "^4.2.4" - jest-regex-util "^26.0.0" - jest-serializer "^26.6.2" - jest-util "^26.6.2" - jest-worker "^26.6.2" - micromatch "^4.0.2" - sane "^4.0.3" - walker "^1.0.7" - optionalDependencies: - fsevents "^2.1.2" - -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-pnp-resolver@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" - integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== - -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== - -jest-resolve@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.6.2.tgz#a3ab1517217f469b504f1b56603c5bb541fbb507" - integrity sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ== - dependencies: - "@jest/types" "^26.6.2" - chalk "^4.0.0" - graceful-fs "^4.2.4" - jest-pnp-resolver "^1.2.2" - jest-util "^26.6.2" - read-pkg-up "^7.0.1" - resolve "^1.18.1" - slash "^3.0.0" - -jest-serializer@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.6.2.tgz#d139aafd46957d3a448f3a6cdabe2919ba0742d1" - integrity sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g== - dependencies: - "@types/node" "*" - graceful-fs "^4.2.4" - -jest-snapshot@^26.5.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.6.2.tgz#f3b0af1acb223316850bd14e1beea9837fb39c84" - integrity sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og== - dependencies: - "@babel/types" "^7.0.0" - "@jest/types" "^26.6.2" - "@types/babel__traverse" "^7.0.4" - "@types/prettier" "^2.0.0" - chalk "^4.0.0" - expect "^26.6.2" - graceful-fs "^4.2.4" - jest-diff "^26.6.2" - jest-get-type "^26.3.0" - jest-haste-map "^26.6.2" - jest-matcher-utils "^26.6.2" - jest-message-util "^26.6.2" - jest-resolve "^26.6.2" - natural-compare "^1.4.0" - pretty-format "^26.6.2" - semver "^7.3.2" - -jest-util@^26.5.2, jest-util@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" - integrity sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q== - dependencies: - "@jest/types" "^26.6.2" - "@types/node" "*" - chalk "^4.0.0" - graceful-fs "^4.2.4" - is-ci "^2.0.0" - micromatch "^4.0.2" - -jest-worker@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" - integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^7.0.0" - -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, 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" - -js-yaml@^3.12.0, js-yaml@^3.13.0, js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - 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-parse-better-errors@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -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@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= - optionalDependencies: - graceful-fs "^4.1.6" - -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" - -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" - -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: - 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" - -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= - optionalDependencies: - graceful-fs "^4.1.9" - -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" - -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-concat-iterator@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz#1d1009cf108340252cb38c51f9727311193e6263" - integrity sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw== - -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-iterator-stream@~4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz#7ceba69b713b0d7e22fcc0d1f128ccdc8a24f79c" - integrity sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q== - dependencies: - inherits "^2.0.4" - readable-stream "^3.4.0" - xtend "^4.0.2" - -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-mem@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/level-mem/-/level-mem-5.0.1.tgz#c345126b74f5b8aa376dc77d36813a177ef8251d" - integrity sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg== - dependencies: - level-packager "^5.0.3" - memdown "^5.0.0" - -level-packager@^5.0.3: - version "5.1.1" - resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-5.1.1.tgz#323ec842d6babe7336f70299c14df2e329c18939" - integrity sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ== - dependencies: - encoding-down "^6.3.0" - levelup "^4.3.2" - -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-supports@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-1.0.1.tgz#2f530a596834c7301622521988e2c36bb77d122d" - integrity sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg== - dependencies: - xtend "^4.0.2" - -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" - -level-ws@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-2.0.0.tgz#207a07bcd0164a0ec5d62c304b4615c54436d339" - integrity sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA== - dependencies: - inherits "^2.0.3" - readable-stream "^3.1.0" - 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" - -levelup@^4.3.2: - version "4.4.0" - resolved "https://registry.yarnpkg.com/levelup/-/levelup-4.4.0.tgz#f89da3a228c38deb49c48f88a70fb71f01cafed6" - integrity sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ== - dependencies: - deferred-leveldown "~5.3.0" - level-errors "~2.0.0" - level-iterator-stream "~4.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lines-and-columns@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" - integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= - -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@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= - dependencies: - p-locate "^2.0.0" - path-exists "^3.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" - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -lodash.assign@^4.0.3, lodash.assign@^4.0.6: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" - integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= - -lodash@4.17.20, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.4: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - -log-symbols@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== - dependencies: - chalk "^2.0.1" - -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" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -lru_map@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" - integrity sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0= - -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-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== - -makeerror@1.0.x: - version "1.0.11" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" - integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= - dependencies: - tmpl "1.0.x" - -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" - -mcl-wasm@^0.7.1: - version "0.7.6" - resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.6.tgz#c1789ebda5565d49b77d2ee195ff3e4d282f1554" - integrity sha512-cbRl3sUOkBeRY2hsM4t1EIln2TIdQBkSiTOqNTv/4Hu5KOECnMWCgjIf+a9Ebunyn22VKqkMF3zj6ejRzz7YBw== - -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= - -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@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/memdown/-/memdown-5.1.0.tgz#608e91a9f10f37f5b5fe767667a8674129a833cb" - integrity sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw== - dependencies: - abstract-leveldown "~6.2.1" - functional-red-black-tree "~1.0.1" - immediate "~3.2.3" - inherits "~2.0.1" - ltgt "~2.2.0" - safe-buffer "~5.2.0" - -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" - -memorystream@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" - integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= - -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= - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -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" - -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@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-4.1.0.tgz#010636c4cfd68682df33a2e3186b7d0be7b98b9d" - integrity sha512-vmP1J7FwIpprFMVjjSMM1JAwFce85Q+tp0TYIedYv8qaMh2oLUZ3ETXn9wbgi9S6elySzKzGa+Ai6VNKGEwSlg== - dependencies: - "@types/levelup" "^4.3.0" - ethereumjs-util "^7.0.8" - level-mem "^5.0.1" - level-ws "^2.0.0" - readable-stream "^3.6.0" - rlp "^2.2.3" - semaphore-async-await "^1.5.1" - -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.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== - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - -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@^1.1.1, 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.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.4.tgz#fd01504a6797ec5c9be81ff43d204961ed64a512" - integrity sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw== - dependencies: - minimist "^1.2.5" - -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" - -mnemonist@^0.38.0: - version "0.38.3" - resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.3.tgz#35ec79c1c1f4357cfda2fe264659c2775ccd7d9d" - integrity sha512-2K9QYubXx/NAjv4VLq1d1Ly8pWNC5L3BrixtdkyTegXWJIqY+zLNDhhX/A+ZwWt70tB1S8H4BE8FLYEFyNoOBw== - dependencies: - obliterator "^1.6.1" - -mocha-chai-jest-snapshot@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/mocha-chai-jest-snapshot/-/mocha-chai-jest-snapshot-1.1.1.tgz#7e49f20d0c12e6792d7f7da2e4ee0c38950571cc" - integrity sha512-52GyyqRD/cI8AIiMTQzizKmLeKQvZRBLwWOHwlwytUKPnWSNpRy1MkIcJIlgUrs5ocrjujOWwtKwyVkLWT/DFQ== - dependencies: - "@jest/test-result" "^26.5.2" - chalk "^4.1.0" - find-package-json "^1.2.0" - jest-snapshot "^26.5.2" - jest-util "^26.5.2" - slash "^3.0.0" - yargs "^16.0.3" - -mocha@^6.2.2: - version "6.2.3" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.2.3.tgz#e648432181d8b99393410212664450a4c1e31912" - integrity sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg== - dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - 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 "2.2.0" - minimatch "3.0.4" - mkdirp "0.5.4" - ms "2.1.1" - node-environment-flags "1.0.5" - 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" - -mocha@^7.1.2: - 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-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= - -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" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -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@^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.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.5.tgz#fa930275f5bf5dae188d6192b24b4c8bbac3d76a" - integrity sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" - -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@^2.6.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - -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== - -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= - -nofilter@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-1.0.4.tgz#78d6f4b6a613e7ced8b015cec534625f7667006e" - integrity sha512-N8lidFp+fCz+TD51+haYdbDGrcBWwuHX40F5+z0qkUjMJ5Tp+rdSuAkMJ9N9eoolDlEVTf6u5icM+cNKkKW2mA== - -normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: - 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== - -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.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, object-inspect@^1.9.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.1.1, object.assign@^4.1.2: - 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.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.getownpropertydescriptors@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" - integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - -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" - -obliterator@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-1.6.1.tgz#dea03e8ab821f6c4d96a299e17aef6a3af994ef3" - integrity sha512-9WXswnqINnnhOG/5SLimUlzuU1hFJUc8zkwyD59Sd+dPOMf05PmnYG/d6Q7HZ+KmgkZJa1PxRso6QdM3sTNHig== - -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.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= - dependencies: - mimic-fn "^1.0.0" - -optionator@^0.8.2: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - -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-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-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-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - -p-limit@^2.0.0, p-limit@^2.2.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@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= - dependencies: - p-limit "^1.1.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-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.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@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= - -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== - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -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-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-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - -parse-json@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.1.0.tgz#f96088cdf24a8faa9aea9a009f2d9d942c999646" - integrity sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -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-browserify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - -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-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0, 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-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - -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-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: - 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" - -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, picomatch@^2.2.1: - 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= - -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= - -postinstall-postinstall@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3" - integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ== - -precond@0.2: - version "0.2.3" - resolved "https://registry.yarnpkg.com/precond/-/precond-0.2.3.tgz#aa9591bcaa24923f1e0f4849d240f47efc1075ac" - integrity sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw= - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - -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= - -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - -prettier-plugin-solidity@^1.0.0-alpha.59: - version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.2.tgz#312a429cd0026b2cbdbe0ad8ef30c4f8db1f74b2" - integrity sha512-afn8Q0E0fY2I26fbagiBo1XRe7Cv/vs3t/N5Xbndzjgln+TXrtNxgWzhdZcFoZLN92WrFbxqqDoP6Lk5L80Fmw== - dependencies: - "@solidity-parser/parser" "^0.10.1" - dir-to-object "^2.0.0" - emoji-regex "^9.0.0" - escape-string-regexp "^4.0.0" - prettier "^2.0.5" - semver "^7.3.2" - solidity-comments-extractor "^0.0.4" - string-width "^4.2.0" - -prettier@^1.14.3: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== - -prettier@^2.0.5, prettier@^2.1.2: - version "2.2.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" - integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== - -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" - -printj@~1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/printj/-/printj-1.1.2.tgz#d90deb2975a8b9f600fb3a1c94e3f4c53c78a222" - integrity sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ== - -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: - 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= - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -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@^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" - -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= - -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.7.0: - 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" - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= - -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" - -raw-body@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c" - integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== - dependencies: - bytes "3.1.0" - http-errors "1.7.3" - 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-up@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" - integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== - dependencies: - find-up "^4.1.0" - read-pkg "^5.2.0" - type-fest "^0.8.1" - -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" - -read-pkg@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" - integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== - dependencies: - "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^2.5.0" - parse-json "^5.0.0" - type-fest "^0.6.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.5, readable-stream@^2.2.2, readable-stream@^2.2.8, readable-stream@^2.2.9, 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.1.0, 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@~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" - -readdirp@~3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" - integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== - dependencies: - picomatch "^2.2.1" - -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" - -regexpp@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== - -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-trailing-separator@^1.0.1: - 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" - -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-from-string@^1.1.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" - integrity sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg= - -require-from-string@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -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-from@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" - integrity sha1-six699nWiBvItuZTM17rywoYh0g= - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -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.17.0, 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" - -resolve@^1.10.0, resolve@^1.18.1, resolve@^1.8.1: - 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" - -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" - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - -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.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -rimraf@^2.2.8, 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" - -rsvp@^4.8.4: - version "4.8.5" - resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" - integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== - -run-async@^2.2.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" - integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - -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== - -rxjs@^6.4.0: - version "6.6.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" - integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== - 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== - -sane@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" - integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== - dependencies: - "@cnakazawa/watch" "^1.0.3" - anymatch "^2.0.0" - capture-exit "^2.0.0" - exec-sh "^0.3.2" - execa "^1.0.0" - fb-watchman "^2.0.0" - micromatch "^3.1.4" - minimist "^1.1.1" - walker "~1.0.5" - -scrypt-js@3.0.1, 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== - -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" - -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== - -semaphore-async-await@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz#857bef5e3644601ca4b9570b87e9df5ca12974fa" - integrity sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo= - -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@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.5.1, 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@^7.3.2: - version "7.3.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" - integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== - dependencies: - lru-cache "^6.0.0" - -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.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, signal-exit@^3.0.2: - 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== - -slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== - dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" - -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" - -solc@0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" - integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== - dependencies: - command-exists "^1.2.8" - commander "3.0.2" - follow-redirects "^1.12.1" - fs-extra "^0.30.0" - js-sha3 "0.8.0" - memorystream "^0.3.1" - require-from-string "^2.0.0" - semver "^5.5.0" - tmp "0.0.33" - -solc@^0.4.20: - version "0.4.26" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.26.tgz#5390a62a99f40806b86258c737c1cf653cc35cb5" - integrity sha512-o+c6FpkiHd+HPjmjEVpQgH7fqZ14tJpXhho+/bQXlXbliLIS/xjXb42Vxh+qQY1WCSTMQ0+a5vR9vi0MfhU6mA== - dependencies: - fs-extra "^0.30.0" - memorystream "^0.3.1" - require-from-string "^1.1.0" - semver "^5.3.0" - yargs "^4.7.1" - -solc@^0.6.3: - version "0.6.12" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.6.12.tgz#48ac854e0c729361b22a7483645077f58cba080e" - integrity sha512-Lm0Ql2G9Qc7yPP2Ba+WNmzw2jwsrd3u4PobHYlSOxaut3TtUbj9+5ZrT6f4DUpNPEoBaFUOEg9Op9C0mk7ge9g== - dependencies: - command-exists "^1.2.8" - commander "3.0.2" - fs-extra "^0.30.0" - js-sha3 "0.8.0" - memorystream "^0.3.1" - require-from-string "^2.0.0" - semver "^5.5.0" - tmp "0.0.33" - -solhint-plugin-prettier@^0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/solhint-plugin-prettier/-/solhint-plugin-prettier-0.0.5.tgz#e3b22800ba435cd640a9eca805a7f8bc3e3e6a6b" - integrity sha512-7jmWcnVshIrO2FFinIvDQmhQpfpS2rRRn3RejiYgnjIE68xO2bvrYvjqVNfrio4xH9ghOqn83tKuTzLjEbmGIA== - dependencies: - prettier-linter-helpers "^1.0.0" - -solhint@^3.2.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/solhint/-/solhint-3.3.2.tgz#ebd7270bb50fd378b427d7a6fc9f2a7fd00216c0" - integrity sha512-8tHCkIAk1axLLG6Qu2WIH3GgNABonj9eAWejJbov3o3ujkZQRNHeHU1cC4/Dmjsh3Om7UzFFeADUHu2i7ZJeiw== - dependencies: - "@solidity-parser/parser" "^0.8.2" - ajv "^6.6.1" - antlr4 "4.7.1" - ast-parents "0.0.1" - chalk "^2.4.2" - commander "2.18.0" - cosmiconfig "^5.0.7" - eslint "^5.6.0" - fast-diff "^1.1.2" - glob "^7.1.3" - ignore "^4.0.6" - js-yaml "^3.12.0" - lodash "^4.17.11" - semver "^6.3.0" - optionalDependencies: - prettier "^1.14.3" - -solidity-comments-extractor@^0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/solidity-comments-extractor/-/solidity-comments-extractor-0.0.4.tgz#ce420aef23641ffd0131c7d80ba85b6e1e42147e" - integrity sha512-58glBODwXIKMaQ7rfcJOrWtFQMMOK28tJ0/LcB5Xhu7WtAxk4UX2fpgKPuaL41XjMp/y0gAa1MTLqk018wuSzA== - -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.13, 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== - -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-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" - -stacktrace-parser@^0.1.10: - version "0.1.10" - resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" - integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== - dependencies: - type-fest "^0.7.1" - -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-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: - 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", string-width@^2.1.0: - 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-width@^4.1.0, string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.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.trimend@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" - integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== - dependencies: - call-bind "^1.0.2" - 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.prototype.trimstart@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" - integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== - dependencies: - call-bind "^1.0.2" - 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-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== - dependencies: - ansi-regex "^5.0.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-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, 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= - -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.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" - -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" - -table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== - dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" - -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@^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" - -test-value@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/test-value/-/test-value-2.1.0.tgz#11da6ff670f3471a73b625ca4f3fdcf7bb748291" - integrity sha1-Edpv9nDzRxpztiXKTz/c97t0gpE= - dependencies: - array-back "^1.0.3" - typical "^2.6.0" - -testrpc@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/testrpc/-/testrpc-0.0.1.tgz#83e2195b1f5873aec7be1af8cbe6dcf39edb7aed" - integrity sha512-afH1hO+SQ/VPlmaLUFj2636QMeDvPCeQMc/9RBMW0IfjNe9gFD9Ra3ShqYkB7py0do1ZcCna/9acHyzTJ+GcNA== - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= - -through2@^2.0.3: - 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.6, 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= - -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.0.33, 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" - -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" - -tmpl@1.0.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" - integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= - -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-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - -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" - -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= - -"true-case-path@^2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/true-case-path/-/true-case-path-2.2.1.tgz#c5bf04a5bbec3fd118be4084461b3a27c4d796bf" - integrity sha512-0z3j8R7MCjy10kc/g+qg7Ln3alJTodw9aDuVWZa3uiWqfuBMKeAeP2ocWcxoyM3D73yz3Jt/Pu4qPr4wHSdB/Q== - -ts-essentials@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-1.0.4.tgz#ce3b5dade5f5d97cf69889c11bf7d2da8555b15a" - integrity sha512-q3N1xS4vZpRouhYHDPwO0bDW3EZ6SK9CrrDHxi/D6BPReSjpVgWIOpLS2o0gSBZm+7q/wyKp6RVM1AeeW7uyfQ== - -ts-essentials@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-7.0.1.tgz#d205508cae0cdadfb73c89503140cf2228389e2d" - integrity sha512-8lwh3QJtIc1UWhkQtr9XuksXu3O0YQdEE5g79guDfhCaU1FWTDIEDZ1ZSx4HTHUmlJZ8L812j3BZQ4a0aOUkSA== - -ts-generator@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ts-generator/-/ts-generator-0.1.1.tgz#af46f2fb88a6db1f9785977e9590e7bcd79220ab" - integrity sha512-N+ahhZxTLYu1HNTQetwWcx3so8hcYbkKBHTr4b4/YgObFTIKkOSSsaa+nal12w8mfrJAyzJfETXawbNjSfP2gQ== - dependencies: - "@types/mkdirp" "^0.5.2" - "@types/prettier" "^2.1.1" - "@types/resolve" "^0.0.8" - chalk "^2.4.1" - glob "^7.1.2" - mkdirp "^0.5.1" - prettier "^2.1.2" - resolve "^1.8.1" - ts-essentials "^1.0.0" - -ts-node@^8.5.4: - version "8.10.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.10.2.tgz#eee03764633b1234ddd37f8db9ec10b75ec7fb8d" - integrity sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA== - dependencies: - arg "^4.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, tslib@^1.9.3: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tsort@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" - integrity sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y= - -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-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - -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-fest@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" - integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== - -type-fest@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" - integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== - -type-fest@^0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" - integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - -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== - -typechain@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/typechain/-/typechain-4.0.1.tgz#b40eaf5ede15588d97a4b9a5f85120f7ea1cf262" - integrity sha512-H/1VpRmplp1qhCTVLU9PCgzyVCQ7Lth7YvaaI1hTvT31IpWnLLNpDpQD4vXJGr26T9BsZ0ZIceOwieAbcoywXw== - dependencies: - command-line-args "^4.0.7" - debug "^4.1.1" - fs-extra "^7.0.0" - js-sha3 "^0.8.0" - lodash "^4.17.15" - ts-essentials "^7.0.1" - ts-generator "^0.1.1" - -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@^3.7.3: - version "3.9.7" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa" - integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw== - -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= - -typical@^2.6.0, typical@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d" - integrity sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0= - -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== - -unbox-primitive@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" - integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== - dependencies: - function-bind "^1.1.1" - has-bigints "^1.0.1" - has-symbols "^1.0.2" - which-boxed-primitive "^1.0.2" - -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== - -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" - -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" - -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= - -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= - dependencies: - punycode "1.3.2" - querystring "0.2.0" - -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" - -util.promisify@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.1.1.tgz#77832f57ced2c9478174149cae9b96e9918cd54b" - integrity sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - for-each "^0.3.3" - has-symbols "^1.0.1" - object.getownpropertydescriptors "^2.1.1" - -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@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== - -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" - -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" - -walker@^1.0.7, walker@~1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" - integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= - dependencies: - makeerror "1.0.x" - -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-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-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-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-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-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@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-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-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-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-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-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-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@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-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-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-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-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-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-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.0.0-beta.31: - version "1.3.1" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.3.1.tgz#9aa880dd8c9463fe5c099107889f86a085370c2e" - integrity sha512-9gPwFm8SXtIJuzdrZ37PRlalu40fufXxo+H2PiCwaO6RpKGAvlUlWU0qQbyToFNXg7W2H8djEgoAVac8NLMCKQ== - 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@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" - -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-boxed-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" - integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== - dependencies: - is-bigint "^1.0.1" - is-boolean-object "^1.1.0" - is-number-object "^1.0.4" - is-string "^1.0.5" - is-symbol "^1.0.3" - -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.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" - -window-size@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" - integrity sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU= - -word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - -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" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -write@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" - integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== - dependencies: - mkdirp "^0.5.1" - -ws@7.2.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" - integrity sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ== - -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" - -ws@^7.2.1: - version "7.4.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.1.tgz#a333be02696bd0e54cea0434e21dcc8a9ac294bb" - integrity sha512-pTsP8UAfhy3sk1lSk/O/s4tjD0CRwvMnzvwr4OKGX7ZvqZtUyx4KIJB5JWbkykPoc55tixMGgTNoh3k4FkNGFQ== - -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: - 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" - -xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, 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== - -y18n@^5.0.5: - version "5.0.5" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18" - integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg== - -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== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yargs-parser@13.1.2, 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@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" - integrity sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ= - dependencies: - camelcase "^3.0.0" - lodash.assign "^4.0.6" - -yargs-parser@^20.2.2: - version "20.2.4" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" - integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== - -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.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@^16.0.3: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - -yargs@^4.7.1: - version "4.8.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" - integrity sha1-wMQpJMpKqmsObaFznfshZDn53cA= - dependencies: - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - lodash.assign "^4.0.3" - 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.1" - which-module "^1.0.0" - window-size "^0.2.0" - y18n "^3.2.1" - yargs-parser "^2.4.1" - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== diff --git a/contract/lib/v3-periphery b/contract/lib/v3-periphery new file mode 160000 index 0000000..80f26c8 --- /dev/null +++ b/contract/lib/v3-periphery @@ -0,0 +1 @@ +Subproject commit 80f26c86c57b8a5e4b913f42844d4c8bd274d058 diff --git a/contract/script/DeploySandwich.s.sol b/contract/script/DeploySandwich.s.sol deleted file mode 100644 index d2ecff6..0000000 --- a/contract/script/DeploySandwich.s.sol +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.15; - -import "forge-std/Script.sol"; -import "forge-std/console.sol"; -import "foundry-huff/HuffDeployer.sol"; -import "../src/BrainDance.sol"; - - -contract Deployer is Script { - - // serachers - function setUp() public { - - } - function run() public{ - address sandwich = HuffDeployer.broadcast("sandwich"); - console.log(address(sandwich)); - } -} -//run bash -//forge script ./script/DeploySandwich.s.sol --rpc-url http://127.0.0.1:8545 --broadcast --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 diff --git a/contract/src/BrainDance.sol b/contract/src/BrainDance.sol deleted file mode 100644 index fcf75a6..0000000 --- a/contract/src/BrainDance.sol +++ /dev/null @@ -1,105 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "../interfaces/IERC20.sol"; -import "v2-core/interfaces/IUniswapV2Pair.sol"; -import "v2-periphery/interfaces/IUniswapV2Router02.sol"; -import "v3-core/interfaces/IUniswapV3Pool.sol"; -import "./lib/SafeMath.sol"; - -contract BrainDance { - using SafeMath for uint; - - function calculateSwapV2(uint amountIn, address targetPair, address inputToken, address outputToken) external returns (uint amountOut, uint realAfterBalance){ - ////////////////////////////////////// - // NO STRINGS // - ////////////////////////////////////// - - // Optimistically send amountIn of inputToken to targetPair - IERC20(inputToken).transfer(targetPair, amountIn); - - ////////////////////////////////////// - // CALCULATING OUR EXPECTED OUTPUT // - ////////////////////////////////////// - - // Prepare variables for calculating expected amount out - uint reserveIn; - uint reserveOut; - - { // Avoid stack too deep error - (uint reserve0, uint reserve1,) = IUniswapV2Pair(targetPair).getReserves(); - - // sort reserves - if (inputToken < outputToken) { - // Token0 is equal to inputToken - // Token1 is equal to outputToken - reserveIn = reserve0; - reserveOut = reserve1; - } else { - // Token0 is equal to outputToken - // Token1 is equal to inputToken - reserveIn = reserve1; - reserveOut = reserve0; - } - } - - ////////////////////////////////////// - // PERFORMING SWAP // - ////////////////////////////////////// - - // Find the actual amountIn sent to pair (accounts for tax if any) and amountOut - uint actualAmountIn = IERC20(inputToken).balanceOf(address(targetPair)).sub(reserveIn); - amountOut = _getAmountOut(actualAmountIn, reserveIn, reserveOut); - - // Prepare swap variables and call pair.swap() - (uint amount0Out, uint amount1Out) = inputToken < outputToken ? (uint(0), amountOut) : (amountOut, uint(0)); - IUniswapV2Pair(targetPair).swap(amount0Out, amount1Out, address(this), new bytes(0)); - - // Find real balance after (accounts for taxed tokens) - realAfterBalance = IERC20(outputToken).balanceOf(address(this)); - } - - function _getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { - require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); - require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); - uint amountInWithFee = amountIn.mul(997); - uint numerator = amountInWithFee.mul(reserveOut); - uint denominator = reserveIn.mul(1000).add(amountInWithFee); - amountOut = numerator / denominator; - } - - function calculateSwapV3(int amountIn, address targetPoolAddress, address inputToken, address outputToken) public returns (uint amountOut, uint realAfterBalance) { - IUniswapV3Pool targetPool = IUniswapV3Pool(targetPoolAddress); - // wether tokenIn is token0 or token1 - bool zeroForOne = inputToken < outputToken; - // From docs: The Q64.96 sqrt price limit. If zero for one, - // The price cannot be less than this value after the swap. - // If one for zero, the price cannot be greater than this value after the swap - uint160 sqrtPriceLimitX96 = (zeroForOne ? 4295128749 : 1461446703485210103287273052203988822378723970341); - - // Data used for callback - bytes memory data = abi.encode(zeroForOne, inputToken); - - // Make swap and calc amountOut - (int amount0, int amount1) = targetPool.swap(address(this), zeroForOne, amountIn, sqrtPriceLimitX96, data); - amountOut = uint256(-(zeroForOne ? amount1 : amount0)); - - // Find real balance after (accounts for taxed tokens) - realAfterBalance = IERC20(outputToken).balanceOf(address(this)); - } - - function uniswapV3SwapCallback( - int256 amount0Delta, - int256 amount1Delta, - bytes calldata _data - ) external { - require(amount0Delta > 0 || amount1Delta > 0); // swaps entirely within 0-liquidity regions are not supported - (bool isZeroForOne, address inputToken) = abi.decode(_data, (bool, address)); - - if (isZeroForOne) { - IERC20(inputToken).transfer(msg.sender, uint(amount0Delta)); - } else { - IERC20(inputToken).transfer(msg.sender, uint(amount1Delta)); - } - } -} diff --git a/contract/src/LilRouter.sol b/contract/src/LilRouter.sol new file mode 100644 index 0000000..45ba866 --- /dev/null +++ b/contract/src/LilRouter.sol @@ -0,0 +1,131 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "v2-core/interfaces/IUniswapV2Pair.sol"; +import "v2-periphery/interfaces/IUniswapV2Router02.sol"; +import "v3-core/interfaces/IUniswapV3Pool.sol"; +import "solmate/tokens/ERC20.sol"; + +/// @title LilRouter +/// @author 0xmouseless +/// @notice Minimal swap router used to sim V2/V3 swaps (and account for taxed tokens) +contract LilRouter { + /** + * @notice Performs a token swap on a v2 pool + * @return amountOut Expected output tokens from the swap + * @return realAfterBalance Post-swap balance, accounting for token tax + */ + function calculateSwapV2(uint256 amountIn, address targetPair, address inputToken, address outputToken) + external + returns (uint256 amountOut, uint256 realAfterBalance) + { + ////////////////////////////////////// + // SETUP // + ////////////////////////////////////// + + // Optimistically send amountIn of inputToken to targetPair + ERC20(inputToken).transfer(targetPair, amountIn); + + ////////////////////////////////////// + // CALCULATING OUR EXPECTED OUTPUT // + ////////////////////////////////////// + + // Prepare variables for calculating expected amount out + uint256 reserveIn; + uint256 reserveOut; + + { + // Avoid stack too deep error + (uint256 reserve0, uint256 reserve1,) = IUniswapV2Pair(targetPair).getReserves(); + + // sort reserves + if (inputToken < outputToken) { + // Token0 is equal to inputToken + // Token1 is equal to outputToken + reserveIn = reserve0; + reserveOut = reserve1; + } else { + // Token0 is equal to outputToken + // Token1 is equal to inputToken + reserveIn = reserve1; + reserveOut = reserve0; + } + } + + ////////////////////////////////////// + // PERFORMING SWAP // + ////////////////////////////////////// + + // Find the actual amountIn sent to pair (accounts for tax if any) and amountOut + uint256 actualAmountIn = ERC20(inputToken).balanceOf(address(targetPair)) - reserveIn; + amountOut = _getAmountOut(actualAmountIn, reserveIn, reserveOut); + + // Prepare swap variables and call pair.swap() + (uint256 amount0Out, uint256 amount1Out) = + inputToken < outputToken ? (uint256(0), amountOut) : (amountOut, uint256(0)); + IUniswapV2Pair(targetPair).swap(amount0Out, amount1Out, address(this), new bytes(0)); + + // Find real balance after (accounts for taxed tokens) + realAfterBalance = ERC20(outputToken).balanceOf(address(this)); + } + + /** + * @notice Performs a token swap on a v3 pool + * @return amountOut Expected output tokens from the swap + * @return realAfterBalance Post-swap balance, accounting for token tax + */ + function calculateSwapV3(int256 amountIn, address targetPoolAddress, address inputToken, address outputToken) + public + returns (uint256 amountOut, uint256 realAfterBalance) + { + IUniswapV3Pool targetPool = IUniswapV3Pool(targetPoolAddress); + // wether tokenIn is token0 or token1 + bool zeroForOne = inputToken < outputToken; + // From docs: The Q64.96 sqrt price limit. If zero for one, + // The price cannot be less than this value after the swap. + // If one for zero, the price cannot be greater than this value after the swap + uint160 sqrtPriceLimitX96 = (zeroForOne ? 4295128749 : 1461446703485210103287273052203988822378723970341); + + // Data used for callback + bytes memory data = abi.encode(zeroForOne, inputToken); + + // Make swap and calc amountOut + (int256 amount0, int256 amount1) = targetPool.swap(address(this), zeroForOne, amountIn, sqrtPriceLimitX96, data); + amountOut = uint256(-(zeroForOne ? amount1 : amount0)); + + // Find real balance after (accounts for taxed tokens) + realAfterBalance = ERC20(outputToken).balanceOf(address(this)); + } + + /** + * @notice Post swap callback to sends amount of input token to v3 pool + */ + function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes calldata _data) external { + require(amount0Delta > 0 || amount1Delta > 0); // swaps entirely within 0-liquidity regions are not supported + (bool isZeroForOne, address inputToken) = abi.decode(_data, (bool, address)); + + if (isZeroForOne) { + ERC20(inputToken).transfer(msg.sender, uint256(amount0Delta)); + } else { + ERC20(inputToken).transfer(msg.sender, uint256(amount1Delta)); + } + } + + /** + * @notice Helper to find output amount from xy=k + * @dev Note that fees are hardcoded to 0.3% (default for sushi and uni) + * @return amountOut Output tokens expected from swap + */ + function _getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) + internal + pure + returns (uint256 amountOut) + { + require(amountIn > 0, "UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT"); + require(reserveIn > 0 && reserveOut > 0, "UniswapV2Library: INSUFFICIENT_LIQUIDITY"); + uint256 amountInWithFee = amountIn * 997; + uint256 numerator = amountInWithFee * reserveOut; + uint256 denominator = reserveIn * 1000 + amountInWithFee; + amountOut = numerator / denominator; + } +} diff --git a/contract/src/lib/SafeMath.sol b/contract/src/lib/SafeMath.sol deleted file mode 100644 index 450b54b..0000000 --- a/contract/src/lib/SafeMath.sol +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.6; - -// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) - -library SafeMath { - function add(uint x, uint y) internal pure returns (uint z) { - require((z = x + y) >= x, 'ds-math-add-overflow'); - } - - function sub(uint x, uint y) internal pure returns (uint z) { - require((z = x - y) <= x, 'ds-math-sub-underflow'); - } - - function mul(uint x, uint y) internal pure returns (uint z) { - require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow'); - } -} diff --git a/contract/src/lib/SafeTransfer.sol b/contract/src/lib/SafeTransfer.sol deleted file mode 100644 index 3d826e8..0000000 --- a/contract/src/lib/SafeTransfer.sol +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.0; - -import "../../interfaces/IERC20.sol"; - -library SafeTransfer { - function safeTransferFrom( - IERC20 token, - address from, - address to, - uint256 value - ) internal { - (bool s, ) = address(token).call( - abi.encodeWithSelector( - IERC20.transferFrom.selector, - from, - to, - value - ) - ); - require(s, "safeTransferFrom failed"); - } - - function safeTransfer( - IERC20 token, - address to, - uint256 value - ) internal { - (bool s, ) = address(token).call( - abi.encodeWithSelector(IERC20.transfer.selector, to, value) - ); - require(s, "safeTransfer failed"); - } - - function safeApprove( - IERC20 token, - address to, - uint256 value - ) internal { - (bool s, ) = address(token).call( - abi.encodeWithSelector(IERC20.approve.selector, to, value) - ); - require(s, "safeApprove failed"); - } - - function safeTransferETH(address to, uint256 value) internal { - (bool s, ) = to.call{value: value}(new bytes(0)); - require(s, "safeTransferETH failed"); - } -} diff --git a/contract/src/sandwich.huff b/contract/src/sando.huff similarity index 67% rename from contract/src/sandwich.huff rename to contract/src/sando.huff index a201005..82627d4 100644 --- a/contract/src/sandwich.huff +++ b/contract/src/sando.huff @@ -1,4 +1,4 @@ -/// @title Sandwich +/// @title Sando /// @notice SPDX-License-Identifier: MIT /// @author 0xmouseless /// @notice gas optimized sandwich contract. @@ -6,16 +6,16 @@ // +-------------------------------------------+ // | Constants | // +-------------------------------------------+ -// 1461446703485210103287273052203988822378723970341 is the gloabl upper bound #define constant MAX_SQRT_PRICE_LIMIT_X96 = 0xFFFD8963EFD1FC6A506488495D951D5263988D25 -// 4295128749 is the global lower bound #define constant MIN_SQRT_PRICE_LIMIT_X96 = 0x1000276AD +// `MAX_SQRT_PRICE_LIMIT_X96` is the gloabl upper bound for v3 swaps +// `MIN_SQRT_PRICE_LIMIT_X96` is the global lower bound for v3 swaps + #define constant FACTORY = 0x1F98431c8aD98523631AE4a59f267346ea31F984000000000000000000000000 #define constant PAIR_INIT_CODE_HASH = 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54 #define constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 #define constant SEARCHER = 0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf -#define constant HELPER = 0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF // +-------------------------------------------+ // | Functin Sigs | @@ -32,73 +32,61 @@ // -- SAFETY IMPROVEMENTS -- // // * Make a base fee check for all frontrun methods (check tx.baseFee = block.baseFee) -// this ensures that tx does not get mined in wrong block (very rare edge case) +// this ensures that tx does not get mined in the wrong block (very rare edge case) // -// * Store gas on stack at start of backrun methods and at the end check if gas_used is -// equal to 70% of start (gasUsed is capped to 70% of gasLimit on botside). -// reason for this check is that if block is not mined at top there might be tx interacting -// with same pool causing price change and you get to be the sandwich victim. -// Checking gasUsed = expected GasUsed makes sure that this doesn't happen +// * Store gas on stack at start of backrun methods and before returning, check if gas_used is +// equal to 70% of start (gasUsed is set to 70% of gasLimit on botside). +// This prevents our bundle from being frontrun by another tx targeting the same pool as us, +// which could cause execution at an unexpected price (could lead to a net negative). #define macro MAIN() = takes (0) returns (0) { // extract function selector (JUMPDEST encoding) - returndatasize // [0] + push0 // [0x00] calldataload // [calldata] - 0x00 // [0x00, calldata] + push0 // [0x00, calldata] byte // [jumplabel] jump // [] // (UniswapV2) Weth is token0 && output -v2_output0_astral_gate: - v2_output0 // [v2_output0_0_label] - jump // [] +v2_backrun0_astral_gate: + v2_backrun0 // [v2_backrun0_label] + jump // [] // (UniswapV2) Weth is token0 && input -v2_input0_astral_gate: - v2_input0 // [v2_input0_0_label] - jump // [] +v2_frontrun0_astral_gate: + v2_frontrun0 // [v2_frontrun0_label] + jump // [] // (UniswapV2) Weth is token1 && output -v2_output1_astral_gate: - v2_output1 // [v2_output1_0_label] - jump // [] +v2_backrun1_astral_gate: + v2_backrun1 // [v2_backrun1_label] + jump // [] // (UniswapV2) Weth is token1 && input -v2_input1_astral_gate: - v2_input1 // [v2_input1_0_label] - jump // [] - -// (UniswapV3) Weth is token1 && output -v3_output1_big_astral_gate: - v3_output1_big // [v3_output1_label] +v2_frontrun1_astral_gate: + v2_frontrun1 // [v2_frontrun1_label] jump // [] // (UniswapV3) Weth is token0 && output -v3_output0_big_astral_gate: - v3_output0_big // [v3_output0_label] +v3_backrun0_astral_gate: + v3_backrun0 // [v3_backrun0_label] jump // [] -// (UniswapV3) Weth is token1 && output -v3_output1_small_astral_gate: - v3_output1_small // [v3_output1_label] - jump // [] - -// (UniswapV3) Weth is token0 && output -v3_output0_small_astral_gate: - v3_output0_small // [v3_output0_label] +// (UniswapV3) Weth is token0 && input +v3_frontrun0_astral_gate: + v3_frontrun0 // [v3_frontrun0_label] jump // [] -// (UniswapV3) Weth is token0 && input -v3_input0_astral_gate: - v3_input0 // [v3_input0_label] +// (UniswapV3) Weth is token1 && output +v3_backrun1_astral_gate: + v3_backrun1 // [v3_backrun1_label] jump // [] // (UniswapV3) Weth is token1 && input -v3_input1_astral_gate: - v3_input1 // [v3_input1_label] +v3_frontrun1_astral_gate: + v3_frontrun1 // [v3_frontrun1_label] jump // [] - seppuku_astral_gate: seppuku // [seppuku_label] jump // [] @@ -111,8 +99,8 @@ recover_weth_astral_gate: recover_weth // [recover_weth_label] jump // [] -// wall of stops used so that the jumpdest of callback label equals 0xfa -// 0xfa = first two bytes of function sig 0xfa461e33 +// wall of stops used so that the jumpdest of callback JUMPDEST equals 0xfa +// 0xfa = first byte of function sig 0xfa461e33 stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop @@ -126,14 +114,18 @@ stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop stop -stop stop stop stop stop stop stop stop stop stop +stop stop stop stop stop stop stop stop stop stop stop stop stop +stop stop stop stop stop stop stop stop // calldata: int256 amount0Delta, int256 amount1Delta, bytes data uniswap_v3_callback: // Extract pool_key_hash for msg.sender validation 0x99 calldataload - // setup variables for keccak256("FF", factory_addr, pool_Key_hash, pool_key_hash) + // setup variables for keccak256("FF", factory_addr, pool_key_hash, pair_init_code_hash) + // ref : https://docs.uniswap.org/contracts/v3/reference/periphery/libraries/CallbackValidation + // ref : https://github.com/Uniswap/v3-periphery/blob/main/contracts/libraries/CallbackValidation.sol#L15 + // ref : https://github.com/Uniswap/v3-periphery/blob/main/contracts/libraries/PoolAddress.sol#L33 __RIGHTPAD(0xFF) 0x00 mstore // [pool_key_hash] *mstore(ff, 0) [FACTORY] chainid mstore // [pool_key_hash] *mstore(FACTORY, 1) 0x15 mstore // [pool_key_hash] *mstore(POOLKEYHASH, 21) @@ -142,17 +134,17 @@ uniswap_v3_callback: // call keccak256 and transform result to address 0x55 0x00 sha3 // [keccak256_result] 0x000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF - and // [pair_addr] + and // [pool_addr] // check if caller is equal to calculated pool addr caller eq iszero gtfo jumpi // [] * Check if msg.sender is pool // setup stack for when we call inputToken.transfer - returndatasize // [retsize] - returndatasize // [retoffset, retsize] + push0 // [retsize] + push0 // [retoffset, retsize] 0x44 // 100 (4+32+32) // [argsize, retoffset, retsize] - returndatasize // [argoffset, argsize, retoffset, retsize] - returndatasize // [value, argoffset, argsize, retoffset, retsize] + push0 // [argoffset, argsize, retoffset, retsize] + push0 // [value, argoffset, argsize, retoffset, retsize] // *** extract inputToken address // inputToken address bit mask @@ -168,7 +160,7 @@ uniswap_v3_callback: // // setup calldata (in memory) for transfer(to,value) - [TRANSFER_SIG] returndatasize mstore // [token_in_addr, value, argoffset, argsize, retoffset, retsize] - mstore(0, 0x23b872dd) + [TRANSFER_SIG] push0 mstore // [token_in_addr, value, argoffset, argsize, retoffset, retsize] - mstore(0, 0x23b872dd) caller 0x04 mstore // [token_in_addr, value, argoffset, argsize, retoffset, retsize] - mstore(36, msg.sender) 0x24 calldataload 0x24 mstore // [token_in_addr, value, argoffset, argsize, retoffset, retsize] - mstore(56, amount1Delta) @@ -176,18 +168,17 @@ uniswap_v3_callback: call iszero gtfo jumpi // [*pair_swap_args] stop -// ****KEEP THIS LABEL UNJUMPABLE TO IF YOU EVER INCREASE JUMP_LABEL IN CALLDATA FROM 1BYTES to 2BYTES**** -// ****KEEP THIS LABEL UNJUMPABLE TO IF YOU EVER INCREASE JUMP_LABEL IN CALLDATA FROM 1BYTES to 2BYTES**** -// ****KEEP THIS LABEL UNJUMPABLE TO IF YOU EVER INCREASE JUMP_LABEL IN CALLDATA FROM 1BYTES to 2BYTES**** -// ****KEEP THIS LABEL UNJUMPABLE TO IF YOU EVER INCREASE JUMP_LABEL IN CALLDATA FROM 1BYTES to 2BYTES**** -// ****KEEP THIS LABEL UNJUMPABLE TO IF YOU EVER INCREASE JUMP_LABEL IN CALLDATA FROM 1BYTES to 2BYTES**** +// ****KEEP THIS LABEL UNJUMPABLE TO IF YOU EVER INCREASE FUNCTION DISPATCH FROM 1BYTES to 2BYTES**** +// ****KEEP THIS LABEL UNJUMPABLE TO IF YOU EVER INCREASE FUNCTION DISPATCH FROM 1BYTES to 2BYTES**** +// ****KEEP THIS LABEL UNJUMPABLE TO IF YOU EVER INCREASE FUNCTION DISPATCH FROM 1BYTES to 2BYTES**** +// ****KEEP THIS LABEL UNJUMPABLE TO IF YOU EVER INCREASE FUNCTION DISPATCH FROM 1BYTES to 2BYTES**** isZeroForOne: // // if execution continues here then isZeroForOne = true // // setup calldata (in memory) for transfer(to,value) - [TRANSFER_SIG] returndatasize mstore // [token_in_addr, value, argoffset, argsize, retoffset, retsize] - mstore(0, 0x23b872dd) + [TRANSFER_SIG] push0 mstore // [token_in_addr, value, argoffset, argsize, retoffset, retsize] - mstore(0, 0x23b872dd) caller 0x04 mstore // [token_in_addr, value, argoffset, argsize, retoffset, retsize] - mstore(36, msg.sender) 0x04 calldataload 0x24 mstore // [token_in_addr, value, argoffset, argsize, retoffset, retsize] - mstore(56, amount0Delta) @@ -195,8 +186,7 @@ isZeroForOne: call iszero gtfo jumpi // [*pair_swap_args] stop - -v3_input1: +v3_frontrun1: // validate msg.sender [SEARCHER] caller eq // [is_caller_searcher] iszero // [!is_caller_searcher] @@ -204,23 +194,23 @@ v3_input1: jumpi // [] // ***Preset the stack for when we call pool.swap(recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) - returndatasize // [retsize] - returndatasize // [retoffset, retsize] + push0 // [retsize] + push0 // [retoffset, retsize] 0xf9 // 249 (4+32+32+32+32+{32+32+53}) // [argsize, retoffset, retsize] - returndatasize // [argoffset, argsize, retoffset, retsize] - returndatasize // [value, argoffset, argsize, retoffset, retsize] + push0 // [argoffset, argsize, retoffset, retsize] + push0 // [value, argoffset, argsize, retoffset, retsize] chainid calldataload 0x60 shr // [pair_address, value, argoffset, argsize, retoffset, retsize] = pair_swap_args - // setup calldata for pool.swap(address(this), true, amountSpecified, minSqrtPriceLimitX96, data) + // setup calldata for pool.swap(address(this), false, amountSpecified, minSqrtPriceLimitX96, data) [V3_SWAP_SIG] 0x00 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(0, 0x022c0d9f) address 0x04 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(4, address(this)) - //0x00 0x24 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(36, false) + //0x00 0x24 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(36, false) 0x0186a0 callvalue mul 0x44 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(68, callvalue * 100000) [MAX_SQRT_PRICE_LIMIT_X96] 0x64 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(100, address(this)) // data part used for callback 0xa0 0x84 mstore // 100 // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(132, 0x80) *dynamic byte offset 0x35 0xa4 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(164, 0x02) *dynamic byte length - // ** abi.encodePacked(isZeroForOne, input_token, pair_address) + // ** abi.encodePacked(isZeroForOne, input_token, pool_key_hash) [WETH] 0x58 shl 0xc4 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(196, isZeroForOne_&_InputTokenAddr) 0x15 calldataload 0xd9 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(217, pool_key_hash) @@ -230,7 +220,7 @@ v3_input1: stop // (UniswapV3) Weth is token0 && input && has an offset of 0 -v3_input0: +v3_frontrun0: // validate msg.sender [SEARCHER] caller eq // [is_caller_searcher] iszero // [!is_caller_searcher] @@ -238,11 +228,11 @@ v3_input0: jumpi // [] // ***Preset the stack for when we call pool.swap(recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) - returndatasize // [retsize] - returndatasize // [retoffset, retsize] + push0 // [retsize] + push0 // [retoffset, retsize] 0xf9 // 249 (4+32+32+32+32+{32+32+53}) // [argsize, retoffset, retsize] - returndatasize // [argoffset, argsize, retoffset, retsize] - returndatasize // [value, argoffset, argsize, retoffset, retsize] + push0 // [argoffset, argsize, retoffset, retsize] + push0 // [value, argoffset, argsize, retoffset, retsize] chainid calldataload 0x60 shr // [pair_address, value, argoffset, argsize, retoffset, retsize] = pair_swap_args // setup calldata for pool.swap(address(this), true, amountSpecified, minSqrtPriceLimitX96, data) @@ -254,7 +244,7 @@ v3_input0: // data part used for callback 0xa0 0x84 mstore // 100 // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(132, 0x80) *dynamic byte offset 0x35 0xa4 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(164, 0x02) *dynamic byte length - // ** abi.encodePacked(isZeroForOne, input_token, pair_address) + // ** abi.encodePacked(isZeroForOne, input_token, pool_key_hash) 0x0100000000000000000000000000000000000000000000000000000000000000 [WETH] 0x58 shl add 0xc4 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(196, isZeroForOne_&_InputTokenAddr) 0x15 calldataload 0xd9 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(217, pool_key_hash) @@ -264,9 +254,7 @@ v3_input0: call iszero gtfo jumpi // [] *did swap succeed without failure? stop - -// **When amountIn is < 10^13** -v3_output0_small: +v3_backrun1: // validate msg.sender [SEARCHER] caller eq // [is_caller_searcher] iszero // [!is_caller_searcher] @@ -274,105 +262,39 @@ v3_output0_small: jumpi // [] // ***Preset the stack for when we call pool.swap(recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) - returndatasize // [retsize] - returndatasize // [retoffset, retsize] + push0 // [retsize] + push0 // [retoffset, retsize] 0xf9 // 249 (4+32+32+32+32+{32+32+53}) // [argsize, retoffset, retsize] - returndatasize // [argoffset, argsize, retoffset, retsize] - returndatasize // [value, argoffset, argsize, retoffset, retsize] + push0 // [argoffset, argsize, retoffset, retsize] + push0 // [value, argoffset, argsize, retoffset, retsize] chainid calldataload 0x60 shr // [pair_address, value, argoffset, argsize, retoffset, retsize] = pair_swap_args - // setup calldata for pool.swap(address(this), true, amountSpecified, minSqrtPriceLimitX96, data) - [V3_SWAP_SIG] 0x00 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(0, 0x022c0d9f) - address 0x04 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(4, address(this)) - //0x00 0x24 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(36, false) - 0x29 calldataload 0xd0 shr 0x44 mstore // [amount_in_raw, pair_address, value, argoffset, argsize, retoffset, retsize] - [MAX_SQRT_PRICE_LIMIT_X96] 0x64 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(100, address(this)) - // data part used for callback - 0xa0 0x84 mstore // 100 // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(132, 0x80) *dynamic byte offset - 0x35 0xa4 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(164, 0x02) *dynamic byte length - // ** abi.encodePacked(isZeroForOne, input_token, pair_address) - 0x15 calldataload 0x60 shr 0x58 shl // [input_token, pair_address, value, argoffset, argsize, retoffset, retsize] - 0xc4 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(196, isZeroForOne_&_InputTokenAddr) - 0x2f calldataload 0xd9 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(217, pool_key_hash) - - // call pool.swap - gas // [gas, pair_address, value, argoffset, argsize, retoffset, retsize] - call iszero gtfo jumpi // [] *did swap succeed without failure? - stop - -// **When amountIn is < 10^13** -v3_output1_small: - // validate msg.sender - [SEARCHER] caller eq // [is_caller_searcher] - iszero // [!is_caller_searcher] - gtfo // [gtfo_label, is_caller_searcher] - jumpi // [] - - // ***Preset the stack for when we call pool.swap(recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) - returndatasize // [retsize] - returndatasize // [retoffset, retsize] - 0xf9 // 249 (4+32+32+32+32+{32+32+53}) // [argsize, retoffset, retsize] - returndatasize // [argoffset, argsize, retoffset, retsize] - returndatasize // [value, argoffset, argsize, retoffset, retsize] - chainid calldataload 0x60 shr // [pair_address, value, argoffset, argsize, retoffset, retsize] = pair_swap_args - // setup calldata for pool.swap(address(this), true, amountSpecified, minSqrtPriceLimitX96, data) [V3_SWAP_SIG] 0x00 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(0, 0x022c0d9f) address 0x04 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(4, address(this)) 0x01 0x24 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(36, true) - 0x29 calldataload 0xd0 shr 0x44 mstore // [amount_in_raw, pair_address, value, argoffset, argsize, retoffset, retsize] - [MIN_SQRT_PRICE_LIMIT_X96] 0x64 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(100, address(this)) - // data part used for callback - 0xa0 0x84 mstore // 100 // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(132, 0x80) *dynamic byte offset - 0x35 0xa4 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(164, 0x02) *dynamic byte length - // ** abi.encodePacked(isZeroForOne, input_token, pair_address) - 0x0100000000000000000000000000000000000000000000000000000000000000 - 0x15 calldataload 0x60 shr 0x58 shl // [input_token, pair_address, value, argoffset, argsize, retoffset, retsize] - add 0xc4 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(196, isZeroForOne_&_InputTokenAddr) - 0x2f calldataload 0xd9 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(217, pool_key_hash) - - // call pool.swap - gas // [gas, pair_address, value, argoffset, argsize, retoffset, retsize] - call iszero gtfo jumpi // [] *did swap succeed without failure? - stop -v3_output1_big: - // validate msg.sender - [SEARCHER] caller eq // [is_caller_searcher] - iszero // [!is_caller_searcher] - gtfo // [gtfo_label, is_caller_searcher] - jumpi // [] - - // ***Preset the stack for when we call pool.swap(recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) - returndatasize // [retsize] - returndatasize // [retoffset, retsize] - 0xf9 // 249 (4+32+32+32+32+{32+32+53}) // [argsize, retoffset, retsize] - returndatasize // [argoffset, argsize, retoffset, retsize] - returndatasize // [value, argoffset, argsize, retoffset, retsize] - chainid calldataload 0x60 shr // [pair_address, value, argoffset, argsize, retoffset, retsize] = pair_swap_args + // get amountIn and store at memOffset (5 byte encoding) + 0x49 calldataload dup1 + 0x08 shl swap1 // extract encodedValue by removing memOffset + 0x00 byte mstore // extract memOffset and perform mstore - // setup calldata for pool.swap(address(this), true, amountSpecified, minSqrtPriceLimitX96, data) - [V3_SWAP_SIG] 0x00 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(0, 0x022c0d9f) - address 0x04 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(4, address(this)) - 0x01 0x24 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(36, true) - 0x29 calldataload 0xb8 shr // [amount_in_raw, pair_address, value, argoffset, argsize, retoffset, retsize] - 0x09184e72a000 mul 0x44 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(68, amount_in_raw * 10000000000000) [MIN_SQRT_PRICE_LIMIT_X96] 0x64 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(100, address(this)) // data part used for callback 0xa0 0x84 mstore // 100 // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(132, 0x80) *dynamic byte offset 0x35 0xa4 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(164, 0x02) *dynamic byte length - // ** abi.encodePacked(isZeroForOne, input_token, pair_address) + // ** abi.encodePacked(isZeroForOne, input_token, pool_key_hash) 0x0100000000000000000000000000000000000000000000000000000000000000 0x15 calldataload 0x60 shr 0x58 shl // [input_token, pair_address, value, argoffset, argsize, retoffset, retsize] add 0xc4 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(196, isZeroForOne_&_InputTokenAddr) - 0x32 calldataload 0xd9 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(217, pool_key_hash) + 0x29 calldataload 0xd9 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(217, pool_key_hash) // call pool.swap gas // [gas, pair_address, value, argoffset, argsize, retoffset, retsize] call iszero gtfo jumpi // [] *did swap succeed without failure? stop -v3_output0_big: +v3_backrun0: // validate msg.sender [SEARCHER] caller eq // [is_caller_searcher] iszero // [!is_caller_searcher] @@ -380,27 +302,30 @@ v3_output0_big: jumpi // [] // ***Preset the stack for when we call pool.swap(recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) - returndatasize // [retsize] - returndatasize // [retoffset, retsize] + push0 // [retsize] + push0 // [retoffset, retsize] 0xf9 // 249 (4+32+32+32+32+{32+32+53}) // [argsize, retoffset, retsize] - returndatasize // [argoffset, argsize, retoffset, retsize] - returndatasize // [value, argoffset, argsize, retoffset, retsize] + push0 // [argoffset, argsize, retoffset, retsize] + push0 // [value, argoffset, argsize, retoffset, retsize] chainid calldataload 0x60 shr // [pair_address, value, argoffset, argsize, retoffset, retsize] = pair_swap_args - // setup calldata for pool.swap(address(this), true, amountSpecified, minSqrtPriceLimitX96, data) + // setup calldata for pool.swap(address(this), false, amountSpecified, minSqrtPriceLimitX96, data) [V3_SWAP_SIG] 0x00 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(0, 0x022c0d9f) address 0x04 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(4, address(this)) - //0x00 0x24 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(36, false) - 0x29 calldataload 0xb8 shr // [amount_in_raw, pair_address, value, argoffset, argsize, retoffset, retsize] - 0x09184e72a000 mul 0x44 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(68, amount_in_raw * 10000000000000) + + // get amountIn and store at memOffset (5 byte encoding) + 0x49 calldataload dup1 + 0x08 shl swap1 // extract encodedValue by removing memOffset + 0x00 byte mstore // extract memOffset and perform mstore + [MAX_SQRT_PRICE_LIMIT_X96] 0x64 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(100, address(this)) // data part used for callback 0xa0 0x84 mstore // 100 // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(132, 0x80) *dynamic byte offset 0x35 0xa4 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(164, 0x02) *dynamic byte length - // ** abi.encodePacked(isZeroForOne, input_token, pair_address) + // ** abi.encodePacked(isZeroForOne, input_token, pool_key_hash) 0x15 calldataload 0x60 shr 0x58 shl // [input_token, pair_address, value, argoffset, argsize, retoffset, retsize] 0xc4 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(196, isZeroForOne_&_InputTokenAddr) - 0x32 calldataload 0xd9 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(217, pool_key_hash) + 0x29 calldataload 0xd9 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(217, pool_key_hash) // call pool.swap gas // [gas, pair_address, value, argoffset, argsize, retoffset, retsize] @@ -408,7 +333,7 @@ v3_output0_big: stop // Make swap when Weth is token0 && output -v2_output0: +v2_backrun0: // validate msg.sender [SEARCHER] caller eq // [is_caller_searcher] iszero // [!is_caller_searcher] @@ -416,29 +341,29 @@ v2_output0: jumpi // [] // ***Preset the stack for when we call pair.swap(token0Out, token1Out, to, data)*** - returndatasize // [retsize] - returndatasize // [retoffset, retsize] + push0 // [retsize] + push0 // [retoffset, retsize] 0xA4 // 164 (4 + 32 + 32 + 32 + {32 + 32}) // [argsize, retoffset, retsize] - returndatasize // [argoffset, argsize, retoffset, retsize] - returndatasize // [value, argoffset, argsize, retoffset, retsize] + push0 // [argoffset, argsize, retoffset, retsize] + push0 // [value, argoffset, argsize, retoffset, retsize] chainid calldataload 0x60 shr // [pair_address, value, argoffset, argsize, retoffset, retsize] = pair_swap_args // ***Preset the stack for when we call token.transfer*** - returndatasize // [retsize, *pair_swap_args] - returndatasize // [retoffset, retsize, *pair_swap_args] = token_transfer_args + push0 // [retsize, *pair_swap_args] + push0 // [retoffset, retsize, *pair_swap_args] = token_transfer_args // setup calldata (in memory) for transfer(to,value) - [TRANSFER_SIG] returndatasize mstore // [*token_transfer_args, *pair_swap_args] - mstore(0, 0x23b872dd) + [TRANSFER_SIG] push0 mstore // [*token_transfer_args, *pair_swap_args] - mstore(0, 0x23b872dd) dup3 0x04 mstore // [*token_transfer_args, *pair_swap_args] - mstore(36, pair_address) - // get amountIn and store at memOffset + // get amountIn and store at memOffset (5 byte encoding) 0x29 calldataload dup1 0x08 shl swap1 // extract encodedValue by removing memOffset 0x00 byte mstore // extract memOffset and perform mstore - // call tokenIn transferFrom + // call tokenIn transfer(to,value) 0x44 // 68 (4+32+32) // [argsize, retoffset, retsize, *pair_swap_args] !expanded token_transfer_args - returndatasize // [argoffset, argsize, retoffset, retsize, *pair_swap_args] - returndatasize // [value, argoffset, argsize, retoffset, retsize, *pair_swap_args] = token_transfer_args + push0 // [argoffset, argsize, retoffset, retsize, *pair_swap_args] + push0 // [value, argoffset, argsize, retoffset, retsize, *pair_swap_args] = token_transfer_args 0x15 calldataload 0x60 shr // [token_in_addr, value, argoffset, argsize, retoffset, retsize, *pair_swap_args] gas // [gas, token_in_addr, value, argoffset, argsize, retoffset, retsize, *pair_swap_args] call pop // [*pair_swap_args] @@ -457,7 +382,7 @@ v2_output0: stop // Make swap when Weth is token1 && output -v2_output1: +v2_backrun1: // validate msg.sender [SEARCHER] caller eq // [is_caller_searcher] iszero // [!is_caller_searcher] @@ -465,30 +390,30 @@ v2_output1: jumpi // [] // ***Preset the stack for when we call pair.swap(token0Out, token1Out, to, data)*** - returndatasize // [retsize] - returndatasize // [retoffset, retsize] + push0 // [retsize] + push0 // [retoffset, retsize] 0xA4 // 164 (4 + 32 + 32 + 32 + {32 + 32}) // [argsize, retoffset, retsize] - returndatasize // [argoffset, argsize, retoffset, retsize] - returndatasize // [value, argoffset, argsize, retoffset, retsize] + push0 // [argoffset, argsize, retoffset, retsize] + push0 // [value, argoffset, argsize, retoffset, retsize] chainid calldataload 0x60 shr // [pair_address, value, argoffset, argsize, retoffset, retsize] = pair_swap_args // ***Preset the stack for when we call token.transfer*** - returndatasize // [retsize, *pair_swap_args] - returndatasize // [retoffset, retsize, *pair_swap_args] = token_transfer_args + push0 // [retsize, *pair_swap_args] + push0 // [retoffset, retsize, *pair_swap_args] = token_transfer_args // setup calldata (in memory) for transfer(to,value) - [TRANSFER_SIG] returndatasize mstore // [*token_transfer_args, *pair_swap_args] - mstore(0, 0x23b872dd) + [TRANSFER_SIG] push0 mstore // [*token_transfer_args, *pair_swap_args] - mstore(0, 0x23b872dd) dup3 0x04 mstore // [*token_transfer_args, *pair_swap_args] - mstore(36, pair_address) - // get amountIn and store at memOffset + // get amountIn and store at memOffset (5 byte encoding) 0x29 calldataload dup1 0x08 shl swap1 // extract encodedValue by removing memOffset 0x00 byte mstore // extract memOffset and perform mstore - // call tokenIn transferFrom + // call tokenIn transfer(to,value) 0x44 // 100 (4+32+32) // [argsize, retoffset, retsize, *pair_swap_args] !expanded token_transfer_args - returndatasize // [argoffset, argsize, retoffset, retsize, *pair_swap_args] - returndatasize // [value, argoffset, argsize, retoffset, retsize, *pair_swap_args] = token_transfer_args + push0 // [argoffset, argsize, retoffset, retsize, *pair_swap_args] + push0 // [value, argoffset, argsize, retoffset, retsize, *pair_swap_args] = token_transfer_args 0x15 calldataload 0x60 shr // [token_in_addr, value, argoffset, argsize, retoffset, retsize, *pair_swap_args] gas // [gas, token_in_addr, value, argoffset, argsize, retoffset, retsize, *pair_swap_args] call pop // [*pair_swap_args] @@ -507,7 +432,7 @@ v2_output1: stop // Make swap when Weth is token0 && input -v2_input0: +v2_frontrun0: // validate msg.sender [SEARCHER] caller eq // [is_caller_searcher] iszero // [!is_caller_searcher] @@ -515,27 +440,27 @@ v2_input0: jumpi // [] // ***Preset the stack for when we call pair.swap(token0Out, token1Out, to, data)*** - returndatasize // [retsize] - returndatasize // [retoffset, retsize] + push0 // [retsize] + push0 // [retoffset, retsize] 0xA4 // 164 (4 + 32 + 32 + 32 + {32 + 32}) // [argsize, retoffset, retsize] - returndatasize // [argoffset, argsize, retoffset, retsize] - returndatasize // [value, argoffset, argsize, retoffset, retsize] + push0 // [argoffset, argsize, retoffset, retsize] + push0 // [value, argoffset, argsize, retoffset, retsize] chainid calldataload 0x60 shr // [pair_address, value, argoffset, argsize, retoffset, retsize] = pair_swap_args // ***Preset the stack for when we call token.transfer*** - returndatasize // [retsize, *pair_swap_args] - returndatasize // [retoffset, retsize, *pair_swap_args] = token_transfer_args + push0 // [retsize, *pair_swap_args] + push0 // [retoffset, retsize, *pair_swap_args] = token_transfer_args // setup calldata for transferFrom(from,to,value) - [TRANSFER_FROM_SIG] returndatasize mstore // [*token_transfer_args, *pair_swap_args] - mstore(0, 0x23b872dd) + [TRANSFER_FROM_SIG] push0 mstore // [*token_transfer_args, *pair_swap_args] - mstore(0, 0x23b872dd) address 0x04 mstore // [*token_transfer_args, *pair_swap_args] - mstore(4, address(this)) dup3 0x24 mstore // [*token_transfer_args, *pair_swap_args] - mstore(36, pair_address) 0x0186a0 callvalue mul 0x44 mstore // [*token_transfer_args, *pair_swap_args] - mstore(68, callvalue * 100000) - // call weth transferFrom + // call weth transferFrom(from,to,value) 0x64 // 100 (4+32+32+32) // [argsize, retoffset, retsize, *pair_swap_args] !expanded token_transfer_args - returndatasize // [argoffset, argsize, retoffset, retsize, *pair_swap_args] - returndatasize // [value, argoffset, argsize, retoffset, retsize, *pair_swap_args] = token_transfer_args + push0 // [argoffset, argsize, retoffset, retsize, *pair_swap_args] + push0 // [value, argoffset, argsize, retoffset, retsize, *pair_swap_args] = token_transfer_args [WETH] // [weth_addr, value, argoffset, argsize, retoffset, retsize, *pair_swap_args] gas // [gas, weth_addr, value, argoffset, argsize, retoffset, retsize, *pair_swap_args] call pop // [*pair_swap_args] @@ -546,7 +471,7 @@ v2_input0: 0x00 0x04 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(4, 0) 0x00 0x24 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(36, 0) **Clear Memory** - // get amountIn and store at memOffset + // get amountOut and store at memOffset (5 byte encoding) 0x15 calldataload dup1 0x08 shl swap1 // extract encodedValue by removing memOffset 0x00 byte mstore // extract memOffset and perform mstore @@ -560,7 +485,7 @@ v2_input0: stop // Make swap when Weth is token1 && input -v2_input1: +v2_frontrun1: // validate msg.sender [SEARCHER] caller eq // [is_caller_searcher] iszero // [!is_caller_searcher] @@ -568,27 +493,27 @@ v2_input1: jumpi // [] // ***Preset the stack for when we call pair.swap(token0Out, token1Out, to, data)*** - returndatasize // [retsize] - returndatasize // [retoffset, retsize] + push0 // [retsize] + push0 // [retoffset, retsize] 0xA4 // 164 (4 + 32 + 32 + 32 + {32 + 32}) // [argsize, retoffset, retsize] - returndatasize // [argoffset, argsize, retoffset, retsize] - returndatasize // [value, argoffset, argsize, retoffset, retsize] + push0 // [argoffset, argsize, retoffset, retsize] + push0 // [value, argoffset, argsize, retoffset, retsize] chainid calldataload 0x60 shr // [pair_address, value, argoffset, argsize, retoffset, retsize] = pair_swap_args // ***Preset the stack for when we call token.transfer*** - returndatasize // [retsize, *pair_swap_args] - returndatasize // [retoffset, retsize, *pair_swap_args] = token_transfer_args + push0 // [retsize, *pair_swap_args] + push0 // [retoffset, retsize, *pair_swap_args] = token_transfer_args // setup calldata for transferFrom(from,to,value) - [TRANSFER_FROM_SIG] returndatasize mstore // [*token_transfer_args, *pair_swap_args] - mstore(0, 0x23b872dd) + [TRANSFER_FROM_SIG] push0 mstore // [*token_transfer_args, *pair_swap_args] - mstore(0, 0x23b872dd) address 0x04 mstore // [*token_transfer_args, *pair_swap_args] - mstore(4, address(this)) dup3 0x24 mstore // [*token_transfer_args, *pair_swap_args] - mstore(36, pair_address) 0x0186a0 callvalue mul 0x44 mstore // [*token_transfer_args, *pair_swap_args] - mstore(68, callvalue * 100000) - // call weth transferFrom + // call weth transferFrom(from,to,value) 0x64 // 100 (4+32+32+32) // [argsize, retoffset, retsize, *pair_swap_args] !expanded token_transfer_args - returndatasize // [argoffset, argsize, retoffset, retsize, *pair_swap_args] - returndatasize // [value, argoffset, argsize, retoffset, retsize, *pair_swap_args] = token_transfer_args + push0 // [argoffset, argsize, retoffset, retsize, *pair_swap_args] + push0 // [value, argoffset, argsize, retoffset, retsize, *pair_swap_args] = token_transfer_args [WETH] // [weth_addr, value, argoffset, argsize, retoffset, retsize, *pair_swap_args] gas // [gas, weth_addr, value, argoffset, argsize, retoffset, retsize, *pair_swap_args] call pop // [*pair_swap_args] @@ -597,7 +522,7 @@ v2_input1: [V2_Swap_Sig] 0x00 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(0, 0x022c0d9f) 0x00 0x04 mstore // [pair_address, value, argoffset, argsize, retoffset, retsize] - mstore(4, 0) **Clear Memory** - // get amountIn and store at memOffset + // get amountOut and store at memOffset (5 byte encoding) 0x15 calldataload dup1 0x08 shl swap1 // extract encodedValue by removing memOffset 0x00 byte mstore // extract memOffset and perform mstore @@ -614,9 +539,9 @@ v2_input1: // incase you deploy with metamorphic factory seppuku: // validate caller - [HELPER] caller eq // [is_caller_helper] - iszero // [!is_caller_helper] - gtfo // [gtfo_label, is_caller_helper] + [SEARCHER] caller eq // [is_caller_searcher] + iszero // [!is_caller_searcher] + gtfo // [gtfo_label, is_caller_searcher] jumpi // [] caller // [caller] @@ -625,20 +550,19 @@ seppuku: recover_eth: // validate caller - [HELPER] caller eq // [is_caller_helper] - iszero // [!is_caller_helper] - gtfo // [gtfo_label, is_caller_helper] + [SEARCHER] caller eq // [is_caller_searcher] + iszero // [!is_caller_searcher] + gtfo // [gtfo_label, is_caller_searcher] jumpi // [] - returndatasize // [retsize] - returndatasize // [retoffset, retsize] - returndatasize // [argsize, retoffset, retsize] - returndatasize // [argoffset, argsize, retoffset, retsize] + push0 // [retsize] + push0 // [retoffset, retsize] + push0 // [argsize, retoffset, retsize] + push0 // [argoffset, argsize, retoffset, retsize] selfbalance // [contract_value, argoffset, argsize, retoffset, retsize] caller // [caller, contract_value, argoffset, argsize, retoffset, retsize] gas // [gas, caller, contract_value, argoffset, argsize, retoffset, retsize] - call - + call // [] stop // +-----------+---------------------------+ @@ -648,9 +572,9 @@ recover_eth: // +-----------+---------------------------+ recover_weth: // validate caller - [HELPER] caller eq // [is_caller_helper] - iszero // [!is_caller_helper] - gtfo // [gtfo_label, is_caller_helper] + [SEARCHER] caller eq // [is_caller_searcher] + iszero // [!is_caller_searcher] + gtfo // [gtfo_label, is_caller_searcher] jumpi // [] // prepare variables for transfer call @@ -659,11 +583,11 @@ recover_weth: chainid calldataload 0x24 mstore // store amountOut at mem(0x24) // make transfer call - returndatasize // [retsize] - returndatasize // [retoffset, retsize] + push0 // [retsize] + push0 // [retoffset, retsize] 0x44 // 68 (4 + 32 + 32) // [argsize, retoffset, retsize] - returndatasize // [argoffset, argsize, retoffset, retsize] - returndatasize // [value, argoffset, argsize, retoffset, retsize] + push0 // [argoffset, argsize, retoffset, retsize] + push0 // [value, argoffset, argsize, retoffset, retsize] [WETH] // [weth_addr, value, argoffset, argsize, retoffset, retsize] gas // [gas, weth_addr, value, argoffset, argsize, retoffset, retsize] call iszero gtfo jumpi // [] * did call succeed? diff --git a/contract/test/BrainDance.t.sol b/contract/test/BrainDance.t.sol deleted file mode 100644 index 8e43f23..0000000 --- a/contract/test/BrainDance.t.sol +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "forge-std/Test.sol"; -import "forge-std/Vm.sol"; -import "forge-std/console.sol"; -import { IWETH } from "../interfaces/IWETH.sol"; -import "v2-core/interfaces/IUniswapV2Pair.sol"; -import "v2-core/interfaces/IUniswapV2Factory.sol"; -import "v2-periphery/interfaces/IUniswapV2Router02.sol"; - -import "../src/BrainDance.sol"; - -contract BrainDanceTest is Test { - BrainDance brainDance; - IWETH weth = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); - IERC20 usdc = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); - address wethUsdcPairV2; - - IUniswapV2Factory univ2Factory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); - - /// @notice Set up the testing suite - function setUp() public { - // Deposit ether into WETH Contract - weth.deposit{value: 10e18}(); - - brainDance = new BrainDance(); - - wethUsdcPairV2 = _getPairV2(address(weth), address(usdc)); - - // Transfer the weth to the sandwich contract - weth.transfer(address(brainDance), 10e18); - } - - function testSwapWethUsdcUniswapV3() public { - address usdcWethPoolV3_05fee = 0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640; - brainDance.calculateSwapV3(2 ether, usdcWethPoolV3_05fee, address(weth), 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); - uint balance = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48).balanceOf(address(brainDance)); - console.log("balance: ", balance); - } - - function testSwapWethUsdtUniswapV3() public { - address wethUsdtPoolV3_30fee = 0x4e68Ccd3E89f51C3074ca5072bbAC773960dFa36; - brainDance.calculateSwapV3(2 ether, wethUsdtPoolV3_30fee, address(weth), 0xdAC17F958D2ee523a2206206994597C13D831ec7); - uint balance = IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7).balanceOf(address(brainDance)); - console.log("balance: ", balance); - } - - function testSwapWethUsdcUniswapV2() public { - (uint amountOut,) = brainDance.calculateSwapV2(2 ether, wethUsdcPairV2, address(weth), 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); - console.log("amountOut:", amountOut); - } - - function testSwapTaxedTokenUniswapV2() public { - address wagie = 0x492baa7A6450712D4bbCCa01B87F029DEe3Ea3Ec; - address wagieWethPair = _getPairV2(address(weth), wagie); - (uint amountOut,) = brainDance.calculateSwapV2(2 ether, wagieWethPair, address(weth), 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); - console.log("amountOut:", amountOut); - } - - function testSwapTokenSushiSwap() public { - (uint amountOut,) = brainDance.calculateSwapV2(2 ether, 0x397FF1542f962076d0BFE58eA045FfA2d347ACa0, address(weth), 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); - console.log("amountOut:", amountOut); - } - - function testGetBrainDanceCode() public { - bytes memory code = address(brainDance).code; - emit log_bytes(code); - } - - function _getPairV2(address tokenA, address tokenB) private view returns (address) { - return univ2Factory.getPair(tokenA, tokenB); - } -} diff --git a/contract/test/LilRouter.t.sol b/contract/test/LilRouter.t.sol new file mode 100644 index 0000000..777e553 --- /dev/null +++ b/contract/test/LilRouter.t.sol @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "forge-std/Test.sol"; +import "forge-std/console2.sol"; +import "v2-core/interfaces/IUniswapV2Pair.sol"; +import "v2-core/interfaces/IUniswapV2Factory.sol"; +import "v2-periphery/interfaces/IUniswapV2Router02.sol"; +import "v3-periphery/interfaces/IQuoter.sol"; +import "v3-core/interfaces/IUniswapV3Pool.sol"; +import "solmate/tokens/WETH.sol"; + +import "../src/LilRouter.sol"; + +/// @title LilRouterTest +/// @author 0xmouseless +/// @notice Test suite for the LilRouter contract +contract LilRouterTest is Test { + address constant weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; + IUniswapV2Factory uniV2Factory; + IUniswapV2Router02 uniV2Router; + IQuoter uniV3Quoter; + LilRouter lilRouter; + + /// @notice Set up the testing suite + function setUp() public { + lilRouter = new LilRouter(); + + uniV2Factory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); + uniV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); + uniV3Quoter = IQuoter(0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6); + WETH wrappedEther = WETH(payable(weth)); + + wrappedEther.deposit{value: 10e18}(); + wrappedEther.transfer(address(lilRouter), 10e18); + } + + /// @notice Test swapping weth to usdc and back + function testUniswapV3() public { + address usdc = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; + address usdcWethPool = 0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640; // 500 fee pool + + // swapping 2 weth to usdc + int256 amountIn = 2 ether; + uint256 amountOutExpected = _quoteV3Swap(amountIn, usdcWethPool, weth, usdc); + (uint256 amountOut,) = lilRouter.calculateSwapV3(amountIn, usdcWethPool, weth, usdc); + console2.log("swapped %d WETH for %d USDC", uint256(amountIn), amountOut); + assertEq( + amountOutExpected, amountOut, "WETH->USDC swap failed: received USDC deviates from expected router output." + ); + + // swapping received usdc back to weth + amountIn = int256(amountOut); + amountOutExpected = _quoteV3Swap(amountIn, usdcWethPool, usdc, weth); + (amountOut,) = lilRouter.calculateSwapV3(amountIn, usdcWethPool, usdc, weth); + console2.log("swapped %d USDC for %d WETH", uint256(amountIn), amountOut); + assertEq( + amountOutExpected, amountOut, "USDC->WETH swap failed: received WETH deviates from expected router output." + ); + } + + /// @notice Test swapping weth to usdc and back + function testUniswapV2() public { + address usdc = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; + address usdcWethPair = _getPairUniV2(usdc, address(weth)); + + // swapping 2 weth to usdc + uint256 amountIn = 2 ether; + uint256 amountOutExpected = _quoteV2Swap(amountIn, usdcWethPair, weth < usdc); + (uint256 amountOut,) = lilRouter.calculateSwapV2(amountIn, usdcWethPair, weth, usdc); + console2.log("swapped %d WETH for %d USDC", amountIn, amountOut); + assertEq( + amountOutExpected, amountOut, "WETH->USDC swap failed: received USDC deviates from expected router output." + ); + + // swapping received usdc back to weth + amountIn = amountOut; + amountOutExpected = _quoteV2Swap(amountIn, usdcWethPair, usdc < weth); + (amountOut,) = lilRouter.calculateSwapV2(amountIn, usdcWethPair, usdc, weth); + console2.log("swapped %d USDC for %d WETH", amountIn, amountOut); + assertEq( + amountOutExpected, amountOut, "USDC->WETH swap failed: received WETH deviates from expected router output." + ); + } + + /// @notice Get the deployed LilRouter bytecode (we inject this into evm instances for simulations) + function testGetLilRouterCode() public { + bytes memory code = address(lilRouter).code; + emit log_bytes(code); + } + + // ------------- + // -- HELPERS -- + // ------------- + function _quoteV3Swap(int256 amountIn, address _pool, address tokenIn, address tokenOut) + private + returns (uint256 amountOut) + { + IUniswapV3Pool pool = IUniswapV3Pool(_pool); + + // wether tokenIn is token0 or token1 + bool zeroForOne = tokenIn < tokenOut; + // From docs: The Q64.96 sqrt price limit. If zero for one, + // The price cannot be less than this value after the swap. + // If one for zero, the price cannot be greater than this value after the swap + uint160 sqrtPriceLimitX96 = (zeroForOne ? 4295128749 : 1461446703485210103287273052203988822378723970341); + + amountOut = + uniV3Quoter.quoteExactInputSingle(tokenIn, tokenOut, pool.fee(), uint256(amountIn), sqrtPriceLimitX96); + } + + function _quoteV2Swap(uint256 amountIn, address pair, bool isInputToken0) + private + view + returns (uint256 amountOut) + { + (uint256 reserveIn, uint256 reserveOut,) = IUniswapV2Pair(pair).getReserves(); + + if (!isInputToken0) { + // reserveIn is token1 + (reserveIn, reserveOut) = (reserveOut, reserveIn); + } + + amountOut = uniV2Router.getAmountOut(amountIn, reserveIn, reserveOut); + } + + function _getPairUniV2(address tokenA, address tokenB) private view returns (address pair) { + pair = uniV2Factory.getPair(tokenA, tokenB); + } +} diff --git a/contract/test/Sando.t.sol b/contract/test/Sando.t.sol new file mode 100644 index 0000000..f4a39fd --- /dev/null +++ b/contract/test/Sando.t.sol @@ -0,0 +1,324 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.15; + +import "forge-std/Test.sol"; +import "foundry-huff/HuffDeployer.sol"; +import "v3-core/interfaces/IUniswapV3Pool.sol"; +import "solmate/tokens/ERC20.sol"; +import "solmate/tokens/WETH.sol"; + +import "./misc/GeneralHelper.sol"; +import "./misc/V2SandoUtility.sol"; +import "./misc/V3SandoUtility.sol"; +import "./misc/SandoCommon.sol"; + +// Need custom interface cause USDT does not return a bool after swap +// see more here: https://github.com/d-xo/weird-erc20#missing-return-values +interface IUSDT { + function transfer(address to, uint256 value) external; +} + +/// @title SandoTest +/// @author 0xmouseless +/// @notice Test suite for the huff sando contract +contract SandoTest is Test { + // wallet associated with private key 0x1 + address constant searcher = 0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf; + WETH weth = WETH(payable(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)); + uint256 wethFundAmount = 100 ether; + address sando; + + function setUp() public { + // change this if ur node isn't hosted on localhost:8545 + vm.createSelectFork("http://localhost:8545", 17401879); + sando = HuffDeployer.deploy("sando"); + + // fund sando + weth.deposit{value: wethFundAmount}(); + weth.transfer(sando, wethFundAmount); + + payable(searcher).transfer(100 ether); + } + + function testRecoverEth() public { + vm.startPrank(searcher); + + uint256 sandoBalanceBefore = address(sando).balance; + uint256 eoaBalanceBefore = address(searcher).balance; + + (bool s,) = sando.call(abi.encodePacked(SandoCommon.getJumpDestFromSig("recoverEth"))); + assertTrue(s, "calling recoverEth failed"); + + assertTrue(address(sando).balance == 0, "sando ETH balance should be zero after calling recover eth"); + assertTrue( + address(searcher).balance == eoaBalanceBefore + sandoBalanceBefore, + "searcher should gain all eth from sando" + ); + } + + function testSepukku() public { + vm.startPrank(searcher); + (bool s,) = sando.call(abi.encodePacked(SandoCommon.getJumpDestFromSig("seppuku"))); + assertTrue(s, "calling seppuku failed"); + } + + function testRecoverWeth() public { + vm.startPrank(searcher); + + uint256 sandoBalanceBefore = weth.balanceOf(sando); + uint256 searcherBalanceBefore = weth.balanceOf(searcher); + + (bool s,) = sando.call(abi.encodePacked(SandoCommon.getJumpDestFromSig("recoverWeth"), sandoBalanceBefore)); + assertTrue(s, "failed to call recoverWeth"); + + assertTrue(weth.balanceOf(sando) == 0, "sando WETH balance should be zero after calling recoverWeth"); + assertTrue( + weth.balanceOf(searcher) == searcherBalanceBefore + sandoBalanceBefore, + "searcher should gain all weth from sando after calling recoverWeth" + ); + } + + function testUnauthorizedAccessToCallback(address trespasser, bytes32 fakePoolKeyHash) public { + vm.startPrank(trespasser); + vm.deal(address(trespasser), 5 ether); + /* + function uniswapV3SwapCallback( + int256 amount0Delta, + int256 amount1Delta, + bytes data + ) external + + custom data = abi.encodePacked(isZeroForOne, input_token, pool_key_hash) + */ + bytes memory payload = + abi.encodePacked(uint8(250), uint256(5 ether), uint256(5 ether), uint8(1), address(weth), fakePoolKeyHash); // 0xfa = 250 + (bool s,) = sando.call(payload); + assertFalse(s, "only pools should be able to call callback"); + } + + function testV3FrontrunWeth1(uint256 inputWethAmount) public { + IUniswapV3Pool pool = IUniswapV3Pool(0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640); // USDC - WETH + (, address outputToken) = (pool.token1(), pool.token0()); + + // make sure fuzzed value is within bounds + inputWethAmount = bound(inputWethAmount, WethEncodingUtils.encodeMultiple(), weth.balanceOf(sando)); + + (bytes memory payload, uint256 encodedValue) = + V3SandoUtility.v3CreateFrontrunPayload(pool, outputToken, int256(inputWethAmount)); + + vm.prank(searcher, searcher); + (bool s,) = address(sando).call{value: encodedValue}(payload); + + assertTrue(s, "calling swap failed"); + } + + function testV3FrontrunWeth0(uint256 inputWethAmount) public { + IUniswapV3Pool pool = IUniswapV3Pool(0x7379e81228514a1D2a6Cf7559203998E20598346); // ETH - STETH + (address outputToken,) = (pool.token1(), pool.token0()); + + // make sure fuzzed value is within bounds + inputWethAmount = bound(inputWethAmount, WethEncodingUtils.encodeMultiple(), weth.balanceOf(sando)); + + (bytes memory payload, uint256 encodedValue) = + V3SandoUtility.v3CreateFrontrunPayload(pool, outputToken, int256(inputWethAmount)); + + vm.prank(searcher, searcher); + (bool s,) = address(sando).call{value: encodedValue}(payload); + + assertTrue(s, "calling swap failed"); + } + + function testV3BackrunWeth0(uint256 inputBttAmount) public { + IUniswapV3Pool pool = IUniswapV3Pool(0x64A078926AD9F9E88016c199017aea196e3899E1); + (address inputToken,) = (pool.token1(), pool.token0()); + + // make sure fuzzed value is within bounds + address sugarDaddy = 0x9277a463A508F45115FdEaf22FfeDA1B16352433; + inputBttAmount = bound(inputBttAmount, 1, ERC20(inputToken).balanceOf(sugarDaddy)); + + // fund sando contract + vm.startPrank(sugarDaddy); + IUSDT(inputToken).transfer(sando, uint256(inputBttAmount)); + + bytes memory payload = V3SandoUtility.v3CreateBackrunPayload(pool, inputToken, int256(inputBttAmount)); + + changePrank(searcher, searcher); + (bool s,) = address(sando).call(payload); + assertTrue(s, "calling swap failed"); + } + + function testV3BackrunWeth1(uint256 inputDaiAmount) public { + IUniswapV3Pool pool = IUniswapV3Pool(0xC2e9F25Be6257c210d7Adf0D4Cd6E3E881ba25f8); + (address inputToken,) = (pool.token0(), pool.token1()); + + // make sure fuzzed value is within bounds + address sugarDaddy = 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643; + inputDaiAmount = bound(inputDaiAmount, 1, ERC20(inputToken).balanceOf(sugarDaddy)); + + // fund sando contract + vm.startPrank(sugarDaddy); + ERC20(inputToken).transfer(sando, uint256(inputDaiAmount)); + + bytes memory payload = V3SandoUtility.v3CreateBackrunPayload(pool, inputToken, int256(inputDaiAmount)); + + changePrank(searcher, searcher); + (bool s,) = address(sando).call(payload); + assertTrue(s, "calling swap failed"); + } + + // +-------------------------------+ + // | Generic Tests | + // +-------------------------------+ + // could decompose further but ran into issues with vm.assume/vm.bound when fuzzing + function testV2FrontrunWeth0(uint256 inputWethAmount) public { + address usdtAddress = 0xdAC17F958D2ee523a2206206994597C13D831ec7; + + // make sure fuzzed value is within bounds + inputWethAmount = bound(inputWethAmount, WethEncodingUtils.encodeMultiple(), weth.balanceOf(sando)); + + // capture pre swap state + uint256 preSwapWethBalance = weth.balanceOf(sando); + uint256 preSwapUsdtBalance = ERC20(usdtAddress).balanceOf(sando); + + // calculate expected values + uint256 actualWethInput = WethEncodingUtils.decode(WethEncodingUtils.encode(inputWethAmount)); + uint256 actualUsdtOutput = GeneralHelper.getAmountOut(address(weth), usdtAddress, actualWethInput); + uint256 expectedUsdtOutput = FiveBytesEncodingUtils.decode(FiveBytesEncodingUtils.encode(actualUsdtOutput)); + + // need this to pass because: https://github.com/Uniswap/v2-core/blob/master/contracts/UniswapV2Pair.sol#L160 + vm.assume(expectedUsdtOutput > 0); + + (bytes memory calldataPayload, uint256 wethEncodedValue) = + V2SandoUtility.v2CreateFrontrunPayload(usdtAddress, inputWethAmount); + vm.prank(searcher); + (bool s,) = address(sando).call{value: wethEncodedValue}(calldataPayload); + assertTrue(s); + + // check values after swap + assertEq( + ERC20(usdtAddress).balanceOf(sando) - preSwapUsdtBalance, + expectedUsdtOutput, + "did not get expected usdt amount out from swap" + ); + assertEq(preSwapWethBalance - weth.balanceOf(sando), actualWethInput, "unexpected amount of weth used in swap"); + } + + function testV2FrontrunWeth1(uint256 inputWethAmount) public { + address usdcAddress = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; + + // make sure fuzzed value is within bounds + inputWethAmount = bound(inputWethAmount, WethEncodingUtils.encodeMultiple(), weth.balanceOf(sando)); + + // capture pre swap state + uint256 preSwapWethBalance = weth.balanceOf(sando); + uint256 preSwapUsdcBalance = ERC20(usdcAddress).balanceOf(sando); + + // calculate expected values + uint256 actualWethInput = WethEncodingUtils.decode(WethEncodingUtils.encode(inputWethAmount)); + uint256 actualUsdcOutput = GeneralHelper.getAmountOut(address(weth), usdcAddress, actualWethInput); + uint256 expectedUsdcOutput = FiveBytesEncodingUtils.decode(FiveBytesEncodingUtils.encode(actualUsdcOutput)); + + // need this to pass because: https://github.com/Uniswap/v2-core/blob/master/contracts/UniswapV2Pair.sol#L160 + vm.assume(expectedUsdcOutput > 0); + + (bytes memory calldataPayload, uint256 wethEncodedValue) = + V2SandoUtility.v2CreateFrontrunPayload(usdcAddress, inputWethAmount); + vm.prank(searcher); + (bool s,) = address(sando).call{value: wethEncodedValue}(calldataPayload); + assertTrue(s); + + // check values after swap + assertEq( + ERC20(usdcAddress).balanceOf(sando) - preSwapUsdcBalance, + expectedUsdcOutput, + "did not get expected usdc amount out from swap" + ); + assertEq(preSwapWethBalance - weth.balanceOf(sando), actualWethInput, "unexpected amount of weth used in swap"); + } + + function testV2BackrunWeth0(uint256 inputSuperAmount) public { + address superAddress = 0xe53EC727dbDEB9E2d5456c3be40cFF031AB40A55; // superfarm token + address sugarDaddy = 0xF977814e90dA44bFA03b6295A0616a897441aceC; + + // make sure fuzzed value is within bounds + inputSuperAmount = bound(inputSuperAmount, 1, ERC20(superAddress).balanceOf(sugarDaddy)); + + // fund sando + vm.prank(sugarDaddy); + IUSDT(superAddress).transfer(sando, inputSuperAmount); + + // capture pre swap state + uint256 preSwapWethBalance = weth.balanceOf(sando); + uint256 preSwapSuperBalance = ERC20(superAddress).balanceOf(sando); + + // calculate expected values + uint256 actualFarmInput = FiveBytesEncodingUtils.decode(FiveBytesEncodingUtils.encode(preSwapSuperBalance)); + uint256 actualWethOutput = GeneralHelper.getAmountOut(superAddress, address(weth), actualFarmInput); + uint256 expectedWethOutput = WethEncodingUtils.decode(WethEncodingUtils.encode(actualWethOutput)); + + // need this to pass because: https://github.com/Uniswap/v2-core/blob/master/contracts/UniswapV2Pair.sol#L160 + vm.assume(expectedWethOutput > 0); + + // perform swap + (bytes memory calldataPayload, uint256 wethEncodedValue) = + V2SandoUtility.v2CreateBackrunPayload(superAddress, inputSuperAmount); + vm.prank(searcher); + (bool s,) = address(sando).call{value: wethEncodedValue}(calldataPayload); + assertTrue(s, "swap failed"); + + // check values after swap + assertEq( + weth.balanceOf(sando) - preSwapWethBalance, + expectedWethOutput, + "did not get expected weth amount out from swap" + ); + assertEq( + preSwapSuperBalance - ERC20(superAddress).balanceOf(sando), + actualFarmInput, + "unexpected amount of superFarm used in swap" + ); + } + + function testV2BackrunWeth1(uint256 inputDaiAmount) public { + address daiAddress = 0x6B175474E89094C44Da98b954EedeAC495271d0F; // DAI + address sugarDaddy = 0x47ac0Fb4F2D84898e4D9E7b4DaB3C24507a6D503; + + // make sure fuzzed value is within bounds + inputDaiAmount = bound(inputDaiAmount, 1, ERC20(daiAddress).balanceOf(sugarDaddy)); + + // fund sando + vm.prank(sugarDaddy); + ERC20(daiAddress).transfer(sando, inputDaiAmount); + + // capture pre swap state + uint256 preSwapWethBalance = weth.balanceOf(sando); + uint256 preSwapDaiBalance = ERC20(daiAddress).balanceOf(sando); + + // calculate expected values + uint256 actualDaiInput = FiveBytesEncodingUtils.decode(FiveBytesEncodingUtils.encode(preSwapDaiBalance)); + uint256 actualWethOutput = GeneralHelper.getAmountOut(daiAddress, address(weth), actualDaiInput); + uint256 expectedWethOutput = WethEncodingUtils.decode(WethEncodingUtils.encode(actualWethOutput)); + + // need this to pass because: https://github.com/Uniswap/v2-core/blob/master/contracts/UniswapV2Pair.sol#L160 + vm.assume(expectedWethOutput > 0); + + // perform swap + (bytes memory calldataPayload, uint256 wethEncodedValue) = + V2SandoUtility.v2CreateBackrunPayload(daiAddress, inputDaiAmount); + vm.prank(searcher); + (bool s,) = address(sando).call{value: wethEncodedValue}(calldataPayload); + assertTrue(s, "swap failed"); + + // check values after swap + assertEq( + weth.balanceOf(sando) - preSwapWethBalance, + expectedWethOutput, + "did not get expected weth amount out from swap" + ); + assertEq( + preSwapDaiBalance - ERC20(daiAddress).balanceOf(sando), + actualDaiInput, + "unexpected amount of dai used in swap" + ); + } +} diff --git a/contract/test/Sandwich.t.sol b/contract/test/Sandwich.t.sol deleted file mode 100644 index 5582809..0000000 --- a/contract/test/Sandwich.t.sol +++ /dev/null @@ -1,516 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.15; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import "foundry-huff/HuffDeployer.sol"; -import "v3-core/interfaces/IUniswapV3Pool.sol"; - -import {IWETH} from "./interfaces/IWETH.sol"; -import "./interfaces/IERC20.sol"; -import "./helpers/GeneralHelper.sol"; -import "./helpers/SandwichHelper.sol"; - -// Need custom interface cause USDT does not return a bool after swap -// see more here: https://github.com/d-xo/weird-erc20#missing-return-values -interface IUSDT { - function transfer(address to, uint256 value) external; -} - -contract ModSandwichV4 is Test { - address binance8 = 0xF977814e90dA44bFA03b6295A0616a897441aceC; - address keeperdao = 0x9a67F1940164d0318612b497E8e6038f902a00a4; - - // serachers - address constant admin = 0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf; - address constant helper = 0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF; - - IWETH weth = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); - uint256 wethFundAmount = 1000000000 ether; - address sandwich; - - SandwichHelper sandwichHelper; - - function setUp() public { - sandwichHelper = new SandwichHelper(); - sandwich = HuffDeployer.deploy("sandwich"); - - // fund sandwich - weth.deposit{value: wethFundAmount}(); - weth.transfer(sandwich, wethFundAmount); - - // apparently if you want to prank addy they need to pay for gas - // hours wasted on this :< - payable(admin).transfer(100 ether); - payable(helper).transfer(100 ether); - } - - function testBreakUniswapV3Callback() public { - vm.startPrank(address(0x69696969)); - - bytes memory payload = abi.encodePacked(uint8(250)); // 0xfa = 250 - (bool s, ) = sandwich.call(payload); - assertFalse(s, "only pools should be able to call callback"); - } - - // helper - function _getV3PoolInfo( - address _pool - ) internal view returns (address token0, address token1, uint24 fee) { - IUniswapV3Pool pool = IUniswapV3Pool(_pool); - token0 = pool.token0(); - token1 = pool.token1(); - fee = pool.fee(); - } - - function testV3Weth1Input() public { - address pool = 0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640; // USDC - WETH - (address token0, address token1, uint24 fee) = _getV3PoolInfo(pool); - int256 amountIn = 1.2345678912341234 ether; - - (address inputToken, address outputToken) = (token1, token0); - - (bytes memory payload, uint256 encodedValue) = sandwichHelper - .v3CreateSandwichPayloadWethIsInput( - pool, - inputToken, - outputToken, - fee, - amountIn - ); - - vm.prank(admin, admin); - (bool s, ) = address(sandwich).call{value: encodedValue}(payload); - - assertTrue(s, "calling swap failed"); - } - - function testV3Weth0Input() public { - address pool = 0x7379e81228514a1D2a6Cf7559203998E20598346; // ETH - STETH - (address token0, address token1, uint24 fee) = _getV3PoolInfo(pool); - int256 amountIn = 1.2345678912341234 ether; - - (address outputToken, address inputToken) = (token1, token0); - - (bytes memory payload, uint256 encodedValue) = sandwichHelper - .v3CreateSandwichPayloadWethIsInput( - pool, - inputToken, - outputToken, - fee, - amountIn - ); - - vm.prank(admin, admin); - (bool s, ) = address(sandwich).call{value: encodedValue}(payload); - - assertTrue(s, "calling swap failed"); - } - - function testV3Weth0OutputSmall() public { - address pool = 0x7379e81228514a1D2a6Cf7559203998E20598346; // ETH - STETH - (address token0, address token1, uint24 fee) = _getV3PoolInfo(pool); - int256 amountIn = 1e6; // 100 usdt - - (address inputToken, address outputToken) = (token1, token0); - - // fund sandwich contract - vm.startPrank(0xa48a523F3e0f1A9232BfE22bB6aE07Bb44bF36F1); - IUSDT(inputToken).transfer(sandwich, uint256(amountIn)); - - bytes memory payload = sandwichHelper - .v3CreateSandwichPayloadWethIsOutput( - pool, - inputToken, - outputToken, - fee, - amountIn - ); - - changePrank(admin); - (bool s, ) = address(sandwich).call(payload); - assertTrue(s, "v3 swap failed"); - } - - function testV3Weth0OutputBig() public { - address pool = 0x64A078926AD9F9E88016c199017aea196e3899E1; - (address token0, address token1, uint24 fee) = _getV3PoolInfo(pool); - (address inputToken, address outputToken) = (token1, token0); - - int256 amountIn = 100000 ether; // 100000 btt - - // fund sandwich contract - vm.startPrank(0x9277a463A508F45115FdEaf22FfeDA1B16352433); - IUSDT(inputToken).transfer(sandwich, uint256(amountIn)); - - bytes memory payload = sandwichHelper - .v3CreateSandwichPayloadWethIsOutput( - pool, - inputToken, - outputToken, - fee, - amountIn - ); - - changePrank(admin, admin); - (bool s, ) = address(sandwich).call(payload); - assertTrue(s, "calling swap failed"); - } - - function testV3Weth1OutputSmall() public { - address pool = 0xC2e9F25Be6257c210d7Adf0D4Cd6E3E881ba25f8; - (address token0, address token1, uint24 fee) = _getV3PoolInfo(pool); - (address inputToken, address outputToken) = (token0, token1); - int256 amountIn = 1e6; // 1000 dai - - // fund sandwich contract - vm.startPrank(0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643); - IERC20(inputToken).transfer(sandwich, uint256(amountIn)); - - bytes memory payload = sandwichHelper - .v3CreateSandwichPayloadWethIsOutput( - pool, - inputToken, - outputToken, - fee, - amountIn - ); - - changePrank(admin, admin); - (bool s, ) = address(sandwich).call(payload); - assertTrue(s, "calling swap failed"); - } - - function testV3Weth1OutputBig() public { - address pool = 0xC2e9F25Be6257c210d7Adf0D4Cd6E3E881ba25f8; - (address token0, address token1, uint24 fee) = _getV3PoolInfo(pool); - (address inputToken, address outputToken) = (token0, token1); - int256 amountIn = 1e21; // 1000 dai - - // fund sandwich contract - vm.startPrank(0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643); - IERC20(inputToken).transfer(sandwich, uint256(amountIn)); - - bytes memory payload = sandwichHelper - .v3CreateSandwichPayloadWethIsOutput( - pool, - inputToken, - outputToken, - fee, - amountIn - ); - - changePrank(admin, admin); - (bool s, ) = address(sandwich).call(payload); - assertTrue(s, "calling swap failed"); - } - - function testUnauthorized() public { - vm.startPrank(address(0xf337babe)); - vm.deal(address(0xf337babe), 200 ether); - - string memory functionName = "recoverEth"; - bytes memory payload = abi.encodePacked( - sandwichHelper.getJumpLabelFromSig(functionName) - ); - (bool s, ) = sandwich.call(payload); - - assertFalse(s, "unauthorized addresses should not call recover eth"); - - functionName = "recoverWeth"; - payload = abi.encodePacked( - sandwichHelper.getJumpLabelFromSig(functionName) - ); - (s, ) = sandwich.call(payload); - - assertFalse( - s, - "unauthorized addresses should not be able to call recover weth" - ); - - functionName = "seppuku"; - payload = abi.encodePacked( - sandwichHelper.getJumpLabelFromSig(functionName) - ); - (s, ) = sandwich.call(payload); - - assertFalse( - s, - "unauthorized addresses should not be able to seppuku contract" - ); - changePrank(helper); - (s, ) = sandwich.call(payload); - assertTrue(s, "calling recoverEth from helper failed"); - } - - function testSepukku() public { - vm.startPrank(helper); - - string memory functionName = "seppuku"; - bytes memory payload = abi.encodePacked( - sandwichHelper.getJumpLabelFromSig(functionName) - ); - (bool s, ) = sandwich.call(payload); - assertTrue(s, "calling seppuku failed"); - } - - function testRecoverEth() public { - vm.startPrank(helper); - - uint256 sandwichBalanceBefore = address(sandwich).balance; - uint256 searcherBalanceBefore = address(helper).balance; - - string memory functionName = "recoverEth"; - emit log_bytes( - abi.encodePacked(sandwichHelper.getJumpLabelFromSig(functionName)) - ); - bytes memory payload = abi.encodePacked( - sandwichHelper.getJumpLabelFromSig(functionName) - ); - (bool s, ) = sandwich.call(payload); - assertTrue(s, "calling recoverEth failed"); - - uint256 sandwichBalanceAfter = address(sandwich).balance; - uint256 searcherBalanceAfter = address(helper).balance; - - // check balance change - assertTrue( - sandwichBalanceAfter == 0, - "sandwich eth balance should be zero" - ); - assertTrue( - searcherBalanceAfter == - searcherBalanceBefore + sandwichBalanceBefore, - "searcher should gain all eth from sandwich" - ); - } - - // Test by recovering the initial funded amount - function testRecoverWeth() public { - vm.startPrank(helper); - - uint256 sandwichBalanceBefore = weth.balanceOf(sandwich); - uint256 searcherBalanceBefore = weth.balanceOf(helper); - - string memory functionName = "recoverWeth"; - bytes memory payload = abi.encodePacked( - sandwichHelper.getJumpLabelFromSig(functionName), - sandwichBalanceBefore - ); - (bool s, ) = sandwich.call(payload); - assertTrue(s, "calling recoverWeth failed"); - - uint256 sandwichBalanceAfter = weth.balanceOf(sandwich); - uint256 searcherBalanceAfter = weth.balanceOf(helper); - - // check balance change - assertTrue( - sandwichBalanceAfter == 0, - "sandwich weth balance should be zero" - ); - assertTrue( - searcherBalanceAfter == - searcherBalanceBefore + sandwichBalanceBefore, - "searcher should gain all weth from sandwich" - ); - } - - // +-------------------------------+ - // | Generic Tests | - // +-------------------------------+ - // could add fuzzing / testing to test values at limits/boundary - - function testV2Weth0Input() public { - address outputToken = 0xdAC17F958D2ee523a2206206994597C13D831ec7; // Tether - uint256 amountIn = 1.94212341234123424 ether; - - // Pre swap checks - uint256 wethBalanceBefore = weth.balanceOf(sandwich); - uint256 usdtBalanceBefore = IERC20(outputToken).balanceOf(sandwich); - - uint256 actualAmountIn = (amountIn / - sandwichHelper.wethEncodeMultiple()) * - sandwichHelper.wethEncodeMultiple(); - uint256 amountOutFromEncoded = GeneralHelper.getAmountOut( - address(weth), - outputToken, - actualAmountIn - ); - (, , uint256 expectedAmountOut) = sandwichHelper - .encodeNumToByteAndOffset(amountOutFromEncoded, 4, true, false); - - (bytes memory payloadV4, uint256 encodedValue) = sandwichHelper - .v2CreateSandwichPayloadWethIsInput(outputToken, amountIn); - vm.prank(admin); - (bool s, ) = address(sandwich).call{value: encodedValue}(payloadV4); - assertTrue(s); - - // Check values after swap - uint256 wethBalanceChange = wethBalanceBefore - - weth.balanceOf(sandwich); - uint256 usdtBalanceChange = IERC20(outputToken).balanceOf(sandwich) - - usdtBalanceBefore; - - assertEq( - usdtBalanceChange, - expectedAmountOut, - "did not get expected usdt amount out from swap" - ); - assertEq( - wethBalanceChange, - actualAmountIn, - "unexpected amount of weth used in swap" - ); - } - - function testV2Weth1Input() public { - address outputToken = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; // USDC - uint256 amountIn = 0.942 ether; - - // Pre swap checks - uint256 wethBalanceBefore = weth.balanceOf(sandwich); - uint256 usdcBalanceBefore = IERC20(outputToken).balanceOf(sandwich); - - uint256 actualAmountIn = (amountIn / - sandwichHelper.wethEncodeMultiple()) * - sandwichHelper.wethEncodeMultiple(); - uint256 amountOutFromEncoded = GeneralHelper.getAmountOut( - address(weth), - outputToken, - actualAmountIn - ); - (, , uint256 expectedAmountOut) = sandwichHelper - .encodeNumToByteAndOffset(amountOutFromEncoded, 4, true, false); - - (bytes memory payloadV4, uint256 encodedValue) = sandwichHelper - .v2CreateSandwichPayloadWethIsInput(outputToken, amountIn); - vm.prank(admin); - (bool s, ) = address(sandwich).call{value: encodedValue}(payloadV4); - assertTrue(s); - - // Check values after swap - uint256 wethBalanceChange = wethBalanceBefore - - weth.balanceOf(sandwich); - uint256 usdcBalanceChange = IERC20(outputToken).balanceOf(sandwich) - - usdcBalanceBefore; - - assertEq( - usdcBalanceChange, - expectedAmountOut, - "did not get expected usdc amount out from swap" - ); - assertEq( - wethBalanceChange, - actualAmountIn, - "unexpected amount of weth used in swap" - ); - } - - function testV2Weth0Output() public { - address inputToken = 0xe53EC727dbDEB9E2d5456c3be40cFF031AB40A55; // superfarm - uint256 amountIn = 1000000 * 10 ** 18; - - // Fund sandwich - vm.prank(binance8); - IUSDT(inputToken).transfer(sandwich, amountIn); - - // Pre swap checks - uint256 wethBalanceBefore = weth.balanceOf(sandwich); - uint256 superFarmBalanceBefore = IERC20(inputToken).balanceOf(sandwich); - - (, , uint256 actualAmountIn) = sandwichHelper.encodeNumToByteAndOffset( - superFarmBalanceBefore, - 4, - false, - true - ); - uint256 amountOutFromEncoded = GeneralHelper.getAmountOut( - inputToken, - address(weth), - actualAmountIn - ); - uint256 expectedAmountOut = (amountOutFromEncoded / - sandwichHelper.wethEncodeMultiple()) * - sandwichHelper.wethEncodeMultiple(); - - // Perform swap - (bytes memory payloadV4, uint256 encodedValue) = sandwichHelper - .v2CreateSandwichPayloadWethIsOutput(inputToken, amountIn); - emit log_bytes(payloadV4); - vm.prank(admin); - (bool s, ) = address(sandwich).call{value: encodedValue}(payloadV4); - assertTrue(s, "swap failed"); - - // Check values after swap - uint256 wethBalanceChange = weth.balanceOf(sandwich) - - wethBalanceBefore; - uint256 superFarmBalanceChange = superFarmBalanceBefore - - IERC20(inputToken).balanceOf(sandwich); - - assertEq( - wethBalanceChange, - expectedAmountOut, - "did not get expected weth amount out from swap" - ); - assertEq( - superFarmBalanceChange, - actualAmountIn, - "unexpected amount of superFarm used in swap" - ); - } - - function testV2Weth1Output() public { - address inputToken = 0x6B175474E89094C44Da98b954EedeAC495271d0F; // DAI - uint256 amountIn = 4722.366481770134 ether; // encoded as 0xFFFFFFFF0000000000 - - console.log("amountIn:", amountIn); - - // Fund sandwich - vm.prank(0x47ac0Fb4F2D84898e4D9E7b4DaB3C24507a6D503); - IERC20(inputToken).transfer(sandwich, amountIn); - - // Pre swap checks - uint256 wethBalanceBefore = weth.balanceOf(sandwich); - uint256 daiBalanceBefore = IERC20(inputToken).balanceOf(sandwich); - - (, , uint256 actualAmountIn) = sandwichHelper.encodeNumToByteAndOffset( - daiBalanceBefore, - 4, - false, - false - ); - uint256 amountOutFromEncoded = GeneralHelper.getAmountOut( - inputToken, - address(weth), - actualAmountIn - ); - uint256 expectedAmountOut = (amountOutFromEncoded / - sandwichHelper.wethEncodeMultiple()) * - sandwichHelper.wethEncodeMultiple(); - - // Perform swap - (bytes memory payload, uint256 encodedValue) = sandwichHelper - .v2CreateSandwichPayloadWethIsOutput(inputToken, amountIn); - emit log_bytes(payload); - vm.prank(admin); - (bool s, ) = address(sandwich).call{value: encodedValue}(payload); - assertTrue(s, "swap failed"); - - // Check values after swap - uint256 wethBalanceChange = weth.balanceOf(sandwich) - - wethBalanceBefore; - uint256 daiBalanceChange = daiBalanceBefore - - IERC20(inputToken).balanceOf(sandwich); - - assertEq( - wethBalanceChange, - expectedAmountOut, - "did not get expected weth amount out from swap" - ); - assertEq( - daiBalanceChange, - actualAmountIn, - "unexpected amount of dai used in swap" - ); - } -} diff --git a/contract/test/helpers/GeneralHelper.sol b/contract/test/helpers/GeneralHelper.sol deleted file mode 100644 index 83080da..0000000 --- a/contract/test/helpers/GeneralHelper.sol +++ /dev/null @@ -1,93 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.15; - -import "v2-core/interfaces/IUniswapV2Pair.sol"; -import "v2-core/interfaces/IUniswapV2Factory.sol"; -import "v2-periphery/interfaces/IUniswapV2Router02.sol"; -import "forge-std/console.sol"; - -library GeneralHelper { - function getAmountOut(address inputToken, address outputToken, uint amountIn) public view returns (uint amountOut) { - // Declare uniswapv2 types - IUniswapV2Router02 univ2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); - - (uint reserveToken0, uint reserveToken1,) = IUniswapV2Pair(getUniswapPair(inputToken, outputToken)).getReserves(); - - uint reserveIn; - uint reserveOut; - - if (inputToken < outputToken) { - // inputToken is token0 - reserveIn = reserveToken0; - reserveOut = reserveToken1; - } else { - // inputToken is token1 - reserveIn = reserveToken1; - reserveOut = reserveToken0; - } - - //console.log("reserveIn", reserveIn); - //console.log("reserveOut", reserveOut); - - // Get amounts out - amountOut = univ2Router.getAmountOut(amountIn, reserveIn, reserveOut); - } - - function getAmountIn(address inputToken, address outputToken, uint amountOut) public view returns (uint amountIn) { - // Declare uniswapv2 types - IUniswapV2Router02 univ2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); - - (uint reserveToken0, uint reserveToken1,) = IUniswapV2Pair(getUniswapPair(inputToken, outputToken)).getReserves(); - - uint reserveIn; - uint reserveOut; - - if (inputToken < outputToken) { - // inputToken is token0 - reserveIn = reserveToken0; - reserveOut = reserveToken1; - } else { - // inputToken is token1 - reserveIn = reserveToken1; - reserveOut = reserveToken0; - } - - //console.log("reserveIn", reserveIn); - //console.log("reserveOut", reserveOut); - - // Get amounts out - amountIn = univ2Router.getAmountIn(amountOut, reserveIn, reserveOut); - } - - function getUniswapPair(address tokenA, address tokenB) public view returns (address pair) { - // Declare uniswapv2 types - IUniswapV2Factory univ2Factory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); - - pair = address(IUniswapV2Pair( - univ2Factory.getPair(address(tokenA), address(tokenB)) - )); - } - - function getSushiSwapPair(address tokenA, address tokenB) public view returns (address pair) { - // Declare uniswapv2 types - IUniswapV2Factory univ2Factory = IUniswapV2Factory(0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac); - - pair = address(IUniswapV2Pair( - univ2Factory.getPair(address(tokenA), address(tokenB)) - )); - } - - // one off helper, might use later idk - function repeatString(string calldata s, uint num) public pure returns (string memory) { - if (num == 0) { - return "NONE"; - } - - string memory r = s; - for (uint i = 1; i < num; i++) { - r = string.concat(r, s); - } - return r; - } - -} diff --git a/contract/test/helpers/SandwichHelper.sol b/contract/test/helpers/SandwichHelper.sol deleted file mode 100644 index f8f2c47..0000000 --- a/contract/test/helpers/SandwichHelper.sol +++ /dev/null @@ -1,294 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.15; - -import "./GeneralHelper.sol"; -import "forge-std/Test.sol"; -//import "forge-std/console.sol"; - -contract SandwichHelper is Test { - mapping(string => uint8) internal functionSigsToJumpLabel; - - constructor() { - setupSigJumpLabelMapping(); - } - - function v3CreateSandwichPayloadWethIsInput( - address pool, - address inputToken, - address outputToken, - uint24 fee, - int256 amountIn - ) public view returns (bytes memory payload, uint256 encodedValue) { - (address token0, address token1) = inputToken < outputToken - ? (inputToken, outputToken) - : (outputToken, inputToken); - bytes32 pairInitHash = keccak256(abi.encode(token0, token1, fee)); - - uint8 swapType = _v3FindSwapType( - true, - inputToken, - outputToken, - amountIn - ); - payload = abi.encodePacked( - uint8(swapType), - address(pool), - pairInitHash - ); - encodedValue = uint256(amountIn) / wethEncodeMultiple(); - } - - function v3CreateSandwichPayloadWethIsOutput( - address pool, - address inputToken, - address outputToken, - uint24 fee, - int256 amountIn - ) public view returns (bytes memory payload) { - (address token0, address token1) = inputToken < outputToken - ? (inputToken, outputToken) - : (outputToken, inputToken); - bytes32 pairInitHash = keccak256(abi.encode(token0, token1, fee)); - - uint8 swapType = _v3FindSwapType( - false, - inputToken, - outputToken, - amountIn - ); - if (amountIn <= 281474976710655) { - // use small method - payload = abi.encodePacked( - uint8(swapType), - address(pool), - address(inputToken), - int48(amountIn), - pairInitHash - ); - } else { - int256 encodedValue = amountIn / 1e13; - // use big method - payload = abi.encodePacked( - uint8(swapType), - address(pool), - address(inputToken), - int72(encodedValue), - pairInitHash - ); - } - } - - function _v3FindSwapType( - bool isWethInput, - address inputToken, - address outputToken, - int256 amountIn - ) internal view returns (uint8) { - if (isWethInput) { - if (inputToken < outputToken) { - // weth is input and token0 - return functionSigsToJumpLabel["v3_input0"]; - } else { - // weth is input and token1 - return functionSigsToJumpLabel["v3_input1"]; - } - } else { - if (inputToken < outputToken) { - // weth is output and token1 - if (amountIn <= 281474976710655) { - // && amountIn < 281474976710655 (0xFFFFFFFFFFFF) - return functionSigsToJumpLabel["v3_output1_small"]; - } else { - return functionSigsToJumpLabel["v3_output1_big"]; - } - } else { - // weth is output and token0 - if (amountIn <= 281474976710655) { - // && amountIn < 10000000000000 - return functionSigsToJumpLabel["v3_output0_small"]; - } else { - return functionSigsToJumpLabel["v3_output0_big"]; - } - } - } - } - - // Create payload for when weth is input - function v2CreateSandwichPayloadWethIsOutput( - address otherToken, - uint256 amountIn - ) public view returns (bytes memory payload, uint256 encodedValue) { - // Declare uniswapv2 types - IUniswapV2Factory univ2Factory = IUniswapV2Factory( - 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f - ); - address weth = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); - - address pair = address( - IUniswapV2Pair(univ2Factory.getPair(weth, address(otherToken))) - ); - - // Libary function starts here - uint8 swapType = _v2FindFunctionSig(false, otherToken); - - // encode amountIn - ( - uint256 encodedAmountIn, - uint256 memoryOffset, - uint256 amountInActual - ) = encodeNumToByteAndOffset(amountIn, 4, false, false); - - payload = abi.encodePacked( - uint8(swapType), // token we're giving - address(pair), // univ2 pair - address(otherToken), // inputToken - uint8(memoryOffset), // memoryOffset to store amountIn - uint32(encodedAmountIn) // amountIn - ); - - uint256 amountOut = GeneralHelper.getAmountOut( - otherToken, - weth, - amountInActual - ); - encodedValue = amountOut / wethEncodeMultiple(); - } - - // Create payload for when weth is input - function v2CreateSandwichPayloadWethIsInput( - address otherToken, - uint256 amountIn - ) public view returns (bytes memory payload, uint256 encodedValue) { - // Declare uniswapv2 types - IUniswapV2Factory univ2Factory = IUniswapV2Factory( - 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f - ); - address weth = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); - - address pair = address( - IUniswapV2Pair(univ2Factory.getPair(weth, address(otherToken))) - ); - - // Encode amountIn here (so we can use it for next step) - uint256 amountInActual = (amountIn / wethEncodeMultiple()) * - wethEncodeMultiple(); - - // Get amounts out and encode it - ( - uint256 encodedAmountOut, - uint256 memoryOffset, - ) = encodeNumToByteAndOffset( - GeneralHelper.getAmountOut(weth, otherToken, amountInActual), - 4, - true, - weth < otherToken - ); - - // Libary function starts here - uint8 swapType = _v2FindFunctionSig(true, otherToken); - - payload = abi.encodePacked( - uint8(swapType), // type of swap to make - address(pair), // univ2 pair - uint8(memoryOffset), // memoryOffset to store amountOut - uint32(encodedAmountOut) // amountOut - ); - - encodedValue = amountIn / wethEncodeMultiple(); - } - - function wethEncodeMultiple() public pure returns (uint256) { - return 1e5; - } - - function _v2FindFunctionSig( - bool isWethInput, - address otherToken - ) internal view returns (uint8 encodeAmount) { - address weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; - - if (isWethInput) { - if (weth < otherToken) { - // weth is input and token0 - return functionSigsToJumpLabel["v2_input0"]; - } else { - // weth is input and token1 - return functionSigsToJumpLabel["v2_input1"]; - } - } else { - if (weth < otherToken) { - // weth is output and token0 - return functionSigsToJumpLabel["v2_output0"]; - } else { - // weth is output and token1 - return functionSigsToJumpLabel["v2_output1"]; - } - } - } - - function encodeNumToByteAndOffset( - uint256 amount, - uint256 numBytesToEncodeTo, - bool isWethInput, - bool isWethToken0 - ) public pure returns (uint256 encodedAmount, uint256 encodedByteOffset, uint256 amountAfterEncoding) { - for (uint256 i = 0; i < 32; i++) { - uint256 _encodedAmount = amount / 2**(8 * i); - - // If we can fit the value in numBytesToEncodeTo bytes, we can encode it - if (_encodedAmount <= 2**(numBytesToEncodeTo * (8)) - 1) { - //uint encodedAmount = amountOutAfter * 2**(8*i); - encodedByteOffset = i; - encodedAmount = _encodedAmount; - amountAfterEncoding = encodedAmount << (encodedByteOffset*8); - break; - } - } - - if (!isWethInput) { - // find byte placement for Transfer(address,uint256) - encodedByteOffset = 68 - numBytesToEncodeTo - encodedByteOffset; - } else { - if (isWethToken0) { - encodedByteOffset = 68 - numBytesToEncodeTo - encodedByteOffset; - } else { - encodedByteOffset = 36 - numBytesToEncodeTo - encodedByteOffset; - } - } - } - - function getJumpLabelFromSig(string calldata sig) - public - view - returns (uint8) - { - return functionSigsToJumpLabel[sig]; - } - - function setupSigJumpLabelMapping() private { - //uint startingIndex = 0x35; - uint256 startingIndex = 0x06; - - string[13] memory functionNames = [ - "v2_output0", - "v2_input0", - "v2_output1", - "v2_input1", - "v3_output1_big", - "v3_output0_big", - "v3_output1_small", - "v3_output0_small", - "v3_input0", - "v3_input1", - "seppuku", - "recoverEth", - "recoverWeth" - ]; - - for (uint256 i = 0; i < functionNames.length; i++) { - functionSigsToJumpLabel[functionNames[i]] = uint8( - startingIndex + (0x05 * i) - ); - } - } -} diff --git a/contract/test/interfaces/IERC20.sol b/contract/test/interfaces/IERC20.sol deleted file mode 100644 index 1538516..0000000 --- a/contract/test/interfaces/IERC20.sol +++ /dev/null @@ -1,89 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.0; - -/** - * @dev Interface of the ERC20 standard as defined in the EIP. - */ -interface IERC20 { - /** - * @dev Returns the amount of tokens in existence. - */ - function totalSupply() external view returns (uint256); - - /** - * @dev Returns the amount of tokens owned by `account`. - */ - function balanceOf(address account) external view returns (uint256); - - /** - * @dev Moves `amount` tokens from the caller's account to `recipient`. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * Emits a {Transfer} event. - */ - function transfer(address recipient, uint256 amount) - external - returns (bool); - - /** - * @dev Returns the remaining number of tokens that `spender` will be - * allowed to spend on behalf of `owner` through {transferFrom}. This is - * zero by default. - * - * This value changes when {approve} or {transferFrom} are called. - */ - function allowance(address owner, address spender) - external - view - returns (uint256); - - /** - * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * IMPORTANT: Beware that changing an allowance with this method brings the risk - * that someone may use both the old and the new allowance by unfortunate - * transaction ordering. One possible solution to mitigate this race - * condition is to first reduce the spender's allowance to 0 and set the - * desired value afterwards: - * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - * - * Emits an {Approval} event. - */ - function approve(address spender, uint256 amount) external returns (bool); - - /** - * @dev Moves `amount` tokens from `sender` to `recipient` using the - * allowance mechanism. `amount` is then deducted from the caller's - * allowance. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * Emits a {Transfer} event. - */ - function transferFrom( - address sender, - address recipient, - uint256 amount - ) external returns (bool); - - /** - * @dev Emitted when `value` tokens are moved from one account (`from`) to - * another (`to`). - * - * Note that `value` may be zero. - */ - event Transfer(address indexed from, address indexed to, uint256 value); - - /** - * @dev Emitted when the allowance of a `spender` for an `owner` is set by - * a call to {approve}. `value` is the new allowance. - */ - event Approval( - address indexed owner, - address indexed spender, - uint256 value - ); -} diff --git a/contract/test/interfaces/IUniswapV2.sol b/contract/test/interfaces/IUniswapV2.sol deleted file mode 100644 index c3e6343..0000000 --- a/contract/test/interfaces/IUniswapV2.sol +++ /dev/null @@ -1,351 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.5.0; - -interface IUniswapV2Factory { - event PairCreated( - address indexed token0, - address indexed token1, - address pair, - uint256 - ); - - function feeTo() external view returns (address); - - function feeToSetter() external view returns (address); - - function migrator() external view returns (address); - - function getPair(address tokenA, address tokenB) - external - view - returns (address pair); - - function allPairs(uint256) external view returns (address pair); - - function allPairsLength() external view returns (uint256); - - function createPair(address tokenA, address tokenB) - external - returns (address pair); - - function setFeeTo(address) external; - - function setFeeToSetter(address) external; - - function setMigrator(address) external; -} - -interface IUniswapV2Pair { - event Approval( - address indexed owner, - address indexed spender, - uint256 value - ); - event Transfer(address indexed from, address indexed to, uint256 value); - - function name() external pure returns (string memory); - - function symbol() external pure returns (string memory); - - function decimals() external pure returns (uint8); - - function totalSupply() external view returns (uint256); - - function balanceOf(address owner) external view returns (uint256); - - function allowance(address owner, address spender) - external - view - returns (uint256); - - function approve(address spender, uint256 value) external returns (bool); - - function transfer(address to, uint256 value) external returns (bool); - - function transferFrom( - address from, - address to, - uint256 value - ) external returns (bool); - - function DOMAIN_SEPARATOR() external view returns (bytes32); - - function PERMIT_TYPEHASH() external pure returns (bytes32); - - function nonces(address owner) external view returns (uint256); - - function permit( - address owner, - address spender, - uint256 value, - uint256 deadline, - uint8 v, - bytes32 r, - bytes32 s - ) external; - - event Mint(address indexed sender, uint256 amount0, uint256 amount1); - event Burn( - address indexed sender, - uint256 amount0, - uint256 amount1, - address indexed to - ); - event Swap( - address indexed sender, - uint256 amount0In, - uint256 amount1In, - uint256 amount0Out, - uint256 amount1Out, - address indexed to - ); - event Sync(uint112 reserve0, uint112 reserve1); - - function MINIMUM_LIQUIDITY() external pure returns (uint256); - - function factory() external view returns (address); - - function token0() external view returns (address); - - function token1() external view returns (address); - - function getReserves() - external - view - returns ( - uint112 reserve0, - uint112 reserve1, - uint32 blockTimestampLast - ); - - function price0CumulativeLast() external view returns (uint256); - - function price1CumulativeLast() external view returns (uint256); - - function kLast() external view returns (uint256); - - function mint(address to) external returns (uint256 liquidity); - - function burn(address to) - external - returns (uint256 amount0, uint256 amount1); - - function swap( - uint256 amount0Out, - uint256 amount1Out, - address to, - bytes calldata data - ) external; - - function skim(address to) external; - - function sync() external; - - function initialize(address, address) external; -} - -interface IUniswapV2Router01 { - function factory() external pure returns (address); - - function WETH() external pure returns (address); - - function addLiquidity( - address tokenA, - address tokenB, - uint256 amountADesired, - uint256 amountBDesired, - uint256 amountAMin, - uint256 amountBMin, - address to, - uint256 deadline - ) - external - returns ( - uint256 amountA, - uint256 amountB, - uint256 liquidity - ); - - function addLiquidityETH( - address token, - uint256 amountTokenDesired, - uint256 amountTokenMin, - uint256 amountETHMin, - address to, - uint256 deadline - ) - external - payable - returns ( - uint256 amountToken, - uint256 amountETH, - uint256 liquidity - ); - - function removeLiquidity( - address tokenA, - address tokenB, - uint256 liquidity, - uint256 amountAMin, - uint256 amountBMin, - address to, - uint256 deadline - ) external returns (uint256 amountA, uint256 amountB); - - function removeLiquidityETH( - address token, - uint256 liquidity, - uint256 amountTokenMin, - uint256 amountETHMin, - address to, - uint256 deadline - ) external returns (uint256 amountToken, uint256 amountETH); - - function removeLiquidityWithPermit( - address tokenA, - address tokenB, - uint256 liquidity, - uint256 amountAMin, - uint256 amountBMin, - address to, - uint256 deadline, - bool approveMax, - uint8 v, - bytes32 r, - bytes32 s - ) external returns (uint256 amountA, uint256 amountB); - - function removeLiquidityETHWithPermit( - address token, - uint256 liquidity, - uint256 amountTokenMin, - uint256 amountETHMin, - address to, - uint256 deadline, - bool approveMax, - uint8 v, - bytes32 r, - bytes32 s - ) external returns (uint256 amountToken, uint256 amountETH); - - function swapExactTokensForTokens( - uint256 amountIn, - uint256 amountOutMin, - address[] calldata path, - address to, - uint256 deadline - ) external returns (uint256[] memory amounts); - - function swapTokensForExactTokens( - uint256 amountOut, - uint256 amountInMax, - address[] calldata path, - address to, - uint256 deadline - ) external returns (uint256[] memory amounts); - - function swapExactETHForTokens( - uint256 amountOutMin, - address[] calldata path, - address to, - uint256 deadline - ) external payable returns (uint256[] memory amounts); - - function swapTokensForExactETH( - uint256 amountOut, - uint256 amountInMax, - address[] calldata path, - address to, - uint256 deadline - ) external returns (uint256[] memory amounts); - - function swapExactTokensForETH( - uint256 amountIn, - uint256 amountOutMin, - address[] calldata path, - address to, - uint256 deadline - ) external returns (uint256[] memory amounts); - - function swapETHForExactTokens( - uint256 amountOut, - address[] calldata path, - address to, - uint256 deadline - ) external payable returns (uint256[] memory amounts); - - function quote( - uint256 amountA, - uint256 reserveA, - uint256 reserveB - ) external pure returns (uint256 amountB); - - function getAmountOut( - uint256 amountIn, - uint256 reserveIn, - uint256 reserveOut - ) external pure returns (uint256 amountOut); - - function getAmountIn( - uint256 amountOut, - uint256 reserveIn, - uint256 reserveOut - ) external pure returns (uint256 amountIn); - - function getAmountsOut(uint256 amountIn, address[] calldata path) - external - view - returns (uint256[] memory amounts); - - function getAmountsIn(uint256 amountOut, address[] calldata path) - external - view - returns (uint256[] memory amounts); -} - -interface IUniswapV2Router02 is IUniswapV2Router01 { - function removeLiquidityETHSupportingFeeOnTransferTokens( - address token, - uint256 liquidity, - uint256 amountTokenMin, - uint256 amountETHMin, - address to, - uint256 deadline - ) external returns (uint256 amountETH); - - function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( - address token, - uint256 liquidity, - uint256 amountTokenMin, - uint256 amountETHMin, - address to, - uint256 deadline, - bool approveMax, - uint8 v, - bytes32 r, - bytes32 s - ) external returns (uint256 amountETH); - - function swapExactTokensForTokensSupportingFeeOnTransferTokens( - uint256 amountIn, - uint256 amountOutMin, - address[] calldata path, - address to, - uint256 deadline - ) external; - - function swapExactETHForTokensSupportingFeeOnTransferTokens( - uint256 amountOutMin, - address[] calldata path, - address to, - uint256 deadline - ) external payable; - - function swapExactTokensForETHSupportingFeeOnTransferTokens( - uint256 amountIn, - uint256 amountOutMin, - address[] calldata path, - address to, - uint256 deadline - ) external; -} diff --git a/contract/test/interfaces/IWETH.sol b/contract/test/interfaces/IWETH.sol deleted file mode 100644 index 6f4ea43..0000000 --- a/contract/test/interfaces/IWETH.sol +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.15; - -interface IWETH { - function name() external view returns (string memory); - - function approve(address guy, uint256 wad) external returns (bool); - - function totalSupply() external view returns (uint256); - - function transferFrom( - address src, - address dst, - uint256 wad - ) external returns (bool); - - function withdraw(uint256 wad) external; - - function decimals() external view returns (uint8); - - function balanceOf(address) external view returns (uint256); - - function symbol() external view returns (string memory); - - function transfer(address dst, uint256 wad) external returns (bool); - - function deposit() external payable; - - function allowance(address, address) external view returns (uint256); -} diff --git a/contract/test/misc/GeneralHelper.sol b/contract/test/misc/GeneralHelper.sol new file mode 100644 index 0000000..32bfe22 --- /dev/null +++ b/contract/test/misc/GeneralHelper.sol @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.15; + +import "v2-core/interfaces/IUniswapV2Pair.sol"; +import "v2-core/interfaces/IUniswapV2Factory.sol"; +import "v2-periphery/interfaces/IUniswapV2Router02.sol"; +import "forge-std/console.sol"; + +library GeneralHelper { + function getAmountOut(address inputToken, address outputToken, uint256 amountIn) + public + view + returns (uint256 amountOut) + { + IUniswapV2Router02 univ2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); + + (uint256 reserveToken0, uint256 reserveToken1,) = + IUniswapV2Pair(_getUniswapPair(inputToken, outputToken)).getReserves(); + + uint256 reserveIn; + uint256 reserveOut; + + if (inputToken < outputToken) { + // inputToken is token0 + reserveIn = reserveToken0; + reserveOut = reserveToken1; + } else { + // inputToken is token1 + reserveIn = reserveToken1; + reserveOut = reserveToken0; + } + + amountOut = univ2Router.getAmountOut(amountIn, reserveIn, reserveOut); + } + + function getAmountIn(address inputToken, address outputToken, uint256 amountOut) + public + view + returns (uint256 amountIn) + { + IUniswapV2Router02 univ2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); + + (uint256 reserveToken0, uint256 reserveToken1,) = + IUniswapV2Pair(_getUniswapPair(inputToken, outputToken)).getReserves(); + + uint256 reserveIn; + uint256 reserveOut; + + if (inputToken < outputToken) { + // inputToken is token0 + reserveIn = reserveToken0; + reserveOut = reserveToken1; + } else { + // inputToken is token1 + reserveIn = reserveToken1; + reserveOut = reserveToken0; + } + + amountIn = univ2Router.getAmountIn(amountOut, reserveIn, reserveOut); + } + + function _getUniswapPair(address tokenA, address tokenB) private view returns (address pair) { + IUniswapV2Factory univ2Factory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); + pair = address(IUniswapV2Pair(univ2Factory.getPair(address(tokenA), address(tokenB)))); + } +} diff --git a/contract/test/misc/SandoCommon.sol b/contract/test/misc/SandoCommon.sol new file mode 100644 index 0000000..004d5ce --- /dev/null +++ b/contract/test/misc/SandoCommon.sol @@ -0,0 +1,140 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.15; + +import "./GeneralHelper.sol"; + +/// @title FiveByteUtils +/// @author 0xmouseless +/// @notice Holds data and functions related to five byte encoding +/// @dev This is a lossy encoding system however the wei lost in encoding is minamal and can be ignored +/// @dev Encoding schema: fits any uint256 (32 byte value) into 5 bytes. 4 bytes reserved for a value, 1 byte reserved for storage slot to store the 4 byte value in. +library FiveBytesEncodingUtils { + struct EncodingMetaData { + /// @notice TargetValue squashed down to four bytes + uint32 fourBytes; + /// @notice How many byte shifts to apply on our four bytes + uint8 byteShift; + } + + /** + * @notice Encodes a value to 5 bytes of calldata (used for other token value) + * + * @param amount The amount to be encoded + * @return encodingParams Parameters used for encoding the given input + */ + function encode(uint256 amount) public pure returns (EncodingMetaData memory encodingParams) { + uint8 byteShift = 0; // how many byte shifts are needed to store value into four bytes? + uint32 fourByteValue = 0; + + while (byteShift < 32) { + uint256 _encodedAmount = amount / 2 ** (8 * byteShift); + + // If we can fit the value in 4 bytes, we can encode it + if (_encodedAmount <= 2 ** (4 * (8)) - 1) { + fourByteValue = uint32(_encodedAmount); + break; + } + + byteShift++; + } + + encodingParams = EncodingMetaData({fourBytes: fourByteValue, byteShift: byteShift}); + } + + /** + * @notice Decodes the 5 bytes back to a 32 byte value (lossy) + * + * @param params Parameters used for the encoded value + * @return decodedValue The decoded value after applying the byte shifts + */ + function decode(EncodingMetaData memory params) public pure returns (uint256 decodedValue) { + decodedValue = uint256(params.fourBytes) << (uint256(params.byteShift) * 8); + } + + /** + * @notice Finalize by encoding for a specific param index + * + * @param encodingParams Metadata used for the encoded value + * @param paramIndex Which param index should we encode to + * @return fiveBytes The final five bytes used in calldata + */ + function finalzeForParamIndex(EncodingMetaData calldata encodingParams, uint8 paramIndex) + public + pure + returns (uint40 fiveBytes) + { + // 4 for function selector + uint8 memLocation = 4 + 32 + (paramIndex * 32) - 4 - encodingParams.byteShift; + + bytes memory encodedBytes = abi.encodePacked(memLocation, encodingParams.fourBytes); + assembly { + fiveBytes := mload(add(encodedBytes, 0x5)) + } + } +} + +/// @title WethEncodingUtils +/// @author 0xmouseless +/// @notice Holds data and functions related to encoding weth for use in `tx.value` +/// @dev lossy encoding but it is okay to leave a small amount of wei in pool contract +library WethEncodingUtils { + /** + * @notice Constant used for encoding WETH amount + */ + function encodeMultiple() public pure returns (uint256) { + return 1e5; + } + + /** + * @notice Encodes a value + */ + function encode(uint256 amount) public pure returns (uint256) { + return amount / encodeMultiple(); + } + + /** + * @notice decode by multiplying amount by weth constant + */ + function decode(uint256 amount) public pure returns (uint256 amountOut) { + amountOut = amount * encodeMultiple(); + } +} + +/// @title SandoCommon +/// @author 0xmouseless +/// @notice Holds common methods between v2 and v3 sandos +library SandoCommon { + /** + * @notice This function is used to look up the JUMPDEST for a given function name + * @param functionName The name of the function we want to jump to + * @return JUMPDEST location in bytecode + */ + function getJumpDestFromSig(string memory functionName) public pure returns (uint8) { + uint8 startingIndex = 0x05; + + // array mapped in same order as on sando contract + string[11] memory functionNames = [ + "v2_backrun0", + "v2_frontrun0", + "v2_backrun1", + "v2_frontrun1", + "v3_backrun0", + "v3_frontrun0", + "v3_backrun1", + "v3_frontrun1", + "seppuku", + "recoverEth", + "recoverWeth" + ]; + + // find index of associated JUMPDEST (sig) + for (uint256 i = 0; i < functionNames.length; i++) { + if (keccak256(abi.encodePacked(functionNames[i])) == keccak256(abi.encodePacked(functionName))) { + return (uint8(i) * 5) + startingIndex; + } + } + + // not found (force jump to invalid JUMPDEST) + return 0x00; + } +} diff --git a/contract/test/misc/V2SandoUtility.sol b/contract/test/misc/V2SandoUtility.sol new file mode 100644 index 0000000..6460a4e --- /dev/null +++ b/contract/test/misc/V2SandoUtility.sol @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.15; + +import "./GeneralHelper.sol"; +import "./SandoCommon.sol"; + +/// @title V2SandoUtility +/// @author 0xmouseless +/// @notice Functions for interacting with sando contract's v2 methods +library V2SandoUtility { + /** + * @notice Utility function to create payload for our v2 backruns + * @return payload Calldata bytes to execute backruns + * @return encodedValue Encoded `tx.value` indicating WETH amount to send + */ + function v2CreateBackrunPayload(address otherToken, uint256 amountIn) + public + view + returns (bytes memory payload, uint256 encodedValue) + { + // Declare uniswapv2 types + address weth = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); + IUniswapV2Factory univ2Factory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); + address pair = address(IUniswapV2Pair(univ2Factory.getPair(weth, address(otherToken)))); + + // encode amountIn + FiveBytesEncodingUtils.EncodingMetaData memory fiveByteParams = FiveBytesEncodingUtils.encode(amountIn); + uint256 amountInActual = FiveBytesEncodingUtils.decode(fiveByteParams); + + string memory functionSignature = weth < otherToken ? "v2_backrun0" : "v2_backrun1"; + uint8 jumpDest = SandoCommon.getJumpDestFromSig(functionSignature); + + payload = abi.encodePacked( + jumpDest, + address(pair), // univ2 pair + address(otherToken), // inputToken + FiveBytesEncodingUtils.finalzeForParamIndex(fiveByteParams, 1) + ); + + uint256 amountOut = GeneralHelper.getAmountOut(otherToken, weth, amountInActual); + encodedValue = WethEncodingUtils.encode(amountOut); + } + + /** + * @notice Utility function to create payload for our v2 frontruns + * @return payload Calldata bytes to execute frontruns + * @return encodedValue Encoded `tx.value` indicating WETH amount to send + */ + function v2CreateFrontrunPayload(address outputToken, uint256 amountIn) + public + view + returns (bytes memory payload, uint256 encodedValue) + { + // Declare uniswapv2 types + address weth = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); + IUniswapV2Factory univ2Factory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); + address pair = address(IUniswapV2Pair(univ2Factory.getPair(weth, address(outputToken)))); + + // Encode amountIn here (so we can use it for next step) + uint256 amountInActual = WethEncodingUtils.decode(WethEncodingUtils.encode(amountIn)); + + // Get amounts out and encode it + FiveBytesEncodingUtils.EncodingMetaData memory fiveByteParams = + FiveBytesEncodingUtils.encode(GeneralHelper.getAmountOut(weth, outputToken, amountInActual)); + + string memory functionSignature = weth < outputToken ? "v2_frontrun0" : "v2_frontrun1"; + uint8 jumpDest = SandoCommon.getJumpDestFromSig(functionSignature); + + payload = abi.encodePacked( + jumpDest, // type of swap to make + address(pair), // univ2 pair + FiveBytesEncodingUtils.finalzeForParamIndex(fiveByteParams, weth < outputToken ? 1 : 0) + ); + + encodedValue = WethEncodingUtils.encode(amountIn); + } +} diff --git a/contract/test/misc/V3SandoUtility.sol b/contract/test/misc/V3SandoUtility.sol new file mode 100644 index 0000000..933a902 --- /dev/null +++ b/contract/test/misc/V3SandoUtility.sol @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.15; + +import "./GeneralHelper.sol"; +import "./SandoCommon.sol"; +import "v3-core/interfaces/IUniswapV3Pool.sol"; + +/// @title V3SandoUtility +/// @author 0xmouseless +/// @notice Functions for interacting with sando contract's v3 methdos +library V3SandoUtility { + /** + * @notice Utility function to create payload for our v3 frontruns + * @return payload Calldata bytes to execute frontrun + * @return encodedValue Encoded `tx.value` indicating WETH amount to send + */ + function v3CreateFrontrunPayload(IUniswapV3Pool pool, address outputToken, int256 amountIn) + public + view + returns (bytes memory payload, uint256 encodedValue) + { + address weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; + + (address token0, address token1) = weth < outputToken ? (weth, outputToken) : (outputToken, weth); + bytes32 poolKeyHash = keccak256(abi.encode(token0, token1, pool.fee())); + + string memory functionSignature = weth < outputToken ? "v3_frontrun0" : "v3_frontrun1"; + uint8 jumpDest = SandoCommon.getJumpDestFromSig(functionSignature); + payload = abi.encodePacked(jumpDest, address(pool), poolKeyHash); + + encodedValue = WethEncodingUtils.encode(uint256(amountIn)); + } + + /** + * @notice Utility function to create payload for our v3 backruns + * @return payload Calldata bytes to execute backruns (empty tx.value because pool optimistically sends weth to sando contract) + */ + function v3CreateBackrunPayload(IUniswapV3Pool pool, address inputToken, int256 amountIn) + public + view + returns (bytes memory payload) + { + address weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; + (address token0, address token1) = inputToken < weth ? (inputToken, weth) : (weth, inputToken); + bytes32 poolKeyHash = keccak256(abi.encode(token0, token1, pool.fee())); + + string memory functionSignature = weth < inputToken ? "v3_backrun0" : "v3_backrun1"; + uint8 jumpDest = SandoCommon.getJumpDestFromSig(functionSignature); + + FiveBytesEncodingUtils.EncodingMetaData memory fiveByteParams = FiveBytesEncodingUtils.encode(uint256(amountIn)); + + payload = abi.encodePacked( + jumpDest, + address(pool), + address(inputToken), + poolKeyHash, + FiveBytesEncodingUtils.finalzeForParamIndex(fiveByteParams, 2) + ); + } +}