[
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "_treasury",
                "type": "address"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "constructor"
    },
    {
        "inputs": [],
        "name": "ErrorCallerNotFUSD",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorDefaultFeeTooLarge",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorDeltaFeeTooSmall",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorFTokenMintPausedInStabilityMode",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorInsufficientBaseOutput",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorInsufficientFTokenOutput",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorInsufficientXTokenOutput",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorMintPaused",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorMintZeroAmount",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorRedeemPaused",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorRedeemZeroAmount",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorStabilityRatioTooLarge",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorTotalFeeTooLarge",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorXTokenRedeemPausedInStabilityMode",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "ErrorZeroAddress",
        "type": "error"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint8",
                "name": "version",
                "type": "uint8"
            }
        ],
        "name": "Initialized",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "address",
                "name": "owner",
                "type": "address"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "recipient",
                "type": "address"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "baseTokenIn",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "fTokenOut",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "mintFee",
                "type": "uint256"
            }
        ],
        "name": "MintFToken",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "address",
                "name": "owner",
                "type": "address"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "recipient",
                "type": "address"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "baseTokenIn",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "xTokenOut",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "bonus",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "mintFee",
                "type": "uint256"
            }
        ],
        "name": "MintXToken",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "address",
                "name": "owner",
                "type": "address"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "recipient",
                "type": "address"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "fTokenBurned",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "baseTokenOut",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "bonus",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "redeemFee",
                "type": "uint256"
            }
        ],
        "name": "RedeemFToken",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "address",
                "name": "owner",
                "type": "address"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "recipient",
                "type": "address"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "xTokenBurned",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "baseTokenOut",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "redeemFee",
                "type": "uint256"
            }
        ],
        "name": "RedeemXToken",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "bytes32",
                "name": "role",
                "type": "bytes32"
            },
            {
                "indexed": true,
                "internalType": "bytes32",
                "name": "previousAdminRole",
                "type": "bytes32"
            },
            {
                "indexed": true,
                "internalType": "bytes32",
                "name": "newAdminRole",
                "type": "bytes32"
            }
        ],
        "name": "RoleAdminChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "bytes32",
                "name": "role",
                "type": "bytes32"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "account",
                "type": "address"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "sender",
                "type": "address"
            }
        ],
        "name": "RoleGranted",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "bytes32",
                "name": "role",
                "type": "bytes32"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "account",
                "type": "address"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "sender",
                "type": "address"
            }
        ],
        "name": "RoleRevoked",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "bool",
                "name": "oldStatus",
                "type": "bool"
            },
            {
                "indexed": false,
                "internalType": "bool",
                "name": "newStatus",
                "type": "bool"
            }
        ],
        "name": "UpdateFTokenMintStatusInStabilityMode",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "defaultFeeRatio",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "int256",
                "name": "extraFeeRatio",
                "type": "int256"
            }
        ],
        "name": "UpdateMintFeeRatioFToken",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "defaultFeeRatio",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "int256",
                "name": "extraFeeRatio",
                "type": "int256"
            }
        ],
        "name": "UpdateMintFeeRatioXToken",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "bool",
                "name": "oldStatus",
                "type": "bool"
            },
            {
                "indexed": false,
                "internalType": "bool",
                "name": "newStatus",
                "type": "bool"
            }
        ],
        "name": "UpdateMintStatus",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "address",
                "name": "oldPlatform",
                "type": "address"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "newPlatform",
                "type": "address"
            }
        ],
        "name": "UpdatePlatform",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "address",
                "name": "oldRegistry",
                "type": "address"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "newRegistry",
                "type": "address"
            }
        ],
        "name": "UpdateRebalancePoolRegistry",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "defaultFeeRatio",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "int256",
                "name": "extraFeeRatio",
                "type": "int256"
            }
        ],
        "name": "UpdateRedeemFeeRatioFToken",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "defaultFeeRatio",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "int256",
                "name": "extraFeeRatio",
                "type": "int256"
            }
        ],
        "name": "UpdateRedeemFeeRatioXToken",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "bool",
                "name": "oldStatus",
                "type": "bool"
            },
            {
                "indexed": false,
                "internalType": "bool",
                "name": "newStatus",
                "type": "bool"
            }
        ],
        "name": "UpdateRedeemStatus",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "address",
                "name": "oldReservePool",
                "type": "address"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "newReservePool",
                "type": "address"
            }
        ],
        "name": "UpdateReservePool",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "oldRatio",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "newRatio",
                "type": "uint256"
            }
        ],
        "name": "UpdateStabilityRatio",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "bool",
                "name": "oldStatus",
                "type": "bool"
            },
            {
                "indexed": false,
                "internalType": "bool",
                "name": "newStatus",
                "type": "bool"
            }
        ],
        "name": "UpdateXTokenRedeemStatusInStabilityMode",
        "type": "event"
    },
    {
        "inputs": [],
        "name": "DEFAULT_ADMIN_ROLE",
        "outputs": [
            {
                "internalType": "bytes32",
                "name": "",
                "type": "bytes32"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "EMERGENCY_DAO_ROLE",
        "outputs": [
            {
                "internalType": "bytes32",
                "name": "",
                "type": "bytes32"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "baseToken",
        "outputs": [
            {
                "internalType": "address",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "_fxUSD",
                "type": "address"
            }
        ],
        "name": "enableFxUSD",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "fToken",
        "outputs": [
            {
                "internalType": "address",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "fTokenMintFeeRatio",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "defaultFee",
                "type": "uint256"
            },
            {
                "internalType": "int256",
                "name": "deltaFee",
                "type": "int256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "fTokenMintPausedInStabilityMode",
        "outputs": [
            {
                "internalType": "bool",
                "name": "",
                "type": "bool"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "fTokenRedeemFeeRatio",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "defaultFee",
                "type": "uint256"
            },
            {
                "internalType": "int256",
                "name": "deltaFee",
                "type": "int256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "fxUSD",
        "outputs": [
            {
                "internalType": "address",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "bytes32",
                "name": "role",
                "type": "bytes32"
            }
        ],
        "name": "getRoleAdmin",
        "outputs": [
            {
                "internalType": "bytes32",
                "name": "",
                "type": "bytes32"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "bytes32",
                "name": "role",
                "type": "bytes32"
            },
            {
                "internalType": "address",
                "name": "account",
                "type": "address"
            }
        ],
        "name": "grantRole",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "bytes32",
                "name": "role",
                "type": "bytes32"
            },
            {
                "internalType": "address",
                "name": "account",
                "type": "address"
            }
        ],
        "name": "hasRole",
        "outputs": [
            {
                "internalType": "bool",
                "name": "",
                "type": "bool"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "_platform",
                "type": "address"
            },
            {
                "internalType": "address",
                "name": "_reservePool",
                "type": "address"
            },
            {
                "internalType": "address",
                "name": "_registry",
                "type": "address"
            }
        ],
        "name": "initialize",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_baseIn",
                "type": "uint256"
            },
            {
                "internalType": "address",
                "name": "_recipient",
                "type": "address"
            },
            {
                "internalType": "uint256",
                "name": "_minFTokenMinted",
                "type": "uint256"
            }
        ],
        "name": "mintFToken",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "_fTokenMinted",
                "type": "uint256"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "mintPaused",
        "outputs": [
            {
                "internalType": "bool",
                "name": "",
                "type": "bool"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_baseIn",
                "type": "uint256"
            },
            {
                "internalType": "address",
                "name": "_recipient",
                "type": "address"
            },
            {
                "internalType": "uint256",
                "name": "_minXTokenMinted",
                "type": "uint256"
            }
        ],
        "name": "mintXToken",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "_xTokenMinted",
                "type": "uint256"
            },
            {
                "internalType": "uint256",
                "name": "_bonus",
                "type": "uint256"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "platform",
        "outputs": [
            {
                "internalType": "address",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_fTokenIn",
                "type": "uint256"
            },
            {
                "internalType": "address",
                "name": "_recipient",
                "type": "address"
            },
            {
                "internalType": "uint256",
                "name": "_minBaseOut",
                "type": "uint256"
            }
        ],
        "name": "redeemFToken",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "_baseOut",
                "type": "uint256"
            },
            {
                "internalType": "uint256",
                "name": "_bonus",
                "type": "uint256"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "redeemPaused",
        "outputs": [
            {
                "internalType": "bool",
                "name": "",
                "type": "bool"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_xTokenIn",
                "type": "uint256"
            },
            {
                "internalType": "address",
                "name": "_recipient",
                "type": "address"
            },
            {
                "internalType": "uint256",
                "name": "_minBaseOut",
                "type": "uint256"
            }
        ],
        "name": "redeemXToken",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "_baseOut",
                "type": "uint256"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "registry",
        "outputs": [
            {
                "internalType": "address",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "bytes32",
                "name": "role",
                "type": "bytes32"
            },
            {
                "internalType": "address",
                "name": "account",
                "type": "address"
            }
        ],
        "name": "renounceRole",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "reservePool",
        "outputs": [
            {
                "internalType": "address",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "bytes32",
                "name": "role",
                "type": "bytes32"
            },
            {
                "internalType": "address",
                "name": "account",
                "type": "address"
            }
        ],
        "name": "revokeRole",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "stabilityRatio",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "bytes4",
                "name": "interfaceId",
                "type": "bytes4"
            }
        ],
        "name": "supportsInterface",
        "outputs": [
            {
                "internalType": "bool",
                "name": "",
                "type": "bool"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "treasury",
        "outputs": [
            {
                "internalType": "address",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "bool",
                "name": "_newStatus",
                "type": "bool"
            }
        ],
        "name": "updateFTokenMintStatusInStabilityMode",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint128",
                "name": "_defaultFeeRatio",
                "type": "uint128"
            },
            {
                "internalType": "int128",
                "name": "_extraFeeRatio",
                "type": "int128"
            },
            {
                "internalType": "bool",
                "name": "_isFToken",
                "type": "bool"
            }
        ],
        "name": "updateMintFeeRatio",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "bool",
                "name": "_newStatus",
                "type": "bool"
            }
        ],
        "name": "updateMintStatus",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "_newPlatform",
                "type": "address"
            }
        ],
        "name": "updatePlatform",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "_newRegistry",
                "type": "address"
            }
        ],
        "name": "updateRebalancePoolRegistry",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_defaultFeeRatio",
                "type": "uint256"
            },
            {
                "internalType": "int256",
                "name": "_extraFeeRatio",
                "type": "int256"
            },
            {
                "internalType": "bool",
                "name": "_isFToken",
                "type": "bool"
            }
        ],
        "name": "updateRedeemFeeRatio",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "bool",
                "name": "_newStatus",
                "type": "bool"
            }
        ],
        "name": "updateRedeemStatus",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "_newReservePool",
                "type": "address"
            }
        ],
        "name": "updateReservePool",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_newRatio",
                "type": "uint256"
            }
        ],
        "name": "updateStabilityRatio",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "bool",
                "name": "_newStatus",
                "type": "bool"
            }
        ],
        "name": "updateXTokenRedeemStatusInStabilityMode",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "xToken",
        "outputs": [
            {
                "internalType": "address",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "xTokenMintFeeRatio",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "defaultFee",
                "type": "uint256"
            },
            {
                "internalType": "int256",
                "name": "deltaFee",
                "type": "int256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "xTokenRedeemFeeRatio",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "defaultFee",
                "type": "uint256"
            },
            {
                "internalType": "int256",
                "name": "deltaFee",
                "type": "int256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "xTokenRedeemPausedInStabilityMode",
        "outputs": [
            {
                "internalType": "bool",
                "name": "",
                "type": "bool"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "int256",
                "name": "current",
                "type": "int256"
            },
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "roundId",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "updatedAt",
                "type": "uint256"
            }
        ],
        "name": "AnswerUpdated",
        "type": "event"
    }
]
