Module brontes_classifier::DodoDPPPool

source ·
Expand description

Generated by the following Solidity interface…

interface DodoDPPPool {
    type RState is uint8;
    struct PMMState {
        uint256 i;
        uint256 K;
        uint256 B;
        uint256 Q;
        uint256 B0;
        uint256 Q0;
        RState R;
    }

    event DODOFlashLoan(address borrower, address assetTo, uint256 baseAmount, uint256 quoteAmount);
    event DODOSwap(address fromToken, address toToken, uint256 fromAmount, uint256 toAmount, address trader, address receiver);
    event LpFeeRateChange(uint256 newLpFeeRate);
    event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event RChange(RState newRState);

    function _BASE_PRICE_CUMULATIVE_LAST_() external view returns (uint256);
    function _BASE_RESERVE_() external view returns (uint112);
    function _BASE_TARGET_() external view returns (uint112);
    function _BASE_TOKEN_() external view returns (address);
    function _BLOCK_TIMESTAMP_LAST_() external view returns (uint32);
    function _IS_OPEN_TWAP_() external view returns (bool);
    function _I_() external view returns (uint128);
    function _K_() external view returns (uint64);
    function _LP_FEE_RATE_() external view returns (uint64);
    function _MAINTAINER_() external view returns (address);
    function _MT_FEE_RATE_MODEL_() external view returns (address);
    function _NEW_OWNER_() external view returns (address);
    function _OWNER_() external view returns (address);
    function _QUOTE_RESERVE_() external view returns (uint112);
    function _QUOTE_TARGET_() external view returns (uint112);
    function _QUOTE_TOKEN_() external view returns (address);
    function _RState_() external view returns (uint32);
    function claimOwnership() external;
    function flashLoan(uint256 baseAmount, uint256 quoteAmount, address assetTo, bytes memory data) external;
    function getBaseInput() external view returns (uint256 input);
    function getMidPrice() external view returns (uint256 midPrice);
    function getPMMState() external view returns (PMMState memory state);
    function getPMMStateForCall() external view returns (uint256 i, uint256 K, uint256 B, uint256 Q, uint256 B0, uint256 Q0, uint256 R);
    function getQuoteInput() external view returns (uint256 input);
    function getUserFeeRate(address user) external view returns (uint256 lpFeeRate, uint256 mtFeeRate);
    function getVaultReserve() external view returns (uint256 baseReserve, uint256 quoteReserve);
    function init(address owner, address maintainer, address baseTokenAddress, address quoteTokenAddress, uint256 lpFeeRate, address mtFeeRateModel, uint256 k, uint256 i, bool isOpenTWAP) external;
    function initOwner(address newOwner) external;
    function querySellBase(address trader, uint256 payBaseAmount) external view returns (uint256 receiveQuoteAmount, uint256 mtFee, RState newRState, uint256 newBaseTarget);
    function querySellQuote(address trader, uint256 payQuoteAmount) external view returns (uint256 receiveBaseAmount, uint256 mtFee, RState newRState, uint256 newQuoteTarget);
    function ratioSync() external;
    function reset(address assetTo, uint256 newLpFeeRate, uint256 newI, uint256 newK, uint256 baseOutAmount, uint256 quoteOutAmount, uint256 minBaseReserve, uint256 minQuoteReserve) external returns (bool);
    function retrieve(address to, address token, uint256 amount) external;
    function sellBase(address to) external returns (uint256 receiveQuoteAmount);
    function sellQuote(address to) external returns (uint256 receiveBaseAmount);
    function transferOwnership(address newOwner) external;
    function version() external pure returns (string memory);
}

…which was generated by the following JSON ABI:

[
  {
    "type": "function",
    "name": "_BASE_PRICE_CUMULATIVE_LAST_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_BASE_RESERVE_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint112",
        "internalType": "uint112"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_BASE_TARGET_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint112",
        "internalType": "uint112"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_BASE_TOKEN_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IERC20"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_BLOCK_TIMESTAMP_LAST_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint32",
        "internalType": "uint32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_IS_OPEN_TWAP_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_I_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint128",
        "internalType": "uint128"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_K_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint64",
        "internalType": "uint64"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_LP_FEE_RATE_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint64",
        "internalType": "uint64"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_MAINTAINER_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_MT_FEE_RATE_MODEL_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IFeeRateModel"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_NEW_OWNER_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_OWNER_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_QUOTE_RESERVE_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint112",
        "internalType": "uint112"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_QUOTE_TARGET_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint112",
        "internalType": "uint112"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_QUOTE_TOKEN_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IERC20"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "_RState_",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint32",
        "internalType": "uint32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "claimOwnership",
    "inputs": [],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "flashLoan",
    "inputs": [
      {
        "name": "baseAmount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "quoteAmount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "assetTo",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "data",
        "type": "bytes",
        "internalType": "bytes"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "getBaseInput",
    "inputs": [],
    "outputs": [
      {
        "name": "input",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getMidPrice",
    "inputs": [],
    "outputs": [
      {
        "name": "midPrice",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getPMMState",
    "inputs": [],
    "outputs": [
      {
        "name": "state",
        "type": "tuple",
        "internalType": "struct PMMPricing.PMMState",
        "components": [
          {
            "name": "i",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "K",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "B",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "Q",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "B0",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "Q0",
            "type": "uint256",
            "internalType": "uint256"
          },
          {
            "name": "R",
            "type": "uint8",
            "internalType": "enum PMMPricing.RState"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getPMMStateForCall",
    "inputs": [],
    "outputs": [
      {
        "name": "i",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "K",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "B",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "Q",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "B0",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "Q0",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "R",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getQuoteInput",
    "inputs": [],
    "outputs": [
      {
        "name": "input",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getUserFeeRate",
    "inputs": [
      {
        "name": "user",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "lpFeeRate",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "mtFeeRate",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getVaultReserve",
    "inputs": [],
    "outputs": [
      {
        "name": "baseReserve",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "quoteReserve",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "init",
    "inputs": [
      {
        "name": "owner",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "maintainer",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "baseTokenAddress",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "quoteTokenAddress",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "lpFeeRate",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "mtFeeRateModel",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "k",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "i",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "isOpenTWAP",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "initOwner",
    "inputs": [
      {
        "name": "newOwner",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "querySellBase",
    "inputs": [
      {
        "name": "trader",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "payBaseAmount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "receiveQuoteAmount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "mtFee",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "newRState",
        "type": "uint8",
        "internalType": "enum PMMPricing.RState"
      },
      {
        "name": "newBaseTarget",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "querySellQuote",
    "inputs": [
      {
        "name": "trader",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "payQuoteAmount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "receiveBaseAmount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "mtFee",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "newRState",
        "type": "uint8",
        "internalType": "enum PMMPricing.RState"
      },
      {
        "name": "newQuoteTarget",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "ratioSync",
    "inputs": [],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "reset",
    "inputs": [
      {
        "name": "assetTo",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "newLpFeeRate",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "newI",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "newK",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "baseOutAmount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "quoteOutAmount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "minBaseReserve",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "minQuoteReserve",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "retrieve",
    "inputs": [
      {
        "name": "to",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "token",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "sellBase",
    "inputs": [
      {
        "name": "to",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "receiveQuoteAmount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "sellQuote",
    "inputs": [
      {
        "name": "to",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "receiveBaseAmount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "transferOwnership",
    "inputs": [
      {
        "name": "newOwner",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "version",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "string",
        "internalType": "string"
      }
    ],
    "stateMutability": "pure"
  },
  {
    "type": "event",
    "name": "DODOFlashLoan",
    "inputs": [
      {
        "name": "borrower",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      },
      {
        "name": "assetTo",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      },
      {
        "name": "baseAmount",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      },
      {
        "name": "quoteAmount",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "DODOSwap",
    "inputs": [
      {
        "name": "fromToken",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      },
      {
        "name": "toToken",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      },
      {
        "name": "fromAmount",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      },
      {
        "name": "toAmount",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      },
      {
        "name": "trader",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      },
      {
        "name": "receiver",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "LpFeeRateChange",
    "inputs": [
      {
        "name": "newLpFeeRate",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "OwnershipTransferPrepared",
    "inputs": [
      {
        "name": "previousOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "newOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "OwnershipTransferred",
    "inputs": [
      {
        "name": "previousOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "newOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "RChange",
    "inputs": [
      {
        "name": "newRState",
        "type": "uint8",
        "indexed": false,
        "internalType": "enum PMMPricing.RState"
      }
    ],
    "anonymous": false
  }
]

Structs§

Enums§