{
    "abi": [
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": false,
                    "internalType": "address",
                    "name": "_positionAddress",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "internalType": "uint256",
                    "name": "_FXDBorrowAmount",
                    "type": "uint256"
                }
            ],
            "name": "LogBorrowedAmount",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": false,
                    "internalType": "address",
                    "name": "_positionAddress",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "internalType": "uint256",
                    "name": "_FXDPaidAmount",
                    "type": "uint256"
                }
            ],
            "name": "LogPaidAmount",
            "type": "event"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_bookKeeper",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_usr",
                    "type": "address"
                }
            ],
            "name": "addToWhitelist",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_bookKeeper",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_usr",
                    "type": "address"
                }
            ],
            "name": "removeFromWhitelist",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "address",
                    "name": "_user",
                    "type": "address"
                },
                {
                    "internalType": "bool",
                    "name": "_ok",
                    "type": "bool"
                }
            ],
            "name": "allowManagePosition",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_user",
                    "type": "address"
                },
                {
                    "internalType": "bool",
                    "name": "_ok",
                    "type": "bool"
                }
            ],
            "name": "allowMigratePosition",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "address",
                    "name": "_destination",
                    "type": "address"
                }
            ],
            "name": "exportPosition",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_source",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                }
            ],
            "name": "importPosition",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_source",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_destination",
                    "type": "uint256"
                }
            ],
            "name": "movePosition",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_xdcAdapter",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "address",
                    "name": "_owner",
                    "type": "address"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "safeLockXDC",
            "outputs": [],
            "stateMutability": "payable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stabilityFeeCollector",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stablecoinAdapter",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_amount",
                    "type": "uint256"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "draw",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stabilityFeeCollector",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_xdcAdapter",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stablecoinAdapter",
                    "type": "address"
                },
                {
                    "internalType": "bytes32",
                    "name": "_collateralPoolId",
                    "type": "bytes32"
                },
                {
                    "internalType": "uint256",
                    "name": "_stablecoinAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "openLockXDCAndDraw",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                }
            ],
            "stateMutability": "payable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_xdcAdapter",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stablecoinAdapter",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_collateralAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_stablecoinAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "wipeAndUnlockXDC",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_xdcAdapter",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stablecoinAdapter",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_collateralAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "wipeAllAndUnlockXDC",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "redeemLockedCollateral",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_adapter",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_to",
                    "type": "address"
                }
            ],
            "name": "emergencyWithdraw",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_adapter",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_positionAddress",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_stablecoinAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "stablecoinAdapterDeposit",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_adapter",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_positionAddress",
                    "type": "address"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "xdcAdapterDeposit",
            "outputs": [],
            "stateMutability": "payable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_adapter",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_positionAddress",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_amount",
                    "type": "uint256"
                },
                {
                    "internalType": "bool",
                    "name": "_transferFrom",
                    "type": "bool"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "tokenAdapterDeposit",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_collateralToken",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_dst",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_amt",
                    "type": "uint256"
                }
            ],
            "name": "transfer",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "bytes32",
                    "name": "_collateralPoolId",
                    "type": "bytes32"
                },
                {
                    "internalType": "address",
                    "name": "_usr",
                    "type": "address"
                }
            ],
            "name": "open",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                }
            ],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "address",
                    "name": "_usr",
                    "type": "address"
                }
            ],
            "name": "transferOwnership",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "int256",
                    "name": "_collateralValue",
                    "type": "int256"
                },
                {
                    "internalType": "int256",
                    "name": "_debtShare",
                    "type": "int256"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "adjustPosition",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "address",
                    "name": "_dst",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_collateralAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "moveCollateral",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "address",
                    "name": "_dst",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_stablecoinValue",
                    "type": "uint256"
                }
            ],
            "name": "moveStablecoin",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_xdcAdapter",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "lockXDC",
            "outputs": [],
            "stateMutability": "payable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stabilityFeeCollector",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_xdcAdapter",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stablecoinAdapter",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_stablecoinAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "lockXDCAndDraw",
            "outputs": [],
            "stateMutability": "payable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_tokenAdapter",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_collateralAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "bool",
                    "name": "_transferFrom",
                    "type": "bool"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "lockToken",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "contract IManager",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stabilityFeeCollector",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_tokenAdapter",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stablecoinAdapter",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_collateralAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_stablecoinAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "bool",
                    "name": "_transferFrom",
                    "type": "bool"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "lockTokenAndDraw",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stabilityFeeCollector",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_tokenAdapter",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stablecoinAdapter",
                    "type": "address"
                },
                {
                    "internalType": "bytes32",
                    "name": "_collateralPoolId",
                    "type": "bytes32"
                },
                {
                    "internalType": "uint256",
                    "name": "_collateralAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_stablecoinAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "bool",
                    "name": "_transferFrom",
                    "type": "bool"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "openLockTokenAndDraw",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                }
            ],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_tokenAdapter",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stablecoinAdapter",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_collateralAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_stablecoinAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "wipeAndUnlockToken",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_manager",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_tokenAdapter",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "_stablecoinAdapter",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_positionId",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_collateralAmount",
                    "type": "uint256"
                },
                {
                    "internalType": "bytes",
                    "name": "_data",
                    "type": "bytes"
                }
            ],
            "name": "wipeAllAndUnlockToken",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        }
    ]
}
