From 2f75acf924a96f011d1816cdbe9aa50c81a517eb Mon Sep 17 00:00:00 2001 From: josh c Date: Thu, 9 Mar 2023 12:52:12 -0500 Subject: [PATCH 1/9] update docs link --- yarn-project/sdk/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/sdk/README.md b/yarn-project/sdk/README.md index 4c3a148ec..bf74aec45 100644 --- a/yarn-project/sdk/README.md +++ b/yarn-project/sdk/README.md @@ -16,4 +16,4 @@ yarn add @aztec/sdk ## Docs -Please see the documentation site [here](https://docs.aztec.network/sdk/overview). +Please see the documentation site [here](https://github.com/AztecProtocol/docs/blob/aztec-connect/docs/sdk/overview.md). From 6fa7306e58116284a2a99b31d64c291312b942a6 Mon Sep 17 00:00:00 2001 From: josh c Date: Fri, 10 Mar 2023 11:26:34 -0500 Subject: [PATCH 2/9] Update package.json --- yarn-project/sdk/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/sdk/package.json b/yarn-project/sdk/package.json index 0e73171f7..91fb5b9ca 100644 --- a/yarn-project/sdk/package.json +++ b/yarn-project/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@aztec/sdk", - "version": "2.1.0", + "version": "2.1.1", "main": "./dest/index.js", "exports": { "node": "./dest/index.js", From ff6737f51da5e68d133d00d30961aeef8f55b3e8 Mon Sep 17 00:00:00 2001 From: Lasse Herskind <16536249+LHerskind@users.noreply.github.com> Date: Tue, 21 Mar 2023 13:10:41 +0100 Subject: [PATCH 3/9] chore: contracts repo update (#34) * chore: bring updates readme * chore: remove unused periphery from readme * chore: bring updated contract setup * chore: move audit and bounty links to root readme --- README.md | 23 + contracts/Dockerfile | 2 +- contracts/README.md | 102 +- contracts/scripts/ci_deploy_contracts.sh | 36 +- contracts/scripts/start_e2e_fork.sh | 2 +- .../scripts/tenderly_increase_balance.sh | 32 - .../core/{ => processors}/RollupProcessor.sol | 10 +- .../reference/RollupProcessorV2Reference.sol | 1941 +++++++++++++++++ .../script/deployments/RollupDeployer.s.sol | 30 +- contracts/src/test/aztec/TestBase.sol | 5 +- .../src/test/rollup_processor/Create2.s.sol | 2 +- .../src/test/rollup_processor/Create2.t.sol | 2 +- .../test/rollup_processor/Upgradeable.t.sol | 2 +- contracts/verification-keys/generate_vks.sh | 1 + 14 files changed, 2083 insertions(+), 107 deletions(-) delete mode 100755 contracts/scripts/tenderly_increase_balance.sh rename contracts/src/core/{ => processors}/RollupProcessor.sol (99%) create mode 100644 contracts/src/core/reference/RollupProcessorV2Reference.sol diff --git a/README.md b/README.md index df56ada8d..3f1e79287 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,26 @@ - `yarn-project/kebab` - Proxy server sitting between falafel and ETH node. - `yarn-project/sdk` - SDK for interacting with a rollup provider. - `yarn-project/wasabi` - Load testing tool. + +## Bug Bounties and Vulnerability Reporting + +We are currently running a Bug Bounty Program. For all information, please visit [immunefi](https://immunefi.com/bounty/aztecnetwork/). + +## Audit reports + +See audit reports [here](https://github.com/AztecProtocol/aztec-security/tree/main/Audits) + +| Title | Vendor | Report | +| ----------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| Rollup Processor | Arbitrary Execution | [link](https://github.com/AztecProtocol/aztec-security/blob/main/Audits/Aztec_20221014.pdf) | +| Rollup Processor | Solidified | [link]() | +| Aave Bridge | Solidified | [link](https://github.com/AztecProtocol/aztec-security/blob/main/Audits/Audit%20Report%20-%20Aztec%20Aave%20Bridge.pdf) | +| Compound Bridge | Solidified | [link](https://github.com/AztecProtocol/aztec-security/blob/main/Audits/Audit%20Report%20-%20Aztec%20Compound%20Bridge.pdf) | +| Curve Bridge | Solidified | [link](https://github.com/AztecProtocol/aztec-security/blob/main/Audits/Audit%20Report%20-%20Aztec%20Curve%20Bridge.pdf) | +| DCA Bridge | Solidified | [link](https://github.com/AztecProtocol/aztec-security/blob/main/Audits/Audit%20Report%20-%20Aztec%20DCA%20Bridge.pdf) | +| Element Bridge | Solidified | [link](https://github.com/AztecProtocol/aztec-security/blob/main/Audits/Audit%20Report%20-%20Aztec%20Element%20Bridge.pdf) | +| Lido Bridge | Solidified | [link](https://github.com/AztecProtocol/aztec-security/blob/main/Audits/Audit%20Report%20-%20Aztec%20Lido%20Bridge.pdf) | +| Liquity Bridge | Solidified | [link](https://github.com/AztecProtocol/aztec-security/blob/main/Audits/Audit%20Report%20-%20Aztec%20Liquity%20Bridge.pdf) | +| Liquity Bridge #2 | Solidified | [link](https://github.com/AztecProtocol/aztec-security/blob/main/Audits/Audit%20Report%20-%20Aztec%20Liquity%20Trove%20Bridge%20II.pdf) | +| Set Bridge | Solidified | [link](https://github.com/AztecProtocol/aztec-security/blob/main/Audits/Audit%20Report%20-%20Aztec%20Set%20Bridge.pdf) | +| Rollup Subsidy | Solidified | [link](https://github.com/AztecProtocol/aztec-security/blob/main/Audits/Audit%20Report%20-%20Aztec%20Subsidy%20Contract.pdf) | \ No newline at end of file diff --git a/contracts/Dockerfile b/contracts/Dockerfile index 675feac63..59ae86375 100644 --- a/contracts/Dockerfile +++ b/contracts/Dockerfile @@ -20,7 +20,7 @@ RUN forge install --no-commit \ https://github.com/AztecProtocol/aztec-connect-bridges@master ENV MAINNET_RPC_URL='https://mainnet.infura.io/v3/9928b52099854248b3a096be07a6b23c' -RUN forge clean && forge build && forge test +RUN forge clean && forge build && forge test && REFERENCE=true forge test WORKDIR /usr/src/contracts CMD ["./scripts/deploy_contracts.sh"] \ No newline at end of file diff --git a/contracts/README.md b/contracts/README.md index 997a3454d..429f74e84 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -1,49 +1,96 @@ # Aztec-Connect Contracts -## Getting setup +## Overview -As per usual, running `./bootstrap.sh` should get you up to speed. However some information below on the use of submodules is covered to help you reason about it does. +Aztec is a privacy-first recursive zero-knowledge rollup (zk-zk-rollup) built on Ethereum and today it is the only zkRollup built from the ground up to be privacy-preserving. Its unique architecture ensures that transactions are private, while also retaining auditability and compliance. Our long-term vision is building a decentralized, high-throughput, privacy-preserving network that enables Web3 to cross the chasm and achieve mainstream adoption. -This project uses foundry as it's testing framework, before getting started / if you have any issues it is worth exploring the [book](https://book.getfoundry.sh/). It is generally a fantastic up to date resource. +For more information about Aztec, please visit https://aztec.network/ or https://twitter.com/aztecnetwork. Documentation for Aztec Connect Bridges is available at https://github.com/AztecProtocol/aztec-connect-bridges. -## Setting up submodules +If you are interested in the Rollup Contract itself, a reference implementation (too big for mainnet) is put in the `core/reference` folder, it uses less yul so is a little easier to reason about. -Foundry has some wrapper functions around submodules that generally make them easier to work with. If it is your first time setting up this repo running `forge install --no-commit` should have you ready to roll. +## Developers -`forge update --no-commit` is the command to use if submodules has changed and you already have some installed. If submodules are causing a lot of issues and lots of errors are occurring while attempting to install. Deleting the /lib folder and running `forge install --no-commit` will generally resolve the issues. +If you would like to build on top of Aztec, please see our [documentation](https://aztec.network/developers/). +If you would like to contribute to the protocol, please see the [aztec2 book](https://github.com/AztecProtocol/aztec-connect/tree/master/specs/aztec-connect) for our specifications. -# Tests +### Getting started -`forge test` will run the test suite. See the forge book linked above about how to target specific tests. +``` +./bootstrap.sh +``` -## Running the docker for tests locally: +As per usual, running `./bootstrap.sh` should get you up to speed. It will install any submodules / frameworks required. +This project uses foundry as it's testing framework, before getting started / if you have any issues consult the [book](https://book.getfoundry.sh/). + +### Submodules + +Forge modules: + +- [forge-std](https://github.com/foundry-rs/forge-std) (Testing) +- [uniswap v2 core](https://github.com/uniswap/v2-core) (Fee Distributor dependency) +- [uniswap v2 periphery](https://github.com/uniswap/v2-periphery) (Fee Distributor dependency) +- [openzeppelin contracts](https://github.com/openzeppelin/openzeppelin-contracts) +- [openzeppelin contracts upgradable](https://github.com/openzeppelin/openzeppelin-contracts-upgradable) +- [rollup encoder](https://github.com/AztecProtocol/rollup-encoder) (Test harness to encode rollup calldata) +- [aztec connect bridges](https://github.com/AztecProtocol/aztec-connect-bridges) (Bridges repository) + +Use `forge update --no-commit` if submodules have changed and you already have some installed. If submodules are causing issues and errors are occurring while installing. Deleting the `/lib` folder then running `forge install --no-commit` will generally resolve the issues. + +### Directory Structure -```bash -# In root run -docker build -f ./contracts/DockerFile --no-cache . ``` +src +├── core +│   ├── Decoder.sol +│   ├── DefiBridgeProxy.sol +│   ├── processors +│ │   ├── RollupProcessor.sol +│   │   └── RollupProcessorV2.sol +│   ├── reference +│   │   └── RollupProcessorV2Reference.sol +│   └── verifier +│   ├── BaseStandardVerifier.sol +│   ├── instances +│   │   └── ... Contract Verifiers +│   └── keys +│   └── ... Contract Verification Keys +├── periphery +│   ├── AztecFaucet.sol +│   ├── AztecFeeDistributor.sol +│   ├── PermitHelper.sol +│   └── ProxyDeployer.sol +├── script +│   └── ... Deployment scripts +└── test + └── ... Test suite +``` +## Tests + +`forge test` will run the test suite. See the forge book linked above about how to target specific tests. To use the reference implementation set `export REFERENCE=true`. -# Generating new verification keys +### Running tests in a Docker container: -It is possible to generate new verification keys by running the `generate_vks.sh` script that is put in `verification-keys`. This generates the keys and their matching solidity contracts. Also to be used for generating the large 28x32 key. +```bash +# In root run +docker build --no-cache . +``` -# Verifier test +## Generating new verification keys (for aztec developers) -The verifier test is available in `yarn-project/contracts-verifier-test`. +It is possible to generate new verification keys by running the `generate_vks.sh` script that is put in `verification-keys`. This generates the keys and their matching solidity contracts. For example the 28x32 key (used in our production rollup) verifies the circuit which validates 28 recursive proofs of 32 smaller inner proofs. -# Deployments +## Deployments -## e2e tests +### Devnet / Stage / Testnet Deployments -The familiar tmux-scripts and docker-compose setups will automatically deploy a new set of contracts to a anvil instance for you. -If you would just like to run the deployment script for testing purposes, `deploy_local` will set reasonable defaults and then run the testing script. +The CI/CD pipeline will use the script in `deploy/deploy_contracts.sh` to orchestrate deployments. -## Devnet / Stage / Testnet Deployments +### Local Deployments -The CD pipeline will use the script in `deploy/deploy_contracts.sh` to reason whether it should perform new deployments or not. +To quickly bootstrap an anvil fork with our entire suite of mainnet contracts deployed run `scripts/start_e2e_fork.sh`. **Environment Variables** -When deploying to dev or testnet from a local machine, there are some required environment variables +When deploying to dev or testnet from a local machine, there are some required environment variables. Required: @@ -61,15 +108,16 @@ Optional: ### How are deployments triggered? -Inside the `deploy` folder there are files named for each of the environments (`dev`, `testnet`. `stage`). In the deployment script it will check whether there is a diff in the file of the deployment environment. E.g. if you want to trigger a redeploy in dev, then if your version tag has a change in the dev file, it will redeploy the contracts. +Redeploying the testnet contracts can be done in one click with the `redeploy-mainnet-fork` circle ci workflow. +To force deployments through ci there are override files for each environment inside the `deploy` folder (`dev`, `testnet`. `stage`). The deployment script it will check whether there is a diff in the target environment's file. E.g. if you want to force a redeploy in dev, changing the dev file will trigger it. Please exercise caution in your commits that these files have not changed by accident. ### How do downstream services consume the contract addresses? #### e2e -In e2e tests the contracts service will serve the deployed addresses using `socat` - see `serve.sh`. It will look for the output of the deployment script `/serve/deployment_addresses.json` and serve it on a defined port (usually 8547). Before each of the other services (`kebab`, `falafel`) boot they run an `export_addresses` script that queries the contract addresses on this port. +For e2e tests the contracts service will serve deployed addresses using `socat` - see `serve.sh`. It will serve the deployment script output (`/serve/deployment_addresses.json`) on the defined port (8547 by default). When downstream services (`kebab`, `falafel`) boot they run an `export_addresses` script that consumes the contract addresses. -### Deployments +#### Deployments -At the end of the deployments script there is a loop that will export all of the critical addresses into terraform variables. The accompanying files in the `terraform` folder will output these addresses such that they are available to the other services as environment vars at deploy time. +At the end of the deployments script, all critical addresses will be saved into terraform variables. They are consumed by downstream services as env vars at deploy time. diff --git a/contracts/scripts/ci_deploy_contracts.sh b/contracts/scripts/ci_deploy_contracts.sh index 674aea7e0..856cc6cff 100755 --- a/contracts/scripts/ci_deploy_contracts.sh +++ b/contracts/scripts/ci_deploy_contracts.sh @@ -4,25 +4,13 @@ set -e # Do not deploy if a mainnet deployment case $VERSION_TAG in testnet) - export ETHEREUM_HOST=https://aztec-connect-$VERSION_TAG-mainnet-fork.aztec.network:8545/$TEST_FORK_API_KEY - export PRIVATE_KEY=$TF_VAR_TEST_FORK_CONTRACTS_DEPLOYER_PRIVATE_KEY - export DEPLOYER_ADDRESS=$TF_VAR_TEST_FORK_CONTRACTS_DEPLOYER_ADDRESS - export FAUCET_CONTROLLER=$TF_VAR_TEST_FORK_FAUCET_OPERATOR_ADDRESS - export ROLLUP_PROVIDER_ADDRESS=$TF_VAR_TEST_FORK_ROLLUP_PROVIDER_ADDRESS + TAG=TEST ;; dev) - export ETHEREUM_HOST=https://aztec-connect-$VERSION_TAG-mainnet-fork.aztec.network:8545/$DEV_FORK_API_KEY - export PRIVATE_KEY=$TF_VAR_DEV_FORK_CONTRACTS_DEPLOYER_PRIVATE_KEY - export DEPLOYER_ADDRESS=$TF_VAR_DEV_FORK_CONTRACTS_DEPLOYER_ADDRESS - export FAUCET_CONTROLLER=$TF_VAR_DEV_FORK_FAUCET_OPERATOR_ADDRESS - export ROLLUP_PROVIDER_ADDRESS=$TF_VAR_DEV_FORK_ROLLUP_PROVIDER_ADDRESS + TAG=DEV ;; stage) - export ETHEREUM_HOST=https://aztec-connect-$VERSION_TAG-mainnet-fork.aztec.network:8545/$STAGE_FORK_API_KEY - export PRIVATE_KEY=$TF_VAR_STAGE_FORK_CONTRACTS_DEPLOYER_PRIVATE_KEY - export DEPLOYER_ADDRESS=$TF_VAR_STAGE_FORK_CONTRACTS_DEPLOYER_ADDRESS - export FAUCET_CONTROLLER=$TF_VAR_STAGE_FORK_FAUCET_OPERATOR_ADDRESS - export ROLLUP_PROVIDER_ADDRESS=$TF_VAR_STAGE_FORK_ROLLUP_PROVIDER_ADDRESS + TAG=STAGE ;; *) echo "No configuration for VERSION_TAG=$VERSION_TAG, skipping contract deployment." @@ -30,6 +18,22 @@ case $VERSION_TAG in ;; esac +# DECLARE INTERMEDIATE VARIABLES +FORK_BASE=https://aztec-connect-$VERSION_TAG-mainnet-fork.aztec.network:8545 +declare API_KEY_VAL=$(eval echo "\$${TAG}_FORK_API_KEY") +declare PRIVATE_KEY_VAL=$(eval echo "\$${TAG}_FORK_CONTRACTS_DEPLOYER_PRIVATE_KEY") +declare DEPLOYER_VAL=$(eval echo "\$${TAG}_FORK_CONTRACTS_DEPLOYER_ADDRESS") +declare FAUCET_VAL=$(eval echo "\$${TAG}_FORK_FAUCET_OPERATOR_ADDRESS") +declare ROLLUP_VAL=$(eval echo "\$${TAG}_FORK_ROLLUP_PROVIDER_ADDRESS") + +# EXPORT VARIABLES +export API_KEY="$API_KEY_VAL" +export PRIVATE_KEY="$PRIVATE_KEY_VAL" +export DEPLOYER_ADDRESS="$DEPLOYER_VAL" +export FAUCET_CONTROLLER="$FAUCET_VAL" +export ROLLUP_PROVIDER_ADDRESS="$ROLLUP_VAL" +export ETHEREUM_HOST="$FORK_BASE/$API_KEY" + LAST_COMMIT=$(last_successful_commit contracts $DEPLOY_TAG-deployed) if [ -z "$LAST_COMMIT" ]; then @@ -55,4 +59,4 @@ elif changed $LAST_COMMIT "contracts/deploy/$VERSION_TAG" || [ "$FORCE_DEPLOY" = deploy_terraform contracts ./terraform/$VERSION_TAG fi -tag_remote_image contracts cache-$COMMIT_HASH cache-$COMMIT_HASH-$DEPLOY_TAG-deployed +tag_remote_image contracts cache-$COMMIT_HASH cache-$COMMIT_HASH-$DEPLOY_TAG-deployed \ No newline at end of file diff --git a/contracts/scripts/start_e2e_fork.sh b/contracts/scripts/start_e2e_fork.sh index 6abacc14e..b3d6e692a 100755 --- a/contracts/scripts/start_e2e_fork.sh +++ b/contracts/scripts/start_e2e_fork.sh @@ -2,7 +2,7 @@ set -eu pipefail export FORK_BLOCK=15918000 -export FORK_URL=https://mainnet.infura.io/v3/6a04b7c89c5b421faefde663f787aa35 +export FORK_URL=https://mainnet.infura.io/v3/9928b52099854248b3a096be07a6b23c export CHAIN_ID=3630 ./scripts/start_e2e.sh \ No newline at end of file diff --git a/contracts/scripts/tenderly_increase_balance.sh b/contracts/scripts/tenderly_increase_balance.sh deleted file mode 100755 index fad4be937..000000000 --- a/contracts/scripts/tenderly_increase_balance.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# inputs -FORK_URL=$1 - -# Convert input 2 to hex -let BALANCE=10**$2 -HEX=$( printf "%x" $BALANCE) - -# Addresses should be a string of addresses -ADDRESSES=$3 - -# Create the payload to send to tenderly -generate_payload() -{ - cat <=0.8.4; + +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; +import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; + +import {IVerifier} from "../interfaces/IVerifier.sol"; +import {IRollupProcessorV2, IRollupProcessor} from "rollup-encoder/interfaces/IRollupProcessorV2.sol"; +import {IDefiBridge} from "../interfaces/IDefiBridge.sol"; + +import {Decoder} from "../Decoder.sol"; +import {AztecTypes} from "rollup-encoder/libraries/AztecTypes.sol"; + +import {TokenTransfers} from "../libraries/TokenTransfers.sol"; +import {RollupProcessorLibrary} from "rollup-encoder/libraries/RollupProcessorLibrary.sol"; +import {SafeCast} from "../libraries/SafeCast.sol"; + +/** + * @title Rollup Processor + * @dev Smart contract responsible for processing Aztec zkRollups, relaying them to a verifier + * contract for validation and performing all the relevant ERC20 token transfers + */ +contract RollupProcessorV2Reference is IRollupProcessorV2, Decoder, Initializable, AccessControl { + using SafeCast for uint256; + /*---------------------------------------- + ERROR TAGS + ----------------------------------------*/ + + error PAUSED(); + error NOT_PAUSED(); + error LOCKED_NO_REENTER(); + error INVALID_PROVIDER(); + error THIRD_PARTY_CONTRACTS_FLAG_NOT_SET(); + error INSUFFICIENT_DEPOSIT(); + error INVALID_ADDRESS_NO_CODE(); + error INVALID_ASSET_GAS(); + error INVALID_ASSET_ID(); + error INVALID_ASSET_ADDRESS(); + error INVALID_BRIDGE_GAS(); + error INVALID_BRIDGE_CALL_DATA(); + error INVALID_BRIDGE_ADDRESS(); + error INVALID_ESCAPE_BOUNDS(); + error INCONSISTENT_BRIDGE_CALL_DATA(); + error BRIDGE_WITH_IDENTICAL_INPUT_ASSETS(uint256 inputAssetId); + error BRIDGE_WITH_IDENTICAL_OUTPUT_ASSETS(uint256 outputAssetId); + error ZERO_TOTAL_INPUT_VALUE(); + error ARRAY_OVERFLOW(); + error MSG_VALUE_WRONG_AMOUNT(); + error INSUFFICIENT_ETH_PAYMENT(); + error WITHDRAW_TO_ZERO_ADDRESS(); + error DEPOSIT_TOKENS_WRONG_PAYMENT_TYPE(); + error INSUFFICIENT_TOKEN_APPROVAL(); + error NONZERO_OUTPUT_VALUE_ON_NOT_USED_ASSET(uint256 outputValue); + error INCORRECT_STATE_HASH(bytes32 oldStateHash, bytes32 newStateHash); + error INCORRECT_DATA_START_INDEX(uint256 providedIndex, uint256 expectedIndex); + error INCORRECT_PREVIOUS_DEFI_INTERACTION_HASH( + bytes32 providedDefiInteractionHash, bytes32 expectedDefiInteractionHash + ); + error PUBLIC_INPUTS_HASH_VERIFICATION_FAILED(uint256, uint256); + error PROOF_VERIFICATION_FAILED(); + error PENDING_CAP_SURPASSED(); + error DAILY_CAP_SURPASSED(); + + /*---------------------------------------- + EVENTS + ----------------------------------------*/ + event OffchainData(uint256 indexed rollupId, uint256 chunk, uint256 totalChunks, address sender); + event RollupProcessed(uint256 indexed rollupId, bytes32[] nextExpectedDefiHashes, address sender); + event DefiBridgeProcessed( + uint256 indexed encodedBridgeCallData, + uint256 indexed nonce, + uint256 totalInputValue, + uint256 totalOutputValueA, + uint256 totalOutputValueB, + bool result, + bytes errorReason + ); + event AsyncDefiBridgeProcessed( + uint256 indexed encodedBridgeCallData, uint256 indexed nonce, uint256 totalInputValue + ); + event Deposit(uint256 indexed assetId, address indexed depositorAddress, uint256 depositValue); + event AssetAdded(uint256 indexed assetId, address indexed assetAddress, uint256 assetGasLimit); + event BridgeAdded(uint256 indexed bridgeAddressId, address indexed bridgeAddress, uint256 bridgeGasLimit); + event RollupProviderUpdated(address indexed providerAddress, bool valid); + event VerifierUpdated(address indexed verifierAddress); + event AllowThirdPartyContractsUpdated(bool allowed); + event DefiBridgeProxyUpdated(address defiBridgeProxy); + event Paused(address account); + event Unpaused(address account); + event DelayBeforeEscapeHatchUpdated(uint32 delay); + event AssetCapUpdated(uint256 assetId, uint256 pendingCap, uint256 dailyCap); + event CappedUpdated(bool isCapped); + + /*---------------------------------------- + STRUCTS + ----------------------------------------*/ + + // @dev ALLOW_ASYNC_REENTER lock is present to allow calling of `processAsyncDefiInteraction(...)` from within + // bridge's `convert(...)` method. + enum Lock { + UNLOCKED, + ALLOW_ASYNC_REENTER, + LOCKED + } + + /** + * @dev RollupState struct contains the following data: + * + * | bit offset | num bits | description | + * | --- | --- | --- | + * | 0 | 160 | PLONK verifier contract address | + * | 160 | 32 | datasize: number of filled entries in note tree | + * | 192 | 16 | asyncDefiInteractionHashes.length : number of entries in asyncDefiInteractionHashes array | + * | 208 | 16 | defiInteractionHashes.length : number of entries in defiInteractionHashes array | + * | 224 | 8 | Lock enum used to guard against reentrancy attacks (minimum value to store in is uint8) + * | 232 | 8 | pause flag, true if contract is paused, false otherwise + * | 240 | 8 | capped flag, true if assets should check cap, false otherwise + * + * Note: (RollupState struct gets packed to 1 storage slot -> bit offset signifies location withing the 256 bit string) + */ + struct RollupState { + IVerifier verifier; + uint32 datasize; + uint16 numAsyncDefiInteractionHashes; + uint16 numDefiInteractionHashes; + Lock lock; + bool paused; + bool capped; + } + + /** + * @dev Contains information that describes a specific call to a bridge + */ + struct FullBridgeCallData { + uint256 bridgeAddressId; + address bridgeAddress; + uint256 inputAssetIdA; + uint256 inputAssetIdB; + uint256 outputAssetIdA; + uint256 outputAssetIdB; + uint256 auxData; + bool firstInputVirtual; + bool secondInputVirtual; + bool firstOutputVirtual; + bool secondOutputVirtual; + bool secondInputInUse; + bool secondOutputInUse; + uint256 bridgeGasLimit; + } + + /** + * @dev Represents an asynchronous DeFi bridge interaction that has not been resolved + * @param encodedBridgeCallData bit-string encoded bridge call data + * @param totalInputValue number of tokens/wei sent to the bridge + */ + struct PendingDefiBridgeInteraction { + uint256 encodedBridgeCallData; + uint256 totalInputValue; + } + + /** + * @dev Container for the results of a DeFi interaction + * @param outputValueA amount of output asset A returned from the interaction + * @param outputValueB amount of output asset B returned from the interaction (0 if asset B unused) + * @param isAsync true if the interaction is asynchronous, false otherwise + * @param success true if the call succeeded, false otherwise + */ + struct BridgeResult { + uint256 outputValueA; + uint256 outputValueB; + bool isAsync; + bool success; + bytes errorReason; + } + + /** + * @dev Container for the inputs of a DeFi interaction + * @param totalInputValue number of tokens/wei sent to the bridge + * @param interactionNonce the unique id of the interaction + * @param auxData additional input specific to the type of interaction + */ + struct InteractionInputs { + uint256 totalInputValue; + uint256 interactionNonce; + uint64 auxData; + } + + /** + * @dev Container for asset cap restrictions + * @dev Caps used to limit usefulness of using Aztec to "wash" larger hacks + * @param available The amount of tokens that can be deposited, bounded by `dailyCap * 10 ** decimals`. + * @param lastUpdatedTimestamp The timestamp of the last deposit with caps activated + * @param pendingCap The cap for each individual pending deposit measured in whole tokens + * @param dailyCap The cap for total amount that can be added to `available` in 24 hours, measured in whole tokens + * @param precision The number of decimals in the precision for specific asset. + */ + struct AssetCap { + uint128 available; + uint32 lastUpdatedTimestamp; + uint32 pendingCap; + uint32 dailyCap; + uint8 precision; + } + + /** + * @dev Container for variables used in `processBridgeCalls(...)` to work around stack too deep errors + */ + struct ProcessBridgeCallVariables { + uint256 defiInteractionHashesLength; + uint256 encodedBridgeCallData; + BridgeResult bridgeResult; + AztecTypes.AztecAsset inputAssetA; + AztecTypes.AztecAsset inputAssetB; + AztecTypes.AztecAsset outputAssetA; + AztecTypes.AztecAsset outputAssetB; + uint256 totalInputValue; + uint256 interactionNonce; + uint256 paymentsSlot; + address rollupBeneficiary; + } + + /*---------------------------------------- + FUNCTION SELECTORS (PRECOMPUTED) + ----------------------------------------*/ + // DEFI_BRIDGE_PROXY_CONVERT_SELECTOR = function signature of: + // function convert( + // address, + // AztecTypes.AztecAsset memory inputAssetA, + // AztecTypes.AztecAsset memory inputAssetB, + // AztecTypes.AztecAsset memory outputAssetA, + // AztecTypes.AztecAsset memory outputAssetB, + // uint256 totalInputValue, + // uint256 interactionNonce, + // uint256 auxData, + // uint256 ethPaymentsSlot + // address rollupBeneficary) + // N.B. this is the selector of the 'convert' function of the DefiBridgeProxy contract. + // This has a different interface to the IDefiBridge.convert function + bytes4 private constant DEFI_BRIDGE_PROXY_CONVERT_SELECTOR = 0x4bd947a8; + + bytes4 private constant INVALID_ADDRESS_NO_CODE_SELECTOR = 0x21409272; // bytes4(keccak256('INVALID_ADDRESS_NO_CODE()')); + + bytes4 private constant ARRAY_OVERFLOW_SELECTOR = 0x58a4ab0e; // bytes4(keccak256('ARRAY_OVERFLOW()')); + + /*---------------------------------------- + CONSTANT STATE VARIABLES + ----------------------------------------*/ + uint256 private constant ETH_ASSET_ID = 0; // if assetId == ETH_ASSET_ID, treat as native ETH and not ERC20 token + + // starting root hash of the DeFi interaction result Merkle tree + bytes32 private constant INIT_DEFI_ROOT = 0x2e4ab7889ab3139204945f9e722c7a8fdb84e66439d787bd066c3d896dba04ea; + + // We need to cap the amount of gas sent to the DeFi bridge contract for two reasons: + // 1. To provide consistency to rollup providers around costs, + // 2. to prevent griefing attacks where a bridge consumes all our gas. + uint256 private constant MIN_BRIDGE_GAS_LIMIT = 35000; + uint256 private constant MIN_ERC20_GAS_LIMIT = 55000; + uint256 private constant MAX_BRIDGE_GAS_LIMIT = 5000000; + uint256 private constant MAX_ERC20_GAS_LIMIT = 1500000; + + // Bit offsets and bit masks used to extract values from `uint256 encodedBridgeCallData` to FullBridgeCallData struct + uint256 private constant INPUT_ASSET_ID_A_SHIFT = 32; + uint256 private constant INPUT_ASSET_ID_B_SHIFT = 62; + uint256 private constant OUTPUT_ASSET_ID_A_SHIFT = 92; + uint256 private constant OUTPUT_ASSET_ID_B_SHIFT = 122; + uint256 private constant BITCONFIG_SHIFT = 152; + uint256 private constant AUX_DATA_SHIFT = 184; + uint256 private constant VIRTUAL_ASSET_ID_FLAG_SHIFT = 29; + uint256 private constant VIRTUAL_ASSET_ID_FLAG = 0x2000_0000; // 2 ** 29 + uint256 private constant MASK_THIRTY_TWO_BITS = 0xffff_ffff; + uint256 private constant MASK_THIRTY_BITS = 0x3fff_ffff; + uint256 private constant MASK_SIXTY_FOUR_BITS = 0xffff_ffff_ffff_ffff; + + // Offsets and masks used to encode/decode the rollupState storage variable of RollupProcessor + uint256 private constant DATASIZE_BIT_OFFSET = 160; + uint256 private constant ASYNCDEFIINTERACTIONHASHES_BIT_OFFSET = 192; + uint256 private constant DEFIINTERACTIONHASHES_BIT_OFFSET = 208; + uint256 private constant ARRAY_LENGTH_MASK = 0x3ff; // 1023 + uint256 private constant DATASIZE_MASK = 0xffff_ffff; + + // the value of hashing a 'zeroed' DeFi interaction result + bytes32 private constant DEFI_RESULT_ZERO_HASH = 0x2d25a1e3a51eb293004c4b56abe12ed0da6bca2b4a21936752a85d102593c1b4; + + // roles used in access control + bytes32 public constant OWNER_ROLE = keccak256("OWNER_ROLE"); + bytes32 public constant EMERGENCY_ROLE = keccak256("EMERGENCY_ROLE"); + bytes32 public constant LISTER_ROLE = keccak256("LISTER_ROLE"); + bytes32 public constant RESUME_ROLE = keccak256("RESUME_ROLE"); + + // bounds used for escape hatch + uint256 public immutable escapeBlockLowerBound; + uint256 public immutable escapeBlockUpperBound; + + /*---------------------------------------- + STATE VARIABLES + ----------------------------------------*/ + RollupState internal rollupState; + + // An array of addresses of supported ERC20 tokens + address[] internal supportedAssets; + + // An array of addresses of supported bridges + // @dev `bridgeAddressId` is an index of the bridge's address in this array incremented by 1 + address[] internal supportedBridges; + + // A mapping from index to async interaction hash (emulates an array) + // @dev next index is stored in `RollupState.numAsyncDefiInteractionHashes` + mapping(uint256 => bytes32) public asyncDefiInteractionHashes; + + // A mapping from index to interaction hash (emulates an array) + // @dev next index is stored in the `RollupState.numDefiInteractionHashes` + mapping(uint256 => bytes32) public defiInteractionHashes; + + // A mapping from assetId to a mapping of userAddress to the user's public pending balance + mapping(uint256 => mapping(address => uint256)) public userPendingDeposits; + + // A mapping from user's address to a mapping of proof hashes to a boolean which indicates approval + mapping(address => mapping(bytes32 => bool)) public depositProofApprovals; + + // A hash of the latest rollup state + bytes32 public override(IRollupProcessor) rollupStateHash; + + // An address of DefiBridgeProxy contract + address public override(IRollupProcessor) defiBridgeProxy; + + // A flag indicating whether addresses without a LISTER role can list assets and bridges + // Note: will be set to true once Aztec Connect is no longer in BETA + bool public allowThirdPartyContracts; + + // A mapping from an address to a boolean which indicates whether address is an approved rollup provider + // @dev A rollup provider is an address which is allowed to call `processRollup(...)` out of escape hatch window. + mapping(address => bool) public rollupProviders; + + // A mapping from interactionNonce to PendingDefiBridgeInteraction struct + mapping(uint256 => PendingDefiBridgeInteraction) public pendingDefiInteractions; + + // A mapping from interactionNonce to ETH amount which was received for that interaction. + // interaction + mapping(uint256 => uint256) public ethPayments; + + // A mapping from an `assetId` to a gas limit + mapping(uint256 => uint256) public assetGasLimits; + + // A mapping from a `bridgeAddressId` to a gas limit + mapping(uint256 => uint256) public bridgeGasLimits; + + // A hash of hashes of pending DeFi interactions, the notes of which are expected to be added in the 'next' rollup + bytes32 public override(IRollupProcessor) prevDefiInteractionsHash; + + // The timestamp of the last rollup that was performed by a rollup provider + uint32 public lastRollupTimeStamp; + // The delay in seconds from `lastRollupTimeStamp` until the escape hatch can be used. + uint32 public delayBeforeEscapeHatch; + + mapping(uint256 => AssetCap) public caps; + + /*---------------------------------------- + MODIFIERS + ----------------------------------------*/ + /** + * @notice A modifier forbidding functions from being called by addresses without LISTER role when Aztec Connect + * is still in BETA (`allowThirdPartyContracts` variable set to false) + */ + modifier checkThirdPartyContractStatus() { + if (!hasRole(LISTER_ROLE, msg.sender) && !allowThirdPartyContracts) { + revert THIRD_PARTY_CONTRACTS_FLAG_NOT_SET(); + } + _; + } + + /** + * @notice A modifier reverting if this contract is paused + */ + modifier whenNotPaused() { + if (rollupState.paused) { + revert PAUSED(); + } + _; + } + + /** + * @notice A modifier reverting if this contract is NOT paused + */ + modifier whenPaused() { + if (!rollupState.paused) { + revert NOT_PAUSED(); + } + _; + } + + /** + * @notice A modifier reverting on any re-enter + */ + modifier noReenter() { + if (rollupState.lock != Lock.UNLOCKED) { + revert LOCKED_NO_REENTER(); + } + rollupState.lock = Lock.LOCKED; + _; + rollupState.lock = Lock.UNLOCKED; + } + + /** + * @notice A modifier reverting on any re-enter but allowing async to be called + */ + modifier allowAsyncReenter() { + if (rollupState.lock != Lock.UNLOCKED) { + revert LOCKED_NO_REENTER(); + } + rollupState.lock = Lock.ALLOW_ASYNC_REENTER; + _; + rollupState.lock = Lock.UNLOCKED; + } + + /** + * @notice A modifier reverting if re-entering after locking, but passes if unlocked or if async is re-enter is + * allowed + */ + modifier noReenterButAsync() { + Lock lock = rollupState.lock; + if (lock == Lock.ALLOW_ASYNC_REENTER) { + _; + } else if (lock == Lock.UNLOCKED) { + rollupState.lock = Lock.ALLOW_ASYNC_REENTER; + _; + rollupState.lock = Lock.UNLOCKED; + } else { + revert LOCKED_NO_REENTER(); + } + } + + /** + * @notice A modifier which reverts if a given `_assetId` represents a virtual asset + * @param _assetId 30-bit integer that describes the asset + * @dev If _assetId's 29th bit is set, it represents a virtual asset with no ERC20 equivalent + * Virtual assets are used by the bridges to track non-token data. E.g. to represent a loan. + * If an _assetId is *not* a virtual asset, its ERC20 address can be recovered from + * `supportedAssets[_assetId]` + */ + modifier validateAssetIdIsNotVirtual(uint256 _assetId) { + if (_assetId > 0x1fffffff) { + revert INVALID_ASSET_ID(); + } + _; + } + + /*---------------------------------------- + CONSTRUCTORS & INITIALIZERS + ----------------------------------------*/ + /** + * @notice Constructor sets escape hatch window and ensure that the implementation cannot be initialized + * @param _escapeBlockLowerBound a block number which defines a start of the escape hatch window + * @param _escapeBlockUpperBound a block number which defines an end of the escape hatch window + */ + constructor(uint256 _escapeBlockLowerBound, uint256 _escapeBlockUpperBound) { + if (_escapeBlockLowerBound == 0 || _escapeBlockLowerBound >= _escapeBlockUpperBound) { + revert INVALID_ESCAPE_BOUNDS(); + } + + // Set storage in implementation. + // Disable initializers to ensure no-one can call initialize on implementation directly + // Pause to limit possibility for user error + _disableInitializers(); + rollupState.paused = true; + + // Set immutables (part of code) so will be used in proxy calls as well + escapeBlockLowerBound = _escapeBlockLowerBound; + escapeBlockUpperBound = _escapeBlockUpperBound; + } + + /** + * @notice Initialiser function which emulates constructor behaviour for upgradeable contracts + */ + function initialize() external reinitializer(getImplementationVersion()) { + rollupState.capped = true; + lastRollupTimeStamp = uint32(block.timestamp); + + // Set Eth asset caps. 6 Eth to cover 5 eth deposits + fee up to 1 eth. + caps[0] = AssetCap({ + available: uint128(1000e18), + lastUpdatedTimestamp: uint32(block.timestamp), + pendingCap: 6, + dailyCap: 1000, + precision: 18 + }); + + // Set Dai asset cap. 10100 Dai to cover 10K deposits + fee up to 100 dai. + caps[1] = AssetCap({ + available: uint128(1e24), + lastUpdatedTimestamp: uint32(block.timestamp), + pendingCap: 10100, + dailyCap: 1e6, + precision: 18 + }); + + emit AssetCapUpdated(0, 6, 1000); + emit AssetCapUpdated(1, 10100, 1e6); + } + + /*---------------------------------------- + MUTATING FUNCTIONS WITH ACCESS CONTROL + ----------------------------------------*/ + /** + * @notice A function which allow the holders of the EMERGENCY_ROLE role to pause the contract + */ + function pause() public override(IRollupProcessor) whenNotPaused onlyRole(EMERGENCY_ROLE) noReenter { + rollupState.paused = true; + emit Paused(msg.sender); + } + + /** + * @dev Allow the holders of the RESUME_ROLE to unpause the contract. + */ + function unpause() public override(IRollupProcessor) whenPaused onlyRole(RESUME_ROLE) noReenter { + rollupState.paused = false; + emit Unpaused(msg.sender); + } + + /** + * @notice A function which allows holders of OWNER_ROLE to set the capped flag + * @dev When going from uncapped to capped, will update `lastRollupTimeStamp` + * @param _isCapped a flag indicating whether caps are used or not + */ + function setCapped(bool _isCapped) external onlyRole(OWNER_ROLE) noReenter { + if (_isCapped == rollupState.capped) return; + + if (_isCapped) { + lastRollupTimeStamp = uint32(block.timestamp); + } + + rollupState.capped = _isCapped; + emit CappedUpdated(_isCapped); + } + + /** + * @notice A function which allows holders of OWNER_ROLE to add and remove a rollup provider. + * @param _provider an address of the rollup provider + * @param _valid a flag indicating whether `_provider` is valid + */ + function setRollupProvider(address _provider, bool _valid) + external + override(IRollupProcessor) + onlyRole(OWNER_ROLE) + noReenter + { + rollupProviders[_provider] = _valid; + emit RollupProviderUpdated(_provider, _valid); + } + + /** + * @notice A function which allows holders of the LISTER_ROLE to update asset caps + * @param _assetId The asset id to update the cap for + * @param _pendingCap The pending cap in whole tokens + * @param _dailyCap The daily "accrual" to available deposits in whole tokens + * @param _precision The precision (decimals) to multiply the caps with + */ + function setAssetCap(uint256 _assetId, uint32 _pendingCap, uint32 _dailyCap, uint8 _precision) + external + onlyRole(LISTER_ROLE) + noReenter + { + caps[_assetId] = AssetCap({ + available: (uint256(_dailyCap) * 10 ** _precision).toU128(), + lastUpdatedTimestamp: uint32(block.timestamp), + pendingCap: _pendingCap, + dailyCap: _dailyCap, + precision: _precision + }); + + emit AssetCapUpdated(_assetId, _pendingCap, _dailyCap); + } + + /** + * @notice A function which allows holders of the OWNER_ROLE to specify the delay before escapehatch is possible + * @param _delay the delay in seconds between last rollup by a provider, and escape hatch being possible + */ + function setDelayBeforeEscapeHatch(uint32 _delay) external onlyRole(OWNER_ROLE) noReenter { + delayBeforeEscapeHatch = _delay; + emit DelayBeforeEscapeHatchUpdated(_delay); + } + + /** + * @notice A function which allows holders of OWNER_ROLE to set the address of the PLONK verification smart + * ( contract + * @param _verifier an address of the verification smart contract + */ + function setVerifier(address _verifier) public override(IRollupProcessor) onlyRole(OWNER_ROLE) noReenter { + if (_verifier.code.length == 0) { + revert INVALID_ADDRESS_NO_CODE(); + } + + rollupState.verifier = IVerifier(_verifier); + emit VerifierUpdated(_verifier); + } + + /** + * @notice A function which allows holders of OWNER_ROLE to set `allowThirdPartyContracts` flag + * @param _allowThirdPartyContracts A flag indicating true if allowing third parties to register, false otherwise + */ + function setAllowThirdPartyContracts(bool _allowThirdPartyContracts) + external + override(IRollupProcessor) + onlyRole(OWNER_ROLE) + noReenter + { + allowThirdPartyContracts = _allowThirdPartyContracts; + emit AllowThirdPartyContractsUpdated(_allowThirdPartyContracts); + } + + /** + * @notice A function which allows holders of OWNER_ROLE to set address of `DefiBridgeProxy` contract + * @param _defiBridgeProxy an address of `DefiBridgeProxy` contract + */ + function setDefiBridgeProxy(address _defiBridgeProxy) + public + override(IRollupProcessor) + onlyRole(OWNER_ROLE) + noReenter + { + if (_defiBridgeProxy.code.length == 0) { + revert INVALID_ADDRESS_NO_CODE(); + } + defiBridgeProxy = _defiBridgeProxy; + emit DefiBridgeProxyUpdated(_defiBridgeProxy); + } + + /** + * @notice Registers an ERC20 token as a supported asset + * @param _token address of the ERC20 token + * @param _gasLimit gas limit used when transferring the token (in withdraw or transferFee) + */ + function setSupportedAsset(address _token, uint256 _gasLimit) + external + override(IRollupProcessor) + whenNotPaused + checkThirdPartyContractStatus + noReenter + { + if (_token.code.length == 0) { + revert INVALID_ADDRESS_NO_CODE(); + } + if (_gasLimit < MIN_ERC20_GAS_LIMIT || _gasLimit > MAX_ERC20_GAS_LIMIT) { + revert INVALID_ASSET_GAS(); + } + + supportedAssets.push(_token); + uint256 assetId = supportedAssets.length; + assetGasLimits[assetId] = _gasLimit; + emit AssetAdded(assetId, _token, assetGasLimits[assetId]); + } + + /** + * @dev Appends a bridge contract to the supportedBridges + * @param _bridge address of the bridge contract + * @param _gasLimit gas limit forwarded to the DefiBridgeProxy to perform convert + */ + function setSupportedBridge(address _bridge, uint256 _gasLimit) + external + override(IRollupProcessor) + whenNotPaused + checkThirdPartyContractStatus + noReenter + { + if (_bridge.code.length == 0) { + revert INVALID_ADDRESS_NO_CODE(); + } + if (_gasLimit < MIN_BRIDGE_GAS_LIMIT || _gasLimit > MAX_BRIDGE_GAS_LIMIT) { + revert INVALID_BRIDGE_GAS(); + } + + supportedBridges.push(_bridge); + uint256 bridgeAddressId = supportedBridges.length; + bridgeGasLimits[bridgeAddressId] = _gasLimit; + emit BridgeAdded(bridgeAddressId, _bridge, bridgeGasLimits[bridgeAddressId]); + } + + /** + * @notice A function which processes a rollup + * @dev Rollup processing consists of decoding a rollup, verifying the corresponding proof and updating relevant + * state variables + * @dev The `encodedProofData` is unnamed param as we are reading it directly from calldata when decoding + * and creating the `proofData` in `Decoder::decodeProof()`. + * @dev For the rollup to be processed `msg.sender` has to be an authorised rollup provider or escape hatch has + * to be open + * @dev This function always transfers fees to the `rollupBeneficiary` encoded in the proof data + * + * @param - cryptographic proof data associated with a rollup + * @param _signatures a byte array of secp256k1 ECDSA signatures, authorising a transfer of tokens from + * the publicOwner for the particular inner proof in question + * + * Structure of each signature in the bytes array is: + * 0x00 - 0x20 : r + * 0x20 - 0x40 : s + * 0x40 - 0x60 : v (in form: 0x0000....0001b for example) + */ + function processRollup( + bytes calldata, + /* encodedProofData */ + bytes calldata _signatures + ) external override(IRollupProcessor) whenNotPaused allowAsyncReenter { + if (rollupProviders[msg.sender]) { + if (rollupState.capped) { + lastRollupTimeStamp = uint32(block.timestamp); + } + } else { + (bool isOpen,) = getEscapeHatchStatus(); + if (!isOpen) { + revert INVALID_PROVIDER(); + } + } + + (bytes memory proofData, uint256 numTxs, uint256 publicInputsHash) = decodeProof(); + address rollupBeneficiary = extractRollupBeneficiary(proofData); + + processRollupProof(proofData, _signatures, numTxs, publicInputsHash, rollupBeneficiary); + + transferFee(proofData, rollupBeneficiary); + } + + /*---------------------------------------- + PUBLIC/EXTERNAL MUTATING FUNCTIONS + ----------------------------------------*/ + + /** + * @notice A function used by bridges to send ETH to the RollupProcessor during an interaction + * @param _interactionNonce an interaction nonce that used as an ID of this payment + */ + function receiveEthFromBridge(uint256 _interactionNonce) external payable override(IRollupProcessor) { + ethPayments[_interactionNonce] += msg.value; + } + + /** + * @notice A function which approves a proofHash to spend the user's pending deposited funds + * @dev this function is one way and must be called by the owner of the funds + * @param _proofHash keccak256 hash of the inner proof public inputs + */ + function approveProof(bytes32 _proofHash) public override(IRollupProcessor) whenNotPaused { + depositProofApprovals[msg.sender][_proofHash] = true; + } + + /** + * @notice A function which deposits funds to the contract + * @dev This is the first stage of a 2 stage deposit process. In the second stage funds are claimed by the user on + * L2. + * @param _assetId asset ID which was assigned during asset registration + * @param _amount token deposit amount + * @param _owner address that can spend the deposited funds + * @param _proofHash 32 byte transaction id that can spend the deposited funds + */ + function depositPendingFunds(uint256 _assetId, uint256 _amount, address _owner, bytes32 _proofHash) + external + payable + override(IRollupProcessor) + whenNotPaused + noReenter + { + // Perform sanity checks on user input + if (_assetId == ETH_ASSET_ID && msg.value != _amount) { + revert MSG_VALUE_WRONG_AMOUNT(); + } + if (_assetId != ETH_ASSET_ID && msg.value != 0) { + revert DEPOSIT_TOKENS_WRONG_PAYMENT_TYPE(); + } + + increasePendingDepositBalance(_assetId, _owner, _amount); + + if (_proofHash != 0) approveProof(_proofHash); + + emit Deposit(_assetId, _owner, _amount); + + if (_assetId != ETH_ASSET_ID) { + address assetAddress = getSupportedAsset(_assetId); + // check user approved contract to transfer funds, so can throw helpful error to user + if (IERC20(assetAddress).allowance(msg.sender, address(this)) < _amount) { + revert INSUFFICIENT_TOKEN_APPROVAL(); + } + TokenTransfers.safeTransferFrom(assetAddress, msg.sender, address(this), _amount); + } + } + + /** + * @notice A function used to publish data that doesn't need to be accessible on-chain + * @dev This function can be called multiple times to work around maximum tx size limits + * @dev The data is expected to be reconstructed by the client + * @param _rollupId rollup id this data is related to + * @param _chunk the chunk number, from 0 to totalChunks-1. + * @param _totalChunks the total number of chunks. + * @param - the data + */ + function offchainData(uint256 _rollupId, uint256 _chunk, uint256 _totalChunks, bytes calldata /* offchainTxData */ ) + external + override(IRollupProcessor) + whenNotPaused + { + emit OffchainData(_rollupId, _chunk, _totalChunks, msg.sender); + } + + /** + * @notice A function which process async bridge interaction + * @param _interactionNonce unique id of the interaction + * @return true if successful, false otherwise + */ + function processAsyncDefiInteraction(uint256 _interactionNonce) + external + override(IRollupProcessor) + whenNotPaused + noReenterButAsync + returns (bool) + { + PendingDefiBridgeInteraction memory interaction = pendingDefiInteractions[_interactionNonce]; + + if (interaction.encodedBridgeCallData == 0) { + revert INVALID_BRIDGE_CALL_DATA(); + } + FullBridgeCallData memory fullBridgeCallData = getFullBridgeCallData(interaction.encodedBridgeCallData); + + ( + AztecTypes.AztecAsset memory inputAssetA, + AztecTypes.AztecAsset memory inputAssetB, + AztecTypes.AztecAsset memory outputAssetA, + AztecTypes.AztecAsset memory outputAssetB + ) = getAztecAssetTypes(fullBridgeCallData, _interactionNonce); + + // Extract the bridge address from the encodedBridgeCallData + IDefiBridge bridgeContract = IDefiBridge(getSupportedBridge(interaction.encodedBridgeCallData & 0xffffffff)); + if (address(bridgeContract) == address(0)) { + revert INVALID_BRIDGE_ADDRESS(); + } + + // delete pendingDefiInteractions[interactionNonce] + // N.B. only need to delete 1st slot value `encodedBridgeCallData`. Deleting vars costs gas post-London + // setting encodedBridgeCallData to 0 is enough to cause future calls with this interaction nonce to fail + pendingDefiInteractions[_interactionNonce].encodedBridgeCallData = 0; + + // Copy some variables to front of stack to get around stack too deep errors + InteractionInputs memory inputs = + InteractionInputs(interaction.totalInputValue, _interactionNonce, uint64(fullBridgeCallData.auxData)); + (uint256 outputValueA, uint256 outputValueB, bool interactionCompleted) = bridgeContract.finalise( + inputAssetA, inputAssetB, outputAssetA, outputAssetB, inputs.interactionNonce, inputs.auxData + ); + + if (!interactionCompleted) { + pendingDefiInteractions[inputs.interactionNonce].encodedBridgeCallData = interaction.encodedBridgeCallData; + return false; + } + + if (outputValueB > 0 && outputAssetB.assetType == AztecTypes.AztecAssetType.NOT_USED) { + revert NONZERO_OUTPUT_VALUE_ON_NOT_USED_ASSET(outputValueB); + } + + bool result = !(outputValueA == 0 && outputValueB == 0); + if (!result) { + // issue refund. + transferTokensAsync(address(bridgeContract), inputAssetA, inputs.totalInputValue, inputs.interactionNonce); + transferTokensAsync(address(bridgeContract), inputAssetB, inputs.totalInputValue, inputs.interactionNonce); + } else { + // transfer output tokens to rollup contract + transferTokensAsync(address(bridgeContract), outputAssetA, outputValueA, inputs.interactionNonce); + transferTokensAsync(address(bridgeContract), outputAssetB, outputValueB, inputs.interactionNonce); + } + + uint16 asyncArrayLen = rollupState.numAsyncDefiInteractionHashes; + if (asyncArrayLen + rollupState.numDefiInteractionHashes + 1 > 512) { + revert ARRAY_OVERFLOW(); + } + + { + asyncDefiInteractionHashes[asyncArrayLen] = computeDefiInteractionHash( + interaction.encodedBridgeCallData, + inputs.interactionNonce, + inputs.totalInputValue, + outputValueA, + outputValueB, + result + ); + } + rollupState.numAsyncDefiInteractionHashes = asyncArrayLen + 1; + + emit DefiBridgeProcessed( + interaction.encodedBridgeCallData, + inputs.interactionNonce, + inputs.totalInputValue, + outputValueA, + outputValueB, + result, + "" + ); + + return true; + } + + /*---------------------------------------- + INTERNAL/PRIVATE MUTATING FUNCTIONS + ----------------------------------------*/ + + /** + * @notice A function which increasees pending deposit amount in the `userPendingDeposits` mapping + * @dev Implemented in assembly in order to reduce compiled bytecode size and improve gas costs + * @param _assetId asset ID which was assigned during asset registration + * @param _owner address that can spend the deposited funds + * @param _amount deposit token amount + */ + function increasePendingDepositBalance(uint256 _assetId, address _owner, uint256 _amount) + internal + validateAssetIdIsNotVirtual(_assetId) + { + uint256 pending = userPendingDeposits[_assetId][_owner]; + + if (rollupState.capped) { + AssetCap memory cap = caps[_assetId]; + uint256 precision = 10 ** cap.precision; + + if (cap.pendingCap == 0 || pending + _amount > uint256(cap.pendingCap) * precision) { + revert PENDING_CAP_SURPASSED(); + } + + if (cap.dailyCap == 0) { + revert DAILY_CAP_SURPASSED(); + } else { + // Increase the available amount, capped by dailyCap + uint256 capVal = uint256(cap.dailyCap) * precision; + uint256 rate = capVal / 1 days; + cap.available += (rate * (block.timestamp - cap.lastUpdatedTimestamp)).toU128(); + if (cap.available > capVal) { + cap.available = capVal.toU128(); + } + if (_amount > cap.available) { + revert DAILY_CAP_SURPASSED(); + } + // Update available and timestamp + cap.available -= _amount.toU128(); + cap.lastUpdatedTimestamp = uint32(block.timestamp); + caps[_assetId] = cap; + } + } + + userPendingDeposits[_assetId][_owner] = pending + _amount; + } + + /** + * @notice A function which decreases pending deposit amount in the `userPendingDeposits` mapping + * @dev Implemented in assembly in order to reduce compiled bytecode size and improve gas costs + * @param _assetId asset ID which was assigned during asset registration + * @param _owner address that owns the pending deposit + * @param _amount amount of tokens to decrease pending by + */ + function decreasePendingDepositBalance(uint256 _assetId, address _owner, uint256 _amount) + internal + validateAssetIdIsNotVirtual(_assetId) + { + uint256 userPendingDeposit = userPendingDeposits[_assetId][_owner]; + if (userPendingDeposit < _amount) { + revert INSUFFICIENT_DEPOSIT(); + } + userPendingDeposits[_assetId][_owner] = userPendingDeposit - _amount; + } + + /** + * @notice A function that processes a rollup proof + * @dev Processing a rollup proof consists of: + * 1) Verifying the proof's correctness, + * 2) using the provided proof data to update rollup state + merkle roots, + * 3) validate/enacting any deposits/withdrawals, + * 4) processing bridge calls. + * @param _proofData decoded rollup proof data + * @param _signatures ECDSA signatures from users authorizing deposit transactions + * @param _numTxs the number of transactions in the block + * @param _publicInputsHash the SHA256 hash of the proof's public inputs + * @param _rollupBeneficiary The address to be paid any subsidy for bridge calls and rollup fees + */ + function processRollupProof( + bytes memory _proofData, + bytes memory _signatures, + uint256 _numTxs, + uint256 _publicInputsHash, + address _rollupBeneficiary + ) internal { + uint256 rollupId = verifyProofAndUpdateState(_proofData, _publicInputsHash); + processDepositsAndWithdrawals(_proofData, _numTxs, _signatures); + bytes32[] memory nextDefiHashes = processBridgeCalls(_proofData, _rollupBeneficiary); + emit RollupProcessed(rollupId, nextDefiHashes, msg.sender); + } + + /** + * @notice A function which verifies zk proof and updates the contract's state variables + * @dev encodedProofData is read from calldata passed into the transaction and differs from `_proofData` + * @param _proofData decoded rollup proof data + * @param _publicInputsHash a hash of public inputs (computed by `Decoder.sol`) + * @return rollupId id of the rollup which is being processed + */ + function verifyProofAndUpdateState(bytes memory _proofData, uint256 _publicInputsHash) + internal + returns (uint256 rollupId) + { + // Verify the rollup proof. + // + // We manually call the verifier contract via assembly to save on gas costs and to reduce contract bytecode size + assembly { + /** + * Validate correctness of zk proof. + * + * 1st Item is to format verifier calldata. + * + */ + + // The `encodedProofData` (in calldata) contains the concatenation of + // encoded 'broadcasted inputs' and the actual zk proof data. + // (The `boadcasted inputs` is converted into a 32-byte SHA256 hash, which is + // validated to equal the first public inputs of the zk proof. This is done in `Decoder.sol`). + // We need to identify the location in calldata that points to the start of the zk proof data. + + // Step 1: compute size of zk proof data and its calldata pointer. + /** + * Data layout for `bytes encodedProofData`... + * + * 0x00 : 0x20 : length of array + * 0x20 : 0x20 + header : root rollup header data + * 0x20 + header : 0x24 + header : X, the length of encoded inner join-split public inputs + * 0x24 + header : 0x24 + header + X : (inner join-split public inputs) + * 0x24 + header + X : 0x28 + header + X : Y, the length of the zk proof data + * 0x28 + header + X : 0x28 + haeder + X + Y : zk proof data + * + * We need to recover the numeric value of `0x28 + header + X` and `Y` + * + */ + // Begin by getting length of encoded inner join-split public inputs. + // `calldataload(0x04)` points to start of bytes array. Add 0x24 to skip over length param and function signature. + // The calldata param 4 bytes *after* the header is the length of the pub inputs array. However it is a packed 4-byte param. + // To extract it, we subtract 24 bytes from the calldata pointer and mask off all but the 4 least significant bytes. + let encodedInnerDataSize := + and(calldataload(add(add(calldataload(0x04), 0x24), sub(ROLLUP_HEADER_LENGTH, 0x18))), 0xffffffff) + + // add 8 bytes to skip over the two packed params that follow the rollup header data + // broadcastedDataSize = inner join-split pubinput size + header size + let broadcastedDataSize := add(add(ROLLUP_HEADER_LENGTH, 8), encodedInnerDataSize) + + // Compute zk proof data size by subtracting broadcastedDataSize from overall length of bytes encodedProofsData + let zkProofDataSize := sub(calldataload(add(calldataload(0x04), 0x04)), broadcastedDataSize) + + // Compute calldata pointer to start of zk proof data by adding calldata offset to broadcastedDataSize + // (+0x24 skips over function signature and length param of bytes encodedProofData) + let zkProofDataPtr := add(broadcastedDataSize, add(calldataload(0x04), 0x24)) + + // Step 2: Format calldata for verifier contract call. + + // Get free memory pointer - we copy calldata into memory starting here + let dataPtr := mload(0x40) + + // We call the function `verify(bytes,uint256)` + // The function signature is 0xac318c5d + // Calldata map is: + // 0x00 - 0x04 : 0xac318c5d + // 0x04 - 0x24 : 0x40 (number of bytes between 0x04 and the start of the `proofData` array at 0x44) + // 0x24 - 0x44 : publicInputsHash + // 0x44 - .... : proofData + mstore8(dataPtr, 0xac) + mstore8(add(dataPtr, 0x01), 0x31) + mstore8(add(dataPtr, 0x02), 0x8c) + mstore8(add(dataPtr, 0x03), 0x5d) + mstore(add(dataPtr, 0x04), 0x40) + mstore(add(dataPtr, 0x24), _publicInputsHash) + mstore(add(dataPtr, 0x44), zkProofDataSize) // length of zkProofData bytes array + calldatacopy(add(dataPtr, 0x64), zkProofDataPtr, zkProofDataSize) // copy the zk proof data into memory + + // Step 3: Call our verifier contract. It does not return any values, but will throw an error if the proof is not valid + // i.e. verified == false if proof is not valid + let verifierAddress := and(sload(rollupState.slot), ADDRESS_MASK) + if iszero(extcodesize(verifierAddress)) { + mstore(0, INVALID_ADDRESS_NO_CODE_SELECTOR) + revert(0, 0x4) + } + let proof_verified := staticcall(gas(), verifierAddress, dataPtr, add(zkProofDataSize, 0x64), 0x00, 0x00) + + // Check the proof is valid! + if iszero(proof_verified) { + returndatacopy(0, 0, returndatasize()) + revert(0, returndatasize()) + } + } + + // Validate and update state hash + rollupId = validateAndUpdateMerkleRoots(_proofData); + } + + /** + * @notice Extracts roots from public inputs and validate that they are inline with current contract `rollupState` + * @param _proofData decoded rollup proof data + * @return rollup id + * @dev To make the circuits happy, we want to only insert at the next subtree. The subtrees that we are using are + * 28 leafs in size. They could be smaller but we just want them to be of same size for circuit related + * reasons. + * When we have the case that the `storedDataSize % numDataLeaves == 0`, we are perfectly dividing. This + * means that the incoming rollup matches perfectly with a boundry of the next subtree. + * When this is not the case, we have to compute an offset that we then apply so that the full state can + * be built with a bunch of same-sized trees (when the rollup is not full we insert a tree with some zero + * leaves). This offset can be computed as `numDataLeaves - (storedDataSize % numDataLeaves)` and is, + * essentially, how big a "space" we should leave so that the currently inserted subtree ends exactly at + * the subtree boundry. The value is always >= 0. In the function below we won’t hit the zero case, because + * that would be cought by the "if-branch". + * + * Example: We have just had 32 rollups of size 28 (`storedDataSize = 896`). Now there is a small rollup with + * only 6 transactions. We are not perfectly dividing, hence we compute the offset as `6 - 896 % 6 = 4`. + * The start index is `896 + 4 = 900`. With the added leaves, the stored data size now becomes `906`. + * Now, comes another full rollup (28 txs). We compute `906 % 28 = 10`. The value is non-zero which means + * that we don’t perfectly divide and have to compute an offset `28 - 906 % 28 = 18`. The start index is + * `906 + 18 = 924`. Notice that `924 % 28 == 0`, so this will land us exactly at a location where everything + * in the past could have been subtrees of size 28. + */ + function validateAndUpdateMerkleRoots(bytes memory _proofData) internal returns (uint256) { + (uint256 rollupId, bytes32 oldStateHash, bytes32 newStateHash, uint32 numDataLeaves, uint32 dataStartIndex) = + computeRootHashes(_proofData); + + if (oldStateHash != rollupStateHash) { + revert INCORRECT_STATE_HASH(oldStateHash, newStateHash); + } + + unchecked { + uint32 storedDataSize = rollupState.datasize; + // Ensure we are inserting at the next subtree boundary. + if (storedDataSize % numDataLeaves == 0) { + if (dataStartIndex != storedDataSize) { + revert INCORRECT_DATA_START_INDEX(dataStartIndex, storedDataSize); + } + } else { + uint256 expected = storedDataSize + numDataLeaves - (storedDataSize % numDataLeaves); + if (dataStartIndex != expected) { + revert INCORRECT_DATA_START_INDEX(dataStartIndex, expected); + } + } + + rollupStateHash = newStateHash; + rollupState.datasize = dataStartIndex + numDataLeaves; + } + return rollupId; + } + + /** + * @notice A function which processes deposits and withdrawls + * @param _proofData decoded rollup proof data + * @param _numTxs number of transactions rolled up in the proof + * @param _signatures byte array of secp256k1 ECDSA signatures, authorising a transfer of tokens + */ + function processDepositsAndWithdrawals(bytes memory _proofData, uint256 _numTxs, bytes memory _signatures) + internal + { + uint256 sigIndex = 0x00; + uint256 proofDataPtr; + uint256 end; + assembly { + // add 0x20 to skip over 1st member of the bytes type (the length field). + // Also skip over the rollup header. + proofDataPtr := add(ROLLUP_HEADER_LENGTH, add(_proofData, 0x20)) + + // compute the position of proofDataPtr after we iterate through every transaction + end := add(proofDataPtr, mul(_numTxs, TX_PUBLIC_INPUT_LENGTH)) + } + + // This is a bit of a hot loop, we iterate over every tx to determine whether to process deposits or withdrawals. + while (proofDataPtr < end) { + // extract the minimum information we need to determine whether to skip this iteration + uint256 publicValue; + assembly { + publicValue := mload(add(proofDataPtr, 0xa0)) + } + if (publicValue > 0) { + uint256 proofId; + uint256 assetId; + address publicOwner; + assembly { + proofId := mload(proofDataPtr) + assetId := mload(add(proofDataPtr, 0xe0)) + publicOwner := mload(add(proofDataPtr, 0xc0)) + } + + if (proofId == 1) { + // validate user has approved deposit + bytes32 digest; + assembly { + // compute the tx id to check if user has approved tx + digest := keccak256(proofDataPtr, TX_PUBLIC_INPUT_LENGTH) + } + // check if there is an existing entry in depositProofApprovals + // if there is, no further work required. + // we don't need to clear `depositProofApprovals[publicOwner][digest]` because proofs cannot be re-used. + // A single proof describes the creation of 2 output notes and the addition of 2 input note nullifiers + // (both of these nullifiers can be categorised as "fake". They may not map to existing notes but are still inserted in the nullifier set) + // Replaying the proof will fail to satisfy the rollup circuit's non-membership check on the input nullifiers. + // We avoid resetting `depositProofApprovals` because that would cost additional gas post-London hard fork. + if (!depositProofApprovals[publicOwner][digest]) { + // extract and validate signature + // we can create a bytes memory container for the signature without allocating new memory, + // by overwriting the previous 32 bytes in the `signatures` array with the 'length' of our synthetic byte array (96) + // we store the memory we overwrite in `temp`, so that we can restore it + bytes memory signature; + uint256 temp; + // We use assembly to handle byte manipulation + assembly { + // set `signature` to point to 32 bytes less than the desired `r, s, v` values in `signatures` + signature := add(_signatures, sigIndex) + // cache the memory we're about to overwrite + temp := mload(signature) + // write in a 96-byte 'length' parameter into the `signature` bytes array + mstore(signature, 0x60) + } + + bytes32 hashedMessage = RollupProcessorLibrary.getSignedMessageForTxId(digest); + + RollupProcessorLibrary.validateShieldSignatureUnpacked(hashedMessage, signature, publicOwner); + // restore the memory we overwrote + assembly { + mstore(signature, temp) + sigIndex := add(sigIndex, 0x60) + } + } + decreasePendingDepositBalance(assetId, publicOwner, publicValue); + } + + if (proofId == 2) { + withdraw(publicValue, publicOwner, assetId); + } + } + // don't check for overflow, would take > 2^200 iterations of this loop for that to happen! + unchecked { + proofDataPtr += TX_PUBLIC_INPUT_LENGTH; + } + } + } + + /** + * @notice A function which pulls tokens from a bridge + * @dev Calls `transferFrom` if asset is of type ERC20. If asset is ETH we validate a payment has been made + * against the provided interaction nonce. This function is used by `processAsyncDefiInteraction`. + * @param _bridge address of bridge contract we're transferring tokens from + * @param _asset the AztecAsset being transferred + * @param _outputValue the expected value transferred + * @param _interactionNonce the defi interaction nonce of the interaction + */ + function transferTokensAsync( + address _bridge, + AztecTypes.AztecAsset memory _asset, + uint256 _outputValue, + uint256 _interactionNonce + ) internal { + if (_outputValue == 0) { + return; + } + if (_asset.assetType == AztecTypes.AztecAssetType.ETH) { + if (_outputValue > ethPayments[_interactionNonce]) { + revert INSUFFICIENT_ETH_PAYMENT(); + } + ethPayments[_interactionNonce] = 0; + } else if (_asset.assetType == AztecTypes.AztecAssetType.ERC20) { + address tokenAddress = _asset.erc20Address; + TokenTransfers.safeTransferFrom(tokenAddress, _bridge, address(this), _outputValue); + } + } + + /** + * @notice A function which transfers fees to the `_feeReceiver` + * @dev Note: function will not revert if underlying transfers fails + * @param _proofData decoded rollup proof data + * @param _feeReceiver fee beneficiary as described by the rollup provider + */ + function transferFee(bytes memory _proofData, address _feeReceiver) internal { + for (uint256 i = 0; i < NUMBER_OF_ASSETS; i++) { + uint256 txFee = extractTotalTxFee(_proofData, i); + if (txFee > 0) { + uint256 assetId = extractFeeAssetId(_proofData, i); + if (assetId == ETH_ASSET_ID) { + // We explicitly do not throw if this call fails, as this opens up the possiblity of griefing + // attacks --> engineering a failed fee would invalidate an entire rollup block. As griefing could + // be done by consuming all gas in the `_feeReceiver` fallback only 50K gas is forwarded. We are + // forwarding a bit more gas than in the withdraw function because this code will only be hit + // at most once each rollup-block and we want to give the provider a bit more flexibility. + assembly { + pop(call(50000, _feeReceiver, txFee, 0, 0, 0, 0)) + } + } else { + address assetAddress = getSupportedAsset(assetId); + TokenTransfers.transferToDoNotBubbleErrors( + assetAddress, _feeReceiver, txFee, assetGasLimits[assetId] + ); + } + } + } + } + + /** + * @notice Internal utility function which withdraws funds from the contract to a receiver address + * @param _withdrawValue - value being withdrawn from the contract + * @param _receiver - address receiving public ERC20 tokens + * @param _assetId - ID of the asset for which a withdrawal is being performed + * @dev The function doesn't throw if the inner call fails, as this opens up the possiblity of griefing attacks + * -> engineering a failed withdrawal would invalidate an entire rollup block. + * A griefing attack could be done by consuming all gas in the `_receiver` fallback and for this reason we + * only forward 30K gas. This still allows the recipient to handle accounting if recipient is a contract. + * The user should ensure their withdrawal will succeed or they will lose the funds. + */ + function withdraw(uint256 _withdrawValue, address _receiver, uint256 _assetId) internal { + if (_receiver == address(0)) { + revert WITHDRAW_TO_ZERO_ADDRESS(); + } + if (_assetId == 0) { + assembly { + pop(call(30000, _receiver, _withdrawValue, 0, 0, 0, 0)) + } + // payable(_receiver).call{gas: 30000, value: _withdrawValue}(''); + } else { + address assetAddress = getSupportedAsset(_assetId); + TokenTransfers.transferToDoNotBubbleErrors( + assetAddress, _receiver, _withdrawValue, assetGasLimits[_assetId] + ); + } + } + + /*---------------------------------------- + PUBLIC/EXTERNAL NON-MUTATING FUNCTIONS + ----------------------------------------*/ + + /** + * @notice Get implementation's version number + * @return version version number of the implementation + */ + function getImplementationVersion() public view virtual returns (uint8 version) { + return 2; + } + + /** + * @notice Get true if the contract is paused, false otherwise + * @return isPaused - True if paused, false otherwise + */ + function paused() external view override(IRollupProcessor) returns (bool isPaused) { + return rollupState.paused; + } + + /** + * @notice Gets the number of filled entries in the data tree + * @return dataSize number of filled entries in the data tree (equivalent to the number of notes created on L2) + */ + function getDataSize() public view override(IRollupProcessor) returns (uint256 dataSize) { + return rollupState.datasize; + } + + /** + * @notice Returns true if deposits are capped, false otherwise + * @return capped - True if deposits are capped, false otherwise + */ + function getCapped() public view override(IRollupProcessorV2) returns (bool capped) { + return rollupState.capped; + } + + /** + * @notice Gets the number of pending defi interactions that have resolved but have not yet been added into the + * DeFi tree + * @return - the number of pending interactions + * @dev This value can never exceed 512. This limit is set in order to prevent griefing attacks - `processRollup` + * iterates through `asyncDefiInteractionHashes` and copies their values into `defiInteractionHashes`. Loop + * is bounded to < 512 so that tx does not exceed block gas limit. + */ + function getPendingDefiInteractionHashesLength() public view override(IRollupProcessor) returns (uint256) { + return rollupState.numAsyncDefiInteractionHashes + rollupState.numDefiInteractionHashes; + } + + /** + * @notice Gets the address of the PLONK verification smart contract + * @return - address of the verification smart contract + */ + function verifier() public view override(IRollupProcessor) returns (address) { + return address(rollupState.verifier); + } + + /** + * @notice Gets the number of supported bridges + * @return - the number of supported bridges + */ + function getSupportedBridgesLength() external view override(IRollupProcessor) returns (uint256) { + return supportedBridges.length; + } + + /** + * @notice Gets the bridge contract address for a given bridgeAddressId + * @param _bridgeAddressId identifier used to denote a particular bridge + * @return - the address of the matching bridge contract + */ + function getSupportedBridge(uint256 _bridgeAddressId) public view override(IRollupProcessor) returns (address) { + return supportedBridges[_bridgeAddressId - 1]; + } + + /** + * @notice Gets the number of supported assets + * @return - the number of supported assets + */ + function getSupportedAssetsLength() external view override(IRollupProcessor) returns (uint256) { + return supportedAssets.length; + } + + /** + * @notice Gets the ERC20 token address of a supported asset for a given `_assetId` + * @param _assetId identifier used to denote a particular asset + * @return - the address of the matching asset + */ + function getSupportedAsset(uint256 _assetId) + public + view + override(IRollupProcessor) + validateAssetIdIsNotVirtual(_assetId) + returns (address) + { + // If assetId == ETH_ASSET_ID (i.e. 0), this represents native ETH. + // ERC20 token asset id values start at 1 + if (_assetId == ETH_ASSET_ID) { + return address(0x0); + } + address result = supportedAssets[_assetId - 1]; + if (result == address(0)) { + revert INVALID_ASSET_ADDRESS(); + } + return result; + } + + /** + * @notice Gets the status of the escape hatch. + * @return True if escape hatch is open, false otherwise + * @return The number of blocks until the next opening/closing of escape hatch + */ + function getEscapeHatchStatus() public view override(IRollupProcessor) returns (bool, uint256) { + uint256 blockNum = block.number; + + bool isOpen = blockNum % escapeBlockUpperBound >= escapeBlockLowerBound; + uint256 blocksRemaining = 0; + if (isOpen) { + if (block.timestamp < uint256(lastRollupTimeStamp) + delayBeforeEscapeHatch) { + isOpen = false; + } + // num blocks escape hatch will remain open for + blocksRemaining = escapeBlockUpperBound - (blockNum % escapeBlockUpperBound); + } else { + // num blocks until escape hatch will be opened + blocksRemaining = escapeBlockLowerBound - (blockNum % escapeBlockUpperBound); + } + return (isOpen, blocksRemaining); + } + + /** + * @notice Gets the number of defi interaction hashes + * @dev A defi interaction hash represents a defi interaction that has resolved, but whose + * result data has not yet been added into the Aztec Defi Merkle tree. This step is needed in order to convert + * L2 Defi claim notes into L2 value notes. + * @return - the number of pending defi interaction hashes + */ + function getDefiInteractionHashesLength() public view override(IRollupProcessor) returns (uint256) { + return rollupState.numDefiInteractionHashes; + } + + /** + * @notice Gets the number of asynchronous defi interaction hashes + * @dev A defi interaction hash represents an asynchronous defi interaction that has resolved, but whose interaction + * result data has not yet been added into the Aztec Defi Merkle tree. This step is needed in order to convert + * L2 Defi claim notes into L2 value notes. + * @return - the number of pending async defi interaction hashes + */ + function getAsyncDefiInteractionHashesLength() public view override(IRollupProcessor) returns (uint256) { + return rollupState.numAsyncDefiInteractionHashes; + } + + /*---------------------------------------- + INTERNAL/PRIVATE NON-MUTATING FUNCTIONS + ----------------------------------------*/ + + /** + * @notice A function which constructs a FullBridgeCallData struct based on values from `_encodedBridgeCallData` + * @param _encodedBridgeCallData a bit-array that contains data describing a specific bridge call + * + * Structure of the bit array is as follows (starting at the least significant bit): + * | bit range | parameter | description | + * | 0 - 32 | bridgeAddressId | The address ID. Bridge address = `supportedBridges[bridgeAddressId]` | + * | 32 - 62 | inputAssetIdA | First input asset ID. | + * | 62 - 92 | inputAssetIdB | Second input asset ID. Must be 0 if bridge does not have a 2nd input asset. | + * | 92 - 122 | outputAssetIdA | First output asset ID. | + * | 122 - 152 | outputAssetIdB | Second output asset ID. Must be 0 if bridge does not have a 2nd output asset. | + * | 152 - 184 | bitConfig | Bit-array that contains boolean bridge settings. | + * | 184 - 248 | auxData | 64 bits of custom data to be passed to the bridge contract. Structure of auxData + * is defined/checked by the bridge contract. | + * + * Structure of the `bitConfig` parameter is as follows + * | bit | parameter | description | + * | 0 | secondInputInUse | Does the bridge have a second input asset? | + * | 1 | secondOutputInUse | Does the bridge have a second output asset? | + * + * @dev Note: Virtual assets are assets that don't have an ERC20 token analogue and exist solely as notes within + * the Aztec network. They can be created/spent within bridge calls. They are used to enable bridges + * to track internally-defined data without having to mint a new token on-chain. An example use of + * a virtual asset would be a virtual loan asset that tracks an outstanding debt that must be repaid + * to recover a collateral deposited into the bridge. + * + * @return fullBridgeCallData a struct that contains information defining a specific bridge call + */ + function getFullBridgeCallData(uint256 _encodedBridgeCallData) + internal + view + returns (FullBridgeCallData memory fullBridgeCallData) + { + assembly { + mstore(fullBridgeCallData, and(_encodedBridgeCallData, MASK_THIRTY_TWO_BITS)) // bridgeAddressId + mstore( + add(fullBridgeCallData, 0x40), + and(shr(INPUT_ASSET_ID_A_SHIFT, _encodedBridgeCallData), MASK_THIRTY_BITS) + ) // inputAssetIdA + mstore( + add(fullBridgeCallData, 0x60), + and(shr(INPUT_ASSET_ID_B_SHIFT, _encodedBridgeCallData), MASK_THIRTY_BITS) + ) // inputAssetIdB + mstore( + add(fullBridgeCallData, 0x80), + and(shr(OUTPUT_ASSET_ID_A_SHIFT, _encodedBridgeCallData), MASK_THIRTY_BITS) + ) // outputAssetIdA + mstore( + add(fullBridgeCallData, 0xa0), + and(shr(OUTPUT_ASSET_ID_B_SHIFT, _encodedBridgeCallData), MASK_THIRTY_BITS) + ) // outputAssetIdB + mstore( + add(fullBridgeCallData, 0xc0), and(shr(AUX_DATA_SHIFT, _encodedBridgeCallData), MASK_SIXTY_FOUR_BITS) + ) // auxData + + mstore( + add(fullBridgeCallData, 0xe0), + and(shr(add(INPUT_ASSET_ID_A_SHIFT, VIRTUAL_ASSET_ID_FLAG_SHIFT), _encodedBridgeCallData), 1) + ) // firstInputVirtual (30th bit of inputAssetIdA) == 1 + mstore( + add(fullBridgeCallData, 0x100), + and(shr(add(INPUT_ASSET_ID_B_SHIFT, VIRTUAL_ASSET_ID_FLAG_SHIFT), _encodedBridgeCallData), 1) + ) // secondInputVirtual (30th bit of inputAssetIdB) == 1 + mstore( + add(fullBridgeCallData, 0x120), + and(shr(add(OUTPUT_ASSET_ID_A_SHIFT, VIRTUAL_ASSET_ID_FLAG_SHIFT), _encodedBridgeCallData), 1) + ) // firstOutputVirtual (30th bit of outputAssetIdA) == 1 + mstore( + add(fullBridgeCallData, 0x140), + and(shr(add(OUTPUT_ASSET_ID_B_SHIFT, VIRTUAL_ASSET_ID_FLAG_SHIFT), _encodedBridgeCallData), 1) + ) // secondOutputVirtual (30th bit of outputAssetIdB) == 1 + let bitConfig := and(shr(BITCONFIG_SHIFT, _encodedBridgeCallData), MASK_THIRTY_TWO_BITS) + // bitConfig = bit mask that contains bridge ID settings + // bit 0 = second input asset in use? + // bit 1 = second output asset in use? + mstore(add(fullBridgeCallData, 0x160), eq(and(bitConfig, 1), 1)) // secondInputInUse (bitConfig & 1) == 1 + mstore(add(fullBridgeCallData, 0x180), eq(and(shr(1, bitConfig), 1), 1)) // secondOutputInUse ((bitConfig >> 1) & 1) == 1 + } + fullBridgeCallData.bridgeAddress = supportedBridges[fullBridgeCallData.bridgeAddressId - 1]; + fullBridgeCallData.bridgeGasLimit = bridgeGasLimits[fullBridgeCallData.bridgeAddressId]; + + // potential conflicting states that are explicitly ruled out by circuit constraints: + if (!fullBridgeCallData.secondInputInUse && fullBridgeCallData.inputAssetIdB > 0) { + revert INCONSISTENT_BRIDGE_CALL_DATA(); + } + if (!fullBridgeCallData.secondOutputInUse && fullBridgeCallData.outputAssetIdB > 0) { + revert INCONSISTENT_BRIDGE_CALL_DATA(); + } + if ( + fullBridgeCallData.secondInputInUse + && (fullBridgeCallData.inputAssetIdA == fullBridgeCallData.inputAssetIdB) + ) { + revert BRIDGE_WITH_IDENTICAL_INPUT_ASSETS(fullBridgeCallData.inputAssetIdA); + } + // Outputs can both be virtual. In that case, their asset ids will both be 2 ** 29. + bool secondOutputReal = fullBridgeCallData.secondOutputInUse && !fullBridgeCallData.secondOutputVirtual; + if (secondOutputReal && fullBridgeCallData.outputAssetIdA == fullBridgeCallData.outputAssetIdB) { + revert BRIDGE_WITH_IDENTICAL_OUTPUT_ASSETS(fullBridgeCallData.outputAssetIdA); + } + } + + /** + * @notice Gets the four input/output assets associated with a specific bridge call + * @param _fullBridgeCallData a struct that contains information defining a specific bridge call + * @param _interactionNonce interaction nonce of a corresponding bridge call + * @dev `_interactionNonce` param is here because it is used as an ID of output virtual asset + * + * @return inputAssetA the first input asset + * @return inputAssetB the second input asset + * @return outputAssetA the first output asset + * @return outputAssetB the second output asset + */ + function getAztecAssetTypes(FullBridgeCallData memory _fullBridgeCallData, uint256 _interactionNonce) + internal + view + returns ( + AztecTypes.AztecAsset memory inputAssetA, + AztecTypes.AztecAsset memory inputAssetB, + AztecTypes.AztecAsset memory outputAssetA, + AztecTypes.AztecAsset memory outputAssetB + ) + { + inputAssetA = getAztecAsset( + _fullBridgeCallData.inputAssetIdA, _interactionNonce, true, _fullBridgeCallData.firstInputVirtual, true + ); + inputAssetB = getAztecAsset( + _fullBridgeCallData.inputAssetIdB, + _interactionNonce, + true, + _fullBridgeCallData.secondInputVirtual, + _fullBridgeCallData.secondInputInUse + ); + + outputAssetA = getAztecAsset( + _fullBridgeCallData.outputAssetIdA, _interactionNonce, false, _fullBridgeCallData.firstOutputVirtual, true + ); + outputAssetB = getAztecAsset( + _fullBridgeCallData.outputAssetIdB, + _interactionNonce, + false, + _fullBridgeCallData.secondOutputVirtual, + _fullBridgeCallData.secondOutputInUse + ); + } + + function getAztecAsset(uint256 _assetId, uint256 _interactionNonce, bool _isInput, bool _isVirtual, bool _isUsed) + internal + view + returns (AztecTypes.AztecAsset memory asset) + { + if (!_isUsed) { + return AztecTypes.AztecAsset(0, address(0x0), AztecTypes.AztecAssetType.NOT_USED); + } + + if (_isVirtual) { + // asset id is a nonce of the interaction in which the virtual asset was created + // TODO: We are missing a test that actually need the virtual asset id to be specific. + // Can probably be handled with just a event test. + asset.id = (_isInput || false) ? _assetId - VIRTUAL_ASSET_ID_FLAG : _interactionNonce; + asset.erc20Address = address(0x0); + asset.assetType = AztecTypes.AztecAssetType.VIRTUAL; + } else { + asset.id = _assetId; + asset.erc20Address = getSupportedAsset(_assetId); + asset.assetType = + asset.erc20Address == address(0x0) ? AztecTypes.AztecAssetType.ETH : AztecTypes.AztecAssetType.ERC20; + } + } + + /** + * @notice Gets the length of the defi interaction hashes array and the number of pending interactions + * + * @return defiInteractionHashesLength the complete length of the defi interaction array + * @return numPendingInteractions the current number of pending defi interactions + * @dev `numPendingInteractions` is capped at `NUMBER_OF_BRIDGE_CALLS` + */ + function getDefiHashesLengthsAndNumPendingInteractions() + internal + view + returns (uint256 defiInteractionHashesLength, uint256 numPendingInteractions) + { + numPendingInteractions = defiInteractionHashesLength = rollupState.numDefiInteractionHashes; + if (numPendingInteractions > NUMBER_OF_BRIDGE_CALLS) { + numPendingInteractions = NUMBER_OF_BRIDGE_CALLS; + } + } + + /** + * @notice Gets the set of hashes that comprise the current pending interactions and nextExpectedHash + * + * @return hashes the set of valid (i.e. non-zero) hashes that comprise the pending interactions + * @return nextExpectedHash the hash of all hashes (including zero hashes) that comprise the pending interactions + */ + function getPendingAndNextExpectedHashes() + internal + view + returns (bytes32[] memory hashes, bytes32 nextExpectedHash) + { + /** + * ---------------------------------------- + * Compute nextExpectedHash + * ----------------------------------------- + * + * The `defiInteractionHashes` mapping emulates an array that represents the + * set of defi interactions from previous blocks that have been resolved. + * + * We need to take the interaction result data from each of the above defi interactions, + * and add that data into the Aztec L2 merkle tree that contains defi interaction results + * (the "Defi Tree". Its merkle root is one of the inputs to the storage variable `rollupStateHash`) + * + * It is the rollup provider's responsibility to perform these additions. + * In the current block being processed, the rollup provider must take these pending interaction results, + * create commitments to each result and insert each commitment into the next empty leaf of the defi tree. + * + * The following code validates that this has happened! This is how: + * + * Part 1: What are we checking? + * + * The rollup circuit will receive, as a private input from the rollup provider, the pending defi interaction + * results + * (`encodedBridgeCallData`, `totalInputValue`, `totalOutputValueA`, `totalOutputValueB`, `result`) + * The rollup circuit will compute the SHA256 hash of each interaction result (the defiInteractionHash) + * Finally the SHA256 hash of `NUMBER_OF_BRIDGE_CALLS` of these defiInteractionHash values is computed. + * (if there are fewer than `NUMBER_OF_BRIDGE_CALLS` pending defi interaction results, the SHA256 hash of + * an empty defi interaction result is used instead. i.e. all variable values are set to 0) + * The computed SHA256 hash, the `pendingDefiInteractionHash`, is one of the broadcasted values that forms + * the `publicInputsHash` public input to the rollup circuit. + * When verifying a rollup proof, this smart contract will compute `publicInputsHash` from the input calldata. + * The PLONK Verifier smart contract will then validate that our computed value for `publicInputHash` matches + * the value used when generating the rollup proof. + * + * TLDR of the above: our proof data contains a variable called `pendingDefiInteractionHash`, which is + * the CLAIMED VALUE of SHA256 hashing the SHA256 hashes of the defi interactions that have resolved but whose + * data has not yet been added into the defi tree. + * + * Part 2: How do we check `pendingDefiInteractionHash` is correct??? + * + * This contract will call `DefiBridgeProxy.convert` (via delegatecall) on every new defi interaction present + * in the block. The return values from the bridge proxy contract are used to construct a defi interaction + * result. Its hash is then computed and stored in `defiInteractionHashes`. + * + * N.B. It's very important that DefiBridgeProxy does not call selfdestruct, or makes a delegatecall out to + * a contract that can selfdestruct :o + * + * Similarly, when async defi interactions resolve, the interaction result is stored in + * `asyncDefiInteractionHashes`. At the end of the processBridgeCalls function, the contents of the async array + * is copied into `defiInteractionHashes` (i.e. async interaction results are delayed by 1 rollup block. + * This is to prevent griefing attacks where the rollup state changes between the time taken for a rollup tx + * to be constructed and the rollup tx to be mined) + * + * We use the contents of `defiInteractionHashes` to reconstruct `pendingDefiInteractionHash`, and validate it + * matches the value present in calldata and therefore the value used in the rollup circuit when this block's + * rollup proof was constructed. This validates that all of the required defi interaction results were added + * into the defi tree by the rollup provider (the circuit logic enforces this, we just need to check the rollup + * provider used the correct inputs) + */ + (uint256 defiInteractionHashesLength, uint256 numPendingInteractions) = + getDefiHashesLengthsAndNumPendingInteractions(); + uint256 offset = defiInteractionHashesLength - numPendingInteractions; + hashes = new bytes32[](NUMBER_OF_BRIDGE_CALLS); + + for (uint256 i = 0; i < NUMBER_OF_BRIDGE_CALLS; i++) { + if (i < numPendingInteractions) { + hashes[i] = defiInteractionHashes[offset + i]; + } else { + hashes[i] = DEFI_RESULT_ZERO_HASH; + } + } + nextExpectedHash = bytes32(uint256(sha256(abi.encodePacked(hashes))) % CIRCUIT_MODULUS); + // Only return non-zero hashes + assembly { + mstore(hashes, numPendingInteractions) + } + } + + /** + * @notice A function that processes bridge calls. + * @dev 1. pop NUMBER_OF_BRIDGE_CALLS (if available) interaction hashes off of `defiInteractionHashes`, + * validate their hash (calculated at the end of the previous rollup and stored as + * nextExpectedDefiInteractionsHash) equals `numPendingInteractions` (this validates that rollup block + * has added these interaction results into the L2 data tree) + * 2. iterate over rollup block's new defi interactions (up to NUMBER_OF_BRIDGE_CALLS). Trigger interactions + * by calling DefiBridgeProxy contract. Record results in either `defiInteractionHashes` (for synchrohnous + * txns) or, for async txns, the `pendingDefiInteractions` mapping + * 3. copy the contents of `asyncInteractionHashes` into `defiInteractionHashes` && clear + * `asyncInteractionHashes` + * 4. calculate the next value of nextExpectedDefiInteractionsHash from the new set of defiInteractionHashes + * @param _proofData decoded rollup proof data + * @param _rollupBeneficiary the address that should be paid any subsidy for processing a bridge call + * @return nextExpectedHashes the set of non-zero hashes that comprise the current pending defi interactions + */ + function processBridgeCalls(bytes memory _proofData, address _rollupBeneficiary) + internal + returns (bytes32[] memory nextExpectedHashes) + { + ProcessBridgeCallVariables memory vars; + + // Verify that nextExpectedDefiInteractionsHash equals the value given in the rollup + // Then remove the set of pending hashes + { + // Extract the claimed value of previousDefiInteractionHash present in the proof data + bytes32 providedDefiInteractionsHash = extractPrevDefiInteractionHash(_proofData); + + // Validate the stored interactionHash matches the value used when making the rollup proof! + if (providedDefiInteractionsHash != prevDefiInteractionsHash) { + revert INCORRECT_PREVIOUS_DEFI_INTERACTION_HASH(providedDefiInteractionsHash, prevDefiInteractionsHash); + } + uint256 numPendingInteractions; + (vars.defiInteractionHashesLength, numPendingInteractions) = getDefiHashesLengthsAndNumPendingInteractions(); + // numPendingInteraction equals the number of interactions expected to be in the given rollup + // this is the length of the defiInteractionHashes array, capped at the NUM_BRIDGE_CALLS as per the following + // numPendingInteractions = min(defiInteractionsHashesLength, numberOfBridgeCalls) + + // Reduce DefiInteractionHashes.length by numPendingInteractions + vars.defiInteractionHashesLength -= numPendingInteractions; + + // We can safely cast to uint16 as the value is reduced, so it must be less than 2^16 + rollupState.numDefiInteractionHashes = uint16(vars.defiInteractionHashesLength); + + uint256 paymentsSlot; + assembly { + paymentsSlot := ethPayments.slot + } + vars.paymentsSlot = paymentsSlot; + } + vars.rollupBeneficiary = _rollupBeneficiary; + vars.interactionNonce = getRollupId(_proofData) * NUMBER_OF_BRIDGE_CALLS; + + // ### Process bridge calls + uint256 proofDataPtr; + assembly { + proofDataPtr := add(_proofData, BRIDGE_CALL_DATAS_OFFSET) + } + if (defiBridgeProxy.code.length == 0) { + revert INVALID_ADDRESS_NO_CODE(); + } + + for (uint256 i = 0; i < NUMBER_OF_BRIDGE_CALLS; i++) { + { + uint256 encodedBridgeCallData; + uint256 totalInputValue; + assembly { + encodedBridgeCallData := mload(proofDataPtr) + totalInputValue := mload(add(proofDataPtr, mul(0x20, NUMBER_OF_BRIDGE_CALLS))) + } + vars.encodedBridgeCallData = encodedBridgeCallData; + vars.totalInputValue = totalInputValue; + } + if (vars.encodedBridgeCallData == 0) { + // no more bridges to call + break; + } + if (vars.totalInputValue == 0) { + revert ZERO_TOTAL_INPUT_VALUE(); + } + + FullBridgeCallData memory fullBridgeCallData = getFullBridgeCallData(vars.encodedBridgeCallData); + vars.bridgeResult = + BridgeResult({success: false, errorReason: "", outputValueA: 0, outputValueB: 0, isAsync: false}); + + (vars.inputAssetA, vars.inputAssetB, vars.outputAssetA, vars.outputAssetB) = + getAztecAssetTypes(fullBridgeCallData, vars.interactionNonce); + + { + (vars.bridgeResult.success, vars.bridgeResult.errorReason) = defiBridgeProxy.delegatecall{ + gas: fullBridgeCallData.bridgeGasLimit + }( + abi.encodeWithSelector( + DEFI_BRIDGE_PROXY_CONVERT_SELECTOR, + fullBridgeCallData.bridgeAddress, + vars.inputAssetA, + vars.inputAssetB, + vars.outputAssetA, + vars.outputAssetB, + vars.totalInputValue, + vars.interactionNonce, + fullBridgeCallData.auxData, + vars.paymentsSlot, + vars.rollupBeneficiary + ) + ); + + if (vars.bridgeResult.success) { + // Decode the output values from the call + (vars.bridgeResult.outputValueA, vars.bridgeResult.outputValueB, vars.bridgeResult.isAsync) = + abi.decode(vars.bridgeResult.errorReason, (uint256, uint256, bool)); + // Reset errorReason to empty string + vars.bridgeResult.errorReason = ""; + } + } + + if (!fullBridgeCallData.secondOutputInUse) { + vars.bridgeResult.outputValueB = 0; + } + + if (vars.bridgeResult.isAsync) { + emit AsyncDefiBridgeProcessed(vars.encodedBridgeCallData, vars.interactionNonce, vars.totalInputValue); + pendingDefiInteractions[vars.interactionNonce] = + PendingDefiBridgeInteraction(vars.encodedBridgeCallData, vars.totalInputValue); + } else { + emit DefiBridgeProcessed( + vars.encodedBridgeCallData, + vars.interactionNonce, + vars.totalInputValue, + vars.bridgeResult.outputValueA, + vars.bridgeResult.outputValueB, + vars.bridgeResult.success, + vars.bridgeResult.errorReason + ); + + // if interaction is synchronous, compute the interaction hash and add to defiInteractionHashes + defiInteractionHashes[vars.defiInteractionHashesLength++] = computeDefiInteractionHash( + vars.encodedBridgeCallData, + vars.interactionNonce, + vars.totalInputValue, + vars.bridgeResult.outputValueA, + vars.bridgeResult.outputValueB, + vars.bridgeResult.success + ); + } + + vars.interactionNonce++; + assembly { + proofDataPtr := add(proofDataPtr, 0x20) + } + } + + uint16 asyncDefiInteractionHashesLength = rollupState.numAsyncDefiInteractionHashes; + if (asyncDefiInteractionHashesLength + vars.defiInteractionHashesLength > ARRAY_LENGTH_MASK) { + revert ARRAY_OVERFLOW(); + } + + for (uint256 i = 0; i < asyncDefiInteractionHashesLength; i++) { + defiInteractionHashes[vars.defiInteractionHashesLength + i] = asyncDefiInteractionHashes[i]; + } + rollupState.numAsyncDefiInteractionHashes = 0; + rollupState.numDefiInteractionHashes = + uint16(vars.defiInteractionHashesLength) + asyncDefiInteractionHashesLength; + + // now we want to extract the next set of pending defi interaction hashes and calculate their hash to store + // for the next rollup + (bytes32[] memory hashes, bytes32 nextExpectedHash) = getPendingAndNextExpectedHashes(); + nextExpectedHashes = hashes; + prevDefiInteractionsHash = nextExpectedHash; + } + + function computeDefiInteractionHash( + uint256 _encodedBridgeCallData, + uint256 _interactionNonce, + uint256 _totalInputValue, + uint256 _outputValueA, + uint256 _outputValueB, + bool _result + ) internal pure returns (bytes32) { + return bytes32( + uint256( + sha256( + abi.encode( + _encodedBridgeCallData, + _interactionNonce, + _totalInputValue, + _outputValueA, + _outputValueB, + _result + ) + ) + ) % CIRCUIT_MODULUS + ); + } +} diff --git a/contracts/src/script/deployments/RollupDeployer.s.sol b/contracts/src/script/deployments/RollupDeployer.s.sol index 1d7b0f3cd..dae4d3767 100644 --- a/contracts/src/script/deployments/RollupDeployer.s.sol +++ b/contracts/src/script/deployments/RollupDeployer.s.sol @@ -8,8 +8,9 @@ import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.s import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import {IRollupProcessor} from "rollup-encoder/interfaces/IRollupProcessor.sol"; -import {RollupProcessor} from "core/RollupProcessor.sol"; +import {RollupProcessor} from "core/processors/RollupProcessor.sol"; import {RollupProcessorV2} from "core/processors/RollupProcessorV2.sol"; +import {RollupProcessorV2Reference as refV2} from "core/reference/RollupProcessorV2Reference.sol"; import {DefiBridgeProxy} from "core/DefiBridgeProxy.sol"; import {PermitHelper} from "periphery/PermitHelper.sol"; import {ProxyDeployer} from "periphery/ProxyDeployer.sol"; @@ -35,25 +36,7 @@ contract RollupDeployer is Test { isDeploying = _isDeploying; } - function deploy(DeployParams memory _params) - public - returns ( - /* address _verifier, - address _contractOwner, - uint256 _escapeBlockLowerBound, - uint256 _escapeBlockUpperBound, - bytes32 _initDataRoot, - bytes32 _initNullRoot, - bytes32 _initRootRoot, - uint32 _initDataSize, - bool _allowThirdPartyContract*/ - address, - address, - address, - address, - address - ) - { + function deploy(DeployParams memory _params) public returns (address, address, address, address, address) { if (isDeploying) vm.broadcast(); DefiBridgeProxy defiBridgeProxy = new DefiBridgeProxy(); @@ -116,8 +99,13 @@ contract RollupDeployer is Test { uint256 lower = old.escapeBlockLowerBound(); uint256 upper = old.escapeBlockUpperBound(); + RollupProcessorV2 rollupProcessorV2; if (isDeploying) vm.broadcast(); - RollupProcessorV2 rollupProcessorV2 = new RollupProcessorV2(lower, upper); + if (vm.envOr("REFERENCE", false)) { + rollupProcessorV2 = RollupProcessorV2(address(new refV2(lower, upper))); + } else { + rollupProcessorV2 = new RollupProcessorV2(lower, upper); + } vm.expectRevert("Initializable: contract is already initialized"); rollupProcessorV2.initialize(); diff --git a/contracts/src/test/aztec/TestBase.sol b/contracts/src/test/aztec/TestBase.sol index 2bcd756c0..861fa8faa 100644 --- a/contracts/src/test/aztec/TestBase.sol +++ b/contracts/src/test/aztec/TestBase.sol @@ -4,7 +4,7 @@ pragma solidity >=0.8.4; import {Test} from "forge-std/Test.sol"; -import {RollupProcessor} from "core/RollupProcessor.sol"; +import {RollupProcessor} from "core/processors/RollupProcessor.sol"; import {RollupProcessorV2} from "core/processors/RollupProcessorV2.sol"; import {DefiBridgeProxy} from "core/DefiBridgeProxy.sol"; import {PermitHelper} from "periphery/PermitHelper.sol"; @@ -16,6 +16,9 @@ import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transpa import {AlwaysTrueVerifier} from "../mocks/AlwaysTrueVerifier.sol"; import {RollupDeployer} from "../../script/deployments/RollupDeployer.s.sol"; +/** + * @dev Bootstraps the test environment for all tests. + */ abstract contract TestBase is Test { // Events copied from RollupProcessor for testing purposes event AssetAdded(uint256 indexed assetId, address indexed assetAddress, uint256 assetGasLimit); diff --git a/contracts/src/test/rollup_processor/Create2.s.sol b/contracts/src/test/rollup_processor/Create2.s.sol index 2ac367c67..2d87c616f 100644 --- a/contracts/src/test/rollup_processor/Create2.s.sol +++ b/contracts/src/test/rollup_processor/Create2.s.sol @@ -9,7 +9,7 @@ import {Test} from "forge-std/Test.sol"; import {AztecTypes} from "rollup-encoder/libraries/AztecTypes.sol"; import {RollupProcessorLibrary} from "rollup-encoder/libraries/RollupProcessorLibrary.sol"; -import {RollupProcessor} from "core/RollupProcessor.sol"; +import {RollupProcessor} from "core/processors/RollupProcessor.sol"; import {DefiBridgeProxy} from "core/DefiBridgeProxy.sol"; import {ProxyDeployer} from "periphery/ProxyDeployer.sol"; diff --git a/contracts/src/test/rollup_processor/Create2.t.sol b/contracts/src/test/rollup_processor/Create2.t.sol index b3aab1ede..5efa8c4e5 100644 --- a/contracts/src/test/rollup_processor/Create2.t.sol +++ b/contracts/src/test/rollup_processor/Create2.t.sol @@ -9,7 +9,7 @@ import {Test} from "forge-std/Test.sol"; import {AztecTypes} from "rollup-encoder/libraries/AztecTypes.sol"; import {RollupProcessorLibrary} from "rollup-encoder/libraries/RollupProcessorLibrary.sol"; -import {RollupProcessor} from "core/RollupProcessor.sol"; +import {RollupProcessor} from "core/processors/RollupProcessor.sol"; import {DefiBridgeProxy} from "core/DefiBridgeProxy.sol"; import {ProxyDeployer} from "periphery/ProxyDeployer.sol"; diff --git a/contracts/src/test/rollup_processor/Upgradeable.t.sol b/contracts/src/test/rollup_processor/Upgradeable.t.sol index f438dbba7..e2e25bfcf 100644 --- a/contracts/src/test/rollup_processor/Upgradeable.t.sol +++ b/contracts/src/test/rollup_processor/Upgradeable.t.sol @@ -4,7 +4,7 @@ pragma solidity >=0.8.4; import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import {Vm} from "forge-std/Test.sol"; -import {RollupProcessor} from "core/RollupProcessor.sol"; +import {RollupProcessor} from "core/processors/RollupProcessor.sol"; import {RollupProcessorV2} from "core/processors/RollupProcessorV2.sol"; import {TestBase} from "../aztec/TestBase.sol"; import {RollupProcessorVPlus1} from "../mocks/RollupProcessorVPlus1.sol"; diff --git a/contracts/verification-keys/generate_vks.sh b/contracts/verification-keys/generate_vks.sh index cfb1e729d..cdeed357f 100755 --- a/contracts/verification-keys/generate_vks.sh +++ b/contracts/verification-keys/generate_vks.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Note this file assumes that it is being build as part of the wider aztec build system. set -e # It takes ages to compute the real 28x32, so let's leave it behind a flag and assume we'll do it manually. From c39b4752aa260d3a857e15f9df8da1b3a384ccdb Mon Sep 17 00:00:00 2001 From: Lasse Herskind <16536249+LHerskind@users.noreply.github.com> Date: Tue, 21 Mar 2023 14:45:12 +0100 Subject: [PATCH 4/9] fix: remove wasabi deployment (#35) --- .circleci/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a9df667c4..61f9d0d63 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -679,9 +679,6 @@ jobs: deploy_ecr sdk deploy_s3 sdk deploy_npm sdk - - run: - name: "wasabi" - command: deploy wasabi - run: name: "hummus" command: | From 69902232dfae7753dd8582c9754a18c446258929 Mon Sep 17 00:00:00 2001 From: crites Date: Thu, 23 Mar 2023 12:44:37 -0400 Subject: [PATCH 5/9] Update package.json --- yarn-project/kebab/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/kebab/package.json b/yarn-project/kebab/package.json index 6fc95b0b0..6881debf4 100644 --- a/yarn-project/kebab/package.json +++ b/yarn-project/kebab/package.json @@ -2,7 +2,7 @@ "name": "kebab", "version": "1.0.0", "main": "dest/index.js", - "license": "GPL-2.0", + "license": "MIT", "type": "module", "scripts": { "build": "rm -rf ./dest && tsc -b tsconfig.json", From c13f5ba31c12887a5fb196716814efebc8c573c4 Mon Sep 17 00:00:00 2001 From: crites Date: Thu, 23 Mar 2023 12:46:34 -0400 Subject: [PATCH 6/9] Update package.json --- yarn-project/block-server/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/block-server/package.json b/yarn-project/block-server/package.json index 53bc837ba..739c40350 100644 --- a/yarn-project/block-server/package.json +++ b/yarn-project/block-server/package.json @@ -2,7 +2,7 @@ "name": "@aztec/block-server", "version": "1.0.0", "main": "dest/index.js", - "license": "GPL-2.0", + "license": "MIT", "type": "module", "scripts": { "build": "rm -rf ./dest && tsc -b tsconfig.dest.json", From a2eba0ab309c386e9b8e87bcd426eb514ba725ed Mon Sep 17 00:00:00 2001 From: Josh Crites Date: Thu, 23 Mar 2023 12:51:35 -0400 Subject: [PATCH 7/9] update license to MIT --- contracts/src/periphery/AztecFaucet.sol | 2 +- yarn-project/account-migrator/package.json | 2 +- yarn-project/alpha-sdk/package.json | 2 +- yarn-project/barretenberg.js/package.json | 2 +- yarn-project/blockchain/package.json | 2 +- .../CurveStEthBridge.json | 109 ++--- .../ElementBridge.sol/ElementBridge.json | 418 ++++-------------- .../src/abis/bridges/ILido.sol/ILido.json | 28 +- .../src/abis/bridges/IVault.sol/IAsset.json | 39 +- .../src/abis/bridges/IVault.sol/IVault.json | 39 +- .../src/abis/bridges/IWstETH.sol/IWstETH.json | 28 +- .../bridges/LidoBridge.sol/LidoBridge.json | 110 ++--- .../contracts-verifier-test/package.json | 2 +- yarn-project/end-to-end/package.json | 2 +- yarn-project/falafel/package.json | 2 +- yarn-project/halloumi/package.json | 2 +- yarn-project/hummus/package.json | 2 +- yarn-project/nym-gateway/package.json | 2 +- yarn-project/sdk/package.json | 2 +- yarn-project/wallet/package.json | 2 +- yarn-project/wasabi/package.json | 2 +- .../ElementBridge.sol/ElementBridge.json | 6 +- .../abis/bridges/IVault.sol/IAsset.json | 6 +- .../abis/bridges/IVault.sol/IVault.json | 6 +- 24 files changed, 212 insertions(+), 605 deletions(-) diff --git a/contracts/src/periphery/AztecFaucet.sol b/contracts/src/periphery/AztecFaucet.sol index a7cd95170..4cda9c8e6 100644 --- a/contracts/src/periphery/AztecFaucet.sol +++ b/contracts/src/periphery/AztecFaucet.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: AGPL-3.0-only +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/yarn-project/account-migrator/package.json b/yarn-project/account-migrator/package.json index fad9f5543..845b072bb 100644 --- a/yarn-project/account-migrator/package.json +++ b/yarn-project/account-migrator/package.json @@ -5,7 +5,7 @@ "private": true, "main": "dest/index.js", "author": "Aztec", - "license": "GPL-2.0", + "license": "MIT", "type": "module", "scripts": { "build": "rm -rf ./dest && tsc -b tsconfig.dest.json && cp ../../aztec-connect-cpp/build-wasm/bin/aztec-connect.wasm ./dest/wasm", diff --git a/yarn-project/alpha-sdk/package.json b/yarn-project/alpha-sdk/package.json index ab3e5d12f..d91e8dfa4 100644 --- a/yarn-project/alpha-sdk/package.json +++ b/yarn-project/alpha-sdk/package.json @@ -9,7 +9,7 @@ "homepage": "https://github.com/AztecProtocol/aztec-connect/blob/master/alpha-sdk/README.md", "author": "AZTEC", "type": "module", - "license": "GPL-2.0", + "license": "MIT", "dependencies": { "@aztec/barretenberg": "2.2.0-alpha.5", "@aztec/blockchain": "2.2.0-alpha.5", diff --git a/yarn-project/barretenberg.js/package.json b/yarn-project/barretenberg.js/package.json index 0653f32f6..e8c7aec76 100644 --- a/yarn-project/barretenberg.js/package.json +++ b/yarn-project/barretenberg.js/package.json @@ -2,7 +2,7 @@ "name": "@aztec/barretenberg", "version": "2.1.0", "main": "index.js", - "license": "GPL-2.0", + "license": "MIT", "type": "module", "scripts": { "build": "yarn clean && tsc -p tsconfig.dest.json && webpack --config webpack.config.prod.js", diff --git a/yarn-project/blockchain/package.json b/yarn-project/blockchain/package.json index e5302ec6e..9b2ccb5b3 100644 --- a/yarn-project/blockchain/package.json +++ b/yarn-project/blockchain/package.json @@ -1,7 +1,7 @@ { "name": "@aztec/blockchain", "version": "2.0.0", - "license": "GPL-2.0-only", + "license": "MIT", "exports": "./dest/index.js", "type": "module", "scripts": { diff --git a/yarn-project/blockchain/src/abis/bridges/CurveStEthBridge.sol/CurveStEthBridge.json b/yarn-project/blockchain/src/abis/bridges/CurveStEthBridge.sol/CurveStEthBridge.json index 4a0ba8f1d..f7a66e7bc 100644 --- a/yarn-project/blockchain/src/abis/bridges/CurveStEthBridge.sol/CurveStEthBridge.json +++ b/yarn-project/blockchain/src/abis/bridges/CurveStEthBridge.sol/CurveStEthBridge.json @@ -527,7 +527,7 @@ "convert((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint256,uint64,address)": "26c3b515", "finalise((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint64)": "9b07d342" }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_rollupProcessor\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AsyncDisabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConfiguration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInputA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidOutputA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidUnwrapReturnValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MissingImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CURVE_POOL\",\"outputs\":[{\"internalType\":\"contract ICurvePool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LIDO\",\"outputs\":[{\"internalType\":\"contract ILido\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PRECISION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ROLLUP_PROCESSOR\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSIDY\",\"outputs\":[{\"internalType\":\"contract ISubsidy\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WRAPPED_STETH\",\"outputs\":[{\"internalType\":\"contract IWstETH\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"computeCriteria\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"_inputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"_outputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"_totalInputValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_interactionNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"_auxData\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"convert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"outputValueA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"finalise\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Aztec Team\",\"details\":\"Synchronous and stateless bridge that will hold no funds beyond dust for gas-savings.\",\"kind\":\"dev\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"details\":\"Should be overridden by bridge implementation if intended to limit subsidy.\",\"returns\":{\"_0\":\"The criteria to be passed along\"}},\"constructor\":{\"details\":\"As the contract will not be holding state nor tokens, it can be approved safely.\",\"params\":{\"_rollupProcessor\":\"The address of the RollupProcessor to use\"}},\"convert((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint256,uint64,address)\":{\"params\":{\"_auxData\":\"For eth->wstEth, the minimum acceptable amount of stEth per 1 eth, for wstEth->eth, the minimum acceptable amount of eth per 1 wstEth.\",\"_inputAssetA\":\"The inputAsset (eth or wstEth)\",\"_interactionNonce\":\"The nonce of the DeFi interaction, used when swapping wstEth -> eth\",\"_outputAssetA\":\"The output asset (eth or wstEth) opposite `_inputAssetB`\",\"_totalInputValue\":\"The amount of token deposited\"},\"returns\":{\"outputValueA\":\"The amount of `_outputAssetA` that the RollupProcessor should pull\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"notice\":\"Computes the criteria that is passed on to the subsidy contract when claiming\"},\"constructor\":{\"notice\":\"Sets the address of the RollupProcessor and pre-approve tokens\"},\"convert((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint256,uint64,address)\":{\"notice\":\"Swaps between the eth<->wstEth tokens through the curve eth/stEth pool and wrapping stEth\"}},\"notice\":\"A DeFiBridge for trading between Eth and wstEth using curve and the stEth wrapper.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridges/curve/CurveStEthBridge.sol\":\"CurveStEthBridge\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0x35e258421ae206f3db37281cea70871b4c3553914734aa76139a41af60ac1abb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2ef94b6bc4ee356db612a1849c615f7dd4b15542d6c8584c86bb9243a7913cf0\",\"dweb:/ipfs/QmaxFj5NFpAjjitZtHPNS9PPtCuBATaRz9ktDDRCQCQ83y\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0xb0fafd1e5a5e316405d08b8390bdf4716c7644cc2c8e89ce41050316f28f92a3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8c194429bb8dd25539faa90982240db467042daf2487b17debc908cfd98f069a\",\"dweb:/ipfs/QmYdFwzgxG9C1iyGsDFZCLNG4LBKSL9b8osCP1RLtYnpvm\"]},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"keccak256\":\"0x68404b57d114b893554b0e54334b32f578f5d1abf61830025c83fb71dc1944ce\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d3d0a94b3c8afd92c2a9f03f3325e9ac22cec56e995b94ff212670ff3653f0d3\",\"dweb:/ipfs/QmPqKWUysbo8QqKcqH5Lp7SQiL1LfjeoGCSa7iFWmAP8Mw\"]},\"lib/rollup-encoder/src/interfaces/IRollupProcessor.sol\":{\"keccak256\":\"0x7f8cc09c537d9c9b80b5e90c1ebe02d2fbb4efd5510bbe3a4df57940e368a71d\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8d0e59e15799702bbdf118c00851ae154e01b329c625dc6f3097b0cd072770ef\",\"dweb:/ipfs/QmPsPp6Drzym9RAai34jMJbnuftV3XkDnDp35RX94hWh2u\"]},\"lib/rollup-encoder/src/libraries/AztecTypes.sol\":{\"keccak256\":\"0xa11ad1ad795337be7761108304a21812aeedfac4b03969ee5f71a251e226cc77\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://5f6ea5409dcbe6c61d1c7a7153a4158bc88db92eae2c5c1041809b19c49c3ea7\",\"dweb:/ipfs/QmY7d8839N7SNyR5eGvFi6C6opNW3GW5oZEhTVKEWFvv56\"]},\"src/aztec/interfaces/IDefiBridge.sol\":{\"keccak256\":\"0xf2e1d1e8dc5326f1fe8b4a909541d459546f44fb7e1013b9f9be3bc8aac379d4\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b24142083ad22a38a2d7e5190d05ed286964f0bedbe83bb0ae4c1366521ee5ec\",\"dweb:/ipfs/QmPbfmHjYq4rqpFwVb75mNxDVdRBoRNWu6neGMdLJibDts\"]},\"src/aztec/interfaces/ISubsidy.sol\":{\"keccak256\":\"0x03afbff2b5181d4fc39190a2bb7ad0a60b6a4ae44527d77509c23299b4a3c668\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8a6f880e61c2a097e8f49409b5db5db42aa727d3256625cf8f4b409423923bea\",\"dweb:/ipfs/QmRkpCEkEHUpP9RWGANyQNPPmDUfht15uSiFKeSNWYmr8C\"]},\"src/bridges/base/BridgeBase.sol\":{\"keccak256\":\"0x7ff16906ae0c58fc9ef08096db9c006887875e371ee45440c535dcae4649b75c\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://778cde55152d439e4e05393af4e54eb6ece56572f7e7ccf7f7eabac20159e525\",\"dweb:/ipfs/QmcGY9MGzBr4MaEQNa76hcKKabkLE2hYDxNRgwEEuCeLW2\"]},\"src/bridges/base/ErrorLib.sol\":{\"keccak256\":\"0x0d5ada9c43f52812ff2c60014543fc21684e48610bbe6c4bd77cfdb0186876c9\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://ee4e31e01128c5b683806908876f3e73f0df9fd4c145f426054aad1dbd829cce\",\"dweb:/ipfs/QmQiLtbCuNCe1r1jcAL1cVtTwouXbGETyk1abtTFBDwxZV\"]},\"src/bridges/curve/CurveStEthBridge.sol\":{\"keccak256\":\"0x8cbb01c6d405957aa5a673b8413cdc0c21499dc8198a376e83bdcee503b1669e\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://cf5ca4fa3e9b8e2c187ad079704aa1ff87eb1a1407ec9eecad8c6ed621adf958\",\"dweb:/ipfs/QmUE5xuSffk8jB55Kt9sR5XTH2kMzV4q7UWRRusyLu4y79\"]},\"src/interfaces/curve/ICurvePool.sol\":{\"keccak256\":\"0xd0383f0c1d3ac1ac5e765290d82e0669379d6a2c62c720361f70eb55626df361\",\"license\":\"GPLv2\",\"urls\":[\"bzz-raw://4c76cea836ff2f0aadb84f764a9d30dacef989f84a3184b3ca8676d8590750ad\",\"dweb:/ipfs/QmNTfV45RwGAwz3iSxCT99WqvRHWz52eu4NTHtgJ2rg9vZ\"]},\"src/interfaces/lido/ILido.sol\":{\"keccak256\":\"0xd195a22416bfc8630dbe6c66805c77712b47de4f1397268a24664c526eca48cd\",\"license\":\"GPLv2\",\"urls\":[\"bzz-raw://3edaef781a5a0555ba2f1e14e7dacabd21d1a4ab43026fe5a743b58a79ca39e1\",\"dweb:/ipfs/QmbatGGRnkn3r4ccFvZqUHSDKe3992LiqPiY9QVSmuz2SD\"]},\"src/interfaces/lido/IWstETH.sol\":{\"keccak256\":\"0x431ee9675fd4634cb56e32bfa8736b5a565f58b5ccf224270d4afa8aa86cbe02\",\"license\":\"GPLv2\",\"urls\":[\"bzz-raw://bc3231cc6592b76881ab137c535b79eeec5fe47349c2cbb5e78312432fb5b48e\",\"dweb:/ipfs/QmfMEbn8hixxzxBLocgpqVQgg9hvbweyWhazWkVpaSAxYL\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_rollupProcessor\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AsyncDisabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConfiguration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInputA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidOutputA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidUnwrapReturnValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MissingImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CURVE_POOL\",\"outputs\":[{\"internalType\":\"contract ICurvePool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LIDO\",\"outputs\":[{\"internalType\":\"contract ILido\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PRECISION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ROLLUP_PROCESSOR\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSIDY\",\"outputs\":[{\"internalType\":\"contract ISubsidy\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WRAPPED_STETH\",\"outputs\":[{\"internalType\":\"contract IWstETH\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"computeCriteria\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"_inputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"_outputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"_totalInputValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_interactionNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"_auxData\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"convert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"outputValueA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"finalise\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Aztec Team\",\"details\":\"Synchronous and stateless bridge that will hold no funds beyond dust for gas-savings.\",\"kind\":\"dev\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"details\":\"Should be overridden by bridge implementation if intended to limit subsidy.\",\"returns\":{\"_0\":\"The criteria to be passed along\"}},\"constructor\":{\"details\":\"As the contract will not be holding state nor tokens, it can be approved safely.\",\"params\":{\"_rollupProcessor\":\"The address of the RollupProcessor to use\"}},\"convert((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint256,uint64,address)\":{\"params\":{\"_auxData\":\"For eth->wstEth, the minimum acceptable amount of stEth per 1 eth, for wstEth->eth, the minimum acceptable amount of eth per 1 wstEth.\",\"_inputAssetA\":\"The inputAsset (eth or wstEth)\",\"_interactionNonce\":\"The nonce of the DeFi interaction, used when swapping wstEth -> eth\",\"_outputAssetA\":\"The output asset (eth or wstEth) opposite `_inputAssetB`\",\"_totalInputValue\":\"The amount of token deposited\"},\"returns\":{\"outputValueA\":\"The amount of `_outputAssetA` that the RollupProcessor should pull\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"notice\":\"Computes the criteria that is passed on to the subsidy contract when claiming\"},\"constructor\":{\"notice\":\"Sets the address of the RollupProcessor and pre-approve tokens\"},\"convert((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint256,uint64,address)\":{\"notice\":\"Swaps between the eth<->wstEth tokens through the curve eth/stEth pool and wrapping stEth\"}},\"notice\":\"A DeFiBridge for trading between Eth and wstEth using curve and the stEth wrapper.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridges/curve/CurveStEthBridge.sol\":\"CurveStEthBridge\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0x35e258421ae206f3db37281cea70871b4c3553914734aa76139a41af60ac1abb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2ef94b6bc4ee356db612a1849c615f7dd4b15542d6c8584c86bb9243a7913cf0\",\"dweb:/ipfs/QmaxFj5NFpAjjitZtHPNS9PPtCuBATaRz9ktDDRCQCQ83y\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0xb0fafd1e5a5e316405d08b8390bdf4716c7644cc2c8e89ce41050316f28f92a3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8c194429bb8dd25539faa90982240db467042daf2487b17debc908cfd98f069a\",\"dweb:/ipfs/QmYdFwzgxG9C1iyGsDFZCLNG4LBKSL9b8osCP1RLtYnpvm\"]},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"keccak256\":\"0x68404b57d114b893554b0e54334b32f578f5d1abf61830025c83fb71dc1944ce\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d3d0a94b3c8afd92c2a9f03f3325e9ac22cec56e995b94ff212670ff3653f0d3\",\"dweb:/ipfs/QmPqKWUysbo8QqKcqH5Lp7SQiL1LfjeoGCSa7iFWmAP8Mw\"]},\"lib/rollup-encoder/src/interfaces/IRollupProcessor.sol\":{\"keccak256\":\"0x7f8cc09c537d9c9b80b5e90c1ebe02d2fbb4efd5510bbe3a4df57940e368a71d\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8d0e59e15799702bbdf118c00851ae154e01b329c625dc6f3097b0cd072770ef\",\"dweb:/ipfs/QmPsPp6Drzym9RAai34jMJbnuftV3XkDnDp35RX94hWh2u\"]},\"lib/rollup-encoder/src/libraries/AztecTypes.sol\":{\"keccak256\":\"0xa11ad1ad795337be7761108304a21812aeedfac4b03969ee5f71a251e226cc77\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://5f6ea5409dcbe6c61d1c7a7153a4158bc88db92eae2c5c1041809b19c49c3ea7\",\"dweb:/ipfs/QmY7d8839N7SNyR5eGvFi6C6opNW3GW5oZEhTVKEWFvv56\"]},\"src/aztec/interfaces/IDefiBridge.sol\":{\"keccak256\":\"0xf2e1d1e8dc5326f1fe8b4a909541d459546f44fb7e1013b9f9be3bc8aac379d4\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b24142083ad22a38a2d7e5190d05ed286964f0bedbe83bb0ae4c1366521ee5ec\",\"dweb:/ipfs/QmPbfmHjYq4rqpFwVb75mNxDVdRBoRNWu6neGMdLJibDts\"]},\"src/aztec/interfaces/ISubsidy.sol\":{\"keccak256\":\"0x03afbff2b5181d4fc39190a2bb7ad0a60b6a4ae44527d77509c23299b4a3c668\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8a6f880e61c2a097e8f49409b5db5db42aa727d3256625cf8f4b409423923bea\",\"dweb:/ipfs/QmRkpCEkEHUpP9RWGANyQNPPmDUfht15uSiFKeSNWYmr8C\"]},\"src/bridges/base/BridgeBase.sol\":{\"keccak256\":\"0x7ff16906ae0c58fc9ef08096db9c006887875e371ee45440c535dcae4649b75c\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://778cde55152d439e4e05393af4e54eb6ece56572f7e7ccf7f7eabac20159e525\",\"dweb:/ipfs/QmcGY9MGzBr4MaEQNa76hcKKabkLE2hYDxNRgwEEuCeLW2\"]},\"src/bridges/base/ErrorLib.sol\":{\"keccak256\":\"0x0d5ada9c43f52812ff2c60014543fc21684e48610bbe6c4bd77cfdb0186876c9\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://ee4e31e01128c5b683806908876f3e73f0df9fd4c145f426054aad1dbd829cce\",\"dweb:/ipfs/QmQiLtbCuNCe1r1jcAL1cVtTwouXbGETyk1abtTFBDwxZV\"]},\"src/bridges/curve/CurveStEthBridge.sol\":{\"keccak256\":\"0x8cbb01c6d405957aa5a673b8413cdc0c21499dc8198a376e83bdcee503b1669e\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://cf5ca4fa3e9b8e2c187ad079704aa1ff87eb1a1407ec9eecad8c6ed621adf958\",\"dweb:/ipfs/QmUE5xuSffk8jB55Kt9sR5XTH2kMzV4q7UWRRusyLu4y79\"]},\"src/interfaces/curve/ICurvePool.sol\":{\"keccak256\":\"0xd0383f0c1d3ac1ac5e765290d82e0669379d6a2c62c720361f70eb55626df361\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4c76cea836ff2f0aadb84f764a9d30dacef989f84a3184b3ca8676d8590750ad\",\"dweb:/ipfs/QmNTfV45RwGAwz3iSxCT99WqvRHWz52eu4NTHtgJ2rg9vZ\"]},\"src/interfaces/lido/ILido.sol\":{\"keccak256\":\"0xd195a22416bfc8630dbe6c66805c77712b47de4f1397268a24664c526eca48cd\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3edaef781a5a0555ba2f1e14e7dacabd21d1a4ab43026fe5a743b58a79ca39e1\",\"dweb:/ipfs/QmbatGGRnkn3r4ccFvZqUHSDKe3992LiqPiY9QVSmuz2SD\"]},\"src/interfaces/lido/IWstETH.sol\":{\"keccak256\":\"0x431ee9675fd4634cb56e32bfa8736b5a565f58b5ccf224270d4afa8aa86cbe02\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc3231cc6592b76881ab137c535b79eeec5fe47349c2cbb5e78312432fb5b48e\",\"dweb:/ipfs/QmfMEbn8hixxzxBLocgpqVQgg9hvbweyWhazWkVpaSAxYL\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.10+commit.fc410830" @@ -1188,7 +1188,7 @@ "bzz-raw://4c76cea836ff2f0aadb84f764a9d30dacef989f84a3184b3ca8676d8590750ad", "dweb:/ipfs/QmNTfV45RwGAwz3iSxCT99WqvRHWz52eu4NTHtgJ2rg9vZ" ], - "license": "GPLv2" + "license": "MIT" }, "src/interfaces/lido/ILido.sol": { "keccak256": "0xd195a22416bfc8630dbe6c66805c77712b47de4f1397268a24664c526eca48cd", @@ -1196,7 +1196,7 @@ "bzz-raw://3edaef781a5a0555ba2f1e14e7dacabd21d1a4ab43026fe5a743b58a79ca39e1", "dweb:/ipfs/QmbatGGRnkn3r4ccFvZqUHSDKe3992LiqPiY9QVSmuz2SD" ], - "license": "GPLv2" + "license": "MIT" }, "src/interfaces/lido/IWstETH.sol": { "keccak256": "0x431ee9675fd4634cb56e32bfa8736b5a565f58b5ccf224270d4afa8aa86cbe02", @@ -1204,7 +1204,7 @@ "bzz-raw://bc3231cc6592b76881ab137c535b79eeec5fe47349c2cbb5e78312432fb5b48e", "dweb:/ipfs/QmfMEbn8hixxzxBLocgpqVQgg9hvbweyWhazWkVpaSAxYL" ], - "license": "GPLv2" + "license": "MIT" } }, "version": 1 @@ -1213,33 +1213,15 @@ "absolutePath": "src/bridges/curve/CurveStEthBridge.sol", "id": 33038, "exportedSymbols": { - "AztecTypes": [ - 29932 - ], - "BridgeBase": [ - 32640 - ], - "CurveStEthBridge": [ - 33037 - ], - "ErrorLib": [ - 32671 - ], - "ICurvePool": [ - 52005 - ], - "ILido": [ - 52394 - ], - "IRollupProcessor": [ - 29897 - ], - "IWstETH": [ - 52441 - ], - "SafeERC20": [ - 26423 - ] + "AztecTypes": [29932], + "BridgeBase": [32640], + "CurveStEthBridge": [33037], + "ErrorLib": [32671], + "ICurvePool": [52005], + "ILido": [52394], + "IRollupProcessor": [29897], + "IWstETH": [52441], + "SafeERC20": [26423] }, "nodeType": "SourceUnit", "src": "64:6516:42", @@ -1249,12 +1231,7 @@ "nodeType": "PragmaDirective", "src": "64:24:42", "nodes": [], - "literals": [ - "solidity", - ">=", - "0.8", - ".4" - ] + "literals": ["solidity", ">=", "0.8", ".4"] }, { "id": 32675, @@ -2876,9 +2853,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 32839 - ], + "assignments": [32839], "declarations": [ { "constant": false, @@ -3000,9 +2975,7 @@ "src": "3434:73:42" }, { - "assignments": [ - 32848 - ], + "assignments": [32848], "declarations": [ { "constant": false, @@ -3611,9 +3584,7 @@ } ] }, - "baseFunctions": [ - 32583 - ], + "baseFunctions": [32583], "documentation": { "id": 32805, "nodeType": "StructuredDocumentation", @@ -4279,9 +4250,7 @@ } }, { - "assignments": [ - 32928 - ], + "assignments": [32928], "declarations": [ { "constant": false, @@ -4404,9 +4373,7 @@ "src": "4841:64:42" }, { - "assignments": [ - 32937 - ], + "assignments": [32937], "declarations": [ { "constant": false, @@ -4557,9 +4524,7 @@ "isLValue": false, "isPure": false, "lValueRequested": false, - "names": [ - "value" - ], + "names": ["value"], "nodeType": "FunctionCallOptions", "options": [ { @@ -5001,9 +4966,7 @@ } }, { - "assignments": [ - 32985 - ], + "assignments": [32985], "declarations": [ { "constant": false, @@ -5101,9 +5064,7 @@ "src": "6037:54:42" }, { - "assignments": [ - 32992 - ], + "assignments": [32992], "declarations": [ { "constant": false, @@ -5226,9 +5187,7 @@ "src": "6102:53:42" }, { - "assignments": [ - 33001 - ], + "assignments": [33001], "declarations": [ { "constant": false, @@ -5660,9 +5619,7 @@ "isLValue": false, "isPure": false, "lValueRequested": false, - "names": [ - "value" - ], + "names": ["value"], "nodeType": "FunctionCallOptions", "options": [ { @@ -5903,26 +5860,14 @@ "text": " @notice A DeFiBridge for trading between Eth and wstEth using curve and the stEth wrapper.\n @dev Synchronous and stateless bridge that will hold no funds beyond dust for gas-savings.\n @author Aztec Team" }, "fullyImplemented": true, - "linearizedBaseContracts": [ - 33037, - 32640, - 31565 - ], + "linearizedBaseContracts": [33037, 32640, 31565], "name": "CurveStEthBridge", "nameLocation": "829:16:42", "scope": 33038, - "usedErrors": [ - 32515, - 32644, - 32648, - 32652, - 32670, - 32702, - 32704 - ] + "usedErrors": [32515, 32644, 32648, 32652, 32670, 32702, 32704] } ], "license": "Apache-2.0" }, "id": 42 -} \ No newline at end of file +} diff --git a/yarn-project/blockchain/src/abis/bridges/ElementBridge.sol/ElementBridge.json b/yarn-project/blockchain/src/abis/bridges/ElementBridge.sol/ElementBridge.json index 996dd90e0..8e0674c96 100644 --- a/yarn-project/blockchain/src/abis/bridges/ElementBridge.sol/ElementBridge.json +++ b/yarn-project/blockchain/src/abis/bridges/ElementBridge.sol/ElementBridge.json @@ -911,7 +911,7 @@ "pools(uint256)": "ac4afa38", "registerConvergentPoolAddress(address,address,uint64)": "05ff03ba" }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_rollupProcessor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_trancheFactory\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_trancheBytecodeHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_balancerVaultAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_elementDeploymentValidatorAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ALREADY_FINALISED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ASSET_IDS_NOT_EQUAL\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ASSET_NOT_ERC20\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BRIDGE_NOT_READY\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HEAP_EMPTY\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INPUT_ASSETB_NOT_UNUSED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INTERACTION_ALREADY_EXISTS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_CHANGE_IN_BALANCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_POOL\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_TOKEN_BALANCE_RECEIVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_TRANCHE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_WRAPPED_POSITION\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MissingImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OUTPUT_ASSETB_NOT_UNUSED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"POOL_EXPIRY_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"POOL_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"POOL_UNDERLYING_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RECEIVED_LESS_THAN_LIMIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_ALREADY_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_EXPIRY_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_POSITION_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_UNDERLYING_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UNREGISTERED_PAIR\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UNREGISTERED_POOL\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UNREGISTERED_POSITION\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAULT_ADDRESS_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAULT_ADDRESS_VERIFICATION_FAILED\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalInputValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int64\",\"name\":\"gasUsed\",\"type\":\"int64\"}],\"name\":\"LogConvert\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"int64\",\"name\":\"gasUsed\",\"type\":\"int64\"}],\"name\":\"LogFinalise\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"poolAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"wrappedPositionAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"LogPoolAdded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ROLLUP_PROCESSOR\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSIDY\",\"outputs\":[{\"internalType\":\"contract ISubsidy\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"assetToExpirys\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"computeCriteria\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"inputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"inputAssetB\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"outputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"outputAssetB\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"totalInputValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"interactionNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"auxData\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"convert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"outputValueA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outputValueB\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isAsync\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"outputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"interactionNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"finalise\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"outputValueA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outputValueB\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"interactionCompleted\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"getAssetExpiries\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"assetExpiries\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"interactionNonce\",\"type\":\"uint256\"}],\"name\":\"getTrancheDeploymentBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"hashAssetAndExpiry\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"hashValue\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"interactions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"quantityPT\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trancheAddress\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"finalised\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"failed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"pools\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"trancheAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"poolAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"wrappedPositionAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_convergentPool\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_wrappedPosition\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_expiry\",\"type\":\"uint64\"}],\"name\":\"registerConvergentPoolAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Smart contract responsible for depositing, managing and redeeming Defi interactions with the Element protocol\",\"kind\":\"dev\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"details\":\"Should be overridden by bridge implementation if intended to limit subsidy.\",\"returns\":{\"_0\":\"The criteria to be passed along\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_balancerVaultAddress\":\"the address of the balancer router contract\",\"_elementDeploymentValidatorAddress\":\"the address of the element deployment validator contract\",\"_rollupProcessor\":\"the address of the rollup contract\",\"_trancheBytecodeHash\":\"the hash of the bytecode of the tranche contract, used for tranche contract address derivation\",\"_trancheFactory\":\"the address of the element tranche factor contract\"}},\"convert((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint256,uint64,address)\":{\"details\":\"Function to add a new interaction to the bridge Converts the amount of input asset given to the market determined amount of tranche asset\",\"params\":{\"auxData\":\"The expiry value for this interaction\",\"inputAssetA\":\"The type of input asset for the new interaction\",\"interactionNonce\":\"The nonce value for this interaction\",\"outputAssetA\":\"The type of output asset for the new interaction\",\"totalInputValue\":\"The amount the the input asset provided in this interaction\"},\"returns\":{\"isAsync\":\"Flag specifying if this interaction is asynchronous - will be true\",\"outputValueA\":\"The interaction's first ouptut value after this call - will be 0\",\"outputValueB\":\"The interaction's second ouptut value after this call - will be 0\"}},\"finalise((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint64)\":{\"details\":\"Function to finalise an interaction Converts the held amount of tranche asset for the given interaction into the output asset\",\"params\":{\"interactionNonce\":\"The nonce value for the interaction that should be finalised\"}},\"getAssetExpiries(address)\":{\"details\":\"Function for retrieving the available expiries for the given asset\",\"params\":{\"asset\":\"the asset address being queried\"},\"returns\":{\"assetExpiries\":\"the list of available expiries for the provided asset address\"}},\"getTrancheDeploymentBlockNumber(uint256)\":{\"details\":\"Returns the block number in which a tranche was first configured on the bridge based on the nonce of an interaction in that tranche\",\"params\":{\"interactionNonce\":\"the nonce of the interaction to query\"},\"returns\":{\"blockNumber\":\"the number of the block in which the tranche was first configured\"}},\"hashAssetAndExpiry(address,uint64)\":{\"details\":\"Produces a hash of the given asset and expiry value\",\"params\":{\"asset\":\"The asset address\",\"expiry\":\"The expiry value\"},\"returns\":{\"hashValue\":\"The resulting hash value\"}},\"registerConvergentPoolAddress(address,address,uint64)\":{\"details\":\"Registers a convergent pool with the contract, setting up a new asset/expiry element tranche\",\"params\":{\"_convergentPool\":\"The pool's address\",\"_expiry\":\"The expiry of the tranche being configured\",\"_wrappedPosition\":\"The element wrapped position contract's address\"}}},\"title\":\"Element Bridge\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"notice\":\"Computes the criteria that is passed on to the subsidy contract when claiming\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridges/element/ElementBridge.sol\":\"ElementBridge\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0x35e258421ae206f3db37281cea70871b4c3553914734aa76139a41af60ac1abb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2ef94b6bc4ee356db612a1849c615f7dd4b15542d6c8584c86bb9243a7913cf0\",\"dweb:/ipfs/QmaxFj5NFpAjjitZtHPNS9PPtCuBATaRz9ktDDRCQCQ83y\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"keccak256\":\"0x6a8df18a4cf9ddce45d0b6609e90ad81c948475b1178ab40c35ea79bfd99a319\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b99013f9788f6de8a4208e0190e1132c102ef83f79215825e2f4dfa8fc01738d\",\"dweb:/ipfs/QmT25dXiwuszQYgbHFxJshdupZXTj2LtFCAaQqxPQwpyWC\"]},\"lib/rollup-encoder/src/interfaces/IRollupProcessor.sol\":{\"keccak256\":\"0x7f8cc09c537d9c9b80b5e90c1ebe02d2fbb4efd5510bbe3a4df57940e368a71d\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8d0e59e15799702bbdf118c00851ae154e01b329c625dc6f3097b0cd072770ef\",\"dweb:/ipfs/QmPsPp6Drzym9RAai34jMJbnuftV3XkDnDp35RX94hWh2u\"]},\"lib/rollup-encoder/src/libraries/AztecTypes.sol\":{\"keccak256\":\"0xa11ad1ad795337be7761108304a21812aeedfac4b03969ee5f71a251e226cc77\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://5f6ea5409dcbe6c61d1c7a7153a4158bc88db92eae2c5c1041809b19c49c3ea7\",\"dweb:/ipfs/QmY7d8839N7SNyR5eGvFi6C6opNW3GW5oZEhTVKEWFvv56\"]},\"src/aztec/interfaces/IDefiBridge.sol\":{\"keccak256\":\"0xf2e1d1e8dc5326f1fe8b4a909541d459546f44fb7e1013b9f9be3bc8aac379d4\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b24142083ad22a38a2d7e5190d05ed286964f0bedbe83bb0ae4c1366521ee5ec\",\"dweb:/ipfs/QmPbfmHjYq4rqpFwVb75mNxDVdRBoRNWu6neGMdLJibDts\"]},\"src/aztec/interfaces/ISubsidy.sol\":{\"keccak256\":\"0x03afbff2b5181d4fc39190a2bb7ad0a60b6a4ae44527d77509c23299b4a3c668\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8a6f880e61c2a097e8f49409b5db5db42aa727d3256625cf8f4b409423923bea\",\"dweb:/ipfs/QmRkpCEkEHUpP9RWGANyQNPPmDUfht15uSiFKeSNWYmr8C\"]},\"src/bridges/base/BridgeBase.sol\":{\"keccak256\":\"0x7ff16906ae0c58fc9ef08096db9c006887875e371ee45440c535dcae4649b75c\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://778cde55152d439e4e05393af4e54eb6ece56572f7e7ccf7f7eabac20159e525\",\"dweb:/ipfs/QmcGY9MGzBr4MaEQNa76hcKKabkLE2hYDxNRgwEEuCeLW2\"]},\"src/bridges/base/ErrorLib.sol\":{\"keccak256\":\"0x0d5ada9c43f52812ff2c60014543fc21684e48610bbe6c4bd77cfdb0186876c9\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://ee4e31e01128c5b683806908876f3e73f0df9fd4c145f426054aad1dbd829cce\",\"dweb:/ipfs/QmQiLtbCuNCe1r1jcAL1cVtTwouXbGETyk1abtTFBDwxZV\"]},\"src/bridges/element/ElementBridge.sol\":{\"keccak256\":\"0x023ed8a50af5e41c3f83642999f1d262d8e0b455f07197a9bf3ef614cbb4193b\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://9369ec5db2aea201bf2f3fd47e9b65c725b51943bcde79ae0535c48f4edf6393\",\"dweb:/ipfs/QmcDveHPiKbV3NJrSTmVdixiAeXLMVw3F37PTvSpRYcu1F\"]},\"src/bridges/element/MinHeap.sol\":{\"keccak256\":\"0x64c7dec82bc1204edffeecd7be082e2b0f15693ac3e06ad282fbdc680efb6d79\",\"urls\":[\"bzz-raw://976d0893256b6cacb69119a4043ae9a7108da748825293a14d77aa52b4483aeb\",\"dweb:/ipfs/QmPSKv8W4DnkbRFNi8yDc6xCYuKLspNaYWdwGqHiuicFDm\"]},\"src/interfaces/element/IDeploymentValidator.sol\":{\"keccak256\":\"0x311aac8f48d197f004dda93cb8fd562f8fca4b6e83f89b30a18e3573130b79c0\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://822e6566b1fdf3659f36f6751353154539416586a67de134ee6e218b5384d962\",\"dweb:/ipfs/QmTWXGuxT3A6dromfoydYEejw4Tidbpp3jyfnUUy6xkvBi\"]},\"src/interfaces/element/IPool.sol\":{\"keccak256\":\"0x8a419a61cf8ee1479f3878d0e296a8fd50ba215b4bf1b8c59a95543433067360\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://66fffc42767e8744414081909afb12eb97c73cd568ae8131cacec1bdf20cbfc7\",\"dweb:/ipfs/Qmd347Z8NhvJpfpgZfsEvkSsDdoot2ANJxDTXV66pF9Xyy\"]},\"src/interfaces/element/ITranche.sol\":{\"keccak256\":\"0xa3da5087be04e99feeecfd9b5065fbfdc53655ac9b8dee0840008c5db92ea62a\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://363c64f44f8db15f48cd1ad1eb12ecdc8b0db2fd7df6638c8c6c532a5ae10801\",\"dweb:/ipfs/QmNS6v9GcwuTfEX6j2xW8Byzb9PBpMVKYDP9SThsGKM8hU\"]},\"src/interfaces/element/IVault.sol\":{\"keccak256\":\"0xb4f96ad12823ffa83e16fbae73900b1bf69c04bd7c84d138f846f85ac0efee8c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3\",\"dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7\"]},\"src/interfaces/element/IWrappedPosition.sol\":{\"keccak256\":\"0xc7baf2ad568f17ded94778da98a27e8eccdeb7067df9a38e7955f46f6f05474e\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://2d5c0dacfe512e93e8b777e34a10b5701d74c1dc6f3bd69b3b73492da0cafade\",\"dweb:/ipfs/Qmc9bdaPYKS9wz7gNQjYQUKBfAoWV7DxY49deVc9maGciY\"]},\"src/libraries/uniswapv3/FullMath.sol\":{\"keccak256\":\"0x6b147dd51ad698298604a81403071c439ec739b40fc4a6ec965520ad4115a1da\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://82a2d96cd8d781b588978b9b09db64e40a3037e330a11cc09395c59fcac4c0f8\",\"dweb:/ipfs/QmRPSEp12gPLkMmZ41fEnUoWdezgqPtzz7qTUXqMBrxxNG\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_rollupProcessor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_trancheFactory\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_trancheBytecodeHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_balancerVaultAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_elementDeploymentValidatorAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ALREADY_FINALISED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ASSET_IDS_NOT_EQUAL\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ASSET_NOT_ERC20\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BRIDGE_NOT_READY\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HEAP_EMPTY\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INPUT_ASSETB_NOT_UNUSED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INTERACTION_ALREADY_EXISTS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_CHANGE_IN_BALANCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_POOL\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_TOKEN_BALANCE_RECEIVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_TRANCHE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_WRAPPED_POSITION\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MissingImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OUTPUT_ASSETB_NOT_UNUSED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"POOL_EXPIRY_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"POOL_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"POOL_UNDERLYING_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RECEIVED_LESS_THAN_LIMIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_ALREADY_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_EXPIRY_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_POSITION_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_UNDERLYING_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UNREGISTERED_PAIR\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UNREGISTERED_POOL\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UNREGISTERED_POSITION\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAULT_ADDRESS_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAULT_ADDRESS_VERIFICATION_FAILED\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalInputValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int64\",\"name\":\"gasUsed\",\"type\":\"int64\"}],\"name\":\"LogConvert\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"int64\",\"name\":\"gasUsed\",\"type\":\"int64\"}],\"name\":\"LogFinalise\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"poolAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"wrappedPositionAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"LogPoolAdded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ROLLUP_PROCESSOR\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSIDY\",\"outputs\":[{\"internalType\":\"contract ISubsidy\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"assetToExpirys\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"computeCriteria\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"inputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"inputAssetB\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"outputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"outputAssetB\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"totalInputValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"interactionNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"auxData\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"convert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"outputValueA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outputValueB\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isAsync\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"outputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"interactionNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"finalise\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"outputValueA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outputValueB\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"interactionCompleted\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"getAssetExpiries\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"assetExpiries\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"interactionNonce\",\"type\":\"uint256\"}],\"name\":\"getTrancheDeploymentBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"hashAssetAndExpiry\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"hashValue\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"interactions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"quantityPT\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trancheAddress\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"finalised\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"failed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"pools\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"trancheAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"poolAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"wrappedPositionAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_convergentPool\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_wrappedPosition\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_expiry\",\"type\":\"uint64\"}],\"name\":\"registerConvergentPoolAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Smart contract responsible for depositing, managing and redeeming Defi interactions with the Element protocol\",\"kind\":\"dev\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"details\":\"Should be overridden by bridge implementation if intended to limit subsidy.\",\"returns\":{\"_0\":\"The criteria to be passed along\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_balancerVaultAddress\":\"the address of the balancer router contract\",\"_elementDeploymentValidatorAddress\":\"the address of the element deployment validator contract\",\"_rollupProcessor\":\"the address of the rollup contract\",\"_trancheBytecodeHash\":\"the hash of the bytecode of the tranche contract, used for tranche contract address derivation\",\"_trancheFactory\":\"the address of the element tranche factor contract\"}},\"convert((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint256,uint64,address)\":{\"details\":\"Function to add a new interaction to the bridge Converts the amount of input asset given to the market determined amount of tranche asset\",\"params\":{\"auxData\":\"The expiry value for this interaction\",\"inputAssetA\":\"The type of input asset for the new interaction\",\"interactionNonce\":\"The nonce value for this interaction\",\"outputAssetA\":\"The type of output asset for the new interaction\",\"totalInputValue\":\"The amount the the input asset provided in this interaction\"},\"returns\":{\"isAsync\":\"Flag specifying if this interaction is asynchronous - will be true\",\"outputValueA\":\"The interaction's first ouptut value after this call - will be 0\",\"outputValueB\":\"The interaction's second ouptut value after this call - will be 0\"}},\"finalise((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint64)\":{\"details\":\"Function to finalise an interaction Converts the held amount of tranche asset for the given interaction into the output asset\",\"params\":{\"interactionNonce\":\"The nonce value for the interaction that should be finalised\"}},\"getAssetExpiries(address)\":{\"details\":\"Function for retrieving the available expiries for the given asset\",\"params\":{\"asset\":\"the asset address being queried\"},\"returns\":{\"assetExpiries\":\"the list of available expiries for the provided asset address\"}},\"getTrancheDeploymentBlockNumber(uint256)\":{\"details\":\"Returns the block number in which a tranche was first configured on the bridge based on the nonce of an interaction in that tranche\",\"params\":{\"interactionNonce\":\"the nonce of the interaction to query\"},\"returns\":{\"blockNumber\":\"the number of the block in which the tranche was first configured\"}},\"hashAssetAndExpiry(address,uint64)\":{\"details\":\"Produces a hash of the given asset and expiry value\",\"params\":{\"asset\":\"The asset address\",\"expiry\":\"The expiry value\"},\"returns\":{\"hashValue\":\"The resulting hash value\"}},\"registerConvergentPoolAddress(address,address,uint64)\":{\"details\":\"Registers a convergent pool with the contract, setting up a new asset/expiry element tranche\",\"params\":{\"_convergentPool\":\"The pool's address\",\"_expiry\":\"The expiry of the tranche being configured\",\"_wrappedPosition\":\"The element wrapped position contract's address\"}}},\"title\":\"Element Bridge\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"notice\":\"Computes the criteria that is passed on to the subsidy contract when claiming\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridges/element/ElementBridge.sol\":\"ElementBridge\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0x35e258421ae206f3db37281cea70871b4c3553914734aa76139a41af60ac1abb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2ef94b6bc4ee356db612a1849c615f7dd4b15542d6c8584c86bb9243a7913cf0\",\"dweb:/ipfs/QmaxFj5NFpAjjitZtHPNS9PPtCuBATaRz9ktDDRCQCQ83y\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"keccak256\":\"0x6a8df18a4cf9ddce45d0b6609e90ad81c948475b1178ab40c35ea79bfd99a319\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b99013f9788f6de8a4208e0190e1132c102ef83f79215825e2f4dfa8fc01738d\",\"dweb:/ipfs/QmT25dXiwuszQYgbHFxJshdupZXTj2LtFCAaQqxPQwpyWC\"]},\"lib/rollup-encoder/src/interfaces/IRollupProcessor.sol\":{\"keccak256\":\"0x7f8cc09c537d9c9b80b5e90c1ebe02d2fbb4efd5510bbe3a4df57940e368a71d\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8d0e59e15799702bbdf118c00851ae154e01b329c625dc6f3097b0cd072770ef\",\"dweb:/ipfs/QmPsPp6Drzym9RAai34jMJbnuftV3XkDnDp35RX94hWh2u\"]},\"lib/rollup-encoder/src/libraries/AztecTypes.sol\":{\"keccak256\":\"0xa11ad1ad795337be7761108304a21812aeedfac4b03969ee5f71a251e226cc77\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://5f6ea5409dcbe6c61d1c7a7153a4158bc88db92eae2c5c1041809b19c49c3ea7\",\"dweb:/ipfs/QmY7d8839N7SNyR5eGvFi6C6opNW3GW5oZEhTVKEWFvv56\"]},\"src/aztec/interfaces/IDefiBridge.sol\":{\"keccak256\":\"0xf2e1d1e8dc5326f1fe8b4a909541d459546f44fb7e1013b9f9be3bc8aac379d4\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b24142083ad22a38a2d7e5190d05ed286964f0bedbe83bb0ae4c1366521ee5ec\",\"dweb:/ipfs/QmPbfmHjYq4rqpFwVb75mNxDVdRBoRNWu6neGMdLJibDts\"]},\"src/aztec/interfaces/ISubsidy.sol\":{\"keccak256\":\"0x03afbff2b5181d4fc39190a2bb7ad0a60b6a4ae44527d77509c23299b4a3c668\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8a6f880e61c2a097e8f49409b5db5db42aa727d3256625cf8f4b409423923bea\",\"dweb:/ipfs/QmRkpCEkEHUpP9RWGANyQNPPmDUfht15uSiFKeSNWYmr8C\"]},\"src/bridges/base/BridgeBase.sol\":{\"keccak256\":\"0x7ff16906ae0c58fc9ef08096db9c006887875e371ee45440c535dcae4649b75c\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://778cde55152d439e4e05393af4e54eb6ece56572f7e7ccf7f7eabac20159e525\",\"dweb:/ipfs/QmcGY9MGzBr4MaEQNa76hcKKabkLE2hYDxNRgwEEuCeLW2\"]},\"src/bridges/base/ErrorLib.sol\":{\"keccak256\":\"0x0d5ada9c43f52812ff2c60014543fc21684e48610bbe6c4bd77cfdb0186876c9\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://ee4e31e01128c5b683806908876f3e73f0df9fd4c145f426054aad1dbd829cce\",\"dweb:/ipfs/QmQiLtbCuNCe1r1jcAL1cVtTwouXbGETyk1abtTFBDwxZV\"]},\"src/bridges/element/ElementBridge.sol\":{\"keccak256\":\"0x023ed8a50af5e41c3f83642999f1d262d8e0b455f07197a9bf3ef614cbb4193b\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://9369ec5db2aea201bf2f3fd47e9b65c725b51943bcde79ae0535c48f4edf6393\",\"dweb:/ipfs/QmcDveHPiKbV3NJrSTmVdixiAeXLMVw3F37PTvSpRYcu1F\"]},\"src/bridges/element/MinHeap.sol\":{\"keccak256\":\"0x64c7dec82bc1204edffeecd7be082e2b0f15693ac3e06ad282fbdc680efb6d79\",\"urls\":[\"bzz-raw://976d0893256b6cacb69119a4043ae9a7108da748825293a14d77aa52b4483aeb\",\"dweb:/ipfs/QmPSKv8W4DnkbRFNi8yDc6xCYuKLspNaYWdwGqHiuicFDm\"]},\"src/interfaces/element/IDeploymentValidator.sol\":{\"keccak256\":\"0x311aac8f48d197f004dda93cb8fd562f8fca4b6e83f89b30a18e3573130b79c0\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://822e6566b1fdf3659f36f6751353154539416586a67de134ee6e218b5384d962\",\"dweb:/ipfs/QmTWXGuxT3A6dromfoydYEejw4Tidbpp3jyfnUUy6xkvBi\"]},\"src/interfaces/element/IPool.sol\":{\"keccak256\":\"0x8a419a61cf8ee1479f3878d0e296a8fd50ba215b4bf1b8c59a95543433067360\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://66fffc42767e8744414081909afb12eb97c73cd568ae8131cacec1bdf20cbfc7\",\"dweb:/ipfs/Qmd347Z8NhvJpfpgZfsEvkSsDdoot2ANJxDTXV66pF9Xyy\"]},\"src/interfaces/element/ITranche.sol\":{\"keccak256\":\"0xa3da5087be04e99feeecfd9b5065fbfdc53655ac9b8dee0840008c5db92ea62a\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://363c64f44f8db15f48cd1ad1eb12ecdc8b0db2fd7df6638c8c6c532a5ae10801\",\"dweb:/ipfs/QmNS6v9GcwuTfEX6j2xW8Byzb9PBpMVKYDP9SThsGKM8hU\"]},\"src/interfaces/element/IVault.sol\":{\"keccak256\":\"0xb4f96ad12823ffa83e16fbae73900b1bf69c04bd7c84d138f846f85ac0efee8c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3\",\"dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7\"]},\"src/interfaces/element/IWrappedPosition.sol\":{\"keccak256\":\"0xc7baf2ad568f17ded94778da98a27e8eccdeb7067df9a38e7955f46f6f05474e\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://2d5c0dacfe512e93e8b777e34a10b5701d74c1dc6f3bd69b3b73492da0cafade\",\"dweb:/ipfs/Qmc9bdaPYKS9wz7gNQjYQUKBfAoWV7DxY49deVc9maGciY\"]},\"src/libraries/uniswapv3/FullMath.sol\":{\"keccak256\":\"0x6b147dd51ad698298604a81403071c439ec739b40fc4a6ec965520ad4115a1da\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://82a2d96cd8d781b588978b9b09db64e40a3037e330a11cc09395c59fcac4c0f8\",\"dweb:/ipfs/QmRPSEp12gPLkMmZ41fEnUoWdezgqPtzz7qTUXqMBrxxNG\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.10+commit.fc410830" @@ -1958,7 +1958,7 @@ "bzz-raw://66fffc42767e8744414081909afb12eb97c73cd568ae8131cacec1bdf20cbfc7", "dweb:/ipfs/Qmd347Z8NhvJpfpgZfsEvkSsDdoot2ANJxDTXV66pF9Xyy" ], - "license": "GPL-2.0-or-later" + "license": "MIT" }, "src/interfaces/element/ITranche.sol": { "keccak256": "0xa3da5087be04e99feeecfd9b5065fbfdc53655ac9b8dee0840008c5db92ea62a", @@ -1974,7 +1974,7 @@ "bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3", "dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7" ], - "license": "GPL-2.0-or-later" + "license": "MIT" }, "src/interfaces/element/IWrappedPosition.sol": { "keccak256": "0xc7baf2ad568f17ded94778da98a27e8eccdeb7067df9a38e7955f46f6f05474e", @@ -1999,51 +1999,21 @@ "absolutePath": "src/bridges/element/ElementBridge.sol", "id": 37924, "exportedSymbols": { - "AztecTypes": [ - 29932 - ], - "BridgeBase": [ - 32640 - ], - "ElementBridge": [ - 37923 - ], - "ErrorLib": [ - 32671 - ], - "FullMath": [ - 53860 - ], - "IAsset": [ - 52169 - ], - "IDeploymentValidator": [ - 52048 - ], - "IERC20": [ - 25396 - ], - "IPool": [ - 52085 - ], - "IRollupProcessor": [ - 29897 - ], - "ITranche": [ - 52164 - ], - "IVault": [ - 52274 - ], - "IWrappedPosition": [ - 52354 - ], - "MinHeap": [ - 38350 - ], - "PoolSpecialization": [ - 52173 - ] + "AztecTypes": [29932], + "BridgeBase": [32640], + "ElementBridge": [37923], + "ErrorLib": [32671], + "FullMath": [53860], + "IAsset": [52169], + "IDeploymentValidator": [52048], + "IERC20": [25396], + "IPool": [52085], + "IRollupProcessor": [29897], + "ITranche": [52164], + "IVault": [52274], + "IWrappedPosition": [52354], + "MinHeap": [38350], + "PoolSpecialization": [52173] }, "nodeType": "SourceUnit", "src": "64:42691:48", @@ -2053,12 +2023,7 @@ "nodeType": "PragmaDirective", "src": "64:24:48", "nodes": [], - "literals": [ - "solidity", - ">=", - "0.8", - ".4" - ] + "literals": ["solidity", ">=", "0.8", ".4"] }, { "id": 35619, @@ -5228,9 +5193,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 35910 - ], + "assignments": [35910], "declarations": [ { "constant": false, @@ -5379,9 +5342,7 @@ "src": "9426:60:48" }, { - "assignments": [ - 35920 - ], + "assignments": [35920], "declarations": [ { "constant": false, @@ -6146,9 +6107,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 35977 - ], + "assignments": [35977], "declarations": [ { "constant": false, @@ -6190,9 +6149,7 @@ "src": "10365:24:48" }, { - "assignments": [ - 35981 - ], + "assignments": [35981], "declarations": [ { "constant": false, @@ -6648,9 +6605,7 @@ "src": "10874:71:48" }, { - "assignments": [ - 36021 - ], + "assignments": [36021], "declarations": [ { "constant": false, @@ -7267,9 +7222,7 @@ "src": "11404:196:48" }, { - "assignments": [ - 36076 - ], + "assignments": [36076], "declarations": [ { "constant": false, @@ -7866,9 +7819,7 @@ } }, { - "assignments": [ - 36129 - ], + "assignments": [36129], "declarations": [ { "constant": false, @@ -9207,9 +9158,7 @@ } }, { - "assignments": [ - 36252 - ], + "assignments": [36252], "declarations": [ { "constant": false, @@ -9299,10 +9248,7 @@ "src": "13777:46:48" }, { - "assignments": [ - 36258, - null - ], + "assignments": [36258, null], "declarations": [ { "constant": false, @@ -9575,9 +9521,7 @@ "src": "14096:88:48" }, { - "assignments": [ - 36279 - ], + "assignments": [36279], "declarations": [ { "constant": false, @@ -9873,9 +9817,7 @@ "src": "14370:108:48" }, { - "assignments": [ - 36303 - ], + "assignments": [36303], "declarations": [ { "constant": false, @@ -9971,9 +9913,7 @@ "src": "14488:76:48" }, { - "assignments": [ - 36310 - ], + "assignments": [36310], "declarations": [ { "constant": false, @@ -10419,9 +10359,7 @@ "src": "14906:56:48" }, { - "assignments": [ - 36350 - ], + "assignments": [36350], "declarations": [ { "constant": false, @@ -10876,9 +10814,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 36382 - ], + "assignments": [36382], "declarations": [ { "constant": false, @@ -11160,9 +11096,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 36410 - ], + "assignments": [36410], "declarations": [ { "constant": false, @@ -11545,9 +11479,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 36444 - ], + "assignments": [36444], "declarations": [ { "constant": false, @@ -12607,9 +12539,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 36552 - ], + "assignments": [36552], "declarations": [ { "constant": false, @@ -12762,9 +12692,7 @@ "src": "19519:43:48" }, { - "assignments": [ - 36563 - ], + "assignments": [36563], "declarations": [ { "constant": false, @@ -13610,9 +13538,7 @@ "src": "20289:16:48" }, { - "assignments": [ - 36634 - ], + "assignments": [36634], "declarations": [ { "constant": false, @@ -13752,12 +13678,7 @@ "isPure": false, "kind": "structConstructorCall", "lValueRequested": false, - "names": [ - "inputAssetAddress", - "totalInputValue", - "interactionNonce", - "auxData" - ], + "names": ["inputAssetAddress", "totalInputValue", "interactionNonce", "auxData"], "nodeType": "FunctionCall", "src": "20438:204:48", "tryCall": false, @@ -13770,9 +13691,7 @@ "src": "20405:237:48" }, { - "assignments": [ - 36645 - ], + "assignments": [36645], "declarations": [ { "constant": false, @@ -13933,9 +13852,7 @@ "src": "20741:97:48" }, { - "assignments": [ - 36656 - ], + "assignments": [36656], "declarations": [ { "constant": false, @@ -14135,9 +14052,7 @@ } }, { - "assignments": [ - 36673 - ], + "assignments": [36673], "declarations": [ { "constant": false, @@ -14227,9 +14142,7 @@ "src": "20993:43:48" }, { - "assignments": [ - 36679 - ], + "assignments": [36679], "declarations": [ { "constant": false, @@ -14456,9 +14369,7 @@ } }, { - "assignments": [ - 36697 - ], + "assignments": [36697], "declarations": [ { "constant": false, @@ -14603,9 +14514,7 @@ "src": "21257:139:48" }, { - "assignments": [ - 36708 - ], + "assignments": [36708], "declarations": [ { "constant": false, @@ -14957,9 +14866,7 @@ "src": "21837:76:48" }, { - "assignments": [ - 36740 - ], + "assignments": [36740], "declarations": [ { "constant": false, @@ -15498,9 +15405,7 @@ } ] }, - "baseFunctions": [ - 32583 - ], + "baseFunctions": [32583], "documentation": { "id": 36518, "nodeType": "StructuredDocumentation", @@ -15898,9 +15803,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 36800 - ], + "assignments": [36800], "declarations": [ { "constant": false, @@ -16208,14 +16111,7 @@ "isPure": false, "kind": "structConstructorCall", "lValueRequested": false, - "names": [ - "poolId", - "kind", - "assetIn", - "assetOut", - "amount", - "userData" - ], + "names": ["poolId", "kind", "assetIn", "assetOut", "amount", "userData"], "nodeType": "FunctionCall", "src": "23186:554:48", "tryCall": false, @@ -16228,9 +16124,7 @@ "src": "23148:592:48" }, { - "assignments": [ - 36823 - ], + "assignments": [36823], "declarations": [ { "constant": false, @@ -16511,12 +16405,7 @@ "isPure": false, "kind": "structConstructorCall", "lValueRequested": false, - "names": [ - "sender", - "fromInternalBalance", - "recipient", - "toInternalBalance" - ], + "names": ["sender", "fromInternalBalance", "recipient", "toInternalBalance"], "nodeType": "FunctionCall", "src": "23796:349:48", "tryCall": false, @@ -16649,9 +16538,7 @@ "src": "24222:58:48" }, { - "assignments": [ - 36850 - ], + "assignments": [36850], "declarations": [ { "constant": false, @@ -17036,9 +16923,7 @@ "src": "24390:225:48" }, { - "assignments": [ - 36876 - ], + "assignments": [36876], "declarations": [ { "constant": false, @@ -17320,9 +17205,7 @@ } }, { - "assignments": [ - 36897 - ], + "assignments": [36897], "declarations": [ { "constant": false, @@ -17736,9 +17619,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 36926 - ], + "assignments": [36926], "declarations": [ { "constant": false, @@ -17845,9 +17726,7 @@ "src": "26042:102:48" }, { - "assignments": [ - 36934 - ], + "assignments": [36934], "declarations": [ { "constant": false, @@ -17930,10 +17809,7 @@ "src": "26265:1106:48", "statements": [ { - "assignments": [ - 36944, - 36946 - ], + "assignments": [36944, 36946], "declarations": [ { "constant": false, @@ -18087,9 +17963,7 @@ } }, { - "assignments": [ - 36957 - ], + "assignments": [36957], "declarations": [ { "constant": false, @@ -18213,9 +18087,7 @@ } }, { - "assignments": [ - 36968 - ], + "assignments": [36968], "declarations": [ { "constant": false, @@ -18454,9 +18326,7 @@ "isLValue": false, "isPure": false, "lValueRequested": false, - "names": [ - "gas" - ], + "names": ["gas"], "nodeType": "FunctionCallOptions", "options": [ { @@ -18633,9 +18503,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 37024 - ], + "assignments": [37024], "declarations": [ { "constant": false, @@ -18788,9 +18656,7 @@ "src": "28067:43:48" }, { - "assignments": [ - 37035 - ], + "assignments": [37035], "declarations": [ { "constant": false, @@ -18841,9 +18707,7 @@ "src": "28120:17:48" }, { - "assignments": [ - 37040 - ], + "assignments": [37040], "declarations": [ { "constant": false, @@ -19237,9 +19101,7 @@ } }, { - "assignments": [ - 37075 - ], + "assignments": [37075], "declarations": [ { "constant": false, @@ -19333,9 +19195,7 @@ "src": "28577:83:48" }, { - "assignments": [ - 37082 - ], + "assignments": [37082], "declarations": [ { "constant": false, @@ -19397,9 +19257,7 @@ "src": "28752:58:48" }, { - "assignments": [ - 37087 - ], + "assignments": [37087], "declarations": [ { "constant": false, @@ -19848,9 +19706,7 @@ "src": "29418:1503:48", "statements": [ { - "assignments": [ - 37120 - ], + "assignments": [37120], "declarations": [ { "constant": false, @@ -21386,9 +21242,7 @@ } }, { - "assignments": [ - 37245 - ], + "assignments": [37245], "declarations": [ { "constant": false, @@ -21748,9 +21602,7 @@ } }, { - "assignments": [ - 37273 - ], + "assignments": [37273], "declarations": [ { "constant": false, @@ -23016,9 +22868,7 @@ } ] }, - "baseFunctions": [ - 32616 - ], + "baseFunctions": [32616], "documentation": { "id": 36994, "nodeType": "StructuredDocumentation", @@ -23685,9 +23535,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 37413 - ], + "assignments": [37413], "declarations": [ { "constant": false, @@ -23768,9 +23616,7 @@ "src": "34691:48:48" }, { - "assignments": [ - 37419 - ], + "assignments": [37419], "declarations": [ { "constant": false, @@ -24460,9 +24306,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 37479 - ], + "assignments": [37479], "declarations": [ { "constant": false, @@ -24524,9 +24368,7 @@ "src": "35731:34:48" }, { - "assignments": [ - 37487 - ], + "assignments": [37487], "declarations": [ { "constant": false, @@ -24607,9 +24449,7 @@ "src": "35775:48:48" }, { - "assignments": [ - 37493 - ], + "assignments": [37493], "declarations": [ { "constant": false, @@ -24750,9 +24590,7 @@ } }, { - "assignments": [ - 37505 - ], + "assignments": [37505], "declarations": [ { "constant": false, @@ -25883,9 +25721,7 @@ } }, { - "assignments": [ - 37599 - ], + "assignments": [37599], "declarations": [ { "constant": false, @@ -26087,9 +25923,7 @@ } }, { - "assignments": [ - 37618 - ], + "assignments": [37618], "declarations": [ { "constant": false, @@ -26170,9 +26004,7 @@ "src": "37602:52:48" }, { - "assignments": [ - 37624 - ], + "assignments": [37624], "declarations": [ { "constant": false, @@ -26233,9 +26065,7 @@ "src": "37664:36:48" }, { - "assignments": [ - 37629 - ], + "assignments": [37629], "declarations": [ { "constant": false, @@ -26334,9 +26164,7 @@ "src": "37842:1509:48", "statements": [ { - "assignments": [ - 37644 - ], + "assignments": [37644], "declarations": [ { "constant": false, @@ -26589,9 +26417,7 @@ } }, { - "assignments": [ - 37668 - ], + "assignments": [37668], "declarations": [ { "constant": false, @@ -26926,10 +26752,7 @@ } }, { - "assignments": [ - 37696, - 37698 - ], + "assignments": [37696, 37698], "declarations": [ { "constant": false, @@ -27884,9 +27707,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 37767 - ], + "assignments": [37767], "declarations": [ { "constant": false, @@ -28510,9 +28331,7 @@ } }, { - "assignments": [ - 37817 - ], + "assignments": [37817], "declarations": [ { "constant": false, @@ -28617,9 +28436,7 @@ "src": "41566:55:48" }, { - "assignments": [ - 37824 - ], + "assignments": [37824], "declarations": [ { "constant": false, @@ -28754,9 +28571,7 @@ "src": "41700:367:48", "statements": [ { - "assignments": [ - 37833 - ], + "assignments": [37833], "declarations": [ { "constant": false, @@ -29031,9 +28846,7 @@ } }, { - "assignments": [ - 37858 - ], + "assignments": [37858], "declarations": [ { "constant": false, @@ -29158,9 +28971,7 @@ "src": "42076:47:48" }, { - "assignments": [ - 37868 - ], + "assignments": [37868], "declarations": [ { "constant": false, @@ -29250,9 +29061,7 @@ "src": "42133:62:48" }, { - "assignments": [ - 37874 - ], + "assignments": [37874], "declarations": [ { "constant": false, @@ -29377,9 +29186,7 @@ "src": "42205:60:48" }, { - "assignments": [ - 37883 - ], + "assignments": [37883], "declarations": [ { "constant": false, @@ -29504,9 +29311,7 @@ "src": "42275:60:48" }, { - "assignments": [ - 37892 - ], + "assignments": [37892], "declarations": [ { "constant": false, @@ -30035,48 +29840,17 @@ "text": " @title Element Bridge\n @dev Smart contract responsible for depositing, managing and redeeming Defi interactions with the Element protocol" }, "fullyImplemented": true, - "linearizedBaseContracts": [ - 37923, - 32640, - 31565 - ], + "linearizedBaseContracts": [37923, 32640, 31565], "name": "ElementBridge", "nameLocation": "1054:13:48", "scope": 37924, "usedErrors": [ - 32515, - 32644, - 32668, - 35652, - 35654, - 35656, - 35658, - 35660, - 35662, - 35664, - 35666, - 35668, - 35670, - 35672, - 35674, - 35676, - 35678, - 35680, - 35682, - 35684, - 35686, - 35688, - 35690, - 35692, - 35694, - 35696, - 35698, - 35700, - 37932 + 32515, 32644, 32668, 35652, 35654, 35656, 35658, 35660, 35662, 35664, 35666, 35668, 35670, 35672, 35674, + 35676, 35678, 35680, 35682, 35684, 35686, 35688, 35690, 35692, 35694, 35696, 35698, 35700, 37932 ] } ], "license": "Apache-2.0" }, "id": 48 -} \ No newline at end of file +} diff --git a/yarn-project/blockchain/src/abis/bridges/ILido.sol/ILido.json b/yarn-project/blockchain/src/abis/bridges/ILido.sol/ILido.json index bbc74bb32..ab47f2c55 100644 --- a/yarn-project/blockchain/src/abis/bridges/ILido.sol/ILido.json +++ b/yarn-project/blockchain/src/abis/bridges/ILido.sol/ILido.json @@ -296,7 +296,7 @@ "transfer(address,uint256)": "a9059cbb", "transferFrom(address,address,uint256)": "23b872dd" }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"getPooledEthByShares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"getSharesByPooledEth\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalShares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"sharesOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_referral\",\"type\":\"address\"}],\"name\":\"submit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"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.\"},\"approve(address,uint256)\":{\"details\":\"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.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `from` to `to` 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.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/lido/ILido.sol\":\"ILido\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"src/interfaces/lido/ILido.sol\":{\"keccak256\":\"0xd195a22416bfc8630dbe6c66805c77712b47de4f1397268a24664c526eca48cd\",\"license\":\"GPLv2\",\"urls\":[\"bzz-raw://3edaef781a5a0555ba2f1e14e7dacabd21d1a4ab43026fe5a743b58a79ca39e1\",\"dweb:/ipfs/QmbatGGRnkn3r4ccFvZqUHSDKe3992LiqPiY9QVSmuz2SD\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"getPooledEthByShares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"getSharesByPooledEth\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalShares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"sharesOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_referral\",\"type\":\"address\"}],\"name\":\"submit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"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.\"},\"approve(address,uint256)\":{\"details\":\"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.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `from` to `to` 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.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/lido/ILido.sol\":\"ILido\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"src/interfaces/lido/ILido.sol\":{\"keccak256\":\"0xd195a22416bfc8630dbe6c66805c77712b47de4f1397268a24664c526eca48cd\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3edaef781a5a0555ba2f1e14e7dacabd21d1a4ab43026fe5a743b58a79ca39e1\",\"dweb:/ipfs/QmbatGGRnkn3r4ccFvZqUHSDKe3992LiqPiY9QVSmuz2SD\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.10+commit.fc410830" @@ -643,7 +643,7 @@ "bzz-raw://3edaef781a5a0555ba2f1e14e7dacabd21d1a4ab43026fe5a743b58a79ca39e1", "dweb:/ipfs/QmbatGGRnkn3r4ccFvZqUHSDKe3992LiqPiY9QVSmuz2SD" ], - "license": "GPLv2" + "license": "MIT" } }, "version": 1 @@ -652,12 +652,8 @@ "absolutePath": "src/interfaces/lido/ILido.sol", "id": 52395, "exportedSymbols": { - "IERC20": [ - 25396 - ], - "ILido": [ - 52394 - ] + "IERC20": [25396], + "ILido": [52394] }, "nodeType": "SourceUnit", "src": "34:511:95", @@ -667,12 +663,7 @@ "nodeType": "PragmaDirective", "src": "34:24:95", "nodes": [], - "literals": [ - "solidity", - ">=", - "0.8", - ".4" - ] + "literals": ["solidity", ">=", "0.8", ".4"] }, { "id": 52358, @@ -1118,17 +1109,14 @@ "contractDependencies": [], "contractKind": "interface", "fullyImplemented": false, - "linearizedBaseContracts": [ - 52394, - 25396 - ], + "linearizedBaseContracts": [52394, 25396], "name": "ILido", "nameLocation": "142:5:95", "scope": 52395, "usedErrors": [] } ], - "license": "GPLv2" + "license": "MIT" }, "id": 95 -} \ No newline at end of file +} diff --git a/yarn-project/blockchain/src/abis/bridges/IVault.sol/IAsset.json b/yarn-project/blockchain/src/abis/bridges/IVault.sol/IAsset.json index d7a3a7d5b..da147f795 100644 --- a/yarn-project/blockchain/src/abis/bridges/IVault.sol/IAsset.json +++ b/yarn-project/blockchain/src/abis/bridges/IVault.sol/IAsset.json @@ -11,7 +11,7 @@ "linkReferences": {} }, "methodIdentifiers": {}, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/element/IVault.sol\":\"IAsset\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"src/interfaces/element/IVault.sol\":{\"keccak256\":\"0xb4f96ad12823ffa83e16fbae73900b1bf69c04bd7c84d138f846f85ac0efee8c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3\",\"dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/element/IVault.sol\":\"IAsset\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"src/interfaces/element/IVault.sol\":{\"keccak256\":\"0xb4f96ad12823ffa83e16fbae73900b1bf69c04bd7c84d138f846f85ac0efee8c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3\",\"dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.10+commit.fc410830" @@ -66,7 +66,7 @@ "bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3", "dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7" ], - "license": "GPL-2.0-or-later" + "license": "MIT" } }, "version": 1 @@ -75,18 +75,10 @@ "absolutePath": "src/interfaces/element/IVault.sol", "id": 52275, "exportedSymbols": { - "IAsset": [ - 52169 - ], - "IERC20": [ - 25396 - ], - "IVault": [ - 52274 - ], - "PoolSpecialization": [ - 52173 - ] + "IAsset": [52169], + "IERC20": [25396], + "IVault": [52274], + "PoolSpecialization": [52173] }, "nodeType": "SourceUnit", "src": "45:5468:93", @@ -96,12 +88,7 @@ "nodeType": "PragmaDirective", "src": "45:24:93", "nodes": [], - "literals": [ - "solidity", - ">=", - "0.8", - ".4" - ] + "literals": ["solidity", ">=", "0.8", ".4"] }, { "id": 52168, @@ -139,9 +126,7 @@ "contractDependencies": [], "contractKind": "interface", "fullyImplemented": true, - "linearizedBaseContracts": [ - 52169 - ], + "linearizedBaseContracts": [52169], "name": "IAsset", "nameLocation": "153:6:93", "scope": 52275, @@ -1376,16 +1361,14 @@ "contractDependencies": [], "contractKind": "interface", "fullyImplemented": false, - "linearizedBaseContracts": [ - 52274 - ], + "linearizedBaseContracts": [52274], "name": "IVault", "nameLocation": "303:6:93", "scope": 52275, "usedErrors": [] } ], - "license": "GPL-2.0-or-later" + "license": "MIT" }, "id": 93 -} \ No newline at end of file +} diff --git a/yarn-project/blockchain/src/abis/bridges/IVault.sol/IVault.json b/yarn-project/blockchain/src/abis/bridges/IVault.sol/IVault.json index 73350aabc..b83de73a9 100644 --- a/yarn-project/blockchain/src/abis/bridges/IVault.sol/IVault.json +++ b/yarn-project/blockchain/src/abis/bridges/IVault.sol/IVault.json @@ -241,7 +241,7 @@ "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool))": "f84d066e", "swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)": "52bbbe29" }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"}],\"name\":\"getPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"enum PoolSpecialization\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"}],\"name\":\"getPoolTokens\",\"outputs\":[{\"internalType\":\"contract IERC20[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"balances\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"lastChangeBlock\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IVault.SwapKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"assetInIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"assetOutIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"userData\",\"type\":\"bytes\"}],\"internalType\":\"struct IVault.BatchSwapStep[]\",\"name\":\"swaps\",\"type\":\"tuple[]\"},{\"internalType\":\"contract IAsset[]\",\"name\":\"assets\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"fromInternalBalance\",\"type\":\"bool\"},{\"internalType\":\"address payable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"toInternalBalance\",\"type\":\"bool\"}],\"internalType\":\"struct IVault.FundManagement\",\"name\":\"funds\",\"type\":\"tuple\"}],\"name\":\"queryBatchSwap\",\"outputs\":[{\"internalType\":\"int256[]\",\"name\":\"assetDeltas\",\"type\":\"int256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"enum IVault.SwapKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"internalType\":\"contract IAsset\",\"name\":\"assetIn\",\"type\":\"address\"},{\"internalType\":\"contract IAsset\",\"name\":\"assetOut\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"userData\",\"type\":\"bytes\"}],\"internalType\":\"struct IVault.SingleSwap\",\"name\":\"singleSwap\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"fromInternalBalance\",\"type\":\"bool\"},{\"internalType\":\"address payable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"toInternalBalance\",\"type\":\"bool\"}],\"internalType\":\"struct IVault.FundManagement\",\"name\":\"funds\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"limit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getPoolTokens(bytes32)\":{\"details\":\"Returns a Pool's registered tokens, the total balance for each, and the latest block when *any* of the tokens' `balances` changed. The order of the `tokens` array is the same order that will be used in `joinPool`, `exitPool`, as well as in all Pool hooks (where applicable). Calls to `registerTokens` and `deregisterTokens` may change this order. If a Pool only registers tokens once, and these are sorted in ascending order, they will be stored in the same order as passed to `registerTokens`. Total balances include both tokens held by the Vault and those withdrawn by the Pool's Asset Managers. These are the amounts used by joins, exits and swaps. For a detailed breakdown of token balances, use `getPoolTokenInfo` instead.\"},\"swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)\":{\"details\":\"Performs a swap with a single Pool. If the swap is 'given in' (the number of tokens to send to the Pool is known), it returns the amount of tokens taken from the Pool, which must be greater than or equal to `limit`. If the swap is 'given out' (the number of tokens to take from the Pool is known), it returns the amount of tokens sent to the Pool, which must be less than or equal to `limit`. Internal Balance usage and the recipient are determined by the `funds` struct. Emits a `Swap` event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/element/IVault.sol\":\"IVault\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"src/interfaces/element/IVault.sol\":{\"keccak256\":\"0xb4f96ad12823ffa83e16fbae73900b1bf69c04bd7c84d138f846f85ac0efee8c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3\",\"dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"}],\"name\":\"getPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"enum PoolSpecialization\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"}],\"name\":\"getPoolTokens\",\"outputs\":[{\"internalType\":\"contract IERC20[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"balances\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"lastChangeBlock\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IVault.SwapKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"assetInIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"assetOutIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"userData\",\"type\":\"bytes\"}],\"internalType\":\"struct IVault.BatchSwapStep[]\",\"name\":\"swaps\",\"type\":\"tuple[]\"},{\"internalType\":\"contract IAsset[]\",\"name\":\"assets\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"fromInternalBalance\",\"type\":\"bool\"},{\"internalType\":\"address payable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"toInternalBalance\",\"type\":\"bool\"}],\"internalType\":\"struct IVault.FundManagement\",\"name\":\"funds\",\"type\":\"tuple\"}],\"name\":\"queryBatchSwap\",\"outputs\":[{\"internalType\":\"int256[]\",\"name\":\"assetDeltas\",\"type\":\"int256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"enum IVault.SwapKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"internalType\":\"contract IAsset\",\"name\":\"assetIn\",\"type\":\"address\"},{\"internalType\":\"contract IAsset\",\"name\":\"assetOut\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"userData\",\"type\":\"bytes\"}],\"internalType\":\"struct IVault.SingleSwap\",\"name\":\"singleSwap\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"fromInternalBalance\",\"type\":\"bool\"},{\"internalType\":\"address payable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"toInternalBalance\",\"type\":\"bool\"}],\"internalType\":\"struct IVault.FundManagement\",\"name\":\"funds\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"limit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getPoolTokens(bytes32)\":{\"details\":\"Returns a Pool's registered tokens, the total balance for each, and the latest block when *any* of the tokens' `balances` changed. The order of the `tokens` array is the same order that will be used in `joinPool`, `exitPool`, as well as in all Pool hooks (where applicable). Calls to `registerTokens` and `deregisterTokens` may change this order. If a Pool only registers tokens once, and these are sorted in ascending order, they will be stored in the same order as passed to `registerTokens`. Total balances include both tokens held by the Vault and those withdrawn by the Pool's Asset Managers. These are the amounts used by joins, exits and swaps. For a detailed breakdown of token balances, use `getPoolTokenInfo` instead.\"},\"swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)\":{\"details\":\"Performs a swap with a single Pool. If the swap is 'given in' (the number of tokens to send to the Pool is known), it returns the amount of tokens taken from the Pool, which must be greater than or equal to `limit`. If the swap is 'given out' (the number of tokens to take from the Pool is known), it returns the amount of tokens sent to the Pool, which must be less than or equal to `limit`. Internal Balance usage and the recipient are determined by the `funds` struct. Emits a `Swap` event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/element/IVault.sol\":\"IVault\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"src/interfaces/element/IVault.sol\":{\"keccak256\":\"0xb4f96ad12823ffa83e16fbae73900b1bf69c04bd7c84d138f846f85ac0efee8c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3\",\"dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.10+commit.fc410830" @@ -528,7 +528,7 @@ "bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3", "dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7" ], - "license": "GPL-2.0-or-later" + "license": "MIT" } }, "version": 1 @@ -537,18 +537,10 @@ "absolutePath": "src/interfaces/element/IVault.sol", "id": 52275, "exportedSymbols": { - "IAsset": [ - 52169 - ], - "IERC20": [ - 25396 - ], - "IVault": [ - 52274 - ], - "PoolSpecialization": [ - 52173 - ] + "IAsset": [52169], + "IERC20": [25396], + "IVault": [52274], + "PoolSpecialization": [52173] }, "nodeType": "SourceUnit", "src": "45:5468:93", @@ -558,12 +550,7 @@ "nodeType": "PragmaDirective", "src": "45:24:93", "nodes": [], - "literals": [ - "solidity", - ">=", - "0.8", - ".4" - ] + "literals": ["solidity", ">=", "0.8", ".4"] }, { "id": 52168, @@ -601,9 +588,7 @@ "contractDependencies": [], "contractKind": "interface", "fullyImplemented": true, - "linearizedBaseContracts": [ - 52169 - ], + "linearizedBaseContracts": [52169], "name": "IAsset", "nameLocation": "153:6:93", "scope": 52275, @@ -1838,16 +1823,14 @@ "contractDependencies": [], "contractKind": "interface", "fullyImplemented": false, - "linearizedBaseContracts": [ - 52274 - ], + "linearizedBaseContracts": [52274], "name": "IVault", "nameLocation": "303:6:93", "scope": 52275, "usedErrors": [] } ], - "license": "GPL-2.0-or-later" + "license": "MIT" }, "id": 93 -} \ No newline at end of file +} diff --git a/yarn-project/blockchain/src/abis/bridges/IWstETH.sol/IWstETH.json b/yarn-project/blockchain/src/abis/bridges/IWstETH.sol/IWstETH.json index 829dd590e..86bc7c93b 100644 --- a/yarn-project/blockchain/src/abis/bridges/IWstETH.sol/IWstETH.json +++ b/yarn-project/blockchain/src/abis/bridges/IWstETH.sol/IWstETH.json @@ -282,7 +282,7 @@ "unwrap(uint256)": "de0e9a3e", "wrap(uint256)": "ea598cb0" }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_wstETHAmount\",\"type\":\"uint256\"}],\"name\":\"getStETHByWstETH\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_stETHAmount\",\"type\":\"uint256\"}],\"name\":\"getWstETHByStETH\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_wstETHAmount\",\"type\":\"uint256\"}],\"name\":\"unwrap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_stETHAmount\",\"type\":\"uint256\"}],\"name\":\"wrap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"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.\"},\"approve(address,uint256)\":{\"details\":\"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.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `from` to `to` 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.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/lido/IWstETH.sol\":\"IWstETH\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"src/interfaces/lido/IWstETH.sol\":{\"keccak256\":\"0x431ee9675fd4634cb56e32bfa8736b5a565f58b5ccf224270d4afa8aa86cbe02\",\"license\":\"GPLv2\",\"urls\":[\"bzz-raw://bc3231cc6592b76881ab137c535b79eeec5fe47349c2cbb5e78312432fb5b48e\",\"dweb:/ipfs/QmfMEbn8hixxzxBLocgpqVQgg9hvbweyWhazWkVpaSAxYL\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_wstETHAmount\",\"type\":\"uint256\"}],\"name\":\"getStETHByWstETH\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_stETHAmount\",\"type\":\"uint256\"}],\"name\":\"getWstETHByStETH\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_wstETHAmount\",\"type\":\"uint256\"}],\"name\":\"unwrap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_stETHAmount\",\"type\":\"uint256\"}],\"name\":\"wrap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"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.\"},\"approve(address,uint256)\":{\"details\":\"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.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `from` to `to` 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.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/lido/IWstETH.sol\":\"IWstETH\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"src/interfaces/lido/IWstETH.sol\":{\"keccak256\":\"0x431ee9675fd4634cb56e32bfa8736b5a565f58b5ccf224270d4afa8aa86cbe02\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc3231cc6592b76881ab137c535b79eeec5fe47349c2cbb5e78312432fb5b48e\",\"dweb:/ipfs/QmfMEbn8hixxzxBLocgpqVQgg9hvbweyWhazWkVpaSAxYL\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.10+commit.fc410830" @@ -616,7 +616,7 @@ "bzz-raw://bc3231cc6592b76881ab137c535b79eeec5fe47349c2cbb5e78312432fb5b48e", "dweb:/ipfs/QmfMEbn8hixxzxBLocgpqVQgg9hvbweyWhazWkVpaSAxYL" ], - "license": "GPLv2" + "license": "MIT" } }, "version": 1 @@ -625,12 +625,8 @@ "absolutePath": "src/interfaces/lido/IWstETH.sol", "id": 52442, "exportedSymbols": { - "IERC20": [ - 25396 - ], - "IWstETH": [ - 52441 - ] + "IERC20": [25396], + "IWstETH": [52441] }, "nodeType": "SourceUnit", "src": "34:443:97", @@ -640,12 +636,7 @@ "nodeType": "PragmaDirective", "src": "34:24:97", "nodes": [], - "literals": [ - "solidity", - ">=", - "0.8", - ".4" - ] + "literals": ["solidity", ">=", "0.8", ".4"] }, { "id": 52410, @@ -1033,17 +1024,14 @@ "contractDependencies": [], "contractKind": "interface", "fullyImplemented": false, - "linearizedBaseContracts": [ - 52441, - 25396 - ], + "linearizedBaseContracts": [52441, 25396], "name": "IWstETH", "nameLocation": "142:7:97", "scope": 52442, "usedErrors": [] } ], - "license": "GPLv2" + "license": "MIT" }, "id": 97 -} \ No newline at end of file +} diff --git a/yarn-project/blockchain/src/abis/bridges/LidoBridge.sol/LidoBridge.json b/yarn-project/blockchain/src/abis/bridges/LidoBridge.sol/LidoBridge.json index 0a47fcc5c..e61b7b6c5 100644 --- a/yarn-project/blockchain/src/abis/bridges/LidoBridge.sol/LidoBridge.json +++ b/yarn-project/blockchain/src/abis/bridges/LidoBridge.sol/LidoBridge.json @@ -547,7 +547,7 @@ "convert((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint256,uint64,address)": "26c3b515", "finalise((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint64)": "9b07d342" }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_rollupProcessor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_referral\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AsyncDisabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConfiguration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInputA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidOutputA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidUnwrapReturnValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidWrapReturnValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MissingImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CURVE_POOL\",\"outputs\":[{\"internalType\":\"contract ICurvePool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LIDO\",\"outputs\":[{\"internalType\":\"contract ILido\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REFERRAL\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ROLLUP_PROCESSOR\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSIDY\",\"outputs\":[{\"internalType\":\"contract ISubsidy\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WRAPPED_STETH\",\"outputs\":[{\"internalType\":\"contract IWstETH\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"computeCriteria\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"_inputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"_outputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"_totalInputValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_interactionNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"convert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"outputValueA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isAsync\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"finalise\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"details\":\"Should be overridden by bridge implementation if intended to limit subsidy.\",\"returns\":{\"_0\":\"The criteria to be passed along\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"notice\":\"Computes the criteria that is passed on to the subsidy contract when claiming\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridges/lido/LidoBridge.sol\":\"LidoBridge\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0x35e258421ae206f3db37281cea70871b4c3553914734aa76139a41af60ac1abb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2ef94b6bc4ee356db612a1849c615f7dd4b15542d6c8584c86bb9243a7913cf0\",\"dweb:/ipfs/QmaxFj5NFpAjjitZtHPNS9PPtCuBATaRz9ktDDRCQCQ83y\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0xb0fafd1e5a5e316405d08b8390bdf4716c7644cc2c8e89ce41050316f28f92a3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8c194429bb8dd25539faa90982240db467042daf2487b17debc908cfd98f069a\",\"dweb:/ipfs/QmYdFwzgxG9C1iyGsDFZCLNG4LBKSL9b8osCP1RLtYnpvm\"]},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"keccak256\":\"0x68404b57d114b893554b0e54334b32f578f5d1abf61830025c83fb71dc1944ce\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d3d0a94b3c8afd92c2a9f03f3325e9ac22cec56e995b94ff212670ff3653f0d3\",\"dweb:/ipfs/QmPqKWUysbo8QqKcqH5Lp7SQiL1LfjeoGCSa7iFWmAP8Mw\"]},\"lib/rollup-encoder/src/interfaces/IRollupProcessor.sol\":{\"keccak256\":\"0x7f8cc09c537d9c9b80b5e90c1ebe02d2fbb4efd5510bbe3a4df57940e368a71d\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8d0e59e15799702bbdf118c00851ae154e01b329c625dc6f3097b0cd072770ef\",\"dweb:/ipfs/QmPsPp6Drzym9RAai34jMJbnuftV3XkDnDp35RX94hWh2u\"]},\"lib/rollup-encoder/src/libraries/AztecTypes.sol\":{\"keccak256\":\"0xa11ad1ad795337be7761108304a21812aeedfac4b03969ee5f71a251e226cc77\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://5f6ea5409dcbe6c61d1c7a7153a4158bc88db92eae2c5c1041809b19c49c3ea7\",\"dweb:/ipfs/QmY7d8839N7SNyR5eGvFi6C6opNW3GW5oZEhTVKEWFvv56\"]},\"src/aztec/interfaces/IDefiBridge.sol\":{\"keccak256\":\"0xf2e1d1e8dc5326f1fe8b4a909541d459546f44fb7e1013b9f9be3bc8aac379d4\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b24142083ad22a38a2d7e5190d05ed286964f0bedbe83bb0ae4c1366521ee5ec\",\"dweb:/ipfs/QmPbfmHjYq4rqpFwVb75mNxDVdRBoRNWu6neGMdLJibDts\"]},\"src/aztec/interfaces/ISubsidy.sol\":{\"keccak256\":\"0x03afbff2b5181d4fc39190a2bb7ad0a60b6a4ae44527d77509c23299b4a3c668\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8a6f880e61c2a097e8f49409b5db5db42aa727d3256625cf8f4b409423923bea\",\"dweb:/ipfs/QmRkpCEkEHUpP9RWGANyQNPPmDUfht15uSiFKeSNWYmr8C\"]},\"src/bridges/base/BridgeBase.sol\":{\"keccak256\":\"0x7ff16906ae0c58fc9ef08096db9c006887875e371ee45440c535dcae4649b75c\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://778cde55152d439e4e05393af4e54eb6ece56572f7e7ccf7f7eabac20159e525\",\"dweb:/ipfs/QmcGY9MGzBr4MaEQNa76hcKKabkLE2hYDxNRgwEEuCeLW2\"]},\"src/bridges/base/ErrorLib.sol\":{\"keccak256\":\"0x0d5ada9c43f52812ff2c60014543fc21684e48610bbe6c4bd77cfdb0186876c9\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://ee4e31e01128c5b683806908876f3e73f0df9fd4c145f426054aad1dbd829cce\",\"dweb:/ipfs/QmQiLtbCuNCe1r1jcAL1cVtTwouXbGETyk1abtTFBDwxZV\"]},\"src/bridges/lido/LidoBridge.sol\":{\"keccak256\":\"0x057084f7b196df9b7a60bda6babce54eea13f4bc1d125cdff55ace9e3fb9fdf8\",\"license\":\"GPLv2\",\"urls\":[\"bzz-raw://4da1f1362202d1b05ac92472da438700679c4a0b7093df8b06d508043c4c4c33\",\"dweb:/ipfs/QmTKPTFQsY7ksEUu8vi6K4ByGNhJqL48xAYMq74QmBWdJy\"]},\"src/interfaces/curve/ICurvePool.sol\":{\"keccak256\":\"0xd0383f0c1d3ac1ac5e765290d82e0669379d6a2c62c720361f70eb55626df361\",\"license\":\"GPLv2\",\"urls\":[\"bzz-raw://4c76cea836ff2f0aadb84f764a9d30dacef989f84a3184b3ca8676d8590750ad\",\"dweb:/ipfs/QmNTfV45RwGAwz3iSxCT99WqvRHWz52eu4NTHtgJ2rg9vZ\"]},\"src/interfaces/lido/ILido.sol\":{\"keccak256\":\"0xd195a22416bfc8630dbe6c66805c77712b47de4f1397268a24664c526eca48cd\",\"license\":\"GPLv2\",\"urls\":[\"bzz-raw://3edaef781a5a0555ba2f1e14e7dacabd21d1a4ab43026fe5a743b58a79ca39e1\",\"dweb:/ipfs/QmbatGGRnkn3r4ccFvZqUHSDKe3992LiqPiY9QVSmuz2SD\"]},\"src/interfaces/lido/IWstETH.sol\":{\"keccak256\":\"0x431ee9675fd4634cb56e32bfa8736b5a565f58b5ccf224270d4afa8aa86cbe02\",\"license\":\"GPLv2\",\"urls\":[\"bzz-raw://bc3231cc6592b76881ab137c535b79eeec5fe47349c2cbb5e78312432fb5b48e\",\"dweb:/ipfs/QmfMEbn8hixxzxBLocgpqVQgg9hvbweyWhazWkVpaSAxYL\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_rollupProcessor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_referral\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AsyncDisabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConfiguration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInputA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidOutputA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidUnwrapReturnValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidWrapReturnValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MissingImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CURVE_POOL\",\"outputs\":[{\"internalType\":\"contract ICurvePool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LIDO\",\"outputs\":[{\"internalType\":\"contract ILido\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REFERRAL\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ROLLUP_PROCESSOR\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSIDY\",\"outputs\":[{\"internalType\":\"contract ISubsidy\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WRAPPED_STETH\",\"outputs\":[{\"internalType\":\"contract IWstETH\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"computeCriteria\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"_inputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"_outputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"_totalInputValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_interactionNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"convert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"outputValueA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isAsync\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"finalise\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"details\":\"Should be overridden by bridge implementation if intended to limit subsidy.\",\"returns\":{\"_0\":\"The criteria to be passed along\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"notice\":\"Computes the criteria that is passed on to the subsidy contract when claiming\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridges/lido/LidoBridge.sol\":\"LidoBridge\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0x35e258421ae206f3db37281cea70871b4c3553914734aa76139a41af60ac1abb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2ef94b6bc4ee356db612a1849c615f7dd4b15542d6c8584c86bb9243a7913cf0\",\"dweb:/ipfs/QmaxFj5NFpAjjitZtHPNS9PPtCuBATaRz9ktDDRCQCQ83y\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0xb0fafd1e5a5e316405d08b8390bdf4716c7644cc2c8e89ce41050316f28f92a3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8c194429bb8dd25539faa90982240db467042daf2487b17debc908cfd98f069a\",\"dweb:/ipfs/QmYdFwzgxG9C1iyGsDFZCLNG4LBKSL9b8osCP1RLtYnpvm\"]},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"keccak256\":\"0x68404b57d114b893554b0e54334b32f578f5d1abf61830025c83fb71dc1944ce\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d3d0a94b3c8afd92c2a9f03f3325e9ac22cec56e995b94ff212670ff3653f0d3\",\"dweb:/ipfs/QmPqKWUysbo8QqKcqH5Lp7SQiL1LfjeoGCSa7iFWmAP8Mw\"]},\"lib/rollup-encoder/src/interfaces/IRollupProcessor.sol\":{\"keccak256\":\"0x7f8cc09c537d9c9b80b5e90c1ebe02d2fbb4efd5510bbe3a4df57940e368a71d\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8d0e59e15799702bbdf118c00851ae154e01b329c625dc6f3097b0cd072770ef\",\"dweb:/ipfs/QmPsPp6Drzym9RAai34jMJbnuftV3XkDnDp35RX94hWh2u\"]},\"lib/rollup-encoder/src/libraries/AztecTypes.sol\":{\"keccak256\":\"0xa11ad1ad795337be7761108304a21812aeedfac4b03969ee5f71a251e226cc77\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://5f6ea5409dcbe6c61d1c7a7153a4158bc88db92eae2c5c1041809b19c49c3ea7\",\"dweb:/ipfs/QmY7d8839N7SNyR5eGvFi6C6opNW3GW5oZEhTVKEWFvv56\"]},\"src/aztec/interfaces/IDefiBridge.sol\":{\"keccak256\":\"0xf2e1d1e8dc5326f1fe8b4a909541d459546f44fb7e1013b9f9be3bc8aac379d4\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b24142083ad22a38a2d7e5190d05ed286964f0bedbe83bb0ae4c1366521ee5ec\",\"dweb:/ipfs/QmPbfmHjYq4rqpFwVb75mNxDVdRBoRNWu6neGMdLJibDts\"]},\"src/aztec/interfaces/ISubsidy.sol\":{\"keccak256\":\"0x03afbff2b5181d4fc39190a2bb7ad0a60b6a4ae44527d77509c23299b4a3c668\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8a6f880e61c2a097e8f49409b5db5db42aa727d3256625cf8f4b409423923bea\",\"dweb:/ipfs/QmRkpCEkEHUpP9RWGANyQNPPmDUfht15uSiFKeSNWYmr8C\"]},\"src/bridges/base/BridgeBase.sol\":{\"keccak256\":\"0x7ff16906ae0c58fc9ef08096db9c006887875e371ee45440c535dcae4649b75c\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://778cde55152d439e4e05393af4e54eb6ece56572f7e7ccf7f7eabac20159e525\",\"dweb:/ipfs/QmcGY9MGzBr4MaEQNa76hcKKabkLE2hYDxNRgwEEuCeLW2\"]},\"src/bridges/base/ErrorLib.sol\":{\"keccak256\":\"0x0d5ada9c43f52812ff2c60014543fc21684e48610bbe6c4bd77cfdb0186876c9\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://ee4e31e01128c5b683806908876f3e73f0df9fd4c145f426054aad1dbd829cce\",\"dweb:/ipfs/QmQiLtbCuNCe1r1jcAL1cVtTwouXbGETyk1abtTFBDwxZV\"]},\"src/bridges/lido/LidoBridge.sol\":{\"keccak256\":\"0x057084f7b196df9b7a60bda6babce54eea13f4bc1d125cdff55ace9e3fb9fdf8\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4da1f1362202d1b05ac92472da438700679c4a0b7093df8b06d508043c4c4c33\",\"dweb:/ipfs/QmTKPTFQsY7ksEUu8vi6K4ByGNhJqL48xAYMq74QmBWdJy\"]},\"src/interfaces/curve/ICurvePool.sol\":{\"keccak256\":\"0xd0383f0c1d3ac1ac5e765290d82e0669379d6a2c62c720361f70eb55626df361\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4c76cea836ff2f0aadb84f764a9d30dacef989f84a3184b3ca8676d8590750ad\",\"dweb:/ipfs/QmNTfV45RwGAwz3iSxCT99WqvRHWz52eu4NTHtgJ2rg9vZ\"]},\"src/interfaces/lido/ILido.sol\":{\"keccak256\":\"0xd195a22416bfc8630dbe6c66805c77712b47de4f1397268a24664c526eca48cd\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3edaef781a5a0555ba2f1e14e7dacabd21d1a4ab43026fe5a743b58a79ca39e1\",\"dweb:/ipfs/QmbatGGRnkn3r4ccFvZqUHSDKe3992LiqPiY9QVSmuz2SD\"]},\"src/interfaces/lido/IWstETH.sol\":{\"keccak256\":\"0x431ee9675fd4634cb56e32bfa8736b5a565f58b5ccf224270d4afa8aa86cbe02\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc3231cc6592b76881ab137c535b79eeec5fe47349c2cbb5e78312432fb5b48e\",\"dweb:/ipfs/QmfMEbn8hixxzxBLocgpqVQgg9hvbweyWhazWkVpaSAxYL\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.10+commit.fc410830" @@ -1186,7 +1186,7 @@ "bzz-raw://4da1f1362202d1b05ac92472da438700679c4a0b7093df8b06d508043c4c4c33", "dweb:/ipfs/QmTKPTFQsY7ksEUu8vi6K4ByGNhJqL48xAYMq74QmBWdJy" ], - "license": "GPLv2" + "license": "MIT" }, "src/interfaces/curve/ICurvePool.sol": { "keccak256": "0xd0383f0c1d3ac1ac5e765290d82e0669379d6a2c62c720361f70eb55626df361", @@ -1194,7 +1194,7 @@ "bzz-raw://4c76cea836ff2f0aadb84f764a9d30dacef989f84a3184b3ca8676d8590750ad", "dweb:/ipfs/QmNTfV45RwGAwz3iSxCT99WqvRHWz52eu4NTHtgJ2rg9vZ" ], - "license": "GPLv2" + "license": "MIT" }, "src/interfaces/lido/ILido.sol": { "keccak256": "0xd195a22416bfc8630dbe6c66805c77712b47de4f1397268a24664c526eca48cd", @@ -1202,7 +1202,7 @@ "bzz-raw://3edaef781a5a0555ba2f1e14e7dacabd21d1a4ab43026fe5a743b58a79ca39e1", "dweb:/ipfs/QmbatGGRnkn3r4ccFvZqUHSDKe3992LiqPiY9QVSmuz2SD" ], - "license": "GPLv2" + "license": "MIT" }, "src/interfaces/lido/IWstETH.sol": { "keccak256": "0x431ee9675fd4634cb56e32bfa8736b5a565f58b5ccf224270d4afa8aa86cbe02", @@ -1210,7 +1210,7 @@ "bzz-raw://bc3231cc6592b76881ab137c535b79eeec5fe47349c2cbb5e78312432fb5b48e", "dweb:/ipfs/QmfMEbn8hixxzxBLocgpqVQgg9hvbweyWhazWkVpaSAxYL" ], - "license": "GPLv2" + "license": "MIT" } }, "version": 1 @@ -1219,36 +1219,16 @@ "absolutePath": "src/bridges/lido/LidoBridge.sol", "id": 39395, "exportedSymbols": { - "AztecTypes": [ - 29932 - ], - "BridgeBase": [ - 32640 - ], - "ErrorLib": [ - 32671 - ], - "ICurvePool": [ - 52005 - ], - "IERC20": [ - 25396 - ], - "ILido": [ - 52394 - ], - "IRollupProcessor": [ - 29897 - ], - "IWstETH": [ - 52441 - ], - "LidoBridge": [ - 39394 - ], - "SafeERC20": [ - 26423 - ] + "AztecTypes": [29932], + "BridgeBase": [32640], + "ErrorLib": [32671], + "ICurvePool": [52005], + "IERC20": [25396], + "ILido": [52394], + "IRollupProcessor": [29897], + "IWstETH": [52441], + "LidoBridge": [39394], + "SafeERC20": [26423] }, "nodeType": "SourceUnit", "src": "34:5111:52", @@ -1258,12 +1238,7 @@ "nodeType": "PragmaDirective", "src": "34:24:52", "nodes": [], - "literals": [ - "solidity", - ">=", - "0.8", - ".4" - ] + "literals": ["solidity", ">=", "0.8", ".4"] }, { "id": 39021, @@ -3018,9 +2993,7 @@ "nodes": [], "statements": [ { - "assignments": [ - 39194 - ], + "assignments": [39194], "declarations": [ { "constant": false, @@ -3142,9 +3115,7 @@ "src": "2420:73:52" }, { - "assignments": [ - 39203 - ], + "assignments": [39203], "declarations": [ { "constant": false, @@ -3768,9 +3739,7 @@ } ] }, - "baseFunctions": [ - 32583 - ], + "baseFunctions": [32583], "functionSelector": "26c3b515", "implemented": true, "kind": "function", @@ -4490,9 +4459,7 @@ "isLValue": false, "isPure": false, "lValueRequested": false, - "names": [ - "value" - ], + "names": ["value"], "nodeType": "FunctionCallOptions", "options": [ { @@ -4534,9 +4501,7 @@ "src": "3446:46:52" }, { - "assignments": [ - 39291 - ], + "assignments": [39291], "declarations": [ { "constant": false, @@ -5265,9 +5230,7 @@ } }, { - "assignments": [ - 39351 - ], + "assignments": [39351], "declarations": [ { "constant": false, @@ -5365,9 +5328,7 @@ "src": "4669:54:52" }, { - "assignments": [ - 39358 - ], + "assignments": [39358], "declarations": [ { "constant": false, @@ -5803,9 +5764,7 @@ "isLValue": false, "isPure": false, "lValueRequested": false, - "names": [ - "value" - ], + "names": ["value"], "nodeType": "FunctionCallOptions", "options": [ { @@ -6013,27 +5972,14 @@ "contractDependencies": [], "contractKind": "contract", "fullyImplemented": true, - "linearizedBaseContracts": [ - 39394, - 32640, - 31565 - ], + "linearizedBaseContracts": [39394, 32640, 31565], "name": "LidoBridge", "nameLocation": "652:10:52", "scope": 39395, - "usedErrors": [ - 32515, - 32644, - 32648, - 32652, - 32670, - 39049, - 39051, - 39053 - ] + "usedErrors": [32515, 32644, 32648, 32652, 32670, 39049, 39051, 39053] } ], - "license": "GPLv2" + "license": "MIT" }, "id": 52 -} \ No newline at end of file +} diff --git a/yarn-project/contracts-verifier-test/package.json b/yarn-project/contracts-verifier-test/package.json index 7da402001..838a80b73 100644 --- a/yarn-project/contracts-verifier-test/package.json +++ b/yarn-project/contracts-verifier-test/package.json @@ -1,7 +1,7 @@ { "name": "@aztec/contracts-verifier-test", "version": "2.0.0", - "license": "GPL-2.0-only", + "license": "MIT", "exports": "./dest/index.js", "type": "module", "scripts": { diff --git a/yarn-project/end-to-end/package.json b/yarn-project/end-to-end/package.json index bd61033cf..2aa1ea4b4 100644 --- a/yarn-project/end-to-end/package.json +++ b/yarn-project/end-to-end/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "main": "dest/index.js", - "license": "GPL-2.0", + "license": "MIT", "type": "module", "scripts": { "build": "run tsc -b tsconfig.dest.json", diff --git a/yarn-project/falafel/package.json b/yarn-project/falafel/package.json index 98e748828..547e9a9d6 100644 --- a/yarn-project/falafel/package.json +++ b/yarn-project/falafel/package.json @@ -2,7 +2,7 @@ "name": "falafel", "version": "1.0.0", "main": "dest/index.js", - "license": "GPL-2.0", + "license": "MIT", "type": "module", "scripts": { "version_hash": "node -p \"`export const VERSION_HASH = '${COMMIT_HASH:-}';`\" > src/package_version.ts", diff --git a/yarn-project/halloumi/package.json b/yarn-project/halloumi/package.json index 2cf0ad169..b604c1e2a 100644 --- a/yarn-project/halloumi/package.json +++ b/yarn-project/halloumi/package.json @@ -1,7 +1,7 @@ { "name": "@aztec/halloumi", "version": "1.0.0", - "license": "GPL-2.0", + "license": "MIT", "type": "module", "exports": { "./proof_generator": "./dest/proof_generator/index.js" diff --git a/yarn-project/hummus/package.json b/yarn-project/hummus/package.json index a3e86466b..a2ee82836 100644 --- a/yarn-project/hummus/package.json +++ b/yarn-project/hummus/package.json @@ -1,7 +1,7 @@ { "name": "hummus", "version": "1.0.1", - "license": "GPL-2.0", + "license": "MIT", "type": "module", "scripts": { "build": "yarn clean && webpack", diff --git a/yarn-project/nym-gateway/package.json b/yarn-project/nym-gateway/package.json index 45034f5de..500ff2800 100644 --- a/yarn-project/nym-gateway/package.json +++ b/yarn-project/nym-gateway/package.json @@ -2,7 +2,7 @@ "name": "nym-gateway", "version": "1.0.0", "main": "dest/index.js", - "license": "GPL-2.0", + "license": "MIT", "type": "module", "scripts": { "build": "rm -rf ./dest && tsc -b tsconfig.json", diff --git a/yarn-project/sdk/package.json b/yarn-project/sdk/package.json index 0e73171f7..2af1d3fbb 100644 --- a/yarn-project/sdk/package.json +++ b/yarn-project/sdk/package.json @@ -8,7 +8,7 @@ }, "homepage": "https://docs.aztec.network/sdk/overview", "author": "AZTEC", - "license": "GPL-2.0", + "license": "MIT", "type": "module", "scripts": { "version_hash": "node -p \"`export const VERSION_HASH = '${COMMIT_HASH:-}';`\" > src/package_version.ts", diff --git a/yarn-project/wallet/package.json b/yarn-project/wallet/package.json index e34a0bc85..b68057fe1 100644 --- a/yarn-project/wallet/package.json +++ b/yarn-project/wallet/package.json @@ -1,7 +1,7 @@ { "name": "wallet", "version": "1.0.0", - "license": "GPL-2.0", + "license": "MIT", "type": "module", "scripts": { "build": "yarn clean && webpack", diff --git a/yarn-project/wasabi/package.json b/yarn-project/wasabi/package.json index c9bb5f064..5fde842fc 100644 --- a/yarn-project/wasabi/package.json +++ b/yarn-project/wasabi/package.json @@ -2,7 +2,7 @@ "name": "wasabi", "version": "1.0.0", "main": "index.js", - "license": "GPL-2.0", + "license": "MIT", "type": "module", "scripts": { "build": "rm -rf ./dest && tsc -b tsconfig.dest.json", diff --git a/yarn-project/wasabi/src/clients/abis/bridges/ElementBridge.sol/ElementBridge.json b/yarn-project/wasabi/src/clients/abis/bridges/ElementBridge.sol/ElementBridge.json index 6b28f5bdb..8e0674c96 100644 --- a/yarn-project/wasabi/src/clients/abis/bridges/ElementBridge.sol/ElementBridge.json +++ b/yarn-project/wasabi/src/clients/abis/bridges/ElementBridge.sol/ElementBridge.json @@ -911,7 +911,7 @@ "pools(uint256)": "ac4afa38", "registerConvergentPoolAddress(address,address,uint64)": "05ff03ba" }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_rollupProcessor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_trancheFactory\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_trancheBytecodeHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_balancerVaultAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_elementDeploymentValidatorAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ALREADY_FINALISED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ASSET_IDS_NOT_EQUAL\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ASSET_NOT_ERC20\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BRIDGE_NOT_READY\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HEAP_EMPTY\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INPUT_ASSETB_NOT_UNUSED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INTERACTION_ALREADY_EXISTS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_CHANGE_IN_BALANCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_POOL\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_TOKEN_BALANCE_RECEIVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_TRANCHE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_WRAPPED_POSITION\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MissingImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OUTPUT_ASSETB_NOT_UNUSED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"POOL_EXPIRY_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"POOL_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"POOL_UNDERLYING_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RECEIVED_LESS_THAN_LIMIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_ALREADY_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_EXPIRY_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_POSITION_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_UNDERLYING_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UNREGISTERED_PAIR\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UNREGISTERED_POOL\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UNREGISTERED_POSITION\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAULT_ADDRESS_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAULT_ADDRESS_VERIFICATION_FAILED\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalInputValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int64\",\"name\":\"gasUsed\",\"type\":\"int64\"}],\"name\":\"LogConvert\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"int64\",\"name\":\"gasUsed\",\"type\":\"int64\"}],\"name\":\"LogFinalise\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"poolAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"wrappedPositionAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"LogPoolAdded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ROLLUP_PROCESSOR\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSIDY\",\"outputs\":[{\"internalType\":\"contract ISubsidy\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"assetToExpirys\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"computeCriteria\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"inputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"inputAssetB\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"outputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"outputAssetB\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"totalInputValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"interactionNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"auxData\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"convert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"outputValueA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outputValueB\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isAsync\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"outputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"interactionNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"finalise\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"outputValueA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outputValueB\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"interactionCompleted\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"getAssetExpiries\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"assetExpiries\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"interactionNonce\",\"type\":\"uint256\"}],\"name\":\"getTrancheDeploymentBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"hashAssetAndExpiry\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"hashValue\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"interactions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"quantityPT\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trancheAddress\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"finalised\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"failed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"pools\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"trancheAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"poolAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"wrappedPositionAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_convergentPool\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_wrappedPosition\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_expiry\",\"type\":\"uint64\"}],\"name\":\"registerConvergentPoolAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Smart contract responsible for depositing, managing and redeeming Defi interactions with the Element protocol\",\"kind\":\"dev\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"details\":\"Should be overridden by bridge implementation if intended to limit subsidy.\",\"returns\":{\"_0\":\"The criteria to be passed along\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_balancerVaultAddress\":\"the address of the balancer router contract\",\"_elementDeploymentValidatorAddress\":\"the address of the element deployment validator contract\",\"_rollupProcessor\":\"the address of the rollup contract\",\"_trancheBytecodeHash\":\"the hash of the bytecode of the tranche contract, used for tranche contract address derivation\",\"_trancheFactory\":\"the address of the element tranche factor contract\"}},\"convert((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint256,uint64,address)\":{\"details\":\"Function to add a new interaction to the bridge Converts the amount of input asset given to the market determined amount of tranche asset\",\"params\":{\"auxData\":\"The expiry value for this interaction\",\"inputAssetA\":\"The type of input asset for the new interaction\",\"interactionNonce\":\"The nonce value for this interaction\",\"outputAssetA\":\"The type of output asset for the new interaction\",\"totalInputValue\":\"The amount the the input asset provided in this interaction\"},\"returns\":{\"isAsync\":\"Flag specifying if this interaction is asynchronous - will be true\",\"outputValueA\":\"The interaction's first ouptut value after this call - will be 0\",\"outputValueB\":\"The interaction's second ouptut value after this call - will be 0\"}},\"finalise((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint64)\":{\"details\":\"Function to finalise an interaction Converts the held amount of tranche asset for the given interaction into the output asset\",\"params\":{\"interactionNonce\":\"The nonce value for the interaction that should be finalised\"}},\"getAssetExpiries(address)\":{\"details\":\"Function for retrieving the available expiries for the given asset\",\"params\":{\"asset\":\"the asset address being queried\"},\"returns\":{\"assetExpiries\":\"the list of available expiries for the provided asset address\"}},\"getTrancheDeploymentBlockNumber(uint256)\":{\"details\":\"Returns the block number in which a tranche was first configured on the bridge based on the nonce of an interaction in that tranche\",\"params\":{\"interactionNonce\":\"the nonce of the interaction to query\"},\"returns\":{\"blockNumber\":\"the number of the block in which the tranche was first configured\"}},\"hashAssetAndExpiry(address,uint64)\":{\"details\":\"Produces a hash of the given asset and expiry value\",\"params\":{\"asset\":\"The asset address\",\"expiry\":\"The expiry value\"},\"returns\":{\"hashValue\":\"The resulting hash value\"}},\"registerConvergentPoolAddress(address,address,uint64)\":{\"details\":\"Registers a convergent pool with the contract, setting up a new asset/expiry element tranche\",\"params\":{\"_convergentPool\":\"The pool's address\",\"_expiry\":\"The expiry of the tranche being configured\",\"_wrappedPosition\":\"The element wrapped position contract's address\"}}},\"title\":\"Element Bridge\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"notice\":\"Computes the criteria that is passed on to the subsidy contract when claiming\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridges/element/ElementBridge.sol\":\"ElementBridge\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0x35e258421ae206f3db37281cea70871b4c3553914734aa76139a41af60ac1abb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2ef94b6bc4ee356db612a1849c615f7dd4b15542d6c8584c86bb9243a7913cf0\",\"dweb:/ipfs/QmaxFj5NFpAjjitZtHPNS9PPtCuBATaRz9ktDDRCQCQ83y\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"keccak256\":\"0x6a8df18a4cf9ddce45d0b6609e90ad81c948475b1178ab40c35ea79bfd99a319\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b99013f9788f6de8a4208e0190e1132c102ef83f79215825e2f4dfa8fc01738d\",\"dweb:/ipfs/QmT25dXiwuszQYgbHFxJshdupZXTj2LtFCAaQqxPQwpyWC\"]},\"lib/rollup-encoder/src/interfaces/IRollupProcessor.sol\":{\"keccak256\":\"0x7f8cc09c537d9c9b80b5e90c1ebe02d2fbb4efd5510bbe3a4df57940e368a71d\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8d0e59e15799702bbdf118c00851ae154e01b329c625dc6f3097b0cd072770ef\",\"dweb:/ipfs/QmPsPp6Drzym9RAai34jMJbnuftV3XkDnDp35RX94hWh2u\"]},\"lib/rollup-encoder/src/libraries/AztecTypes.sol\":{\"keccak256\":\"0xa11ad1ad795337be7761108304a21812aeedfac4b03969ee5f71a251e226cc77\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://5f6ea5409dcbe6c61d1c7a7153a4158bc88db92eae2c5c1041809b19c49c3ea7\",\"dweb:/ipfs/QmY7d8839N7SNyR5eGvFi6C6opNW3GW5oZEhTVKEWFvv56\"]},\"src/aztec/interfaces/IDefiBridge.sol\":{\"keccak256\":\"0xf2e1d1e8dc5326f1fe8b4a909541d459546f44fb7e1013b9f9be3bc8aac379d4\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b24142083ad22a38a2d7e5190d05ed286964f0bedbe83bb0ae4c1366521ee5ec\",\"dweb:/ipfs/QmPbfmHjYq4rqpFwVb75mNxDVdRBoRNWu6neGMdLJibDts\"]},\"src/aztec/interfaces/ISubsidy.sol\":{\"keccak256\":\"0x03afbff2b5181d4fc39190a2bb7ad0a60b6a4ae44527d77509c23299b4a3c668\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8a6f880e61c2a097e8f49409b5db5db42aa727d3256625cf8f4b409423923bea\",\"dweb:/ipfs/QmRkpCEkEHUpP9RWGANyQNPPmDUfht15uSiFKeSNWYmr8C\"]},\"src/bridges/base/BridgeBase.sol\":{\"keccak256\":\"0x7ff16906ae0c58fc9ef08096db9c006887875e371ee45440c535dcae4649b75c\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://778cde55152d439e4e05393af4e54eb6ece56572f7e7ccf7f7eabac20159e525\",\"dweb:/ipfs/QmcGY9MGzBr4MaEQNa76hcKKabkLE2hYDxNRgwEEuCeLW2\"]},\"src/bridges/base/ErrorLib.sol\":{\"keccak256\":\"0x0d5ada9c43f52812ff2c60014543fc21684e48610bbe6c4bd77cfdb0186876c9\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://ee4e31e01128c5b683806908876f3e73f0df9fd4c145f426054aad1dbd829cce\",\"dweb:/ipfs/QmQiLtbCuNCe1r1jcAL1cVtTwouXbGETyk1abtTFBDwxZV\"]},\"src/bridges/element/ElementBridge.sol\":{\"keccak256\":\"0x023ed8a50af5e41c3f83642999f1d262d8e0b455f07197a9bf3ef614cbb4193b\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://9369ec5db2aea201bf2f3fd47e9b65c725b51943bcde79ae0535c48f4edf6393\",\"dweb:/ipfs/QmcDveHPiKbV3NJrSTmVdixiAeXLMVw3F37PTvSpRYcu1F\"]},\"src/bridges/element/MinHeap.sol\":{\"keccak256\":\"0x64c7dec82bc1204edffeecd7be082e2b0f15693ac3e06ad282fbdc680efb6d79\",\"urls\":[\"bzz-raw://976d0893256b6cacb69119a4043ae9a7108da748825293a14d77aa52b4483aeb\",\"dweb:/ipfs/QmPSKv8W4DnkbRFNi8yDc6xCYuKLspNaYWdwGqHiuicFDm\"]},\"src/interfaces/element/IDeploymentValidator.sol\":{\"keccak256\":\"0x311aac8f48d197f004dda93cb8fd562f8fca4b6e83f89b30a18e3573130b79c0\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://822e6566b1fdf3659f36f6751353154539416586a67de134ee6e218b5384d962\",\"dweb:/ipfs/QmTWXGuxT3A6dromfoydYEejw4Tidbpp3jyfnUUy6xkvBi\"]},\"src/interfaces/element/IPool.sol\":{\"keccak256\":\"0x8a419a61cf8ee1479f3878d0e296a8fd50ba215b4bf1b8c59a95543433067360\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://66fffc42767e8744414081909afb12eb97c73cd568ae8131cacec1bdf20cbfc7\",\"dweb:/ipfs/Qmd347Z8NhvJpfpgZfsEvkSsDdoot2ANJxDTXV66pF9Xyy\"]},\"src/interfaces/element/ITranche.sol\":{\"keccak256\":\"0xa3da5087be04e99feeecfd9b5065fbfdc53655ac9b8dee0840008c5db92ea62a\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://363c64f44f8db15f48cd1ad1eb12ecdc8b0db2fd7df6638c8c6c532a5ae10801\",\"dweb:/ipfs/QmNS6v9GcwuTfEX6j2xW8Byzb9PBpMVKYDP9SThsGKM8hU\"]},\"src/interfaces/element/IVault.sol\":{\"keccak256\":\"0xb4f96ad12823ffa83e16fbae73900b1bf69c04bd7c84d138f846f85ac0efee8c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3\",\"dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7\"]},\"src/interfaces/element/IWrappedPosition.sol\":{\"keccak256\":\"0xc7baf2ad568f17ded94778da98a27e8eccdeb7067df9a38e7955f46f6f05474e\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://2d5c0dacfe512e93e8b777e34a10b5701d74c1dc6f3bd69b3b73492da0cafade\",\"dweb:/ipfs/Qmc9bdaPYKS9wz7gNQjYQUKBfAoWV7DxY49deVc9maGciY\"]},\"src/libraries/uniswapv3/FullMath.sol\":{\"keccak256\":\"0x6b147dd51ad698298604a81403071c439ec739b40fc4a6ec965520ad4115a1da\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://82a2d96cd8d781b588978b9b09db64e40a3037e330a11cc09395c59fcac4c0f8\",\"dweb:/ipfs/QmRPSEp12gPLkMmZ41fEnUoWdezgqPtzz7qTUXqMBrxxNG\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_rollupProcessor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_trancheFactory\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_trancheBytecodeHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_balancerVaultAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_elementDeploymentValidatorAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ALREADY_FINALISED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ASSET_IDS_NOT_EQUAL\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ASSET_NOT_ERC20\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BRIDGE_NOT_READY\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HEAP_EMPTY\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INPUT_ASSETB_NOT_UNUSED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INTERACTION_ALREADY_EXISTS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_CHANGE_IN_BALANCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_POOL\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_TOKEN_BALANCE_RECEIVED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_TRANCHE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_WRAPPED_POSITION\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MissingImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OUTPUT_ASSETB_NOT_UNUSED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"POOL_EXPIRY_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"POOL_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"POOL_UNDERLYING_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RECEIVED_LESS_THAN_LIMIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_ALREADY_EXPIRED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_EXPIRY_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_POSITION_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TRANCHE_UNDERLYING_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UNREGISTERED_PAIR\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UNREGISTERED_POOL\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UNREGISTERED_POSITION\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAULT_ADDRESS_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAULT_ADDRESS_VERIFICATION_FAILED\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalInputValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int64\",\"name\":\"gasUsed\",\"type\":\"int64\"}],\"name\":\"LogConvert\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"int64\",\"name\":\"gasUsed\",\"type\":\"int64\"}],\"name\":\"LogFinalise\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"poolAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"wrappedPositionAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"LogPoolAdded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ROLLUP_PROCESSOR\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSIDY\",\"outputs\":[{\"internalType\":\"contract ISubsidy\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"assetToExpirys\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"computeCriteria\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"inputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"inputAssetB\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"outputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"outputAssetB\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"totalInputValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"interactionNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"auxData\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"convert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"outputValueA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outputValueB\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isAsync\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"outputAssetA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"erc20Address\",\"type\":\"address\"},{\"internalType\":\"enum AztecTypes.AztecAssetType\",\"name\":\"assetType\",\"type\":\"uint8\"}],\"internalType\":\"struct AztecTypes.AztecAsset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"interactionNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"finalise\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"outputValueA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"outputValueB\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"interactionCompleted\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"getAssetExpiries\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"assetExpiries\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"interactionNonce\",\"type\":\"uint256\"}],\"name\":\"getTrancheDeploymentBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"hashAssetAndExpiry\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"hashValue\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"interactions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"quantityPT\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trancheAddress\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"finalised\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"failed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"pools\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"trancheAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"poolAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"wrappedPositionAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_convergentPool\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_wrappedPosition\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_expiry\",\"type\":\"uint64\"}],\"name\":\"registerConvergentPoolAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Smart contract responsible for depositing, managing and redeeming Defi interactions with the Element protocol\",\"kind\":\"dev\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"details\":\"Should be overridden by bridge implementation if intended to limit subsidy.\",\"returns\":{\"_0\":\"The criteria to be passed along\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_balancerVaultAddress\":\"the address of the balancer router contract\",\"_elementDeploymentValidatorAddress\":\"the address of the element deployment validator contract\",\"_rollupProcessor\":\"the address of the rollup contract\",\"_trancheBytecodeHash\":\"the hash of the bytecode of the tranche contract, used for tranche contract address derivation\",\"_trancheFactory\":\"the address of the element tranche factor contract\"}},\"convert((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint256,uint64,address)\":{\"details\":\"Function to add a new interaction to the bridge Converts the amount of input asset given to the market determined amount of tranche asset\",\"params\":{\"auxData\":\"The expiry value for this interaction\",\"inputAssetA\":\"The type of input asset for the new interaction\",\"interactionNonce\":\"The nonce value for this interaction\",\"outputAssetA\":\"The type of output asset for the new interaction\",\"totalInputValue\":\"The amount the the input asset provided in this interaction\"},\"returns\":{\"isAsync\":\"Flag specifying if this interaction is asynchronous - will be true\",\"outputValueA\":\"The interaction's first ouptut value after this call - will be 0\",\"outputValueB\":\"The interaction's second ouptut value after this call - will be 0\"}},\"finalise((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint256,uint64)\":{\"details\":\"Function to finalise an interaction Converts the held amount of tranche asset for the given interaction into the output asset\",\"params\":{\"interactionNonce\":\"The nonce value for the interaction that should be finalised\"}},\"getAssetExpiries(address)\":{\"details\":\"Function for retrieving the available expiries for the given asset\",\"params\":{\"asset\":\"the asset address being queried\"},\"returns\":{\"assetExpiries\":\"the list of available expiries for the provided asset address\"}},\"getTrancheDeploymentBlockNumber(uint256)\":{\"details\":\"Returns the block number in which a tranche was first configured on the bridge based on the nonce of an interaction in that tranche\",\"params\":{\"interactionNonce\":\"the nonce of the interaction to query\"},\"returns\":{\"blockNumber\":\"the number of the block in which the tranche was first configured\"}},\"hashAssetAndExpiry(address,uint64)\":{\"details\":\"Produces a hash of the given asset and expiry value\",\"params\":{\"asset\":\"The asset address\",\"expiry\":\"The expiry value\"},\"returns\":{\"hashValue\":\"The resulting hash value\"}},\"registerConvergentPoolAddress(address,address,uint64)\":{\"details\":\"Registers a convergent pool with the contract, setting up a new asset/expiry element tranche\",\"params\":{\"_convergentPool\":\"The pool's address\",\"_expiry\":\"The expiry of the tranche being configured\",\"_wrappedPosition\":\"The element wrapped position contract's address\"}}},\"title\":\"Element Bridge\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"computeCriteria((uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),(uint256,address,uint8),uint64)\":{\"notice\":\"Computes the criteria that is passed on to the subsidy contract when claiming\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridges/element/ElementBridge.sol\":\"ElementBridge\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0x35e258421ae206f3db37281cea70871b4c3553914734aa76139a41af60ac1abb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2ef94b6bc4ee356db612a1849c615f7dd4b15542d6c8584c86bb9243a7913cf0\",\"dweb:/ipfs/QmaxFj5NFpAjjitZtHPNS9PPtCuBATaRz9ktDDRCQCQ83y\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"keccak256\":\"0x6a8df18a4cf9ddce45d0b6609e90ad81c948475b1178ab40c35ea79bfd99a319\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b99013f9788f6de8a4208e0190e1132c102ef83f79215825e2f4dfa8fc01738d\",\"dweb:/ipfs/QmT25dXiwuszQYgbHFxJshdupZXTj2LtFCAaQqxPQwpyWC\"]},\"lib/rollup-encoder/src/interfaces/IRollupProcessor.sol\":{\"keccak256\":\"0x7f8cc09c537d9c9b80b5e90c1ebe02d2fbb4efd5510bbe3a4df57940e368a71d\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8d0e59e15799702bbdf118c00851ae154e01b329c625dc6f3097b0cd072770ef\",\"dweb:/ipfs/QmPsPp6Drzym9RAai34jMJbnuftV3XkDnDp35RX94hWh2u\"]},\"lib/rollup-encoder/src/libraries/AztecTypes.sol\":{\"keccak256\":\"0xa11ad1ad795337be7761108304a21812aeedfac4b03969ee5f71a251e226cc77\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://5f6ea5409dcbe6c61d1c7a7153a4158bc88db92eae2c5c1041809b19c49c3ea7\",\"dweb:/ipfs/QmY7d8839N7SNyR5eGvFi6C6opNW3GW5oZEhTVKEWFvv56\"]},\"src/aztec/interfaces/IDefiBridge.sol\":{\"keccak256\":\"0xf2e1d1e8dc5326f1fe8b4a909541d459546f44fb7e1013b9f9be3bc8aac379d4\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b24142083ad22a38a2d7e5190d05ed286964f0bedbe83bb0ae4c1366521ee5ec\",\"dweb:/ipfs/QmPbfmHjYq4rqpFwVb75mNxDVdRBoRNWu6neGMdLJibDts\"]},\"src/aztec/interfaces/ISubsidy.sol\":{\"keccak256\":\"0x03afbff2b5181d4fc39190a2bb7ad0a60b6a4ae44527d77509c23299b4a3c668\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://8a6f880e61c2a097e8f49409b5db5db42aa727d3256625cf8f4b409423923bea\",\"dweb:/ipfs/QmRkpCEkEHUpP9RWGANyQNPPmDUfht15uSiFKeSNWYmr8C\"]},\"src/bridges/base/BridgeBase.sol\":{\"keccak256\":\"0x7ff16906ae0c58fc9ef08096db9c006887875e371ee45440c535dcae4649b75c\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://778cde55152d439e4e05393af4e54eb6ece56572f7e7ccf7f7eabac20159e525\",\"dweb:/ipfs/QmcGY9MGzBr4MaEQNa76hcKKabkLE2hYDxNRgwEEuCeLW2\"]},\"src/bridges/base/ErrorLib.sol\":{\"keccak256\":\"0x0d5ada9c43f52812ff2c60014543fc21684e48610bbe6c4bd77cfdb0186876c9\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://ee4e31e01128c5b683806908876f3e73f0df9fd4c145f426054aad1dbd829cce\",\"dweb:/ipfs/QmQiLtbCuNCe1r1jcAL1cVtTwouXbGETyk1abtTFBDwxZV\"]},\"src/bridges/element/ElementBridge.sol\":{\"keccak256\":\"0x023ed8a50af5e41c3f83642999f1d262d8e0b455f07197a9bf3ef614cbb4193b\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://9369ec5db2aea201bf2f3fd47e9b65c725b51943bcde79ae0535c48f4edf6393\",\"dweb:/ipfs/QmcDveHPiKbV3NJrSTmVdixiAeXLMVw3F37PTvSpRYcu1F\"]},\"src/bridges/element/MinHeap.sol\":{\"keccak256\":\"0x64c7dec82bc1204edffeecd7be082e2b0f15693ac3e06ad282fbdc680efb6d79\",\"urls\":[\"bzz-raw://976d0893256b6cacb69119a4043ae9a7108da748825293a14d77aa52b4483aeb\",\"dweb:/ipfs/QmPSKv8W4DnkbRFNi8yDc6xCYuKLspNaYWdwGqHiuicFDm\"]},\"src/interfaces/element/IDeploymentValidator.sol\":{\"keccak256\":\"0x311aac8f48d197f004dda93cb8fd562f8fca4b6e83f89b30a18e3573130b79c0\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://822e6566b1fdf3659f36f6751353154539416586a67de134ee6e218b5384d962\",\"dweb:/ipfs/QmTWXGuxT3A6dromfoydYEejw4Tidbpp3jyfnUUy6xkvBi\"]},\"src/interfaces/element/IPool.sol\":{\"keccak256\":\"0x8a419a61cf8ee1479f3878d0e296a8fd50ba215b4bf1b8c59a95543433067360\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://66fffc42767e8744414081909afb12eb97c73cd568ae8131cacec1bdf20cbfc7\",\"dweb:/ipfs/Qmd347Z8NhvJpfpgZfsEvkSsDdoot2ANJxDTXV66pF9Xyy\"]},\"src/interfaces/element/ITranche.sol\":{\"keccak256\":\"0xa3da5087be04e99feeecfd9b5065fbfdc53655ac9b8dee0840008c5db92ea62a\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://363c64f44f8db15f48cd1ad1eb12ecdc8b0db2fd7df6638c8c6c532a5ae10801\",\"dweb:/ipfs/QmNS6v9GcwuTfEX6j2xW8Byzb9PBpMVKYDP9SThsGKM8hU\"]},\"src/interfaces/element/IVault.sol\":{\"keccak256\":\"0xb4f96ad12823ffa83e16fbae73900b1bf69c04bd7c84d138f846f85ac0efee8c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3\",\"dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7\"]},\"src/interfaces/element/IWrappedPosition.sol\":{\"keccak256\":\"0xc7baf2ad568f17ded94778da98a27e8eccdeb7067df9a38e7955f46f6f05474e\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://2d5c0dacfe512e93e8b777e34a10b5701d74c1dc6f3bd69b3b73492da0cafade\",\"dweb:/ipfs/Qmc9bdaPYKS9wz7gNQjYQUKBfAoWV7DxY49deVc9maGciY\"]},\"src/libraries/uniswapv3/FullMath.sol\":{\"keccak256\":\"0x6b147dd51ad698298604a81403071c439ec739b40fc4a6ec965520ad4115a1da\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://82a2d96cd8d781b588978b9b09db64e40a3037e330a11cc09395c59fcac4c0f8\",\"dweb:/ipfs/QmRPSEp12gPLkMmZ41fEnUoWdezgqPtzz7qTUXqMBrxxNG\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.10+commit.fc410830" @@ -1958,7 +1958,7 @@ "bzz-raw://66fffc42767e8744414081909afb12eb97c73cd568ae8131cacec1bdf20cbfc7", "dweb:/ipfs/Qmd347Z8NhvJpfpgZfsEvkSsDdoot2ANJxDTXV66pF9Xyy" ], - "license": "GPL-2.0-or-later" + "license": "MIT" }, "src/interfaces/element/ITranche.sol": { "keccak256": "0xa3da5087be04e99feeecfd9b5065fbfdc53655ac9b8dee0840008c5db92ea62a", @@ -1974,7 +1974,7 @@ "bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3", "dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7" ], - "license": "GPL-2.0-or-later" + "license": "MIT" }, "src/interfaces/element/IWrappedPosition.sol": { "keccak256": "0xc7baf2ad568f17ded94778da98a27e8eccdeb7067df9a38e7955f46f6f05474e", diff --git a/yarn-project/wasabi/src/clients/abis/bridges/IVault.sol/IAsset.json b/yarn-project/wasabi/src/clients/abis/bridges/IVault.sol/IAsset.json index ccb5eeee4..da147f795 100644 --- a/yarn-project/wasabi/src/clients/abis/bridges/IVault.sol/IAsset.json +++ b/yarn-project/wasabi/src/clients/abis/bridges/IVault.sol/IAsset.json @@ -11,7 +11,7 @@ "linkReferences": {} }, "methodIdentifiers": {}, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/element/IVault.sol\":\"IAsset\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"src/interfaces/element/IVault.sol\":{\"keccak256\":\"0xb4f96ad12823ffa83e16fbae73900b1bf69c04bd7c84d138f846f85ac0efee8c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3\",\"dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/element/IVault.sol\":\"IAsset\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"src/interfaces/element/IVault.sol\":{\"keccak256\":\"0xb4f96ad12823ffa83e16fbae73900b1bf69c04bd7c84d138f846f85ac0efee8c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3\",\"dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.10+commit.fc410830" @@ -66,7 +66,7 @@ "bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3", "dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7" ], - "license": "GPL-2.0-or-later" + "license": "MIT" } }, "version": 1 @@ -1368,7 +1368,7 @@ "usedErrors": [] } ], - "license": "GPL-2.0-or-later" + "license": "MIT" }, "id": 93 } diff --git a/yarn-project/wasabi/src/clients/abis/bridges/IVault.sol/IVault.json b/yarn-project/wasabi/src/clients/abis/bridges/IVault.sol/IVault.json index a2f9e86df..b83de73a9 100644 --- a/yarn-project/wasabi/src/clients/abis/bridges/IVault.sol/IVault.json +++ b/yarn-project/wasabi/src/clients/abis/bridges/IVault.sol/IVault.json @@ -241,7 +241,7 @@ "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool))": "f84d066e", "swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)": "52bbbe29" }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"}],\"name\":\"getPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"enum PoolSpecialization\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"}],\"name\":\"getPoolTokens\",\"outputs\":[{\"internalType\":\"contract IERC20[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"balances\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"lastChangeBlock\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IVault.SwapKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"assetInIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"assetOutIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"userData\",\"type\":\"bytes\"}],\"internalType\":\"struct IVault.BatchSwapStep[]\",\"name\":\"swaps\",\"type\":\"tuple[]\"},{\"internalType\":\"contract IAsset[]\",\"name\":\"assets\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"fromInternalBalance\",\"type\":\"bool\"},{\"internalType\":\"address payable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"toInternalBalance\",\"type\":\"bool\"}],\"internalType\":\"struct IVault.FundManagement\",\"name\":\"funds\",\"type\":\"tuple\"}],\"name\":\"queryBatchSwap\",\"outputs\":[{\"internalType\":\"int256[]\",\"name\":\"assetDeltas\",\"type\":\"int256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"enum IVault.SwapKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"internalType\":\"contract IAsset\",\"name\":\"assetIn\",\"type\":\"address\"},{\"internalType\":\"contract IAsset\",\"name\":\"assetOut\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"userData\",\"type\":\"bytes\"}],\"internalType\":\"struct IVault.SingleSwap\",\"name\":\"singleSwap\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"fromInternalBalance\",\"type\":\"bool\"},{\"internalType\":\"address payable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"toInternalBalance\",\"type\":\"bool\"}],\"internalType\":\"struct IVault.FundManagement\",\"name\":\"funds\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"limit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getPoolTokens(bytes32)\":{\"details\":\"Returns a Pool's registered tokens, the total balance for each, and the latest block when *any* of the tokens' `balances` changed. The order of the `tokens` array is the same order that will be used in `joinPool`, `exitPool`, as well as in all Pool hooks (where applicable). Calls to `registerTokens` and `deregisterTokens` may change this order. If a Pool only registers tokens once, and these are sorted in ascending order, they will be stored in the same order as passed to `registerTokens`. Total balances include both tokens held by the Vault and those withdrawn by the Pool's Asset Managers. These are the amounts used by joins, exits and swaps. For a detailed breakdown of token balances, use `getPoolTokenInfo` instead.\"},\"swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)\":{\"details\":\"Performs a swap with a single Pool. If the swap is 'given in' (the number of tokens to send to the Pool is known), it returns the amount of tokens taken from the Pool, which must be greater than or equal to `limit`. If the swap is 'given out' (the number of tokens to take from the Pool is known), it returns the amount of tokens sent to the Pool, which must be less than or equal to `limit`. Internal Balance usage and the recipient are determined by the `funds` struct. Emits a `Swap` event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/element/IVault.sol\":\"IVault\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"src/interfaces/element/IVault.sol\":{\"keccak256\":\"0xb4f96ad12823ffa83e16fbae73900b1bf69c04bd7c84d138f846f85ac0efee8c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3\",\"dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"}],\"name\":\"getPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"enum PoolSpecialization\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"}],\"name\":\"getPoolTokens\",\"outputs\":[{\"internalType\":\"contract IERC20[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"balances\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"lastChangeBlock\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IVault.SwapKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"assetInIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"assetOutIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"userData\",\"type\":\"bytes\"}],\"internalType\":\"struct IVault.BatchSwapStep[]\",\"name\":\"swaps\",\"type\":\"tuple[]\"},{\"internalType\":\"contract IAsset[]\",\"name\":\"assets\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"fromInternalBalance\",\"type\":\"bool\"},{\"internalType\":\"address payable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"toInternalBalance\",\"type\":\"bool\"}],\"internalType\":\"struct IVault.FundManagement\",\"name\":\"funds\",\"type\":\"tuple\"}],\"name\":\"queryBatchSwap\",\"outputs\":[{\"internalType\":\"int256[]\",\"name\":\"assetDeltas\",\"type\":\"int256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"enum IVault.SwapKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"internalType\":\"contract IAsset\",\"name\":\"assetIn\",\"type\":\"address\"},{\"internalType\":\"contract IAsset\",\"name\":\"assetOut\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"userData\",\"type\":\"bytes\"}],\"internalType\":\"struct IVault.SingleSwap\",\"name\":\"singleSwap\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"fromInternalBalance\",\"type\":\"bool\"},{\"internalType\":\"address payable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"toInternalBalance\",\"type\":\"bool\"}],\"internalType\":\"struct IVault.FundManagement\",\"name\":\"funds\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"limit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getPoolTokens(bytes32)\":{\"details\":\"Returns a Pool's registered tokens, the total balance for each, and the latest block when *any* of the tokens' `balances` changed. The order of the `tokens` array is the same order that will be used in `joinPool`, `exitPool`, as well as in all Pool hooks (where applicable). Calls to `registerTokens` and `deregisterTokens` may change this order. If a Pool only registers tokens once, and these are sorted in ascending order, they will be stored in the same order as passed to `registerTokens`. Total balances include both tokens held by the Vault and those withdrawn by the Pool's Asset Managers. These are the amounts used by joins, exits and swaps. For a detailed breakdown of token balances, use `getPoolTokenInfo` instead.\"},\"swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)\":{\"details\":\"Performs a swap with a single Pool. If the swap is 'given in' (the number of tokens to send to the Pool is known), it returns the amount of tokens taken from the Pool, which must be greater than or equal to `limit`. If the swap is 'given out' (the number of tokens to take from the Pool is known), it returns the amount of tokens sent to the Pool, which must be less than or equal to `limit`. Internal Balance usage and the recipient are determined by the `funds` struct. Emits a `Swap` event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/element/IVault.sol\":\"IVault\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":rollup-encoder/=lib/rollup-encoder/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"src/interfaces/element/IVault.sol\":{\"keccak256\":\"0xb4f96ad12823ffa83e16fbae73900b1bf69c04bd7c84d138f846f85ac0efee8c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3\",\"dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.10+commit.fc410830" @@ -528,7 +528,7 @@ "bzz-raw://d8898e490b4323ae3fc9af035cbda4a4ff42c6ab40c2df7bc604fd0a427b8ab3", "dweb:/ipfs/QmNcrqKPYZj8TkaX6C9xpihU1XztRXtXU131zLPEb6h6T7" ], - "license": "GPL-2.0-or-later" + "license": "MIT" } }, "version": 1 @@ -1830,7 +1830,7 @@ "usedErrors": [] } ], - "license": "GPL-2.0-or-later" + "license": "MIT" }, "id": 93 } From 43ba07753bca3c682df3fa5ddfdafb7952479114 Mon Sep 17 00:00:00 2001 From: Charlie Lye Date: Tue, 12 Sep 2023 09:59:25 +0000 Subject: [PATCH 8/9] Reduce desired counts. --- yarn-project/block-server/terraform/prod/main.tf | 2 +- yarn-project/halloumi/terraform/prod/main.tf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn-project/block-server/terraform/prod/main.tf b/yarn-project/block-server/terraform/prod/main.tf index 931a37ffb..8dde4618b 100644 --- a/yarn-project/block-server/terraform/prod/main.tf +++ b/yarn-project/block-server/terraform/prod/main.tf @@ -150,7 +150,7 @@ resource "aws_ecs_service" "block-server" { name = "${var.DEPLOY_TAG}-block-server" cluster = data.terraform_remote_state.setup_iac.outputs.ecs_cluster_id launch_type = "FARGATE" - desired_count = 4 + desired_count = 1 deployment_maximum_percent = 100 deployment_minimum_healthy_percent = 0 platform_version = "1.4.0" diff --git a/yarn-project/halloumi/terraform/prod/main.tf b/yarn-project/halloumi/terraform/prod/main.tf index d8a9d4572..6b9ebe2ce 100644 --- a/yarn-project/halloumi/terraform/prod/main.tf +++ b/yarn-project/halloumi/terraform/prod/main.tf @@ -119,8 +119,8 @@ resource "aws_ec2_fleet" "halloumi_inner" { target_capacity_specification { default_target_capacity_type = "spot" - total_target_capacity = 8 - spot_target_capacity = 7 + total_target_capacity = 1 + spot_target_capacity = 0 on_demand_target_capacity = 1 } @@ -254,7 +254,7 @@ resource "aws_ecs_service" "halloumi_inner" { name = "${var.DEPLOY_TAG}-halloumi-inner" cluster = data.terraform_remote_state.setup_iac.outputs.ecs_cluster_id launch_type = "EC2" - desired_count = 8 + desired_count = 1 deployment_maximum_percent = 100 deployment_minimum_healthy_percent = 0 From 27c7db8f5a3638a279f43011a5573079127b7d19 Mon Sep 17 00:00:00 2001 From: Charlie Lye Date: Tue, 12 Sep 2023 10:45:20 +0000 Subject: [PATCH 9/9] Bump postgres version. --- yarn-project/falafel/terraform/dev/main.tf | 2 +- yarn-project/falafel/terraform/prod/main.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn-project/falafel/terraform/dev/main.tf b/yarn-project/falafel/terraform/dev/main.tf index e9d34b854..8ef7cf573 100644 --- a/yarn-project/falafel/terraform/dev/main.tf +++ b/yarn-project/falafel/terraform/dev/main.tf @@ -90,7 +90,7 @@ resource "aws_db_instance" "postgres" { allocated_storage = 8 db_subnet_group_name = aws_db_subnet_group.default.name engine = "postgres" - engine_version = "13.7" + engine_version = "13.10" identifier = "${var.DEPLOY_TAG}-falafel-db" instance_class = "db.t4g.large" name = "falafel" diff --git a/yarn-project/falafel/terraform/prod/main.tf b/yarn-project/falafel/terraform/prod/main.tf index 7600d262e..ac5054208 100644 --- a/yarn-project/falafel/terraform/prod/main.tf +++ b/yarn-project/falafel/terraform/prod/main.tf @@ -82,7 +82,7 @@ resource "aws_db_instance" "postgres" { max_allocated_storage = 100 db_subnet_group_name = aws_db_subnet_group.default.name engine = "postgres" - engine_version = "13.7" + engine_version = "13.10" identifier = "${var.DEPLOY_TAG}-falafel-db" instance_class = "db.t4g.large" name = "falafel"