{
  "$schema": "../../../../contract.schema.json",
  "released": false,
  "contractName": "MangroveAmplifier",
  "version": "2.0.1-0",
  "networkAddresses": {
    "80001": {
      "primaryAddress": "0x5936A0CA18C72074852Ec81147B8D3FA714c423C",
      "allAddresses": [
        {
          "address": "0x5936A0CA18C72074852Ec81147B8D3FA714c423C",
          "dependencies": [
            {
              "name": "Mangrove",
              "address": "0x80cd6Ef14c23dD3957FD5629141a9d7028557c39"
            }
          ]
        }
      ]
    }
  },
  "abi": [
    {
      "type": "constructor",
      "inputs": [
        {
          "name": "mgv",
          "type": "address",
          "internalType": "contract IMangrove"
        },
        {
          "name": "factory",
          "type": "address",
          "internalType": "contract RouterProxyFactory"
        },
        {
          "name": "routerImplementation",
          "type": "address",
          "internalType": "contract SmartRouter"
        }
      ],
      "stateMutability": "nonpayable"
    },
    {
      "type": "receive",
      "stateMutability": "payable"
    },
    {
      "type": "function",
      "name": "MGV",
      "inputs": [],
      "outputs": [
        {
          "name": "",
          "type": "address",
          "internalType": "contract IMangrove"
        }
      ],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "ROUTER_FACTORY",
      "inputs": [],
      "outputs": [
        {
          "name": "",
          "type": "address",
          "internalType": "contract RouterProxyFactory"
        }
      ],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "ROUTER_IMPLEMENTATION",
      "inputs": [],
      "outputs": [
        {
          "name": "",
          "type": "address",
          "internalType": "contract AbstractRouter"
        }
      ],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "activate",
      "inputs": [
        {
          "name": "token",
          "type": "address",
          "internalType": "contract IERC20"
        }
      ],
      "outputs": [],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "admin",
      "inputs": [],
      "outputs": [
        {
          "name": "current",
          "type": "address",
          "internalType": "address"
        }
      ],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "approve",
      "inputs": [
        {
          "name": "token",
          "type": "address",
          "internalType": "contract IERC20"
        },
        {
          "name": "spender",
          "type": "address",
          "internalType": "address"
        },
        {
          "name": "amount",
          "type": "uint256",
          "internalType": "uint256"
        }
      ],
      "outputs": [
        {
          "name": "",
          "type": "bool",
          "internalType": "bool"
        }
      ],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "makerExecute",
      "inputs": [
        {
          "name": "order",
          "type": "tuple",
          "internalType": "struct MgvLib.SingleOrder",
          "components": [
            {
              "name": "olKey",
              "type": "tuple",
              "internalType": "struct OLKey",
              "components": [
                {
                  "name": "outbound_tkn",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "inbound_tkn",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "tickSpacing",
                  "type": "uint256",
                  "internalType": "uint256"
                }
              ]
            },
            {
              "name": "offerId",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "offer",
              "type": "uint256",
              "internalType": "Offer"
            },
            {
              "name": "takerWants",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "takerGives",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "offerDetail",
              "type": "uint256",
              "internalType": "OfferDetail"
            },
            {
              "name": "global",
              "type": "uint256",
              "internalType": "Global"
            },
            {
              "name": "local",
              "type": "uint256",
              "internalType": "Local"
            }
          ]
        }
      ],
      "outputs": [
        {
          "name": "ret",
          "type": "bytes32",
          "internalType": "bytes32"
        }
      ],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "makerPosthook",
      "inputs": [
        {
          "name": "order",
          "type": "tuple",
          "internalType": "struct MgvLib.SingleOrder",
          "components": [
            {
              "name": "olKey",
              "type": "tuple",
              "internalType": "struct OLKey",
              "components": [
                {
                  "name": "outbound_tkn",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "inbound_tkn",
                  "type": "address",
                  "internalType": "address"
                },
                {
                  "name": "tickSpacing",
                  "type": "uint256",
                  "internalType": "uint256"
                }
              ]
            },
            {
              "name": "offerId",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "offer",
              "type": "uint256",
              "internalType": "Offer"
            },
            {
              "name": "takerWants",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "takerGives",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "offerDetail",
              "type": "uint256",
              "internalType": "OfferDetail"
            },
            {
              "name": "global",
              "type": "uint256",
              "internalType": "Global"
            },
            {
              "name": "local",
              "type": "uint256",
              "internalType": "Local"
            }
          ]
        },
        {
          "name": "result",
          "type": "tuple",
          "internalType": "struct MgvLib.OrderResult",
          "components": [
            {
              "name": "makerData",
              "type": "bytes32",
              "internalType": "bytes32"
            },
            {
              "name": "mgvData",
              "type": "bytes32",
              "internalType": "bytes32"
            }
          ]
        }
      ],
      "outputs": [],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "newBundle",
      "inputs": [
        {
          "name": "fx",
          "type": "tuple",
          "internalType": "struct MangroveAmplifier.FixedBundleParams",
          "components": [
            {
              "name": "outbound_tkn",
              "type": "address",
              "internalType": "contract IERC20"
            },
            {
              "name": "outVolume",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "outboundLogic",
              "type": "address",
              "internalType": "contract AbstractRoutingLogic"
            },
            {
              "name": "expiryDate",
              "type": "uint256",
              "internalType": "uint256"
            }
          ]
        },
        {
          "name": "vr",
          "type": "tuple[]",
          "internalType": "struct MangroveAmplifier.VariableBundleParams[]",
          "components": [
            {
              "name": "tick",
              "type": "int256",
              "internalType": "Tick"
            },
            {
              "name": "gasreq",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "provision",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "tickSpacing",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "inboundLogic",
              "type": "address",
              "internalType": "contract AbstractRoutingLogic"
            },
            {
              "name": "inbound_tkn",
              "type": "address",
              "internalType": "contract IERC20"
            }
          ]
        }
      ],
      "outputs": [
        {
          "name": "freshBundleId",
          "type": "uint256",
          "internalType": "uint256"
        }
      ],
      "stateMutability": "payable"
    },
    {
      "type": "function",
      "name": "offersOf",
      "inputs": [
        {
          "name": "bundleId",
          "type": "uint256",
          "internalType": "uint256"
        }
      ],
      "outputs": [
        {
          "name": "",
          "type": "tuple[]",
          "internalType": "struct MangroveAmplifier.BundledOffer[]",
          "components": [
            {
              "name": "inbound_tkn",
              "type": "address",
              "internalType": "contract IERC20"
            },
            {
              "name": "tickSpacing",
              "type": "uint256",
              "internalType": "uint256"
            },
            {
              "name": "offerId",
              "type": "uint256",
              "internalType": "uint256"
            }
          ]
        }
      ],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "ownerOf",
      "inputs": [
        {
          "name": "bundleId",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "outbound_tkn",
          "type": "address",
          "internalType": "contract IERC20"
        }
      ],
      "outputs": [
        {
          "name": "",
          "type": "address",
          "internalType": "address"
        }
      ],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "ownerOf",
      "inputs": [
        {
          "name": "olKeyHash",
          "type": "bytes32",
          "internalType": "bytes32"
        },
        {
          "name": "offerId",
          "type": "uint256",
          "internalType": "uint256"
        }
      ],
      "outputs": [
        {
          "name": "owner",
          "type": "address",
          "internalType": "address"
        }
      ],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "provisionOf",
      "inputs": [
        {
          "name": "olKey",
          "type": "tuple",
          "internalType": "struct OLKey",
          "components": [
            {
              "name": "outbound_tkn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "inbound_tkn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tickSpacing",
              "type": "uint256",
              "internalType": "uint256"
            }
          ]
        },
        {
          "name": "offerId",
          "type": "uint256",
          "internalType": "uint256"
        }
      ],
      "outputs": [
        {
          "name": "provision",
          "type": "uint256",
          "internalType": "uint256"
        }
      ],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "reneging",
      "inputs": [
        {
          "name": "olKeyHash",
          "type": "bytes32",
          "internalType": "bytes32"
        },
        {
          "name": "offerId",
          "type": "uint256",
          "internalType": "uint256"
        }
      ],
      "outputs": [
        {
          "name": "",
          "type": "tuple",
          "internalType": "struct RenegingForwarder.Condition",
          "components": [
            {
              "name": "date",
              "type": "uint160",
              "internalType": "uint160"
            },
            {
              "name": "volume",
              "type": "uint96",
              "internalType": "uint96"
            }
          ]
        }
      ],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "retractBundle",
      "inputs": [
        {
          "name": "bundleId",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "outbound_tkn",
          "type": "address",
          "internalType": "contract IERC20"
        }
      ],
      "outputs": [
        {
          "name": "freeWei",
          "type": "uint256",
          "internalType": "uint256"
        }
      ],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "retractOffer",
      "inputs": [
        {
          "name": "olKey",
          "type": "tuple",
          "internalType": "struct OLKey",
          "components": [
            {
              "name": "outbound_tkn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "inbound_tkn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tickSpacing",
              "type": "uint256",
              "internalType": "uint256"
            }
          ]
        },
        {
          "name": "offerId",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "deprovision",
          "type": "bool",
          "internalType": "bool"
        }
      ],
      "outputs": [
        {
          "name": "freeWei",
          "type": "uint256",
          "internalType": "uint256"
        }
      ],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "router",
      "inputs": [
        {
          "name": "fundOwner",
          "type": "address",
          "internalType": "address"
        }
      ],
      "outputs": [
        {
          "name": "",
          "type": "address",
          "internalType": "contract AbstractRouter"
        }
      ],
      "stateMutability": "view"
    },
    {
      "type": "function",
      "name": "setAdmin",
      "inputs": [
        {
          "name": "admin_",
          "type": "address",
          "internalType": "address"
        }
      ],
      "outputs": [],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "setReneging",
      "inputs": [
        {
          "name": "olKeyHash",
          "type": "bytes32",
          "internalType": "bytes32"
        },
        {
          "name": "offerId",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "expiryDate",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "volume",
          "type": "uint256",
          "internalType": "uint256"
        }
      ],
      "outputs": [],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "updateBundle",
      "inputs": [
        {
          "name": "bundleId",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "outbound_tkn",
          "type": "address",
          "internalType": "contract IERC20"
        },
        {
          "name": "outboundVolume",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "updateExpiry",
          "type": "bool",
          "internalType": "bool"
        },
        {
          "name": "expiryDate",
          "type": "uint256",
          "internalType": "uint256"
        }
      ],
      "outputs": [],
      "stateMutability": "nonpayable"
    },
    {
      "type": "function",
      "name": "updateOffer",
      "inputs": [
        {
          "name": "olKey",
          "type": "tuple",
          "internalType": "struct OLKey",
          "components": [
            {
              "name": "outbound_tkn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "inbound_tkn",
              "type": "address",
              "internalType": "address"
            },
            {
              "name": "tickSpacing",
              "type": "uint256",
              "internalType": "uint256"
            }
          ]
        },
        {
          "name": "tick",
          "type": "int256",
          "internalType": "Tick"
        },
        {
          "name": "gives",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "gasreq",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "offerId",
          "type": "uint256",
          "internalType": "uint256"
        }
      ],
      "outputs": [],
      "stateMutability": "payable"
    },
    {
      "type": "function",
      "name": "withdrawFromMangrove",
      "inputs": [
        {
          "name": "amount",
          "type": "uint256",
          "internalType": "uint256"
        },
        {
          "name": "receiver",
          "type": "address",
          "internalType": "address payable"
        }
      ],
      "outputs": [],
      "stateMutability": "nonpayable"
    },
    {
      "type": "event",
      "name": "EndBundle",
      "inputs": [],
      "anonymous": false
    },
    {
      "type": "event",
      "name": "InitBundle",
      "inputs": [
        {
          "name": "bundleId",
          "type": "uint256",
          "indexed": true,
          "internalType": "uint256"
        }
      ],
      "anonymous": false
    },
    {
      "type": "event",
      "name": "LogIncident",
      "inputs": [
        {
          "name": "olKeyHash",
          "type": "bytes32",
          "indexed": true,
          "internalType": "bytes32"
        },
        {
          "name": "offerId",
          "type": "uint256",
          "indexed": true,
          "internalType": "uint256"
        },
        {
          "name": "makerData",
          "type": "bytes32",
          "indexed": false,
          "internalType": "bytes32"
        },
        {
          "name": "mgvData",
          "type": "bytes32",
          "indexed": false,
          "internalType": "bytes32"
        }
      ],
      "anonymous": false
    },
    {
      "type": "event",
      "name": "NewOwnedOffer",
      "inputs": [
        {
          "name": "olKeyHash",
          "type": "bytes32",
          "indexed": true,
          "internalType": "bytes32"
        },
        {
          "name": "offerId",
          "type": "uint256",
          "indexed": true,
          "internalType": "uint256"
        },
        {
          "name": "owner",
          "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": "SetReneging",
      "inputs": [
        {
          "name": "olKeyHash",
          "type": "bytes32",
          "indexed": true,
          "internalType": "bytes32"
        },
        {
          "name": "offerId",
          "type": "uint256",
          "indexed": true,
          "internalType": "uint256"
        },
        {
          "name": "date",
          "type": "uint256",
          "indexed": false,
          "internalType": "uint256"
        },
        {
          "name": "volume",
          "type": "uint256",
          "indexed": false,
          "internalType": "uint256"
        }
      ],
      "anonymous": false
    }
  ]
}
