diff --git a/.github/workflows/npm-package-release.yml b/.github/workflows/npm-package-release.yml index 9cb7d62ab5..be0ab8208a 100644 --- a/.github/workflows/npm-package-release.yml +++ b/.github/workflows/npm-package-release.yml @@ -87,7 +87,7 @@ jobs: fi echo "Repositories match" # install dependencies and build the workspace - - run: ./prep-base.sh + - run: ./pointers.sh # remove debug artifacts to free disk space before WASM build - name: Remove Unused Artifacts run: rm -rf ./target/debug diff --git a/.github/workflows/test-subgraph.yml b/.github/workflows/test-subgraph.yml index c832d090c4..2064b5fa99 100644 --- a/.github/workflows/test-subgraph.yml +++ b/.github/workflows/test-subgraph.yml @@ -1,50 +1,6 @@ name: Subgraph unit tests -on: - push: - branches: - - main - pull_request: -concurrency: - group: ${{ github.ref }}-subgraph - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} +on: [push] jobs: - test: - permissions: - id-token: write - contents: read - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Free disk space - uses: jlumbroso/free-disk-space@v1.3.1 - - uses: nixbuild/nix-quick-install-action@v30 - with: - nix_conf: | - keep-env-derivations = true - keep-outputs = true - - name: Restore and save Nix store - uses: nix-community/cache-nix-action@v6 - with: - # restore and save a cache using this key - primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} - # if there's no cache hit, restore a cache by this prefix - restore-prefixes-first-match: nix-${{ runner.os }}- - # collect garbage until the Nix store size (in bytes) is at most this number - # before trying to save a new cache - # 1G = 1073741824 - gc-max-store-size-linux: 1G - - name: Install Soldeer dependencies - run: nix develop -c forge soldeer install - - name: Build subgraph - run: nix develop -c subgraph-build - - name: Matchstick tests - run: nix develop -c subgraph-test - # forwards status to telegram chat if this ci fails or gets canceled, only runs for default branch - - name: Forward CI Status - if: always() - uses: rainlanguage/github-chore/.github/actions/telegram-status-report@main - with: - status: ${{ job.status }} - telegram-bot-token: ${{ secrets.TELEGRAM_BOT_TOKEN }} - telegram-chat-id: ${{ secrets.TELEGRAM_CHAT_ID }} + subgraph-test: + uses: rainlanguage/rainix/.github/workflows/rainix-subgraph-test.yaml@main + secrets: inherit diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..86367cc9da --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +# Forge-emitted ABIs are copied verbatim by script/build-subgraph.sh; keeping +# them raw means rainix-copy-artifacts' regen + `git diff --exit-code` gate +# matches what forge build produces. +subgraph/abis/ diff --git a/REUSE.toml b/REUSE.toml index 4eea063e00..4a5d30097a 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -6,6 +6,7 @@ path = [ ".gas-snapshot", ".github/**/", ".gitignore", + ".prettierignore", ".vscode/**/", ".cargo/**/", "README.md", @@ -34,7 +35,6 @@ path = [ "crates/**/", "meta/**/", "test-resources/**/", - "prep-base.sh", "prep-webapp.sh", "audit/**/", ".coderabbit.yaml", diff --git a/crates/bindings/abis/ERC20.json b/crates/bindings/abis/ERC20.json new file mode 100644 index 0000000000..b65fe63720 --- /dev/null +++ b/crates/bindings/abis/ERC20.json @@ -0,0 +1,312 @@ +{ + "abi": [ + { + "type": "function", + "name": "allowance", + "inputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "spender", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "approve", + "inputs": [ + { + "name": "spender", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "balanceOf", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "decimals", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "symbol", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "totalSupply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "transfer", + "inputs": [ + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "transferFrom", + "inputs": [ + { + "name": "from", + "type": "address", + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "Approval", + "inputs": [ + { + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "spender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Transfer", + "inputs": [ + { + "name": "from", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "ERC20InsufficientAllowance", + "inputs": [ + { + "name": "spender", + "type": "address", + "internalType": "address" + }, + { + "name": "allowance", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "needed", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "ERC20InsufficientBalance", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "balance", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "needed", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "ERC20InvalidApprover", + "inputs": [ + { + "name": "approver", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ERC20InvalidReceiver", + "inputs": [ + { + "name": "receiver", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ERC20InvalidSender", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ERC20InvalidSpender", + "inputs": [ + { + "name": "spender", + "type": "address", + "internalType": "address" + } + ] + } + ] +} diff --git a/crates/bindings/abis/IERC20Metadata.json b/crates/bindings/abis/IERC20Metadata.json new file mode 100644 index 0000000000..9cf0433269 --- /dev/null +++ b/crates/bindings/abis/IERC20Metadata.json @@ -0,0 +1,226 @@ +{ + "abi": [ + { + "type": "function", + "name": "allowance", + "inputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "spender", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "approve", + "inputs": [ + { + "name": "spender", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "balanceOf", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "decimals", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "symbol", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "totalSupply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "transfer", + "inputs": [ + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "transferFrom", + "inputs": [ + { + "name": "from", + "type": "address", + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "Approval", + "inputs": [ + { + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "spender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Transfer", + "inputs": [ + { + "name": "from", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + } + ] +} diff --git a/crates/bindings/abis/IInterpreterStoreV3.json b/crates/bindings/abis/IInterpreterStoreV3.json new file mode 100644 index 0000000000..e7ddc59f43 --- /dev/null +++ b/crates/bindings/abis/IInterpreterStoreV3.json @@ -0,0 +1,71 @@ +{ + "abi": [ + { + "type": "function", + "name": "get", + "inputs": [ + { + "name": "namespace", + "type": "uint256", + "internalType": "FullyQualifiedNamespace" + }, + { + "name": "key", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "set", + "inputs": [ + { + "name": "namespace", + "type": "uint256", + "internalType": "StateNamespace" + }, + { + "name": "kvs", + "type": "bytes32[]", + "internalType": "bytes32[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "Set", + "inputs": [ + { + "name": "namespace", + "type": "uint256", + "indexed": false, + "internalType": "FullyQualifiedNamespace" + }, + { + "name": "key", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "value", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + } + ] +} diff --git a/crates/bindings/abis/IRaindexV6.json b/crates/bindings/abis/IRaindexV6.json new file mode 100644 index 0000000000..7cd8e47c5f --- /dev/null +++ b/crates/bindings/abis/IRaindexV6.json @@ -0,0 +1,1971 @@ +{ + "abi": [ + { + "type": "function", + "name": "addOrder4", + "inputs": [ + { + "name": "config", + "type": "tuple", + "internalType": "struct OrderConfigV4", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "secret", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "meta", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "tasks", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [ + { + "name": "stateChanged", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "clear3", + "inputs": [ + { + "name": "alice", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "bob", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "clearConfig", + "type": "tuple", + "internalType": "struct ClearConfigV2", + "components": [ + { + "name": "aliceInputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "aliceOutputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bobInputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bobOutputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "aliceBountyVaultId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "bobBountyVaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "aliceSignedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "bobSignedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "deposit4", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "depositAmount", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "tasks", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "entask2", + "inputs": [ + { + "name": "tasks", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "flashFee", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "flashLoan", + "inputs": [ + { + "name": "receiver", + "type": "address", + "internalType": "contract IERC3156FlashBorrower" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "maxFlashLoan", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "orderExists", + "inputs": [ + { + "name": "orderHash", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "exists", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "quote2", + "inputs": [ + { + "name": "quoteConfig", + "type": "tuple", + "internalType": "struct QuoteV2", + "components": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "inputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "outputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [ + { + "name": "exists", + "type": "bool", + "internalType": "bool" + }, + { + "name": "outputMax", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "ioRatio", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "removeOrder3", + "inputs": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "tasks", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [ + { + "name": "stateChanged", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "takeOrders4", + "inputs": [ + { + "name": "config", + "type": "tuple", + "internalType": "struct TakeOrdersConfigV5", + "components": [ + { + "name": "minimumIO", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "maximumIO", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "maximumIORatio", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "IOIsInput", + "type": "bool", + "internalType": "bool" + }, + { + "name": "orders", + "type": "tuple[]", + "internalType": "struct TakeOrderConfigV4[]", + "components": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "inputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "outputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "outputs": [ + { + "name": "totalTakerInput", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "totalTakerOutput", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "vaultBalance2", + "inputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "balance", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "withdraw4", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "targetAmount", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "tasks", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "AddOrderV3", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "order", + "type": "tuple", + "indexed": false, + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "AfterClearV2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "clearStateChange", + "type": "tuple", + "indexed": false, + "internalType": "struct ClearStateChangeV2", + "components": [ + { + "name": "aliceOutput", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "bobOutput", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "aliceInput", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "bobInput", + "type": "bytes32", + "internalType": "Float" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ClearV3", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "alice", + "type": "tuple", + "indexed": false, + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "bob", + "type": "tuple", + "indexed": false, + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "clearConfig", + "type": "tuple", + "indexed": false, + "internalType": "struct ClearConfigV2", + "components": [ + { + "name": "aliceInputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "aliceOutputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bobInputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bobOutputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "aliceBountyVaultId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "bobBountyVaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ContextV2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[][]", + "indexed": false, + "internalType": "bytes32[][]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DepositV2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "depositAmountUint256", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OrderExceedsMaxRatio", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "owner", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OrderNotFound", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "owner", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OrderZeroAmount", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "owner", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RemoveOrderV3", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "order", + "type": "tuple", + "indexed": false, + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TakeOrderV3", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "config", + "type": "tuple", + "indexed": false, + "internalType": "struct TakeOrderConfigV4", + "components": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "inputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "outputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + }, + { + "name": "input", + "type": "bytes32", + "indexed": false, + "internalType": "Float" + }, + { + "name": "output", + "type": "bytes32", + "indexed": false, + "internalType": "Float" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "WithdrawV2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "targetAmount", + "type": "bytes32", + "indexed": false, + "internalType": "Float" + }, + { + "name": "withdrawAmount", + "type": "bytes32", + "indexed": false, + "internalType": "Float" + }, + { + "name": "withdrawAmountUint256", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "NoOrders", + "inputs": [] + }, + { + "type": "error", + "name": "OrderNoHandleIO", + "inputs": [] + }, + { + "type": "error", + "name": "OrderNoInputs", + "inputs": [] + }, + { + "type": "error", + "name": "OrderNoOutputs", + "inputs": [] + }, + { + "type": "error", + "name": "OrderNoSources", + "inputs": [] + }, + { + "type": "error", + "name": "ZeroDepositAmount", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "ZeroMaximumIO", + "inputs": [] + }, + { + "type": "error", + "name": "ZeroVaultId", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ZeroWithdrawTargetAmount", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ] +} diff --git a/crates/bindings/abis/RaindexV6.json b/crates/bindings/abis/RaindexV6.json new file mode 100644 index 0000000000..fa86240bc2 --- /dev/null +++ b/crates/bindings/abis/RaindexV6.json @@ -0,0 +1,2375 @@ +{ + "abi": [ + { + "type": "function", + "name": "addOrder4", + "inputs": [ + { + "name": "orderConfig", + "type": "tuple", + "internalType": "struct OrderConfigV4", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "secret", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "meta", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "post", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "clear3", + "inputs": [ + { + "name": "aliceOrder", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "bobOrder", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "clearConfig", + "type": "tuple", + "internalType": "struct ClearConfigV2", + "components": [ + { + "name": "aliceInputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "aliceOutputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bobInputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bobOutputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "aliceBountyVaultId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "bobBountyVaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "aliceSignedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "bobSignedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "deposit4", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "depositAmount", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "post", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "entask2", + "inputs": [ + { + "name": "post", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "flashFee", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "flashLoan", + "inputs": [ + { + "name": "receiver", + "type": "address", + "internalType": "contract IERC3156FlashBorrower" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "maxFlashLoan", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "multicall", + "inputs": [ + { + "name": "data", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "outputs": [ + { + "name": "results", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "orderExists", + "inputs": [ + { + "name": "orderHash", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "quote2", + "inputs": [ + { + "name": "quoteConfig", + "type": "tuple", + "internalType": "struct QuoteV2", + "components": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "inputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "outputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + }, + { + "name": "", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "removeOrder3", + "inputs": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "post", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [ + { + "name": "stateChanged", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "supportsInterface", + "inputs": [ + { + "name": "interfaceId", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "takeOrders4", + "inputs": [ + { + "name": "config", + "type": "tuple", + "internalType": "struct TakeOrdersConfigV5", + "components": [ + { + "name": "minimumIO", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "maximumIO", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "maximumIORatio", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "IOIsInput", + "type": "bool", + "internalType": "bool" + }, + { + "name": "orders", + "type": "tuple[]", + "internalType": "struct TakeOrderConfigV4[]", + "components": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "inputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "outputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "outputs": [ + { + "name": "totalTakerInput", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "totalTakerOutput", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "vaultBalance2", + "inputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "withdraw4", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "targetAmount", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "post", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "AddOrderV3", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "order", + "type": "tuple", + "indexed": false, + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "AfterClearV2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "clearStateChange", + "type": "tuple", + "indexed": false, + "internalType": "struct ClearStateChangeV2", + "components": [ + { + "name": "aliceOutput", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "bobOutput", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "aliceInput", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "bobInput", + "type": "bytes32", + "internalType": "Float" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ClearV3", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "alice", + "type": "tuple", + "indexed": false, + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "bob", + "type": "tuple", + "indexed": false, + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "clearConfig", + "type": "tuple", + "indexed": false, + "internalType": "struct ClearConfigV2", + "components": [ + { + "name": "aliceInputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "aliceOutputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bobInputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bobOutputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "aliceBountyVaultId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "bobBountyVaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ContextV2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[][]", + "indexed": false, + "internalType": "bytes32[][]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DepositV2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "depositAmountUint256", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "MetaV1_2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "subject", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "meta", + "type": "bytes", + "indexed": false, + "internalType": "bytes" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OrderExceedsMaxRatio", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "owner", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OrderNotFound", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "owner", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OrderZeroAmount", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "owner", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RemoveOrderV3", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "order", + "type": "tuple", + "indexed": false, + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TakeOrderV3", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "config", + "type": "tuple", + "indexed": false, + "internalType": "struct TakeOrderConfigV4", + "components": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "inputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "outputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + }, + { + "name": "input", + "type": "bytes32", + "indexed": false, + "internalType": "Float" + }, + { + "name": "output", + "type": "bytes32", + "indexed": false, + "internalType": "Float" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "WithdrawV2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "targetAmount", + "type": "bytes32", + "indexed": false, + "internalType": "Float" + }, + { + "name": "withdrawAmount", + "type": "bytes32", + "indexed": false, + "internalType": "Float" + }, + { + "name": "withdrawAmountUint256", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "AddressEmptyCode", + "inputs": [ + { + "name": "target", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ClearZeroAmount", + "inputs": [] + }, + { + "type": "error", + "name": "CoefficientOverflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "DivisionByZero", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "ExponentOverflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "ExponentUnderflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "FailedCall", + "inputs": [] + }, + { + "type": "error", + "name": "FixedDecimalOverflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + }, + { + "name": "decimals", + "type": "uint8", + "internalType": "uint8" + } + ] + }, + { + "type": "error", + "name": "FlashLenderCallbackFailed", + "inputs": [ + { + "name": "result", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "InvalidSignature", + "inputs": [ + { + "name": "i", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "LossyConversionToFloat", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "MaximizeOverflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "MinimumIO", + "inputs": [ + { + "name": "minimumIO", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "actualIO", + "type": "bytes32", + "internalType": "Float" + } + ] + }, + { + "type": "error", + "name": "MulDivOverflow", + "inputs": [ + { + "name": "x", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "y", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "denominator", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "NegativeBounty", + "inputs": [] + }, + { + "type": "error", + "name": "NegativeFixedDecimalConversion", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "NegativePull", + "inputs": [] + }, + { + "type": "error", + "name": "NegativePush", + "inputs": [] + }, + { + "type": "error", + "name": "NegativeVaultBalance", + "inputs": [ + { + "name": "vaultBalance", + "type": "bytes32", + "internalType": "Float" + } + ] + }, + { + "type": "error", + "name": "NegativeVaultBalanceChange", + "inputs": [ + { + "name": "amount", + "type": "bytes32", + "internalType": "Float" + } + ] + }, + { + "type": "error", + "name": "NoOrders", + "inputs": [] + }, + { + "type": "error", + "name": "NotOrderOwner", + "inputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "NotRainMetaV1", + "inputs": [ + { + "name": "unmeta", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "type": "error", + "name": "OrderNoHandleIO", + "inputs": [] + }, + { + "type": "error", + "name": "OrderNoInputs", + "inputs": [] + }, + { + "type": "error", + "name": "OrderNoOutputs", + "inputs": [] + }, + { + "type": "error", + "name": "OrderNoSources", + "inputs": [] + }, + { + "type": "error", + "name": "ReentrancyGuardReentrantCall", + "inputs": [] + }, + { + "type": "error", + "name": "SafeERC20FailedOperation", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "SameOwner", + "inputs": [] + }, + { + "type": "error", + "name": "TOFUTokenDecimalsNotDeployed", + "inputs": [ + { + "name": "expectedAddress", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "TokenDecimalsReadFailure", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "tofuOutcome", + "type": "uint8", + "internalType": "enum TOFUOutcome" + } + ] + }, + { + "type": "error", + "name": "TokenMismatch", + "inputs": [] + }, + { + "type": "error", + "name": "TokenSelfTrade", + "inputs": [] + }, + { + "type": "error", + "name": "UnsupportedCalculateOutputs", + "inputs": [ + { + "name": "outputs", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "ZeroDepositAmount", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "ZeroMaximumIO", + "inputs": [] + }, + { + "type": "error", + "name": "ZeroVaultId", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ZeroWithdrawTargetAmount", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ] +} diff --git a/crates/bindings/src/lib.rs b/crates/bindings/src/lib.rs index 3e3a6dfc22..40c701f748 100644 --- a/crates/bindings/src/lib.rs +++ b/crates/bindings/src/lib.rs @@ -3,13 +3,13 @@ use alloy::sol; sol!( #![sol(all_derives = true, rpc)] #![sol(extra_derives(serde::Serialize, serde::Deserialize))] - IRaindexV6, "../../out/IRaindexV6.sol/IRaindexV6.json" + IRaindexV6, "./abis/IRaindexV6.json" ); sol!( #![sol(all_derives = true)] #![sol(extra_derives(serde::Serialize, serde::Deserialize))] - Raindex, "../../out/RaindexV6.sol/RaindexV6.json" + Raindex, "./abis/RaindexV6.json" ); // Inline definition avoids non-deterministic artifact collision between @@ -32,18 +32,18 @@ sol!( sol!( #![sol(all_derives = true)] - ERC20, "../../out/ERC20.sol/ERC20.json" + ERC20, "./abis/ERC20.json" ); sol!( #![sol(all_derives = true, rpc)] - IERC20Metadata, "../../out/IERC20Metadata.sol/IERC20Metadata.json" + IERC20Metadata, "./abis/IERC20Metadata.json" ); sol!( #![sol(all_derives = true)] #![sol(extra_derives(serde::Serialize, serde::Deserialize))] - IInterpreterStoreV3, "../../out/IInterpreterStoreV3.sol/IInterpreterStoreV3.json" + IInterpreterStoreV3, "./abis/IInterpreterStoreV3.json" ); pub mod provider; diff --git a/flake.lock b/flake.lock index 83ff2fcda9..2c1d82451b 100644 --- a/flake.lock +++ b/flake.lock @@ -499,11 +499,11 @@ "solc": "solc_2" }, "locked": { - "lastModified": 1779906039, - "narHash": "sha256-NKMWv+iiirFgjOLPPlKsUA7chNzRrZd+6LFMei2M8HQ=", + "lastModified": 1780154135, + "narHash": "sha256-dzfWTnq+80nLKHkwvbBcEIIJylABaxQShsok8nU0GLM=", "owner": "rainlanguage", "repo": "rainix", - "rev": "660d0efe84a3ed1c8a7ef5b8493db53e4a12fe04", + "rev": "81c6e4e3556abcbad30f51ef46481d01a672adbf", "type": "github" }, "original": { diff --git a/prep-all.sh b/prep-all.sh index a47a72a720..ffb45a4d54 100755 --- a/prep-all.sh +++ b/prep-all.sh @@ -27,14 +27,14 @@ keep=( ) echo "Preparing base setup..." -./prep-base.sh +./pointers.sh echo "Setting up UI components..." -nix develop -i ${keep[@]} -c raindex-ui-components-prelude +nix develop -i "${keep[@]}" -c raindex-ui-components-prelude echo "Building packages..." -nix develop -i ${keep[@]} -c bash -c '(npm run build -w @rainlanguage/raindex)' -nix develop -i ${keep[@]} -c bash -c '(npm run build -w @rainlanguage/ui-components && npm run build -w @rainlanguage/webapp)' +nix develop -i "${keep[@]}" -c bash -c '(npm run build -w @rainlanguage/raindex)' +nix develop -i "${keep[@]}" -c bash -c '(npm run build -w @rainlanguage/ui-components && npm run build -w @rainlanguage/webapp)' # Temporarily disable command echoing set +x @@ -42,9 +42,6 @@ set +x export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 -GREEN='\033[0;32m' -NC='\033[0m' # No Color - # Print the completion message printf "\033[0;32m" # Set text to green printf "╔════════════════════════════════════════════════════════════════════════╗\n" diff --git a/prep-base.sh b/prep-base.sh deleted file mode 100755 index 49030a517b..0000000000 --- a/prep-base.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -set -euxo pipefail - -echo "Starting project setup..." - -keep=( - -k CI_DEPLOY_SEPOLIA_RPC_URL - -k CI_FORK_SEPOLIA_DEPLOYER_ADDRESS - -k CI_FORK_SEPOLIA_BLOCK_NUMBER - -k CI_DEPLOY_ARBITRUM_RPC_URL - -k CI_DEPLOY_BASE_RPC_URL - -k CI_DEPLOY_BASE_SEPOLIA_RPC_URL - -k CI_DEPLOY_FLARE_RPC_URL - -k CI_DEPLOY_POLYGON_RPC_URL - -k CI_SEPOLIA_METABOARD_URL - -k RPC_URL_ETHEREUM_FORK - -k COMMIT_SHA - -k DEPLOYMENT_KEY - -k PUBLIC_WALLETCONNECT_PROJECT_ID -) - -nix develop -c forge soldeer install -nix develop -c forge build - -nix develop -i "${keep[@]}" -c raindex-prelude - -nix develop -i "${keep[@]}" -c forge build - -set +x - -export LANG=en_US.UTF-8 -export LC_ALL=en_US.UTF-8 - -printf "\033[0;32m" -printf "╔════════════════════════════════════════════════════════════════════════╗\n" -printf "║ Base Setup Complete! ║\n" -printf "╚════════════════════════════════════════════════════════════════════════╝\n" -printf "\033[0m" - -set -x diff --git a/prep-webapp.sh b/prep-webapp.sh index 2b212165a5..7cdfa78ee3 100755 --- a/prep-webapp.sh +++ b/prep-webapp.sh @@ -27,16 +27,16 @@ keep=( ) echo "Preparing base setup..." -./prep-base.sh +./pointers.sh rm -rf target || true echo "Building packages..." -nix develop -i ${keep[@]} -c bash -c '(npm run build -w @rainlanguage/raindex)' +nix develop -i "${keep[@]}" -c bash -c '(npm run build -w @rainlanguage/raindex)' rm -rf target || true -nix develop -i ${keep[@]} -c bash -c '(npm run build -w @rainlanguage/ui-components && npm run build -w @rainlanguage/webapp)' +nix develop -i "${keep[@]}" -c bash -c '(npm run build -w @rainlanguage/ui-components && npm run build -w @rainlanguage/webapp)' # Temporarily disable command echoing set +x @@ -44,9 +44,6 @@ set +x export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 -GREEN='\033[0;32m' -NC='\033[0m' # No Color - # Print the completion message printf "\033[0;32m" # Set text to green printf "╔════════════════════════════════════════════════════════════════════════╗\n" diff --git a/script/build.sh b/script/build.sh new file mode 100755 index 0000000000..42124a1896 --- /dev/null +++ b/script/build.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# SPDX-License-Identifier: LicenseRef-DCL-1.0 +# SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd + +# Post-CopyArtifacts hook for rainix-copy-artifacts. Regenerates all committed +# derived artifacts: subgraph ABIs + codegen, bindings ABIs (read by `sol!` in +# crates/bindings/src/lib.rs). Strips forge JSON to just `.abi` — +# bytecode/metadata/id embed build-host paths and aren't deterministic across +# runners, which would defeat the diff gate; consumers (alloy sol!, graph CLI, +# matchstick) read `.abi` anyway. + +set -euxo pipefail + +nix develop github:rainlanguage/rainix#subgraph-shell -c bash <<'INNER' +set -euxo pipefail + +mkdir -p subgraph/abis +jq '{abi}' out/RaindexV6.sol/RaindexV6.json > subgraph/abis/Raindex.json +jq '{abi}' out/ERC20.sol/ERC20.json > subgraph/abis/ERC20.json +jq '{abi}' out/DecimalFloat.sol/DecimalFloat.json > subgraph/abis/DecimalFloat.json + +(cd subgraph && npm ci && graph codegen) + +mkdir -p crates/bindings/abis +jq '{abi}' out/IRaindexV6.sol/IRaindexV6.json > crates/bindings/abis/IRaindexV6.json +jq '{abi}' out/RaindexV6.sol/RaindexV6.json > crates/bindings/abis/RaindexV6.json +jq '{abi}' out/ERC20.sol/ERC20.json > crates/bindings/abis/ERC20.json +jq '{abi}' out/IERC20Metadata.sol/IERC20Metadata.json > crates/bindings/abis/IERC20Metadata.json +jq '{abi}' out/IInterpreterStoreV3.sol/IInterpreterStoreV3.json > crates/bindings/abis/IInterpreterStoreV3.json +INNER diff --git a/subgraph/.gitignore b/subgraph/.gitignore index 65117f3fca..e00bd45070 100644 --- a/subgraph/.gitignore +++ b/subgraph/.gitignore @@ -1,4 +1,3 @@ node_modules -generated build .bin \ No newline at end of file diff --git a/subgraph/abis/DecimalFloat.json b/subgraph/abis/DecimalFloat.json new file mode 100644 index 0000000000..ae07f50603 --- /dev/null +++ b/subgraph/abis/DecimalFloat.json @@ -0,0 +1,1104 @@ +{ + "abi": [ + { + "type": "constructor", + "inputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "FORMAT_DEFAULT_SCIENTIFIC_MAX", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "FORMAT_DEFAULT_SCIENTIFIC_MIN", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "abs", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "add", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "b", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "ceil", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "div", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "b", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "e", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "eq", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "b", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "floor", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "format", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "scientific", + "type": "bool", + "internalType": "bool" + } + ], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "format", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "format", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "scientificMin", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "scientificMax", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "frac", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "fromFixedDecimalLossless", + "inputs": [ + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "decimals", + "type": "uint8", + "internalType": "uint8" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "fromFixedDecimalLossy", + "inputs": [ + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "decimals", + "type": "uint8", + "internalType": "uint8" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "gt", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "b", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "gte", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "b", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "integer", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "inv", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "isZero", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "log10", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "lt", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "b", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "lte", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "b", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "max", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "b", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "maxNegativeValue", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "maxPositiveValue", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "min", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "b", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "minNegativeValue", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "minPositiveValue", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "minus", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "mul", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "b", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "parse", + "inputs": [ + { + "name": "str", + "type": "string", + "internalType": "string" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "pow", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "b", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "pow10", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "sqrt", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "sub", + "inputs": [ + { + "name": "a", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "b", + "type": "bytes32", + "internalType": "Float" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "toFixedDecimalLossless", + "inputs": [ + { + "name": "float", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "decimals", + "type": "uint8", + "internalType": "uint8" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "toFixedDecimalLossy", + "inputs": [ + { + "name": "float", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "decimals", + "type": "uint8", + "internalType": "uint8" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "zero", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "pure" + }, + { + "type": "error", + "name": "CoefficientOverflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "DivisionByZero", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "ExponentOverflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "ExponentUnderflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "FixedDecimalOverflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + }, + { + "name": "decimals", + "type": "uint8", + "internalType": "uint8" + } + ] + }, + { + "type": "error", + "name": "Log10Negative", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "Log10Zero", + "inputs": [] + }, + { + "type": "error", + "name": "LogTablesNotDeployed", + "inputs": [ + { + "name": "tablesAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "expectedCodehash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "actualCodehash", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "LossyConversionFromFloat", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "LossyConversionToFloat", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "MaximizeOverflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "MulDivOverflow", + "inputs": [ + { + "name": "x", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "y", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "denominator", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "NegativeFixedDecimalConversion", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "PowNegativeBase", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "ScientificMinNotLessThanMax", + "inputs": [ + { + "name": "scientificMin", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "scientificMax", + "type": "bytes32", + "internalType": "Float" + } + ] + }, + { + "type": "error", + "name": "UnformatableExponent", + "inputs": [ + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "WithTargetExponentOverflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + }, + { + "name": "targetExponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "ZeroNegativePower", + "inputs": [ + { + "name": "b", + "type": "bytes32", + "internalType": "Float" + } + ] + }, + { + "type": "error", + "name": "ZeroStringStartPointer", + "inputs": [] + } + ] +} diff --git a/subgraph/abis/ERC20.json b/subgraph/abis/ERC20.json new file mode 100644 index 0000000000..b65fe63720 --- /dev/null +++ b/subgraph/abis/ERC20.json @@ -0,0 +1,312 @@ +{ + "abi": [ + { + "type": "function", + "name": "allowance", + "inputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "spender", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "approve", + "inputs": [ + { + "name": "spender", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "balanceOf", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "decimals", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "symbol", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "totalSupply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "transfer", + "inputs": [ + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "transferFrom", + "inputs": [ + { + "name": "from", + "type": "address", + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "Approval", + "inputs": [ + { + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "spender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Transfer", + "inputs": [ + { + "name": "from", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "ERC20InsufficientAllowance", + "inputs": [ + { + "name": "spender", + "type": "address", + "internalType": "address" + }, + { + "name": "allowance", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "needed", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "ERC20InsufficientBalance", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "balance", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "needed", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "ERC20InvalidApprover", + "inputs": [ + { + "name": "approver", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ERC20InvalidReceiver", + "inputs": [ + { + "name": "receiver", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ERC20InvalidSender", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ERC20InvalidSpender", + "inputs": [ + { + "name": "spender", + "type": "address", + "internalType": "address" + } + ] + } + ] +} diff --git a/subgraph/abis/Raindex.json b/subgraph/abis/Raindex.json new file mode 100644 index 0000000000..fa86240bc2 --- /dev/null +++ b/subgraph/abis/Raindex.json @@ -0,0 +1,2375 @@ +{ + "abi": [ + { + "type": "function", + "name": "addOrder4", + "inputs": [ + { + "name": "orderConfig", + "type": "tuple", + "internalType": "struct OrderConfigV4", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "secret", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "meta", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "post", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "clear3", + "inputs": [ + { + "name": "aliceOrder", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "bobOrder", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "clearConfig", + "type": "tuple", + "internalType": "struct ClearConfigV2", + "components": [ + { + "name": "aliceInputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "aliceOutputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bobInputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bobOutputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "aliceBountyVaultId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "bobBountyVaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "aliceSignedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "bobSignedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "deposit4", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "depositAmount", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "post", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "entask2", + "inputs": [ + { + "name": "post", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "flashFee", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "flashLoan", + "inputs": [ + { + "name": "receiver", + "type": "address", + "internalType": "contract IERC3156FlashBorrower" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "maxFlashLoan", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "multicall", + "inputs": [ + { + "name": "data", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "outputs": [ + { + "name": "results", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "orderExists", + "inputs": [ + { + "name": "orderHash", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "quote2", + "inputs": [ + { + "name": "quoteConfig", + "type": "tuple", + "internalType": "struct QuoteV2", + "components": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "inputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "outputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + }, + { + "name": "", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "removeOrder3", + "inputs": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "post", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [ + { + "name": "stateChanged", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "supportsInterface", + "inputs": [ + { + "name": "interfaceId", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "takeOrders4", + "inputs": [ + { + "name": "config", + "type": "tuple", + "internalType": "struct TakeOrdersConfigV5", + "components": [ + { + "name": "minimumIO", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "maximumIO", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "maximumIORatio", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "IOIsInput", + "type": "bool", + "internalType": "bool" + }, + { + "name": "orders", + "type": "tuple[]", + "internalType": "struct TakeOrderConfigV4[]", + "components": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "inputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "outputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "outputs": [ + { + "name": "totalTakerInput", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "totalTakerOutput", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "vaultBalance2", + "inputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "Float" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "withdraw4", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "targetAmount", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "post", + "type": "tuple[]", + "internalType": "struct TaskV2[]", + "components": [ + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "AddOrderV3", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "order", + "type": "tuple", + "indexed": false, + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "AfterClearV2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "clearStateChange", + "type": "tuple", + "indexed": false, + "internalType": "struct ClearStateChangeV2", + "components": [ + { + "name": "aliceOutput", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "bobOutput", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "aliceInput", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "bobInput", + "type": "bytes32", + "internalType": "Float" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ClearV3", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "alice", + "type": "tuple", + "indexed": false, + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "bob", + "type": "tuple", + "indexed": false, + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "clearConfig", + "type": "tuple", + "indexed": false, + "internalType": "struct ClearConfigV2", + "components": [ + { + "name": "aliceInputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "aliceOutputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bobInputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bobOutputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "aliceBountyVaultId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "bobBountyVaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ContextV2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[][]", + "indexed": false, + "internalType": "bytes32[][]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DepositV2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "depositAmountUint256", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "MetaV1_2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "subject", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "meta", + "type": "bytes", + "indexed": false, + "internalType": "bytes" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OrderExceedsMaxRatio", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "owner", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OrderNotFound", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "owner", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OrderZeroAmount", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "owner", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RemoveOrderV3", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "orderHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "order", + "type": "tuple", + "indexed": false, + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TakeOrderV3", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "config", + "type": "tuple", + "indexed": false, + "internalType": "struct TakeOrderConfigV4", + "components": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct OrderV4", + "components": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "evaluable", + "type": "tuple", + "internalType": "struct EvaluableV4", + "components": [ + { + "name": "interpreter", + "type": "address", + "internalType": "contract IInterpreterV4" + }, + { + "name": "store", + "type": "address", + "internalType": "contract IInterpreterStoreV3" + }, + { + "name": "bytecode", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validInputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validOutputs", + "type": "tuple[]", + "internalType": "struct IOV2[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "nonce", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "inputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "outputIOIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "signedContext", + "type": "tuple[]", + "internalType": "struct SignedContextV1[]", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "context", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + }, + { + "name": "input", + "type": "bytes32", + "indexed": false, + "internalType": "Float" + }, + { + "name": "output", + "type": "bytes32", + "indexed": false, + "internalType": "Float" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "WithdrawV2", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "targetAmount", + "type": "bytes32", + "indexed": false, + "internalType": "Float" + }, + { + "name": "withdrawAmount", + "type": "bytes32", + "indexed": false, + "internalType": "Float" + }, + { + "name": "withdrawAmountUint256", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "AddressEmptyCode", + "inputs": [ + { + "name": "target", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ClearZeroAmount", + "inputs": [] + }, + { + "type": "error", + "name": "CoefficientOverflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "DivisionByZero", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "ExponentOverflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "ExponentUnderflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "FailedCall", + "inputs": [] + }, + { + "type": "error", + "name": "FixedDecimalOverflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + }, + { + "name": "decimals", + "type": "uint8", + "internalType": "uint8" + } + ] + }, + { + "type": "error", + "name": "FlashLenderCallbackFailed", + "inputs": [ + { + "name": "result", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "InvalidSignature", + "inputs": [ + { + "name": "i", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "LossyConversionToFloat", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "MaximizeOverflow", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "MinimumIO", + "inputs": [ + { + "name": "minimumIO", + "type": "bytes32", + "internalType": "Float" + }, + { + "name": "actualIO", + "type": "bytes32", + "internalType": "Float" + } + ] + }, + { + "type": "error", + "name": "MulDivOverflow", + "inputs": [ + { + "name": "x", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "y", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "denominator", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "NegativeBounty", + "inputs": [] + }, + { + "type": "error", + "name": "NegativeFixedDecimalConversion", + "inputs": [ + { + "name": "signedCoefficient", + "type": "int256", + "internalType": "int256" + }, + { + "name": "exponent", + "type": "int256", + "internalType": "int256" + } + ] + }, + { + "type": "error", + "name": "NegativePull", + "inputs": [] + }, + { + "type": "error", + "name": "NegativePush", + "inputs": [] + }, + { + "type": "error", + "name": "NegativeVaultBalance", + "inputs": [ + { + "name": "vaultBalance", + "type": "bytes32", + "internalType": "Float" + } + ] + }, + { + "type": "error", + "name": "NegativeVaultBalanceChange", + "inputs": [ + { + "name": "amount", + "type": "bytes32", + "internalType": "Float" + } + ] + }, + { + "type": "error", + "name": "NoOrders", + "inputs": [] + }, + { + "type": "error", + "name": "NotOrderOwner", + "inputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "NotRainMetaV1", + "inputs": [ + { + "name": "unmeta", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "type": "error", + "name": "OrderNoHandleIO", + "inputs": [] + }, + { + "type": "error", + "name": "OrderNoInputs", + "inputs": [] + }, + { + "type": "error", + "name": "OrderNoOutputs", + "inputs": [] + }, + { + "type": "error", + "name": "OrderNoSources", + "inputs": [] + }, + { + "type": "error", + "name": "ReentrancyGuardReentrantCall", + "inputs": [] + }, + { + "type": "error", + "name": "SafeERC20FailedOperation", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "SameOwner", + "inputs": [] + }, + { + "type": "error", + "name": "TOFUTokenDecimalsNotDeployed", + "inputs": [ + { + "name": "expectedAddress", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "TokenDecimalsReadFailure", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "tofuOutcome", + "type": "uint8", + "internalType": "enum TOFUOutcome" + } + ] + }, + { + "type": "error", + "name": "TokenMismatch", + "inputs": [] + }, + { + "type": "error", + "name": "TokenSelfTrade", + "inputs": [] + }, + { + "type": "error", + "name": "UnsupportedCalculateOutputs", + "inputs": [ + { + "name": "outputs", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "ZeroDepositAmount", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "ZeroMaximumIO", + "inputs": [] + }, + { + "type": "error", + "name": "ZeroVaultId", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ZeroWithdrawTargetAmount", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "vaultId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ] +} diff --git a/subgraph/generated/Raindex/DecimalFloat.ts b/subgraph/generated/Raindex/DecimalFloat.ts new file mode 100644 index 0000000000..fca6408a99 --- /dev/null +++ b/subgraph/generated/Raindex/DecimalFloat.ts @@ -0,0 +1,996 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt, +} from "@graphprotocol/graph-ts"; + +export class DecimalFloat__fromFixedDecimalLossyResult { + value0: Bytes; + value1: boolean; + + constructor(value0: Bytes, value1: boolean) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromFixedBytes(this.value0)); + map.set("value1", ethereum.Value.fromBoolean(this.value1)); + return map; + } + + getValue0(): Bytes { + return this.value0; + } + + getValue1(): boolean { + return this.value1; + } +} + +export class DecimalFloat__parseResult { + value0: Bytes; + value1: Bytes; + + constructor(value0: Bytes, value1: Bytes) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromFixedBytes(this.value0)); + map.set("value1", ethereum.Value.fromFixedBytes(this.value1)); + return map; + } + + getValue0(): Bytes { + return this.value0; + } + + getValue1(): Bytes { + return this.value1; + } +} + +export class DecimalFloat__toFixedDecimalLossyResult { + value0: BigInt; + value1: boolean; + + constructor(value0: BigInt, value1: boolean) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromBoolean(this.value1)); + return map; + } + + getValue0(): BigInt { + return this.value0; + } + + getValue1(): boolean { + return this.value1; + } +} + +export class DecimalFloat extends ethereum.SmartContract { + static bind(address: Address): DecimalFloat { + return new DecimalFloat("DecimalFloat", address); + } + + FORMAT_DEFAULT_SCIENTIFIC_MAX(): Bytes { + let result = super.call( + "FORMAT_DEFAULT_SCIENTIFIC_MAX", + "FORMAT_DEFAULT_SCIENTIFIC_MAX():(bytes32)", + [], + ); + + return result[0].toBytes(); + } + + try_FORMAT_DEFAULT_SCIENTIFIC_MAX(): ethereum.CallResult { + let result = super.tryCall( + "FORMAT_DEFAULT_SCIENTIFIC_MAX", + "FORMAT_DEFAULT_SCIENTIFIC_MAX():(bytes32)", + [], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + FORMAT_DEFAULT_SCIENTIFIC_MIN(): Bytes { + let result = super.call( + "FORMAT_DEFAULT_SCIENTIFIC_MIN", + "FORMAT_DEFAULT_SCIENTIFIC_MIN():(bytes32)", + [], + ); + + return result[0].toBytes(); + } + + try_FORMAT_DEFAULT_SCIENTIFIC_MIN(): ethereum.CallResult { + let result = super.tryCall( + "FORMAT_DEFAULT_SCIENTIFIC_MIN", + "FORMAT_DEFAULT_SCIENTIFIC_MIN():(bytes32)", + [], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + abs(a: Bytes): Bytes { + let result = super.call("abs", "abs(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + + return result[0].toBytes(); + } + + try_abs(a: Bytes): ethereum.CallResult { + let result = super.tryCall("abs", "abs(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + add(a: Bytes, b: Bytes): Bytes { + let result = super.call("add", "add(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + + return result[0].toBytes(); + } + + try_add(a: Bytes, b: Bytes): ethereum.CallResult { + let result = super.tryCall("add", "add(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + ceil(a: Bytes): Bytes { + let result = super.call("ceil", "ceil(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + + return result[0].toBytes(); + } + + try_ceil(a: Bytes): ethereum.CallResult { + let result = super.tryCall("ceil", "ceil(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + div(a: Bytes, b: Bytes): Bytes { + let result = super.call("div", "div(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + + return result[0].toBytes(); + } + + try_div(a: Bytes, b: Bytes): ethereum.CallResult { + let result = super.tryCall("div", "div(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + e(): Bytes { + let result = super.call("e", "e():(bytes32)", []); + + return result[0].toBytes(); + } + + try_e(): ethereum.CallResult { + let result = super.tryCall("e", "e():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + eq(a: Bytes, b: Bytes): boolean { + let result = super.call("eq", "eq(bytes32,bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + + return result[0].toBoolean(); + } + + try_eq(a: Bytes, b: Bytes): ethereum.CallResult { + let result = super.tryCall("eq", "eq(bytes32,bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + floor(a: Bytes): Bytes { + let result = super.call("floor", "floor(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + + return result[0].toBytes(); + } + + try_floor(a: Bytes): ethereum.CallResult { + let result = super.tryCall("floor", "floor(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + format(a: Bytes, scientific: boolean): string { + let result = super.call("format", "format(bytes32,bool):(string)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromBoolean(scientific), + ]); + + return result[0].toString(); + } + + try_format(a: Bytes, scientific: boolean): ethereum.CallResult { + let result = super.tryCall("format", "format(bytes32,bool):(string)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromBoolean(scientific), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + format1(a: Bytes): string { + let result = super.call("format", "format(bytes32):(string)", [ + ethereum.Value.fromFixedBytes(a), + ]); + + return result[0].toString(); + } + + try_format1(a: Bytes): ethereum.CallResult { + let result = super.tryCall("format", "format(bytes32):(string)", [ + ethereum.Value.fromFixedBytes(a), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + format2(a: Bytes, scientificMin: Bytes, scientificMax: Bytes): string { + let result = super.call( + "format", + "format(bytes32,bytes32,bytes32):(string)", + [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(scientificMin), + ethereum.Value.fromFixedBytes(scientificMax), + ], + ); + + return result[0].toString(); + } + + try_format2( + a: Bytes, + scientificMin: Bytes, + scientificMax: Bytes, + ): ethereum.CallResult { + let result = super.tryCall( + "format", + "format(bytes32,bytes32,bytes32):(string)", + [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(scientificMin), + ethereum.Value.fromFixedBytes(scientificMax), + ], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + frac(a: Bytes): Bytes { + let result = super.call("frac", "frac(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + + return result[0].toBytes(); + } + + try_frac(a: Bytes): ethereum.CallResult { + let result = super.tryCall("frac", "frac(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + fromFixedDecimalLossless(value: BigInt, decimals: i32): Bytes { + let result = super.call( + "fromFixedDecimalLossless", + "fromFixedDecimalLossless(uint256,uint8):(bytes32)", + [ + ethereum.Value.fromUnsignedBigInt(value), + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(decimals)), + ], + ); + + return result[0].toBytes(); + } + + try_fromFixedDecimalLossless( + value: BigInt, + decimals: i32, + ): ethereum.CallResult { + let result = super.tryCall( + "fromFixedDecimalLossless", + "fromFixedDecimalLossless(uint256,uint8):(bytes32)", + [ + ethereum.Value.fromUnsignedBigInt(value), + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(decimals)), + ], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + fromFixedDecimalLossy( + value: BigInt, + decimals: i32, + ): DecimalFloat__fromFixedDecimalLossyResult { + let result = super.call( + "fromFixedDecimalLossy", + "fromFixedDecimalLossy(uint256,uint8):(bytes32,bool)", + [ + ethereum.Value.fromUnsignedBigInt(value), + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(decimals)), + ], + ); + + return new DecimalFloat__fromFixedDecimalLossyResult( + result[0].toBytes(), + result[1].toBoolean(), + ); + } + + try_fromFixedDecimalLossy( + value: BigInt, + decimals: i32, + ): ethereum.CallResult { + let result = super.tryCall( + "fromFixedDecimalLossy", + "fromFixedDecimalLossy(uint256,uint8):(bytes32,bool)", + [ + ethereum.Value.fromUnsignedBigInt(value), + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(decimals)), + ], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new DecimalFloat__fromFixedDecimalLossyResult( + value[0].toBytes(), + value[1].toBoolean(), + ), + ); + } + + gt(a: Bytes, b: Bytes): boolean { + let result = super.call("gt", "gt(bytes32,bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + + return result[0].toBoolean(); + } + + try_gt(a: Bytes, b: Bytes): ethereum.CallResult { + let result = super.tryCall("gt", "gt(bytes32,bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + gte(a: Bytes, b: Bytes): boolean { + let result = super.call("gte", "gte(bytes32,bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + + return result[0].toBoolean(); + } + + try_gte(a: Bytes, b: Bytes): ethereum.CallResult { + let result = super.tryCall("gte", "gte(bytes32,bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + integer(a: Bytes): Bytes { + let result = super.call("integer", "integer(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + + return result[0].toBytes(); + } + + try_integer(a: Bytes): ethereum.CallResult { + let result = super.tryCall("integer", "integer(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + inv(a: Bytes): Bytes { + let result = super.call("inv", "inv(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + + return result[0].toBytes(); + } + + try_inv(a: Bytes): ethereum.CallResult { + let result = super.tryCall("inv", "inv(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + isZero(a: Bytes): boolean { + let result = super.call("isZero", "isZero(bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(a), + ]); + + return result[0].toBoolean(); + } + + try_isZero(a: Bytes): ethereum.CallResult { + let result = super.tryCall("isZero", "isZero(bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(a), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + log10(a: Bytes): Bytes { + let result = super.call("log10", "log10(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + + return result[0].toBytes(); + } + + try_log10(a: Bytes): ethereum.CallResult { + let result = super.tryCall("log10", "log10(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + lt(a: Bytes, b: Bytes): boolean { + let result = super.call("lt", "lt(bytes32,bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + + return result[0].toBoolean(); + } + + try_lt(a: Bytes, b: Bytes): ethereum.CallResult { + let result = super.tryCall("lt", "lt(bytes32,bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + lte(a: Bytes, b: Bytes): boolean { + let result = super.call("lte", "lte(bytes32,bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + + return result[0].toBoolean(); + } + + try_lte(a: Bytes, b: Bytes): ethereum.CallResult { + let result = super.tryCall("lte", "lte(bytes32,bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + max(a: Bytes, b: Bytes): Bytes { + let result = super.call("max", "max(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + + return result[0].toBytes(); + } + + try_max(a: Bytes, b: Bytes): ethereum.CallResult { + let result = super.tryCall("max", "max(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + maxNegativeValue(): Bytes { + let result = super.call( + "maxNegativeValue", + "maxNegativeValue():(bytes32)", + [], + ); + + return result[0].toBytes(); + } + + try_maxNegativeValue(): ethereum.CallResult { + let result = super.tryCall( + "maxNegativeValue", + "maxNegativeValue():(bytes32)", + [], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + maxPositiveValue(): Bytes { + let result = super.call( + "maxPositiveValue", + "maxPositiveValue():(bytes32)", + [], + ); + + return result[0].toBytes(); + } + + try_maxPositiveValue(): ethereum.CallResult { + let result = super.tryCall( + "maxPositiveValue", + "maxPositiveValue():(bytes32)", + [], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + min(a: Bytes, b: Bytes): Bytes { + let result = super.call("min", "min(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + + return result[0].toBytes(); + } + + try_min(a: Bytes, b: Bytes): ethereum.CallResult { + let result = super.tryCall("min", "min(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + minNegativeValue(): Bytes { + let result = super.call( + "minNegativeValue", + "minNegativeValue():(bytes32)", + [], + ); + + return result[0].toBytes(); + } + + try_minNegativeValue(): ethereum.CallResult { + let result = super.tryCall( + "minNegativeValue", + "minNegativeValue():(bytes32)", + [], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + minPositiveValue(): Bytes { + let result = super.call( + "minPositiveValue", + "minPositiveValue():(bytes32)", + [], + ); + + return result[0].toBytes(); + } + + try_minPositiveValue(): ethereum.CallResult { + let result = super.tryCall( + "minPositiveValue", + "minPositiveValue():(bytes32)", + [], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + minus(a: Bytes): Bytes { + let result = super.call("minus", "minus(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + + return result[0].toBytes(); + } + + try_minus(a: Bytes): ethereum.CallResult { + let result = super.tryCall("minus", "minus(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + mul(a: Bytes, b: Bytes): Bytes { + let result = super.call("mul", "mul(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + + return result[0].toBytes(); + } + + try_mul(a: Bytes, b: Bytes): ethereum.CallResult { + let result = super.tryCall("mul", "mul(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + parse(str: string): DecimalFloat__parseResult { + let result = super.call("parse", "parse(string):(bytes4,bytes32)", [ + ethereum.Value.fromString(str), + ]); + + return new DecimalFloat__parseResult( + result[0].toBytes(), + result[1].toBytes(), + ); + } + + try_parse(str: string): ethereum.CallResult { + let result = super.tryCall("parse", "parse(string):(bytes4,bytes32)", [ + ethereum.Value.fromString(str), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new DecimalFloat__parseResult(value[0].toBytes(), value[1].toBytes()), + ); + } + + pow(a: Bytes, b: Bytes): Bytes { + let result = super.call("pow", "pow(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + + return result[0].toBytes(); + } + + try_pow(a: Bytes, b: Bytes): ethereum.CallResult { + let result = super.tryCall("pow", "pow(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + pow10(a: Bytes): Bytes { + let result = super.call("pow10", "pow10(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + + return result[0].toBytes(); + } + + try_pow10(a: Bytes): ethereum.CallResult { + let result = super.tryCall("pow10", "pow10(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + sqrt(a: Bytes): Bytes { + let result = super.call("sqrt", "sqrt(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + + return result[0].toBytes(); + } + + try_sqrt(a: Bytes): ethereum.CallResult { + let result = super.tryCall("sqrt", "sqrt(bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + sub(a: Bytes, b: Bytes): Bytes { + let result = super.call("sub", "sub(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + + return result[0].toBytes(); + } + + try_sub(a: Bytes, b: Bytes): ethereum.CallResult { + let result = super.tryCall("sub", "sub(bytes32,bytes32):(bytes32)", [ + ethereum.Value.fromFixedBytes(a), + ethereum.Value.fromFixedBytes(b), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + toFixedDecimalLossless(float: Bytes, decimals: i32): BigInt { + let result = super.call( + "toFixedDecimalLossless", + "toFixedDecimalLossless(bytes32,uint8):(uint256)", + [ + ethereum.Value.fromFixedBytes(float), + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(decimals)), + ], + ); + + return result[0].toBigInt(); + } + + try_toFixedDecimalLossless( + float: Bytes, + decimals: i32, + ): ethereum.CallResult { + let result = super.tryCall( + "toFixedDecimalLossless", + "toFixedDecimalLossless(bytes32,uint8):(uint256)", + [ + ethereum.Value.fromFixedBytes(float), + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(decimals)), + ], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + toFixedDecimalLossy( + float: Bytes, + decimals: i32, + ): DecimalFloat__toFixedDecimalLossyResult { + let result = super.call( + "toFixedDecimalLossy", + "toFixedDecimalLossy(bytes32,uint8):(uint256,bool)", + [ + ethereum.Value.fromFixedBytes(float), + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(decimals)), + ], + ); + + return new DecimalFloat__toFixedDecimalLossyResult( + result[0].toBigInt(), + result[1].toBoolean(), + ); + } + + try_toFixedDecimalLossy( + float: Bytes, + decimals: i32, + ): ethereum.CallResult { + let result = super.tryCall( + "toFixedDecimalLossy", + "toFixedDecimalLossy(bytes32,uint8):(uint256,bool)", + [ + ethereum.Value.fromFixedBytes(float), + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(decimals)), + ], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new DecimalFloat__toFixedDecimalLossyResult( + value[0].toBigInt(), + value[1].toBoolean(), + ), + ); + } + + zero(): Bytes { + let result = super.call("zero", "zero():(bytes32)", []); + + return result[0].toBytes(); + } + + try_zero(): ethereum.CallResult { + let result = super.tryCall("zero", "zero():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} diff --git a/subgraph/generated/Raindex/ERC20.ts b/subgraph/generated/Raindex/ERC20.ts new file mode 100644 index 0000000000..c7309f63b7 --- /dev/null +++ b/subgraph/generated/Raindex/ERC20.ts @@ -0,0 +1,366 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt, +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class ERC20 extends ethereum.SmartContract { + static bind(address: Address): ERC20 { + return new ERC20("ERC20", address); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)], + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, value: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(value), + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, value: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(value), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account), + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(to: Address, value: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(to), + ethereum.Value.fromUnsignedBigInt(value), + ]); + + return result[0].toBoolean(); + } + + try_transfer(to: Address, value: BigInt): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(to), + ethereum.Value.fromUnsignedBigInt(value), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(from: Address, to: Address, value: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(from), + ethereum.Value.fromAddress(to), + ethereum.Value.fromUnsignedBigInt(value), + ], + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + from: Address, + to: Address, + value: BigInt, + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(from), + ethereum.Value.fromAddress(to), + ethereum.Value.fromUnsignedBigInt(value), + ], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get to(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get from(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get to(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/subgraph/generated/Raindex/Raindex.ts b/subgraph/generated/Raindex/Raindex.ts new file mode 100644 index 0000000000..fee60701d4 --- /dev/null +++ b/subgraph/generated/Raindex/Raindex.ts @@ -0,0 +1,2458 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt, +} from "@graphprotocol/graph-ts"; + +export class AddOrderV3 extends ethereum.Event { + get params(): AddOrderV3__Params { + return new AddOrderV3__Params(this); + } +} + +export class AddOrderV3__Params { + _event: AddOrderV3; + + constructor(event: AddOrderV3) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get orderHash(): Bytes { + return this._event.parameters[1].value.toBytes(); + } + + get order(): AddOrderV3OrderStruct { + return changetype( + this._event.parameters[2].value.toTuple(), + ); + } +} + +export class AddOrderV3OrderStruct extends ethereum.Tuple { + get owner(): Address { + return this[0].toAddress(); + } + + get evaluable(): AddOrderV3OrderEvaluableStruct { + return changetype(this[1].toTuple()); + } + + get validInputs(): Array { + return this[2].toTupleArray(); + } + + get validOutputs(): Array { + return this[3].toTupleArray(); + } + + get nonce(): Bytes { + return this[4].toBytes(); + } +} + +export class AddOrderV3OrderEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class AddOrderV3OrderValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class AddOrderV3OrderValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class AfterClearV2 extends ethereum.Event { + get params(): AfterClearV2__Params { + return new AfterClearV2__Params(this); + } +} + +export class AfterClearV2__Params { + _event: AfterClearV2; + + constructor(event: AfterClearV2) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get clearStateChange(): AfterClearV2ClearStateChangeStruct { + return changetype( + this._event.parameters[1].value.toTuple(), + ); + } +} + +export class AfterClearV2ClearStateChangeStruct extends ethereum.Tuple { + get aliceOutput(): Bytes { + return this[0].toBytes(); + } + + get bobOutput(): Bytes { + return this[1].toBytes(); + } + + get aliceInput(): Bytes { + return this[2].toBytes(); + } + + get bobInput(): Bytes { + return this[3].toBytes(); + } +} + +export class ClearV3 extends ethereum.Event { + get params(): ClearV3__Params { + return new ClearV3__Params(this); + } +} + +export class ClearV3__Params { + _event: ClearV3; + + constructor(event: ClearV3) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get alice(): ClearV3AliceStruct { + return changetype( + this._event.parameters[1].value.toTuple(), + ); + } + + get bob(): ClearV3BobStruct { + return changetype( + this._event.parameters[2].value.toTuple(), + ); + } + + get clearConfig(): ClearV3ClearConfigStruct { + return changetype( + this._event.parameters[3].value.toTuple(), + ); + } +} + +export class ClearV3AliceStruct extends ethereum.Tuple { + get owner(): Address { + return this[0].toAddress(); + } + + get evaluable(): ClearV3AliceEvaluableStruct { + return changetype(this[1].toTuple()); + } + + get validInputs(): Array { + return this[2].toTupleArray(); + } + + get validOutputs(): Array { + return this[3].toTupleArray(); + } + + get nonce(): Bytes { + return this[4].toBytes(); + } +} + +export class ClearV3AliceEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class ClearV3AliceValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class ClearV3AliceValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class ClearV3BobStruct extends ethereum.Tuple { + get owner(): Address { + return this[0].toAddress(); + } + + get evaluable(): ClearV3BobEvaluableStruct { + return changetype(this[1].toTuple()); + } + + get validInputs(): Array { + return this[2].toTupleArray(); + } + + get validOutputs(): Array { + return this[3].toTupleArray(); + } + + get nonce(): Bytes { + return this[4].toBytes(); + } +} + +export class ClearV3BobEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class ClearV3BobValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class ClearV3BobValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class ClearV3ClearConfigStruct extends ethereum.Tuple { + get aliceInputIOIndex(): BigInt { + return this[0].toBigInt(); + } + + get aliceOutputIOIndex(): BigInt { + return this[1].toBigInt(); + } + + get bobInputIOIndex(): BigInt { + return this[2].toBigInt(); + } + + get bobOutputIOIndex(): BigInt { + return this[3].toBigInt(); + } + + get aliceBountyVaultId(): Bytes { + return this[4].toBytes(); + } + + get bobBountyVaultId(): Bytes { + return this[5].toBytes(); + } +} + +export class ContextV2 extends ethereum.Event { + get params(): ContextV2__Params { + return new ContextV2__Params(this); + } +} + +export class ContextV2__Params { + _event: ContextV2; + + constructor(event: ContextV2) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get context(): Array> { + return this._event.parameters[1].value.toBytesMatrix(); + } +} + +export class DepositV2 extends ethereum.Event { + get params(): DepositV2__Params { + return new DepositV2__Params(this); + } +} + +export class DepositV2__Params { + _event: DepositV2; + + constructor(event: DepositV2) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get vaultId(): Bytes { + return this._event.parameters[2].value.toBytes(); + } + + get depositAmountUint256(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class MetaV1_2 extends ethereum.Event { + get params(): MetaV1_2__Params { + return new MetaV1_2__Params(this); + } +} + +export class MetaV1_2__Params { + _event: MetaV1_2; + + constructor(event: MetaV1_2) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get subject(): Bytes { + return this._event.parameters[1].value.toBytes(); + } + + get meta(): Bytes { + return this._event.parameters[2].value.toBytes(); + } +} + +export class OrderExceedsMaxRatio extends ethereum.Event { + get params(): OrderExceedsMaxRatio__Params { + return new OrderExceedsMaxRatio__Params(this); + } +} + +export class OrderExceedsMaxRatio__Params { + _event: OrderExceedsMaxRatio; + + constructor(event: OrderExceedsMaxRatio) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get owner(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get orderHash(): Bytes { + return this._event.parameters[2].value.toBytes(); + } +} + +export class OrderNotFound extends ethereum.Event { + get params(): OrderNotFound__Params { + return new OrderNotFound__Params(this); + } +} + +export class OrderNotFound__Params { + _event: OrderNotFound; + + constructor(event: OrderNotFound) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get owner(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get orderHash(): Bytes { + return this._event.parameters[2].value.toBytes(); + } +} + +export class OrderZeroAmount extends ethereum.Event { + get params(): OrderZeroAmount__Params { + return new OrderZeroAmount__Params(this); + } +} + +export class OrderZeroAmount__Params { + _event: OrderZeroAmount; + + constructor(event: OrderZeroAmount) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get owner(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get orderHash(): Bytes { + return this._event.parameters[2].value.toBytes(); + } +} + +export class RemoveOrderV3 extends ethereum.Event { + get params(): RemoveOrderV3__Params { + return new RemoveOrderV3__Params(this); + } +} + +export class RemoveOrderV3__Params { + _event: RemoveOrderV3; + + constructor(event: RemoveOrderV3) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get orderHash(): Bytes { + return this._event.parameters[1].value.toBytes(); + } + + get order(): RemoveOrderV3OrderStruct { + return changetype( + this._event.parameters[2].value.toTuple(), + ); + } +} + +export class RemoveOrderV3OrderStruct extends ethereum.Tuple { + get owner(): Address { + return this[0].toAddress(); + } + + get evaluable(): RemoveOrderV3OrderEvaluableStruct { + return changetype(this[1].toTuple()); + } + + get validInputs(): Array { + return this[2].toTupleArray(); + } + + get validOutputs(): Array { + return this[3].toTupleArray(); + } + + get nonce(): Bytes { + return this[4].toBytes(); + } +} + +export class RemoveOrderV3OrderEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class RemoveOrderV3OrderValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class RemoveOrderV3OrderValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class TakeOrderV3 extends ethereum.Event { + get params(): TakeOrderV3__Params { + return new TakeOrderV3__Params(this); + } +} + +export class TakeOrderV3__Params { + _event: TakeOrderV3; + + constructor(event: TakeOrderV3) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get config(): TakeOrderV3ConfigStruct { + return changetype( + this._event.parameters[1].value.toTuple(), + ); + } + + get input(): Bytes { + return this._event.parameters[2].value.toBytes(); + } + + get output(): Bytes { + return this._event.parameters[3].value.toBytes(); + } +} + +export class TakeOrderV3ConfigStruct extends ethereum.Tuple { + get order(): TakeOrderV3ConfigOrderStruct { + return changetype(this[0].toTuple()); + } + + get inputIOIndex(): BigInt { + return this[1].toBigInt(); + } + + get outputIOIndex(): BigInt { + return this[2].toBigInt(); + } + + get signedContext(): Array { + return this[3].toTupleArray(); + } +} + +export class TakeOrderV3ConfigOrderStruct extends ethereum.Tuple { + get owner(): Address { + return this[0].toAddress(); + } + + get evaluable(): TakeOrderV3ConfigOrderEvaluableStruct { + return changetype(this[1].toTuple()); + } + + get validInputs(): Array { + return this[2].toTupleArray(); + } + + get validOutputs(): Array { + return this[3].toTupleArray(); + } + + get nonce(): Bytes { + return this[4].toBytes(); + } +} + +export class TakeOrderV3ConfigOrderEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class TakeOrderV3ConfigOrderValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class TakeOrderV3ConfigOrderValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class TakeOrderV3ConfigSignedContextStruct extends ethereum.Tuple { + get signer(): Address { + return this[0].toAddress(); + } + + get context(): Array { + return this[1].toBytesArray(); + } + + get signature(): Bytes { + return this[2].toBytes(); + } +} + +export class WithdrawV2 extends ethereum.Event { + get params(): WithdrawV2__Params { + return new WithdrawV2__Params(this); + } +} + +export class WithdrawV2__Params { + _event: WithdrawV2; + + constructor(event: WithdrawV2) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get vaultId(): Bytes { + return this._event.parameters[2].value.toBytes(); + } + + get targetAmount(): Bytes { + return this._event.parameters[3].value.toBytes(); + } + + get withdrawAmount(): Bytes { + return this._event.parameters[4].value.toBytes(); + } + + get withdrawAmountUint256(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } +} + +export class Raindex__addOrder4InputOrderConfigStruct extends ethereum.Tuple { + get evaluable(): Raindex__addOrder4InputOrderConfigEvaluableStruct { + return changetype( + this[0].toTuple(), + ); + } + + get validInputs(): Array { + return this[1].toTupleArray(); + } + + get validOutputs(): Array { + return this[2].toTupleArray(); + } + + get nonce(): Bytes { + return this[3].toBytes(); + } + + get secret(): Bytes { + return this[4].toBytes(); + } + + get meta(): Bytes { + return this[5].toBytes(); + } +} + +export class Raindex__addOrder4InputOrderConfigEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class Raindex__addOrder4InputOrderConfigValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class Raindex__addOrder4InputOrderConfigValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class Raindex__addOrder4InputPostStruct extends ethereum.Tuple { + get evaluable(): Raindex__addOrder4InputPostEvaluableStruct { + return changetype( + this[0].toTuple(), + ); + } + + get signedContext(): Array { + return this[1].toTupleArray(); + } +} + +export class Raindex__addOrder4InputPostEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class Raindex__addOrder4InputPostSignedContextStruct extends ethereum.Tuple { + get signer(): Address { + return this[0].toAddress(); + } + + get context(): Array { + return this[1].toBytesArray(); + } + + get signature(): Bytes { + return this[2].toBytes(); + } +} + +export class Raindex__quote2Result { + value0: boolean; + value1: Bytes; + value2: Bytes; + + constructor(value0: boolean, value1: Bytes, value2: Bytes) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromFixedBytes(this.value1)); + map.set("value2", ethereum.Value.fromFixedBytes(this.value2)); + return map; + } + + getValue0(): boolean { + return this.value0; + } + + getValue1(): Bytes { + return this.value1; + } + + getValue2(): Bytes { + return this.value2; + } +} + +export class Raindex__quote2InputQuoteConfigStruct extends ethereum.Tuple { + get order(): Raindex__quote2InputQuoteConfigOrderStruct { + return changetype( + this[0].toTuple(), + ); + } + + get inputIOIndex(): BigInt { + return this[1].toBigInt(); + } + + get outputIOIndex(): BigInt { + return this[2].toBigInt(); + } + + get signedContext(): Array { + return this[3].toTupleArray(); + } +} + +export class Raindex__quote2InputQuoteConfigOrderStruct extends ethereum.Tuple { + get owner(): Address { + return this[0].toAddress(); + } + + get evaluable(): Raindex__quote2InputQuoteConfigOrderEvaluableStruct { + return changetype( + this[1].toTuple(), + ); + } + + get validInputs(): Array { + return this[2].toTupleArray(); + } + + get validOutputs(): Array { + return this[3].toTupleArray(); + } + + get nonce(): Bytes { + return this[4].toBytes(); + } +} + +export class Raindex__quote2InputQuoteConfigOrderEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class Raindex__quote2InputQuoteConfigOrderValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class Raindex__quote2InputQuoteConfigOrderValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class Raindex__quote2InputQuoteConfigSignedContextStruct extends ethereum.Tuple { + get signer(): Address { + return this[0].toAddress(); + } + + get context(): Array { + return this[1].toBytesArray(); + } + + get signature(): Bytes { + return this[2].toBytes(); + } +} + +export class Raindex__removeOrder3InputOrderStruct extends ethereum.Tuple { + get owner(): Address { + return this[0].toAddress(); + } + + get evaluable(): Raindex__removeOrder3InputOrderEvaluableStruct { + return changetype( + this[1].toTuple(), + ); + } + + get validInputs(): Array { + return this[2].toTupleArray(); + } + + get validOutputs(): Array { + return this[3].toTupleArray(); + } + + get nonce(): Bytes { + return this[4].toBytes(); + } +} + +export class Raindex__removeOrder3InputOrderEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class Raindex__removeOrder3InputOrderValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class Raindex__removeOrder3InputOrderValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class Raindex__removeOrder3InputPostStruct extends ethereum.Tuple { + get evaluable(): Raindex__removeOrder3InputPostEvaluableStruct { + return changetype( + this[0].toTuple(), + ); + } + + get signedContext(): Array { + return this[1].toTupleArray(); + } +} + +export class Raindex__removeOrder3InputPostEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class Raindex__removeOrder3InputPostSignedContextStruct extends ethereum.Tuple { + get signer(): Address { + return this[0].toAddress(); + } + + get context(): Array { + return this[1].toBytesArray(); + } + + get signature(): Bytes { + return this[2].toBytes(); + } +} + +export class Raindex__takeOrders4Result { + value0: Bytes; + value1: Bytes; + + constructor(value0: Bytes, value1: Bytes) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromFixedBytes(this.value0)); + map.set("value1", ethereum.Value.fromFixedBytes(this.value1)); + return map; + } + + getTotalTakerInput(): Bytes { + return this.value0; + } + + getTotalTakerOutput(): Bytes { + return this.value1; + } +} + +export class Raindex__takeOrders4InputConfigStruct extends ethereum.Tuple { + get minimumIO(): Bytes { + return this[0].toBytes(); + } + + get maximumIO(): Bytes { + return this[1].toBytes(); + } + + get maximumIORatio(): Bytes { + return this[2].toBytes(); + } + + get IOIsInput(): boolean { + return this[3].toBoolean(); + } + + get orders(): Array { + return this[4].toTupleArray(); + } + + get data(): Bytes { + return this[5].toBytes(); + } +} + +export class Raindex__takeOrders4InputConfigOrdersStruct extends ethereum.Tuple { + get order(): Raindex__takeOrders4InputConfigOrdersOrderStruct { + return changetype( + this[0].toTuple(), + ); + } + + get inputIOIndex(): BigInt { + return this[1].toBigInt(); + } + + get outputIOIndex(): BigInt { + return this[2].toBigInt(); + } + + get signedContext(): Array { + return this[3].toTupleArray(); + } +} + +export class Raindex__takeOrders4InputConfigOrdersOrderStruct extends ethereum.Tuple { + get owner(): Address { + return this[0].toAddress(); + } + + get evaluable(): Raindex__takeOrders4InputConfigOrdersOrderEvaluableStruct { + return changetype( + this[1].toTuple(), + ); + } + + get validInputs(): Array { + return this[2].toTupleArray(); + } + + get validOutputs(): Array { + return this[3].toTupleArray(); + } + + get nonce(): Bytes { + return this[4].toBytes(); + } +} + +export class Raindex__takeOrders4InputConfigOrdersOrderEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class Raindex__takeOrders4InputConfigOrdersOrderValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class Raindex__takeOrders4InputConfigOrdersOrderValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class Raindex__takeOrders4InputConfigOrdersSignedContextStruct extends ethereum.Tuple { + get signer(): Address { + return this[0].toAddress(); + } + + get context(): Array { + return this[1].toBytesArray(); + } + + get signature(): Bytes { + return this[2].toBytes(); + } +} + +export class Raindex extends ethereum.SmartContract { + static bind(address: Address): Raindex { + return new Raindex("Raindex", address); + } + + addOrder4( + orderConfig: Raindex__addOrder4InputOrderConfigStruct, + post: Array, + ): boolean { + let result = super.call( + "addOrder4", + "addOrder4(((address,address,bytes),(address,bytes32)[],(address,bytes32)[],bytes32,bytes32,bytes),((address,address,bytes),(address,bytes32[],bytes)[])[]):(bool)", + [ + ethereum.Value.fromTuple(orderConfig), + ethereum.Value.fromTupleArray(post), + ], + ); + + return result[0].toBoolean(); + } + + try_addOrder4( + orderConfig: Raindex__addOrder4InputOrderConfigStruct, + post: Array, + ): ethereum.CallResult { + let result = super.tryCall( + "addOrder4", + "addOrder4(((address,address,bytes),(address,bytes32)[],(address,bytes32)[],bytes32,bytes32,bytes),((address,address,bytes),(address,bytes32[],bytes)[])[]):(bool)", + [ + ethereum.Value.fromTuple(orderConfig), + ethereum.Value.fromTupleArray(post), + ], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + flashFee(param0: Address, param1: BigInt): BigInt { + let result = super.call("flashFee", "flashFee(address,uint256):(uint256)", [ + ethereum.Value.fromAddress(param0), + ethereum.Value.fromUnsignedBigInt(param1), + ]); + + return result[0].toBigInt(); + } + + try_flashFee(param0: Address, param1: BigInt): ethereum.CallResult { + let result = super.tryCall( + "flashFee", + "flashFee(address,uint256):(uint256)", + [ + ethereum.Value.fromAddress(param0), + ethereum.Value.fromUnsignedBigInt(param1), + ], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + flashLoan( + receiver: Address, + token: Address, + amount: BigInt, + data: Bytes, + ): boolean { + let result = super.call( + "flashLoan", + "flashLoan(address,address,uint256,bytes):(bool)", + [ + ethereum.Value.fromAddress(receiver), + ethereum.Value.fromAddress(token), + ethereum.Value.fromUnsignedBigInt(amount), + ethereum.Value.fromBytes(data), + ], + ); + + return result[0].toBoolean(); + } + + try_flashLoan( + receiver: Address, + token: Address, + amount: BigInt, + data: Bytes, + ): ethereum.CallResult { + let result = super.tryCall( + "flashLoan", + "flashLoan(address,address,uint256,bytes):(bool)", + [ + ethereum.Value.fromAddress(receiver), + ethereum.Value.fromAddress(token), + ethereum.Value.fromUnsignedBigInt(amount), + ethereum.Value.fromBytes(data), + ], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + maxFlashLoan(token: Address): BigInt { + let result = super.call("maxFlashLoan", "maxFlashLoan(address):(uint256)", [ + ethereum.Value.fromAddress(token), + ]); + + return result[0].toBigInt(); + } + + try_maxFlashLoan(token: Address): ethereum.CallResult { + let result = super.tryCall( + "maxFlashLoan", + "maxFlashLoan(address):(uint256)", + [ethereum.Value.fromAddress(token)], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + multicall(data: Array): Array { + let result = super.call("multicall", "multicall(bytes[]):(bytes[])", [ + ethereum.Value.fromBytesArray(data), + ]); + + return result[0].toBytesArray(); + } + + try_multicall(data: Array): ethereum.CallResult> { + let result = super.tryCall("multicall", "multicall(bytes[]):(bytes[])", [ + ethereum.Value.fromBytesArray(data), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytesArray()); + } + + orderExists(orderHash: Bytes): boolean { + let result = super.call("orderExists", "orderExists(bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(orderHash), + ]); + + return result[0].toBoolean(); + } + + try_orderExists(orderHash: Bytes): ethereum.CallResult { + let result = super.tryCall("orderExists", "orderExists(bytes32):(bool)", [ + ethereum.Value.fromFixedBytes(orderHash), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + quote2( + quoteConfig: Raindex__quote2InputQuoteConfigStruct, + ): Raindex__quote2Result { + let result = super.call( + "quote2", + "quote2(((address,(address,address,bytes),(address,bytes32)[],(address,bytes32)[],bytes32),uint256,uint256,(address,bytes32[],bytes)[])):(bool,bytes32,bytes32)", + [ethereum.Value.fromTuple(quoteConfig)], + ); + + return new Raindex__quote2Result( + result[0].toBoolean(), + result[1].toBytes(), + result[2].toBytes(), + ); + } + + try_quote2( + quoteConfig: Raindex__quote2InputQuoteConfigStruct, + ): ethereum.CallResult { + let result = super.tryCall( + "quote2", + "quote2(((address,(address,address,bytes),(address,bytes32)[],(address,bytes32)[],bytes32),uint256,uint256,(address,bytes32[],bytes)[])):(bool,bytes32,bytes32)", + [ethereum.Value.fromTuple(quoteConfig)], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Raindex__quote2Result( + value[0].toBoolean(), + value[1].toBytes(), + value[2].toBytes(), + ), + ); + } + + removeOrder3( + order: Raindex__removeOrder3InputOrderStruct, + post: Array, + ): boolean { + let result = super.call( + "removeOrder3", + "removeOrder3((address,(address,address,bytes),(address,bytes32)[],(address,bytes32)[],bytes32),((address,address,bytes),(address,bytes32[],bytes)[])[]):(bool)", + [ethereum.Value.fromTuple(order), ethereum.Value.fromTupleArray(post)], + ); + + return result[0].toBoolean(); + } + + try_removeOrder3( + order: Raindex__removeOrder3InputOrderStruct, + post: Array, + ): ethereum.CallResult { + let result = super.tryCall( + "removeOrder3", + "removeOrder3((address,(address,address,bytes),(address,bytes32)[],(address,bytes32)[],bytes32),((address,address,bytes),(address,bytes32[],bytes)[])[]):(bool)", + [ethereum.Value.fromTuple(order), ethereum.Value.fromTupleArray(post)], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + supportsInterface(interfaceId: Bytes): boolean { + let result = super.call( + "supportsInterface", + "supportsInterface(bytes4):(bool)", + [ethereum.Value.fromFixedBytes(interfaceId)], + ); + + return result[0].toBoolean(); + } + + try_supportsInterface(interfaceId: Bytes): ethereum.CallResult { + let result = super.tryCall( + "supportsInterface", + "supportsInterface(bytes4):(bool)", + [ethereum.Value.fromFixedBytes(interfaceId)], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + takeOrders4( + config: Raindex__takeOrders4InputConfigStruct, + ): Raindex__takeOrders4Result { + let result = super.call( + "takeOrders4", + "takeOrders4((bytes32,bytes32,bytes32,bool,((address,(address,address,bytes),(address,bytes32)[],(address,bytes32)[],bytes32),uint256,uint256,(address,bytes32[],bytes)[])[],bytes)):(bytes32,bytes32)", + [ethereum.Value.fromTuple(config)], + ); + + return new Raindex__takeOrders4Result( + result[0].toBytes(), + result[1].toBytes(), + ); + } + + try_takeOrders4( + config: Raindex__takeOrders4InputConfigStruct, + ): ethereum.CallResult { + let result = super.tryCall( + "takeOrders4", + "takeOrders4((bytes32,bytes32,bytes32,bool,((address,(address,address,bytes),(address,bytes32)[],(address,bytes32)[],bytes32),uint256,uint256,(address,bytes32[],bytes)[])[],bytes)):(bytes32,bytes32)", + [ethereum.Value.fromTuple(config)], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Raindex__takeOrders4Result(value[0].toBytes(), value[1].toBytes()), + ); + } + + vaultBalance2(owner: Address, token: Address, vaultId: Bytes): Bytes { + let result = super.call( + "vaultBalance2", + "vaultBalance2(address,address,bytes32):(bytes32)", + [ + ethereum.Value.fromAddress(owner), + ethereum.Value.fromAddress(token), + ethereum.Value.fromFixedBytes(vaultId), + ], + ); + + return result[0].toBytes(); + } + + try_vaultBalance2( + owner: Address, + token: Address, + vaultId: Bytes, + ): ethereum.CallResult { + let result = super.tryCall( + "vaultBalance2", + "vaultBalance2(address,address,bytes32):(bytes32)", + [ + ethereum.Value.fromAddress(owner), + ethereum.Value.fromAddress(token), + ethereum.Value.fromFixedBytes(vaultId), + ], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } +} + +export class AddOrder4Call extends ethereum.Call { + get inputs(): AddOrder4Call__Inputs { + return new AddOrder4Call__Inputs(this); + } + + get outputs(): AddOrder4Call__Outputs { + return new AddOrder4Call__Outputs(this); + } +} + +export class AddOrder4Call__Inputs { + _call: AddOrder4Call; + + constructor(call: AddOrder4Call) { + this._call = call; + } + + get orderConfig(): AddOrder4CallOrderConfigStruct { + return changetype( + this._call.inputValues[0].value.toTuple(), + ); + } + + get post(): Array { + return this._call.inputValues[1].value.toTupleArray(); + } +} + +export class AddOrder4Call__Outputs { + _call: AddOrder4Call; + + constructor(call: AddOrder4Call) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class AddOrder4CallOrderConfigStruct extends ethereum.Tuple { + get evaluable(): AddOrder4CallOrderConfigEvaluableStruct { + return changetype( + this[0].toTuple(), + ); + } + + get validInputs(): Array { + return this[1].toTupleArray(); + } + + get validOutputs(): Array { + return this[2].toTupleArray(); + } + + get nonce(): Bytes { + return this[3].toBytes(); + } + + get secret(): Bytes { + return this[4].toBytes(); + } + + get meta(): Bytes { + return this[5].toBytes(); + } +} + +export class AddOrder4CallOrderConfigEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class AddOrder4CallOrderConfigValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class AddOrder4CallOrderConfigValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class AddOrder4CallPostStruct extends ethereum.Tuple { + get evaluable(): AddOrder4CallPostEvaluableStruct { + return changetype(this[0].toTuple()); + } + + get signedContext(): Array { + return this[1].toTupleArray(); + } +} + +export class AddOrder4CallPostEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class AddOrder4CallPostSignedContextStruct extends ethereum.Tuple { + get signer(): Address { + return this[0].toAddress(); + } + + get context(): Array { + return this[1].toBytesArray(); + } + + get signature(): Bytes { + return this[2].toBytes(); + } +} + +export class Clear3Call extends ethereum.Call { + get inputs(): Clear3Call__Inputs { + return new Clear3Call__Inputs(this); + } + + get outputs(): Clear3Call__Outputs { + return new Clear3Call__Outputs(this); + } +} + +export class Clear3Call__Inputs { + _call: Clear3Call; + + constructor(call: Clear3Call) { + this._call = call; + } + + get aliceOrder(): Clear3CallAliceOrderStruct { + return changetype( + this._call.inputValues[0].value.toTuple(), + ); + } + + get bobOrder(): Clear3CallBobOrderStruct { + return changetype( + this._call.inputValues[1].value.toTuple(), + ); + } + + get clearConfig(): Clear3CallClearConfigStruct { + return changetype( + this._call.inputValues[2].value.toTuple(), + ); + } + + get aliceSignedContext(): Array { + return this._call.inputValues[3].value.toTupleArray(); + } + + get bobSignedContext(): Array { + return this._call.inputValues[4].value.toTupleArray(); + } +} + +export class Clear3Call__Outputs { + _call: Clear3Call; + + constructor(call: Clear3Call) { + this._call = call; + } +} + +export class Clear3CallAliceOrderStruct extends ethereum.Tuple { + get owner(): Address { + return this[0].toAddress(); + } + + get evaluable(): Clear3CallAliceOrderEvaluableStruct { + return changetype(this[1].toTuple()); + } + + get validInputs(): Array { + return this[2].toTupleArray(); + } + + get validOutputs(): Array { + return this[3].toTupleArray(); + } + + get nonce(): Bytes { + return this[4].toBytes(); + } +} + +export class Clear3CallAliceOrderEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class Clear3CallAliceOrderValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class Clear3CallAliceOrderValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class Clear3CallBobOrderStruct extends ethereum.Tuple { + get owner(): Address { + return this[0].toAddress(); + } + + get evaluable(): Clear3CallBobOrderEvaluableStruct { + return changetype(this[1].toTuple()); + } + + get validInputs(): Array { + return this[2].toTupleArray(); + } + + get validOutputs(): Array { + return this[3].toTupleArray(); + } + + get nonce(): Bytes { + return this[4].toBytes(); + } +} + +export class Clear3CallBobOrderEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class Clear3CallBobOrderValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class Clear3CallBobOrderValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class Clear3CallClearConfigStruct extends ethereum.Tuple { + get aliceInputIOIndex(): BigInt { + return this[0].toBigInt(); + } + + get aliceOutputIOIndex(): BigInt { + return this[1].toBigInt(); + } + + get bobInputIOIndex(): BigInt { + return this[2].toBigInt(); + } + + get bobOutputIOIndex(): BigInt { + return this[3].toBigInt(); + } + + get aliceBountyVaultId(): Bytes { + return this[4].toBytes(); + } + + get bobBountyVaultId(): Bytes { + return this[5].toBytes(); + } +} + +export class Clear3CallAliceSignedContextStruct extends ethereum.Tuple { + get signer(): Address { + return this[0].toAddress(); + } + + get context(): Array { + return this[1].toBytesArray(); + } + + get signature(): Bytes { + return this[2].toBytes(); + } +} + +export class Clear3CallBobSignedContextStruct extends ethereum.Tuple { + get signer(): Address { + return this[0].toAddress(); + } + + get context(): Array { + return this[1].toBytesArray(); + } + + get signature(): Bytes { + return this[2].toBytes(); + } +} + +export class Deposit4Call extends ethereum.Call { + get inputs(): Deposit4Call__Inputs { + return new Deposit4Call__Inputs(this); + } + + get outputs(): Deposit4Call__Outputs { + return new Deposit4Call__Outputs(this); + } +} + +export class Deposit4Call__Inputs { + _call: Deposit4Call; + + constructor(call: Deposit4Call) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get vaultId(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } + + get depositAmount(): Bytes { + return this._call.inputValues[2].value.toBytes(); + } + + get post(): Array { + return this._call.inputValues[3].value.toTupleArray(); + } +} + +export class Deposit4Call__Outputs { + _call: Deposit4Call; + + constructor(call: Deposit4Call) { + this._call = call; + } +} + +export class Deposit4CallPostStruct extends ethereum.Tuple { + get evaluable(): Deposit4CallPostEvaluableStruct { + return changetype(this[0].toTuple()); + } + + get signedContext(): Array { + return this[1].toTupleArray(); + } +} + +export class Deposit4CallPostEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class Deposit4CallPostSignedContextStruct extends ethereum.Tuple { + get signer(): Address { + return this[0].toAddress(); + } + + get context(): Array { + return this[1].toBytesArray(); + } + + get signature(): Bytes { + return this[2].toBytes(); + } +} + +export class Entask2Call extends ethereum.Call { + get inputs(): Entask2Call__Inputs { + return new Entask2Call__Inputs(this); + } + + get outputs(): Entask2Call__Outputs { + return new Entask2Call__Outputs(this); + } +} + +export class Entask2Call__Inputs { + _call: Entask2Call; + + constructor(call: Entask2Call) { + this._call = call; + } + + get post(): Array { + return this._call.inputValues[0].value.toTupleArray(); + } +} + +export class Entask2Call__Outputs { + _call: Entask2Call; + + constructor(call: Entask2Call) { + this._call = call; + } +} + +export class Entask2CallPostStruct extends ethereum.Tuple { + get evaluable(): Entask2CallPostEvaluableStruct { + return changetype(this[0].toTuple()); + } + + get signedContext(): Array { + return this[1].toTupleArray(); + } +} + +export class Entask2CallPostEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class Entask2CallPostSignedContextStruct extends ethereum.Tuple { + get signer(): Address { + return this[0].toAddress(); + } + + get context(): Array { + return this[1].toBytesArray(); + } + + get signature(): Bytes { + return this[2].toBytes(); + } +} + +export class FlashLoanCall extends ethereum.Call { + get inputs(): FlashLoanCall__Inputs { + return new FlashLoanCall__Inputs(this); + } + + get outputs(): FlashLoanCall__Outputs { + return new FlashLoanCall__Outputs(this); + } +} + +export class FlashLoanCall__Inputs { + _call: FlashLoanCall; + + constructor(call: FlashLoanCall) { + this._call = call; + } + + get receiver(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get token(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get data(): Bytes { + return this._call.inputValues[3].value.toBytes(); + } +} + +export class FlashLoanCall__Outputs { + _call: FlashLoanCall; + + constructor(call: FlashLoanCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class MulticallCall extends ethereum.Call { + get inputs(): MulticallCall__Inputs { + return new MulticallCall__Inputs(this); + } + + get outputs(): MulticallCall__Outputs { + return new MulticallCall__Outputs(this); + } +} + +export class MulticallCall__Inputs { + _call: MulticallCall; + + constructor(call: MulticallCall) { + this._call = call; + } + + get data(): Array { + return this._call.inputValues[0].value.toBytesArray(); + } +} + +export class MulticallCall__Outputs { + _call: MulticallCall; + + constructor(call: MulticallCall) { + this._call = call; + } + + get results(): Array { + return this._call.outputValues[0].value.toBytesArray(); + } +} + +export class RemoveOrder3Call extends ethereum.Call { + get inputs(): RemoveOrder3Call__Inputs { + return new RemoveOrder3Call__Inputs(this); + } + + get outputs(): RemoveOrder3Call__Outputs { + return new RemoveOrder3Call__Outputs(this); + } +} + +export class RemoveOrder3Call__Inputs { + _call: RemoveOrder3Call; + + constructor(call: RemoveOrder3Call) { + this._call = call; + } + + get order(): RemoveOrder3CallOrderStruct { + return changetype( + this._call.inputValues[0].value.toTuple(), + ); + } + + get post(): Array { + return this._call.inputValues[1].value.toTupleArray(); + } +} + +export class RemoveOrder3Call__Outputs { + _call: RemoveOrder3Call; + + constructor(call: RemoveOrder3Call) { + this._call = call; + } + + get stateChanged(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class RemoveOrder3CallOrderStruct extends ethereum.Tuple { + get owner(): Address { + return this[0].toAddress(); + } + + get evaluable(): RemoveOrder3CallOrderEvaluableStruct { + return changetype(this[1].toTuple()); + } + + get validInputs(): Array { + return this[2].toTupleArray(); + } + + get validOutputs(): Array { + return this[3].toTupleArray(); + } + + get nonce(): Bytes { + return this[4].toBytes(); + } +} + +export class RemoveOrder3CallOrderEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class RemoveOrder3CallOrderValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class RemoveOrder3CallOrderValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class RemoveOrder3CallPostStruct extends ethereum.Tuple { + get evaluable(): RemoveOrder3CallPostEvaluableStruct { + return changetype(this[0].toTuple()); + } + + get signedContext(): Array { + return this[1].toTupleArray(); + } +} + +export class RemoveOrder3CallPostEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class RemoveOrder3CallPostSignedContextStruct extends ethereum.Tuple { + get signer(): Address { + return this[0].toAddress(); + } + + get context(): Array { + return this[1].toBytesArray(); + } + + get signature(): Bytes { + return this[2].toBytes(); + } +} + +export class TakeOrders4Call extends ethereum.Call { + get inputs(): TakeOrders4Call__Inputs { + return new TakeOrders4Call__Inputs(this); + } + + get outputs(): TakeOrders4Call__Outputs { + return new TakeOrders4Call__Outputs(this); + } +} + +export class TakeOrders4Call__Inputs { + _call: TakeOrders4Call; + + constructor(call: TakeOrders4Call) { + this._call = call; + } + + get config(): TakeOrders4CallConfigStruct { + return changetype( + this._call.inputValues[0].value.toTuple(), + ); + } +} + +export class TakeOrders4Call__Outputs { + _call: TakeOrders4Call; + + constructor(call: TakeOrders4Call) { + this._call = call; + } + + get totalTakerInput(): Bytes { + return this._call.outputValues[0].value.toBytes(); + } + + get totalTakerOutput(): Bytes { + return this._call.outputValues[1].value.toBytes(); + } +} + +export class TakeOrders4CallConfigStruct extends ethereum.Tuple { + get minimumIO(): Bytes { + return this[0].toBytes(); + } + + get maximumIO(): Bytes { + return this[1].toBytes(); + } + + get maximumIORatio(): Bytes { + return this[2].toBytes(); + } + + get IOIsInput(): boolean { + return this[3].toBoolean(); + } + + get orders(): Array { + return this[4].toTupleArray(); + } + + get data(): Bytes { + return this[5].toBytes(); + } +} + +export class TakeOrders4CallConfigOrdersStruct extends ethereum.Tuple { + get order(): TakeOrders4CallConfigOrdersOrderStruct { + return changetype( + this[0].toTuple(), + ); + } + + get inputIOIndex(): BigInt { + return this[1].toBigInt(); + } + + get outputIOIndex(): BigInt { + return this[2].toBigInt(); + } + + get signedContext(): Array { + return this[3].toTupleArray(); + } +} + +export class TakeOrders4CallConfigOrdersOrderStruct extends ethereum.Tuple { + get owner(): Address { + return this[0].toAddress(); + } + + get evaluable(): TakeOrders4CallConfigOrdersOrderEvaluableStruct { + return changetype( + this[1].toTuple(), + ); + } + + get validInputs(): Array { + return this[2].toTupleArray(); + } + + get validOutputs(): Array { + return this[3].toTupleArray(); + } + + get nonce(): Bytes { + return this[4].toBytes(); + } +} + +export class TakeOrders4CallConfigOrdersOrderEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class TakeOrders4CallConfigOrdersOrderValidInputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class TakeOrders4CallConfigOrdersOrderValidOutputsStruct extends ethereum.Tuple { + get token(): Address { + return this[0].toAddress(); + } + + get vaultId(): Bytes { + return this[1].toBytes(); + } +} + +export class TakeOrders4CallConfigOrdersSignedContextStruct extends ethereum.Tuple { + get signer(): Address { + return this[0].toAddress(); + } + + get context(): Array { + return this[1].toBytesArray(); + } + + get signature(): Bytes { + return this[2].toBytes(); + } +} + +export class Withdraw4Call extends ethereum.Call { + get inputs(): Withdraw4Call__Inputs { + return new Withdraw4Call__Inputs(this); + } + + get outputs(): Withdraw4Call__Outputs { + return new Withdraw4Call__Outputs(this); + } +} + +export class Withdraw4Call__Inputs { + _call: Withdraw4Call; + + constructor(call: Withdraw4Call) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get vaultId(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } + + get targetAmount(): Bytes { + return this._call.inputValues[2].value.toBytes(); + } + + get post(): Array { + return this._call.inputValues[3].value.toTupleArray(); + } +} + +export class Withdraw4Call__Outputs { + _call: Withdraw4Call; + + constructor(call: Withdraw4Call) { + this._call = call; + } +} + +export class Withdraw4CallPostStruct extends ethereum.Tuple { + get evaluable(): Withdraw4CallPostEvaluableStruct { + return changetype(this[0].toTuple()); + } + + get signedContext(): Array { + return this[1].toTupleArray(); + } +} + +export class Withdraw4CallPostEvaluableStruct extends ethereum.Tuple { + get interpreter(): Address { + return this[0].toAddress(); + } + + get store(): Address { + return this[1].toAddress(); + } + + get bytecode(): Bytes { + return this[2].toBytes(); + } +} + +export class Withdraw4CallPostSignedContextStruct extends ethereum.Tuple { + get signer(): Address { + return this[0].toAddress(); + } + + get context(): Array { + return this[1].toBytesArray(); + } + + get signature(): Bytes { + return this[2].toBytes(); + } +} diff --git a/subgraph/generated/schema.ts b/subgraph/generated/schema.ts new file mode 100644 index 0000000000..67eb08dce0 --- /dev/null +++ b/subgraph/generated/schema.ts @@ -0,0 +1,2247 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + TypedMap, + Entity, + Value, + ValueKind, + store, + Bytes, + BigInt, + BigDecimal, +} from "@graphprotocol/graph-ts"; + +export class Raindex extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Raindex entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type Raindex must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("Raindex", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): Raindex | null { + return changetype( + store.get_in_block("Raindex", id.toHexString()), + ); + } + + static load(id: Bytes): Raindex | null { + return changetype(store.get("Raindex", id.toHexString())); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get orders(): OrderLoader { + return new OrderLoader( + "Raindex", + this.get("id")!.toBytes().toHexString(), + "orders", + ); + } + + get trades(): TradeLoader { + return new TradeLoader( + "Raindex", + this.get("id")!.toBytes().toHexString(), + "trades", + ); + } + + get vaults(): VaultLoader { + return new VaultLoader( + "Raindex", + this.get("id")!.toBytes().toHexString(), + "vaults", + ); + } + + get deposits(): DepositLoader { + return new DepositLoader( + "Raindex", + this.get("id")!.toBytes().toHexString(), + "deposits", + ); + } + + get withdrawals(): WithdrawalLoader { + return new WithdrawalLoader( + "Raindex", + this.get("id")!.toBytes().toHexString(), + "withdrawals", + ); + } + + get addOrders(): AddOrderLoader { + return new AddOrderLoader( + "Raindex", + this.get("id")!.toBytes().toHexString(), + "addOrders", + ); + } + + get removeOrders(): RemoveOrderLoader { + return new RemoveOrderLoader( + "Raindex", + this.get("id")!.toBytes().toHexString(), + "removeOrders", + ); + } + + get takeOrders(): TakeOrderLoader { + return new TakeOrderLoader( + "Raindex", + this.get("id")!.toBytes().toHexString(), + "takeOrders", + ); + } +} + +export class Vault extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Vault entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type Vault must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("Vault", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): Vault | null { + return changetype( + store.get_in_block("Vault", id.toHexString()), + ); + } + + static load(id: Bytes): Vault | null { + return changetype(store.get("Vault", id.toHexString())); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get raindex(): Bytes { + let value = this.get("raindex"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set raindex(value: Bytes) { + this.set("raindex", Value.fromBytes(value)); + } + + get token(): Bytes { + let value = this.get("token"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set token(value: Bytes) { + this.set("token", Value.fromBytes(value)); + } + + get owner(): Bytes { + let value = this.get("owner"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set owner(value: Bytes) { + this.set("owner", Value.fromBytes(value)); + } + + get vaultId(): Bytes { + let value = this.get("vaultId"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set vaultId(value: Bytes) { + this.set("vaultId", Value.fromBytes(value)); + } + + get ordersAsInput(): OrderLoader { + return new OrderLoader( + "Vault", + this.get("id")!.toBytes().toHexString(), + "ordersAsInput", + ); + } + + get ordersAsOutput(): OrderLoader { + return new OrderLoader( + "Vault", + this.get("id")!.toBytes().toHexString(), + "ordersAsOutput", + ); + } + + get balance(): Bytes { + let value = this.get("balance"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set balance(value: Bytes) { + this.set("balance", Value.fromBytes(value)); + } +} + +export class Deposit extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Deposit entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type Deposit must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("Deposit", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): Deposit | null { + return changetype( + store.get_in_block("Deposit", id.toHexString()), + ); + } + + static load(id: Bytes): Deposit | null { + return changetype(store.get("Deposit", id.toHexString())); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get raindex(): Bytes { + let value = this.get("raindex"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set raindex(value: Bytes) { + this.set("raindex", Value.fromBytes(value)); + } + + get vault(): Bytes { + let value = this.get("vault"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set vault(value: Bytes) { + this.set("vault", Value.fromBytes(value)); + } + + get amount(): Bytes { + let value = this.get("amount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set amount(value: Bytes) { + this.set("amount", Value.fromBytes(value)); + } + + get oldVaultBalance(): Bytes { + let value = this.get("oldVaultBalance"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set oldVaultBalance(value: Bytes) { + this.set("oldVaultBalance", Value.fromBytes(value)); + } + + get newVaultBalance(): Bytes { + let value = this.get("newVaultBalance"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set newVaultBalance(value: Bytes) { + this.set("newVaultBalance", Value.fromBytes(value)); + } + + get timestamp(): BigInt { + let value = this.get("timestamp"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set timestamp(value: BigInt) { + this.set("timestamp", Value.fromBigInt(value)); + } + + get transaction(): Bytes { + let value = this.get("transaction"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set transaction(value: Bytes) { + this.set("transaction", Value.fromBytes(value)); + } + + get sender(): Bytes { + let value = this.get("sender"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set sender(value: Bytes) { + this.set("sender", Value.fromBytes(value)); + } +} + +export class Withdrawal extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Withdrawal entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type Withdrawal must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("Withdrawal", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): Withdrawal | null { + return changetype( + store.get_in_block("Withdrawal", id.toHexString()), + ); + } + + static load(id: Bytes): Withdrawal | null { + return changetype( + store.get("Withdrawal", id.toHexString()), + ); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get targetAmount(): Bytes { + let value = this.get("targetAmount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set targetAmount(value: Bytes) { + this.set("targetAmount", Value.fromBytes(value)); + } + + get raindex(): Bytes { + let value = this.get("raindex"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set raindex(value: Bytes) { + this.set("raindex", Value.fromBytes(value)); + } + + get vault(): Bytes { + let value = this.get("vault"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set vault(value: Bytes) { + this.set("vault", Value.fromBytes(value)); + } + + get amount(): Bytes { + let value = this.get("amount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set amount(value: Bytes) { + this.set("amount", Value.fromBytes(value)); + } + + get oldVaultBalance(): Bytes { + let value = this.get("oldVaultBalance"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set oldVaultBalance(value: Bytes) { + this.set("oldVaultBalance", Value.fromBytes(value)); + } + + get newVaultBalance(): Bytes { + let value = this.get("newVaultBalance"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set newVaultBalance(value: Bytes) { + this.set("newVaultBalance", Value.fromBytes(value)); + } + + get timestamp(): BigInt { + let value = this.get("timestamp"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set timestamp(value: BigInt) { + this.set("timestamp", Value.fromBigInt(value)); + } + + get transaction(): Bytes { + let value = this.get("transaction"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set transaction(value: Bytes) { + this.set("transaction", Value.fromBytes(value)); + } + + get sender(): Bytes { + let value = this.get("sender"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set sender(value: Bytes) { + this.set("sender", Value.fromBytes(value)); + } +} + +export class TradeVaultBalanceChange extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert( + id != null, + "Cannot save TradeVaultBalanceChange entity without an ID", + ); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type TradeVaultBalanceChange must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("TradeVaultBalanceChange", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): TradeVaultBalanceChange | null { + return changetype( + store.get_in_block("TradeVaultBalanceChange", id.toHexString()), + ); + } + + static load(id: Bytes): TradeVaultBalanceChange | null { + return changetype( + store.get("TradeVaultBalanceChange", id.toHexString()), + ); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get raindex(): Bytes { + let value = this.get("raindex"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set raindex(value: Bytes) { + this.set("raindex", Value.fromBytes(value)); + } + + get trade(): Bytes { + let value = this.get("trade"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set trade(value: Bytes) { + this.set("trade", Value.fromBytes(value)); + } + + get vault(): Bytes { + let value = this.get("vault"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set vault(value: Bytes) { + this.set("vault", Value.fromBytes(value)); + } + + get amount(): Bytes { + let value = this.get("amount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set amount(value: Bytes) { + this.set("amount", Value.fromBytes(value)); + } + + get oldVaultBalance(): Bytes { + let value = this.get("oldVaultBalance"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set oldVaultBalance(value: Bytes) { + this.set("oldVaultBalance", Value.fromBytes(value)); + } + + get newVaultBalance(): Bytes { + let value = this.get("newVaultBalance"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set newVaultBalance(value: Bytes) { + this.set("newVaultBalance", Value.fromBytes(value)); + } + + get timestamp(): BigInt { + let value = this.get("timestamp"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set timestamp(value: BigInt) { + this.set("timestamp", Value.fromBigInt(value)); + } + + get transaction(): Bytes { + let value = this.get("transaction"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set transaction(value: Bytes) { + this.set("transaction", Value.fromBytes(value)); + } +} + +export class ClearBounty extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save ClearBounty entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type ClearBounty must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("ClearBounty", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): ClearBounty | null { + return changetype( + store.get_in_block("ClearBounty", id.toHexString()), + ); + } + + static load(id: Bytes): ClearBounty | null { + return changetype( + store.get("ClearBounty", id.toHexString()), + ); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get raindex(): Bytes { + let value = this.get("raindex"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set raindex(value: Bytes) { + this.set("raindex", Value.fromBytes(value)); + } + + get sender(): Bytes { + let value = this.get("sender"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set sender(value: Bytes) { + this.set("sender", Value.fromBytes(value)); + } + + get vault(): Bytes { + let value = this.get("vault"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set vault(value: Bytes) { + this.set("vault", Value.fromBytes(value)); + } + + get amount(): Bytes { + let value = this.get("amount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set amount(value: Bytes) { + this.set("amount", Value.fromBytes(value)); + } + + get oldVaultBalance(): Bytes { + let value = this.get("oldVaultBalance"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set oldVaultBalance(value: Bytes) { + this.set("oldVaultBalance", Value.fromBytes(value)); + } + + get newVaultBalance(): Bytes { + let value = this.get("newVaultBalance"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set newVaultBalance(value: Bytes) { + this.set("newVaultBalance", Value.fromBytes(value)); + } + + get timestamp(): BigInt { + let value = this.get("timestamp"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set timestamp(value: BigInt) { + this.set("timestamp", Value.fromBigInt(value)); + } + + get transaction(): Bytes { + let value = this.get("transaction"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set transaction(value: Bytes) { + this.set("transaction", Value.fromBytes(value)); + } +} + +export class Order extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Order entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type Order must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("Order", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): Order | null { + return changetype( + store.get_in_block("Order", id.toHexString()), + ); + } + + static load(id: Bytes): Order | null { + return changetype(store.get("Order", id.toHexString())); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get raindex(): Bytes { + let value = this.get("raindex"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set raindex(value: Bytes) { + this.set("raindex", Value.fromBytes(value)); + } + + get active(): boolean { + let value = this.get("active"); + if (!value || value.kind == ValueKind.NULL) { + return false; + } else { + return value.toBoolean(); + } + } + + set active(value: boolean) { + this.set("active", Value.fromBoolean(value)); + } + + get orderHash(): Bytes { + let value = this.get("orderHash"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set orderHash(value: Bytes) { + this.set("orderHash", Value.fromBytes(value)); + } + + get owner(): Bytes { + let value = this.get("owner"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set owner(value: Bytes) { + this.set("owner", Value.fromBytes(value)); + } + + get inputs(): Array { + let value = this.get("inputs"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytesArray(); + } + } + + set inputs(value: Array) { + this.set("inputs", Value.fromBytesArray(value)); + } + + get outputs(): Array { + let value = this.get("outputs"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytesArray(); + } + } + + set outputs(value: Array) { + this.set("outputs", Value.fromBytesArray(value)); + } + + get nonce(): Bytes { + let value = this.get("nonce"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set nonce(value: Bytes) { + this.set("nonce", Value.fromBytes(value)); + } + + get orderBytes(): Bytes { + let value = this.get("orderBytes"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set orderBytes(value: Bytes) { + this.set("orderBytes", Value.fromBytes(value)); + } + + get addEvents(): AddOrderLoader { + return new AddOrderLoader( + "Order", + this.get("id")!.toBytes().toHexString(), + "addEvents", + ); + } + + get removeEvents(): RemoveOrderLoader { + return new RemoveOrderLoader( + "Order", + this.get("id")!.toBytes().toHexString(), + "removeEvents", + ); + } + + get trades(): TradeLoader { + return new TradeLoader( + "Order", + this.get("id")!.toBytes().toHexString(), + "trades", + ); + } + + get meta(): Bytes | null { + let value = this.get("meta"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set meta(value: Bytes | null) { + if (!value) { + this.unset("meta"); + } else { + this.set("meta", Value.fromBytes(value)); + } + } + + get timestampAdded(): BigInt { + let value = this.get("timestampAdded"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set timestampAdded(value: BigInt) { + this.set("timestampAdded", Value.fromBigInt(value)); + } +} + +export class AddOrder extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save AddOrder entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type AddOrder must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("AddOrder", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): AddOrder | null { + return changetype( + store.get_in_block("AddOrder", id.toHexString()), + ); + } + + static load(id: Bytes): AddOrder | null { + return changetype(store.get("AddOrder", id.toHexString())); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get order(): Bytes { + let value = this.get("order"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set order(value: Bytes) { + this.set("order", Value.fromBytes(value)); + } + + get raindex(): Bytes { + let value = this.get("raindex"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set raindex(value: Bytes) { + this.set("raindex", Value.fromBytes(value)); + } + + get transaction(): Bytes { + let value = this.get("transaction"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set transaction(value: Bytes) { + this.set("transaction", Value.fromBytes(value)); + } + + get sender(): Bytes { + let value = this.get("sender"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set sender(value: Bytes) { + this.set("sender", Value.fromBytes(value)); + } +} + +export class RemoveOrder extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save RemoveOrder entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type RemoveOrder must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("RemoveOrder", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): RemoveOrder | null { + return changetype( + store.get_in_block("RemoveOrder", id.toHexString()), + ); + } + + static load(id: Bytes): RemoveOrder | null { + return changetype( + store.get("RemoveOrder", id.toHexString()), + ); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get order(): Bytes { + let value = this.get("order"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set order(value: Bytes) { + this.set("order", Value.fromBytes(value)); + } + + get raindex(): Bytes { + let value = this.get("raindex"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set raindex(value: Bytes) { + this.set("raindex", Value.fromBytes(value)); + } + + get transaction(): Bytes { + let value = this.get("transaction"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set transaction(value: Bytes) { + this.set("transaction", Value.fromBytes(value)); + } + + get sender(): Bytes { + let value = this.get("sender"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set sender(value: Bytes) { + this.set("sender", Value.fromBytes(value)); + } +} + +export class Trade extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Trade entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type Trade must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("Trade", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): Trade | null { + return changetype( + store.get_in_block("Trade", id.toHexString()), + ); + } + + static load(id: Bytes): Trade | null { + return changetype(store.get("Trade", id.toHexString())); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get raindex(): Bytes { + let value = this.get("raindex"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set raindex(value: Bytes) { + this.set("raindex", Value.fromBytes(value)); + } + + get order(): Bytes { + let value = this.get("order"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set order(value: Bytes) { + this.set("order", Value.fromBytes(value)); + } + + get inputVaultBalanceChange(): Bytes { + let value = this.get("inputVaultBalanceChange"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set inputVaultBalanceChange(value: Bytes) { + this.set("inputVaultBalanceChange", Value.fromBytes(value)); + } + + get outputVaultBalanceChange(): Bytes { + let value = this.get("outputVaultBalanceChange"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set outputVaultBalanceChange(value: Bytes) { + this.set("outputVaultBalanceChange", Value.fromBytes(value)); + } + + get tradeEvent(): Bytes { + let value = this.get("tradeEvent"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set tradeEvent(value: Bytes) { + this.set("tradeEvent", Value.fromBytes(value)); + } + + get timestamp(): BigInt { + let value = this.get("timestamp"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set timestamp(value: BigInt) { + this.set("timestamp", Value.fromBigInt(value)); + } +} + +export class TakeOrder extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save TakeOrder entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type TakeOrder must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("TakeOrder", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): TakeOrder | null { + return changetype( + store.get_in_block("TakeOrder", id.toHexString()), + ); + } + + static load(id: Bytes): TakeOrder | null { + return changetype( + store.get("TakeOrder", id.toHexString()), + ); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get inputAmount(): Bytes { + let value = this.get("inputAmount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set inputAmount(value: Bytes) { + this.set("inputAmount", Value.fromBytes(value)); + } + + get outputAmount(): Bytes { + let value = this.get("outputAmount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set outputAmount(value: Bytes) { + this.set("outputAmount", Value.fromBytes(value)); + } + + get takeOrderConfigBytes(): Bytes { + let value = this.get("takeOrderConfigBytes"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set takeOrderConfigBytes(value: Bytes) { + this.set("takeOrderConfigBytes", Value.fromBytes(value)); + } + + get raindex(): Bytes { + let value = this.get("raindex"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set raindex(value: Bytes) { + this.set("raindex", Value.fromBytes(value)); + } + + get trades(): TradeLoader { + return new TradeLoader( + "TakeOrder", + this.get("id")!.toBytes().toHexString(), + "trades", + ); + } + + get transaction(): Bytes { + let value = this.get("transaction"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set transaction(value: Bytes) { + this.set("transaction", Value.fromBytes(value)); + } + + get sender(): Bytes { + let value = this.get("sender"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set sender(value: Bytes) { + this.set("sender", Value.fromBytes(value)); + } +} + +export class Clear extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Clear entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type Clear must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("Clear", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): Clear | null { + return changetype( + store.get_in_block("Clear", id.toHexString()), + ); + } + + static load(id: Bytes): Clear | null { + return changetype(store.get("Clear", id.toHexString())); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get aliceInputAmount(): Bytes { + let value = this.get("aliceInputAmount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set aliceInputAmount(value: Bytes) { + this.set("aliceInputAmount", Value.fromBytes(value)); + } + + get aliceOutputAmount(): Bytes { + let value = this.get("aliceOutputAmount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set aliceOutputAmount(value: Bytes) { + this.set("aliceOutputAmount", Value.fromBytes(value)); + } + + get bobInputAmount(): Bytes { + let value = this.get("bobInputAmount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set bobInputAmount(value: Bytes) { + this.set("bobInputAmount", Value.fromBytes(value)); + } + + get bobOutputAmount(): Bytes { + let value = this.get("bobOutputAmount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set bobOutputAmount(value: Bytes) { + this.set("bobOutputAmount", Value.fromBytes(value)); + } + + get aliceBountyAmount(): Bytes { + let value = this.get("aliceBountyAmount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set aliceBountyAmount(value: Bytes) { + this.set("aliceBountyAmount", Value.fromBytes(value)); + } + + get bobBountyAmount(): Bytes { + let value = this.get("bobBountyAmount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set bobBountyAmount(value: Bytes) { + this.set("bobBountyAmount", Value.fromBytes(value)); + } + + get aliceBountyVaultBalanceChange(): Bytes | null { + let value = this.get("aliceBountyVaultBalanceChange"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set aliceBountyVaultBalanceChange(value: Bytes | null) { + if (!value) { + this.unset("aliceBountyVaultBalanceChange"); + } else { + this.set("aliceBountyVaultBalanceChange", Value.fromBytes(value)); + } + } + + get bobBountyVaultBalanceChange(): Bytes | null { + let value = this.get("bobBountyVaultBalanceChange"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set bobBountyVaultBalanceChange(value: Bytes | null) { + if (!value) { + this.unset("bobBountyVaultBalanceChange"); + } else { + this.set("bobBountyVaultBalanceChange", Value.fromBytes(value)); + } + } + + get raindex(): Bytes { + let value = this.get("raindex"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set raindex(value: Bytes) { + this.set("raindex", Value.fromBytes(value)); + } + + get trades(): TradeLoader { + return new TradeLoader( + "Clear", + this.get("id")!.toBytes().toHexString(), + "trades", + ); + } + + get transaction(): Bytes { + let value = this.get("transaction"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set transaction(value: Bytes) { + this.set("transaction", Value.fromBytes(value)); + } + + get sender(): Bytes { + let value = this.get("sender"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set sender(value: Bytes) { + this.set("sender", Value.fromBytes(value)); + } +} + +export class Transaction extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Transaction entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type Transaction must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("Transaction", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): Transaction | null { + return changetype( + store.get_in_block("Transaction", id.toHexString()), + ); + } + + static load(id: Bytes): Transaction | null { + return changetype( + store.get("Transaction", id.toHexString()), + ); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get timestamp(): BigInt { + let value = this.get("timestamp"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set timestamp(value: BigInt) { + this.set("timestamp", Value.fromBigInt(value)); + } + + get blockNumber(): BigInt { + let value = this.get("blockNumber"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set blockNumber(value: BigInt) { + this.set("blockNumber", Value.fromBigInt(value)); + } + + get from(): Bytes { + let value = this.get("from"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set from(value: Bytes) { + this.set("from", Value.fromBytes(value)); + } +} + +export class ERC20 extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save ERC20 entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type ERC20 must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("ERC20", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): ERC20 | null { + return changetype( + store.get_in_block("ERC20", id.toHexString()), + ); + } + + static load(id: Bytes): ERC20 | null { + return changetype(store.get("ERC20", id.toHexString())); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get address(): Bytes { + let value = this.get("address"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set address(value: Bytes) { + this.set("address", Value.fromBytes(value)); + } + + get name(): string | null { + let value = this.get("name"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set name(value: string | null) { + if (!value) { + this.unset("name"); + } else { + this.set("name", Value.fromString(value)); + } + } + + get symbol(): string | null { + let value = this.get("symbol"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set symbol(value: string | null) { + if (!value) { + this.unset("symbol"); + } else { + this.set("symbol", Value.fromString(value)); + } + } + + get decimals(): BigInt | null { + let value = this.get("decimals"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set decimals(value: BigInt | null) { + if (!value) { + this.unset("decimals"); + } else { + this.set("decimals", Value.fromBigInt(value)); + } + } +} + +export class ClearTemporaryData extends Entity { + constructor(id: Bytes) { + super(); + this.set("id", Value.fromBytes(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save ClearTemporaryData entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.BYTES, + `Entities of type ClearTemporaryData must have an ID of type Bytes but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("ClearTemporaryData", id.toBytes().toHexString(), this); + } + } + + static loadInBlock(id: Bytes): ClearTemporaryData | null { + return changetype( + store.get_in_block("ClearTemporaryData", id.toHexString()), + ); + } + + static load(id: Bytes): ClearTemporaryData | null { + return changetype( + store.get("ClearTemporaryData", id.toHexString()), + ); + } + + get id(): Bytes { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set id(value: Bytes) { + this.set("id", Value.fromBytes(value)); + } + + get aliceOrderHash(): Bytes { + let value = this.get("aliceOrderHash"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set aliceOrderHash(value: Bytes) { + this.set("aliceOrderHash", Value.fromBytes(value)); + } + + get aliceAddress(): Bytes { + let value = this.get("aliceAddress"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set aliceAddress(value: Bytes) { + this.set("aliceAddress", Value.fromBytes(value)); + } + + get aliceInputVaultId(): Bytes { + let value = this.get("aliceInputVaultId"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set aliceInputVaultId(value: Bytes) { + this.set("aliceInputVaultId", Value.fromBytes(value)); + } + + get aliceInputToken(): Bytes { + let value = this.get("aliceInputToken"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set aliceInputToken(value: Bytes) { + this.set("aliceInputToken", Value.fromBytes(value)); + } + + get aliceOutputVaultId(): Bytes { + let value = this.get("aliceOutputVaultId"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set aliceOutputVaultId(value: Bytes) { + this.set("aliceOutputVaultId", Value.fromBytes(value)); + } + + get aliceOutputToken(): Bytes { + let value = this.get("aliceOutputToken"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set aliceOutputToken(value: Bytes) { + this.set("aliceOutputToken", Value.fromBytes(value)); + } + + get aliceBounty(): Bytes { + let value = this.get("aliceBounty"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set aliceBounty(value: Bytes) { + this.set("aliceBounty", Value.fromBytes(value)); + } + + get bobOrderHash(): Bytes { + let value = this.get("bobOrderHash"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set bobOrderHash(value: Bytes) { + this.set("bobOrderHash", Value.fromBytes(value)); + } + + get bobAddress(): Bytes { + let value = this.get("bobAddress"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set bobAddress(value: Bytes) { + this.set("bobAddress", Value.fromBytes(value)); + } + + get bobInputVaultId(): Bytes { + let value = this.get("bobInputVaultId"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set bobInputVaultId(value: Bytes) { + this.set("bobInputVaultId", Value.fromBytes(value)); + } + + get bobInputToken(): Bytes { + let value = this.get("bobInputToken"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set bobInputToken(value: Bytes) { + this.set("bobInputToken", Value.fromBytes(value)); + } + + get bobOutputVaultId(): Bytes { + let value = this.get("bobOutputVaultId"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set bobOutputVaultId(value: Bytes) { + this.set("bobOutputVaultId", Value.fromBytes(value)); + } + + get bobOutputToken(): Bytes { + let value = this.get("bobOutputToken"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set bobOutputToken(value: Bytes) { + this.set("bobOutputToken", Value.fromBytes(value)); + } + + get bobBounty(): Bytes { + let value = this.get("bobBounty"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set bobBounty(value: Bytes) { + this.set("bobBounty", Value.fromBytes(value)); + } +} + +export class OrderLoader extends Entity { + _entity: string; + _field: string; + _id: string; + + constructor(entity: string, id: string, field: string) { + super(); + this._entity = entity; + this._id = id; + this._field = field; + } + + load(): Order[] { + let value = store.loadRelated(this._entity, this._id, this._field); + return changetype(value); + } +} + +export class TradeLoader extends Entity { + _entity: string; + _field: string; + _id: string; + + constructor(entity: string, id: string, field: string) { + super(); + this._entity = entity; + this._id = id; + this._field = field; + } + + load(): Trade[] { + let value = store.loadRelated(this._entity, this._id, this._field); + return changetype(value); + } +} + +export class VaultLoader extends Entity { + _entity: string; + _field: string; + _id: string; + + constructor(entity: string, id: string, field: string) { + super(); + this._entity = entity; + this._id = id; + this._field = field; + } + + load(): Vault[] { + let value = store.loadRelated(this._entity, this._id, this._field); + return changetype(value); + } +} + +export class DepositLoader extends Entity { + _entity: string; + _field: string; + _id: string; + + constructor(entity: string, id: string, field: string) { + super(); + this._entity = entity; + this._id = id; + this._field = field; + } + + load(): Deposit[] { + let value = store.loadRelated(this._entity, this._id, this._field); + return changetype(value); + } +} + +export class WithdrawalLoader extends Entity { + _entity: string; + _field: string; + _id: string; + + constructor(entity: string, id: string, field: string) { + super(); + this._entity = entity; + this._id = id; + this._field = field; + } + + load(): Withdrawal[] { + let value = store.loadRelated(this._entity, this._id, this._field); + return changetype(value); + } +} + +export class AddOrderLoader extends Entity { + _entity: string; + _field: string; + _id: string; + + constructor(entity: string, id: string, field: string) { + super(); + this._entity = entity; + this._id = id; + this._field = field; + } + + load(): AddOrder[] { + let value = store.loadRelated(this._entity, this._id, this._field); + return changetype(value); + } +} + +export class RemoveOrderLoader extends Entity { + _entity: string; + _field: string; + _id: string; + + constructor(entity: string, id: string, field: string) { + super(); + this._entity = entity; + this._id = id; + this._field = field; + } + + load(): RemoveOrder[] { + let value = store.loadRelated(this._entity, this._id, this._field); + return changetype(value); + } +} + +export class TakeOrderLoader extends Entity { + _entity: string; + _field: string; + _id: string; + + constructor(entity: string, id: string, field: string) { + super(); + this._entity = entity; + this._id = id; + this._field = field; + } + + load(): TakeOrder[] { + let value = store.loadRelated(this._entity, this._id, this._field); + return changetype(value); + } +} diff --git a/subgraph/subgraph.yaml b/subgraph/subgraph.yaml index ebcf930c56..f7e063b46e 100644 --- a/subgraph/subgraph.yaml +++ b/subgraph/subgraph.yaml @@ -19,11 +19,11 @@ dataSources: - Transaction abis: - name: Raindex - file: ../out/RaindexV6.sol/RaindexV6.json + file: ./abis/Raindex.json - name: ERC20 - file: ../out/ERC20.sol/ERC20.json + file: ./abis/ERC20.json - name: DecimalFloat - file: ../out/DecimalFloat.sol/DecimalFloat.json + file: ./abis/DecimalFloat.json eventHandlers: - event: DepositV2(address,address,bytes32,uint256) handler: handleDeposit