Skip to content
Verified contractPartialLicenseRef-DCL-1.0

GenericPoolRaindexV7ArbOrderTaker

Address0x65bd3eef1df4fcaac56576d993d6b523e2cb49d7
Balance

0 ETH

 

Transactions

0

 

Compiler

solc 0.8.25

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.25+commit.b61c2a91
Language
solidity
Optimization
Yes, 800 runs
EVM version
cancun
License
LicenseRef-DCL-1.0
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,282,529
Creation transaction
0xc7a7e43c43…4a0770c3f3

71 files

The source code is large: one file is shown at a time. Choose a file in the list.

src/concrete/arb/GenericPoolRaindexV7ArbOrderTaker.sol

// SPDX-License-Identifier: LicenseRef-DCL-1.0
// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd
pragma solidity =0.8.25;

import {RaindexV7ArbOrderTaker, Float} from "../../abstract/RaindexV7ArbOrderTaker.sol";
import {LibGenericPoolExchange} from "../../lib/LibGenericPoolExchange.sol";

/// @title GenericPoolRaindexV7ArbOrderTaker
/// @notice Order-taker arb that swaps via an arbitrary external pool call.
/// The `takeOrdersData` is decoded as `(spender, pool, encodedFunctionCall)`.
contract GenericPoolRaindexV7ArbOrderTaker is RaindexV7ArbOrderTaker {
    constructor() {}

    /// @inheritdoc RaindexV7ArbOrderTaker
    /// @dev Decodes `takeOrdersData` as `(spender, pool, encodedFunctionCall)`
    /// and routes the swap through the specified pool via `LibGenericPoolExchange`.
    function onTakeOrders2(
        address inputToken,
        address outputToken,
        Float inputAmountSent,
        Float totalOutputAmount,
        bytes calldata takeOrdersData
    ) public virtual override {
        super.onTakeOrders2(inputToken, outputToken, inputAmountSent, totalOutputAmount, takeOrdersData);
        LibGenericPoolExchange.exchange(inputToken, takeOrdersData);
    }

    /// Allow arbitrary calls and ETH transfers to this contract without
    /// reverting. Any ETH still held when `finalizeArb` runs is swept to
    /// `msg.sender`. The arb holds no ETH between operations, so anyone who
    /// sends ETH outside an `arb` call forfeits it: an in-flight generic pool
    /// exchange forwards the contract's entire ETH balance to the pool before
    /// `finalizeArb` is reached.
    receive() external payable {}
    fallback() external payable {}
}
Compiler settingsShow
{
  "viaIR": false,
  "metadata": {
    "appendCBOR": false,
    "bytecodeHash": "none",
    "useLiteralContent": false
  },
  "libraries": {},
  "optimizer": {
    "runs": 800,
    "enabled": true
  },
  "evmVersion": "cancun",
  "remappings": [
    "@openzeppelin-contracts-5.7.0/=dependencies/@openzeppelin-contracts-5.7.0/",
    "forge-std-1.17.0/=dependencies/forge-std-1.17.0/",
    "rain-deploy-0.1.25/=dependencies/rain-deploy-0.1.25/",
    "rain-extrospection-0.1.16/=dependencies/rain-extrospection-0.1.16/",
    "rain-factory-0.2.5/=dependencies/rain-factory-0.2.5/",
    "rain-intorastring-0.1.4/=dependencies/rain-intorastring-0.1.4/",
    "rain-lib-hash-0.1.27/=dependencies/rain-lib-hash-0.1.27/",
    "rain-lib-memkv-0.2.0/=dependencies/rain-lib-memkv-0.2.0/",
    "rain-lib-typecast-0.1.4/=dependencies/rain-lib-typecast-0.1.4/",
    "rain-math-binary-0.1.4/=dependencies/rain-math-binary-0.1.4/",
    "rain-math-float-0.3.11/=dependencies/rain-math-float-0.3.11/",
    "rain-math-float-deploy-0.1.9/=dependencies/rain-math-float-deploy-0.1.9/",
    "rain-metadata-0.1.43/=dependencies/rain-metadata-0.1.43/",
    "rain-metadata-deploy-0.1.4/=dependencies/rain-metadata-deploy-0.1.4/",
    "rain-sol-codegen-0.1.39/=dependencies/rain-sol-codegen-0.1.39/",
    "rain-solmem-0.1.28/=dependencies/rain-solmem-0.1.28/",
    "rain-string-0.3.9/=dependencies/rain-string-0.3.9/",
    "rain-tofu-erc20-decimals-0.1.4/=dependencies/rain-tofu-erc20-decimals-0.1.4/",
    "rain-tofu-erc20-decimals-deploy-0.1.4/=dependencies/rain-tofu-erc20-decimals-deploy-0.1.4/",
    "raindex-interface-0.1.13/=dependencies/raindex-interface-0.1.13/",
    "rainlang-0.2.30/=dependencies/rainlang-0.2.30/",
    "@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.7.0/",
    "mut/=dependencies/rain-string-0.3.9/src/lib/mut/",
    "parse/=dependencies/rain-string-0.3.9/src/lib/parse/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.