{
  "$schema": "../../../../contract.schema.json",
  "released": true,
  "contractName": "SmartRouter",
  "deploymentName": "MangroveOrder-Router",
  "version": "2.1.0",
  "networkAddresses": {
    "81457": {
      "primaryAddress": "0x270C0Bc25795DceF15Bb6D374670eBe9eCf76998",
      "allAddresses": [
        {
          "address": "0x270C0Bc25795DceF15Bb6D374670eBe9eCf76998",
          "dependencies": [
            {
              "name": "Mangrove",
              "address": "0xb1a49C54192Ea59B233200eA38aB56650Dfb448C"
            }
          ]
        }
      ]
    },
    "42161": {
      "primaryAddress": "0x2F83f79390550227e5507D2036ec12e7D9b956f9",
      "allAddresses": [
        {
          "address": "0x2F83f79390550227e5507D2036ec12e7D9b956f9",
          "dependencies": [
            {
              "name": "Mangrove",
              "address": "0x109d9CDFA4aC534354873EF634EF63C235F93f61"
            }
          ]
        }
      ]
    }
  },
  "abi": [
    {
      "type": "constructor",
      "inputs": [
        {
          "name": "_forcedBinding",
          "type": "address",
          "internalType": "address"
        }
      ],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "admin",
      "inputs": [],
      "outputs": [
        { "name": "current", "type": "address", "internalType": "address" }
      ],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "bind",
      "inputs": [
        {
          "name": "makerContract",
          "type": "address",
          "internalType": "address"
        }
      ],
      "outputs": [],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "flush",
      "inputs": [
        {
          "name": "routingOrders",
          "type": "tuple[]",
          "internalType": "struct RoutingOrderLib.RoutingOrder[]",
          "components": [
            {
              "name": "token",
              "type": "address",
              "internalType": "contract IERC20"
            },
            {
              "name": "olKeyHash",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            { "name": "offerId", "type": "uint256", "internalType": "uint256" },
            {
              "name": "fundOwner",
              "type": "address",
              "internalType": "address"
            }
          ]
        }
      ],
      "outputs": [],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "forcedBinding",
      "inputs": [],
      "outputs": [{ "name": "", "type": "address", "internalType": "address" }],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "getLogic",
      "inputs": [
        {
          "name": "routingOrder",
          "type": "tuple",
          "internalType": "struct RoutingOrderLib.RoutingOrder",
          "components": [
            {
              "name": "token",
              "type": "address",
              "internalType": "contract IERC20"
            },
            {
              "name": "olKeyHash",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            { "name": "offerId", "type": "uint256", "internalType": "uint256" },
            {
              "name": "fundOwner",
              "type": "address",
              "internalType": "address"
            }
          ]
        }
      ],
      "outputs": [
        {
          "name": "",
          "type": "address",
          "internalType": "contract AbstractRoutingLogic"
        }
      ],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "isBound",
      "inputs": [
        { "name": "mkr", "type": "address", "internalType": "address" }
      ],
      "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "pull",
      "inputs": [
        {
          "name": "routingOrder",
          "type": "tuple",
          "internalType": "struct RoutingOrderLib.RoutingOrder",
          "components": [
            {
              "name": "token",
              "type": "address",
              "internalType": "contract IERC20"
            },
            {
              "name": "olKeyHash",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            { "name": "offerId", "type": "uint256", "internalType": "uint256" },
            {
              "name": "fundOwner",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        { "name": "amount", "type": "uint256", "internalType": "uint256" },
        { "name": "strict", "type": "bool", "internalType": "bool" }
      ],
      "outputs": [
        { "name": "pulled", "type": "uint256", "internalType": "uint256" }
      ],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "push",
      "inputs": [
        {
          "name": "routingOrder",
          "type": "tuple",
          "internalType": "struct RoutingOrderLib.RoutingOrder",
          "components": [
            {
              "name": "token",
              "type": "address",
              "internalType": "contract IERC20"
            },
            {
              "name": "olKeyHash",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            { "name": "offerId", "type": "uint256", "internalType": "uint256" },
            {
              "name": "fundOwner",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        { "name": "amount", "type": "uint256", "internalType": "uint256" }
      ],
      "outputs": [
        { "name": "pushed", "type": "uint256", "internalType": "uint256" }
      ],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "setAdmin",
      "inputs": [
        { "name": "admin_", "type": "address", "internalType": "address" }
      ],
      "outputs": [],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "setLogic",
      "inputs": [
        {
          "name": "routingOrder",
          "type": "tuple",
          "internalType": "struct RoutingOrderLib.RoutingOrder",
          "components": [
            {
              "name": "token",
              "type": "address",
              "internalType": "contract IERC20"
            },
            {
              "name": "olKeyHash",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            { "name": "offerId", "type": "uint256", "internalType": "uint256" },
            {
              "name": "fundOwner",
              "type": "address",
              "internalType": "address"
            }
          ]
        },
        {
          "name": "logic",
          "type": "address",
          "internalType": "contract AbstractRoutingLogic"
        }
      ],
      "outputs": [],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "tokenBalanceOf",
      "inputs": [
        {
          "name": "routingOrder",
          "type": "tuple",
          "internalType": "struct RoutingOrderLib.RoutingOrder",
          "components": [
            {
              "name": "token",
              "type": "address",
              "internalType": "contract IERC20"
            },
            {
              "name": "olKeyHash",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            { "name": "offerId", "type": "uint256", "internalType": "uint256" },
            {
              "name": "fundOwner",
              "type": "address",
              "internalType": "address"
            }
          ]
        }
      ],
      "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "unbind",
      "inputs": [],
      "outputs": [],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "unbind",
      "inputs": [
        {
          "name": "makerContract",
          "type": "address",
          "internalType": "address"
        }
      ],
      "outputs": [],
      "stateMutability": "nonpayable"
    },
    {
      "type": "event",
      "name": "MakerBind",
      "inputs": [
        {
          "name": "maker",
          "type": "address",
          "indexed": true,
          "internalType": "address"
        }
      ],
      "anonymous": false
    },
    {
      "type": "event",
      "name": "MakerUnbind",
      "inputs": [
        {
          "name": "maker",
          "type": "address",
          "indexed": true,
          "internalType": "address"
        }
      ],
      "anonymous": false
    },
    {
      "type": "event",
      "name": "SetAdmin",
      "inputs": [
        {
          "name": "admin",
          "type": "address",
          "indexed": false,
          "internalType": "address"
        }
      ],
      "anonymous": false
    },
    {
      "type": "event",
      "name": "SetRouteLogic",
      "inputs": [
        {
          "name": "token",
          "type": "address",
          "indexed": true,
          "internalType": "contract IERC20"
        },
        {
          "name": "olKeyHash",
          "type": "bytes32",
          "indexed": true,
          "internalType": "bytes32"
        },
        {
          "name": "offerId",
          "type": "uint256",
          "indexed": false,
          "internalType": "uint256"
        },
        {
          "name": "logic",
          "type": "address",
          "indexed": false,
          "internalType": "contract AbstractRoutingLogic"
        }
      ],
      "anonymous": false
    }
  ]
}
