From edbb0d1ca687c8b683c295f4c0aa728a253297c7 Mon Sep 17 00:00:00 2001 From: troy Date: Thu, 22 Aug 2024 15:59:35 -0600 Subject: [PATCH] Add BFP integration (#58) * add L1 contract hard-codes * update contracts * initial implementation * fix common functions * update logging * add sepolia contracts * update perps class structure * add debt payment * adjust config and add liquidation functions * pin web3 version * update docs * bump version --- README.md | 16 +- src/setup.py | 4 +- src/synthetix/constants.py | 8 +- .../contracts/deployments/1/SNX.json | 418 ++ .../contracts/deployments/1/WETH.json | 282 + .../1/spotFactory/SpotMarketProxy.json | 3946 ++++++++++++ .../deployments/1/system/AccountProxy.json | 820 +++ .../deployments/1/system/CoreProxy.json | 5327 +++++++++++++++++ .../deployments/1/system/USDProxy.json | 836 +++ .../TrustedMulticallForwarder.json | 887 +++ .../contracts/deployments/11155111/Pyth.json | 1632 +++++ .../contracts/deployments/11155111/SNX.json | 431 ++ .../bfp_market_factory/BfpMarketProxy.json | 4191 +++++++++++++ .../bfp_market_factory/PerpAccountProxy.json | 819 +++ .../PythERC7412Wrapper.json | 171 + .../11155111/system/AccountProxy.json | 818 +++ .../11155111/system/CoreProxy.json | 5327 +++++++++++++++++ .../deployments/11155111/system/USDProxy.json | 834 +++ .../TrustedMulticallForwarder.json | 885 +++ src/synthetix/perps/__init__.py | 4 +- src/synthetix/perps/perps.py | 873 ++- src/synthetix/perps/perps_utils.py | 86 + src/synthetix/synthetix.py | 17 +- 23 files changed, 28507 insertions(+), 125 deletions(-) create mode 100644 src/synthetix/contracts/deployments/1/SNX.json create mode 100644 src/synthetix/contracts/deployments/1/WETH.json create mode 100644 src/synthetix/contracts/deployments/1/spotFactory/SpotMarketProxy.json create mode 100644 src/synthetix/contracts/deployments/1/system/AccountProxy.json create mode 100644 src/synthetix/contracts/deployments/1/system/CoreProxy.json create mode 100644 src/synthetix/contracts/deployments/1/system/USDProxy.json create mode 100644 src/synthetix/contracts/deployments/1/system/trusted_multicall_forwarder/TrustedMulticallForwarder.json create mode 100644 src/synthetix/contracts/deployments/11155111/Pyth.json create mode 100644 src/synthetix/contracts/deployments/11155111/SNX.json create mode 100644 src/synthetix/contracts/deployments/11155111/bfp_market_factory/BfpMarketProxy.json create mode 100644 src/synthetix/contracts/deployments/11155111/bfp_market_factory/PerpAccountProxy.json create mode 100644 src/synthetix/contracts/deployments/11155111/pyth_erc7412_wrapper/PythERC7412Wrapper.json create mode 100644 src/synthetix/contracts/deployments/11155111/system/AccountProxy.json create mode 100644 src/synthetix/contracts/deployments/11155111/system/CoreProxy.json create mode 100644 src/synthetix/contracts/deployments/11155111/system/USDProxy.json create mode 100644 src/synthetix/contracts/deployments/11155111/system/trusted_multicall_forwarder/TrustedMulticallForwarder.json create mode 100644 src/synthetix/perps/perps_utils.py diff --git a/README.md b/README.md index 7a17f77..7c4b1f5 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,12 @@ This is a Python SDK designed to help you interact with Synthetix smart contracts and subgraphs. Visit the [documentation](https://synthetixio.github.io/python-sdk/) for more information. ## Features -* Interfaces for all Synthetix V3 contracts -* Simple tools for trading Synthetix perps -* Interfaces for synth swapping and wrapping -* Inferfaces for managing LP positions -* Seamless integration with [Cannon](https://usecannon.com/) for fetching deployments from IPFS + +- Interfaces for all Synthetix V3 contracts +- Simple tools for trading Synthetix perps +- Interfaces for synth swapping and wrapping +- Interfaces for managing LP positions +- Seamless integration with [Cannon](https://usecannon.com/) for fetching deployments from IPFS ## Installation @@ -22,8 +23,9 @@ pip install synthetix ## Documentation There are a few guides to help you get started: -* [Getting Started](https://synthetixio.github.io/python-sdk/guides/quickstart.html) -* [Trade Perps](https://synthetixio.github.io/python-sdk/guides/trade_perps.html) + +- [Getting Started](https://synthetixio.github.io/python-sdk/guides/quickstart.html) +- [Trade Perps](https://synthetixio.github.io/python-sdk/guides/trade_perps.html) For complete documentation, visit our [documentation site](https://synthetixio.github.io/python-sdk/). diff --git a/src/setup.py b/src/setup.py index f678f32..0b0ccbd 100644 --- a/src/setup.py +++ b/src/setup.py @@ -2,7 +2,7 @@ setup( name="synthetix", - version="0.1.15", + version="0.1.16", description="Synthetix protocol SDK", long_description=open("README.md").read(), long_description_content_type="text/markdown", @@ -13,7 +13,7 @@ "pandas", "requests", "requests_toolbelt", - "web3>=6.4.0", + "web3>=6.4.0,<7.0.0", "gql", ], classifiers=[ diff --git a/src/synthetix/constants.py b/src/synthetix/constants.py index 250d90a..69934c3 100644 --- a/src/synthetix/constants.py +++ b/src/synthetix/constants.py @@ -17,12 +17,6 @@ 10: "https://api.thegraph.com/subgraphs/name/kwenta/optimism-latest-rates", } -DEFAULT_PRICE_SERVICE_ENDPOINTS = { - 10: "https://xc-mainnet.pyth.network", - 84532: "https://hermes.pyth.network", - 8453: "https://hermes.pyth.network", - 42161: "https://hermes.pyth.network", - 421614: "https://hermes.pyth.network", -} +DEFAULT_PRICE_SERVICE_ENDPOINT = "https://hermes.pyth.network" ETH_DECIMAL = Decimal("1e18") diff --git a/src/synthetix/contracts/deployments/1/SNX.json b/src/synthetix/contracts/deployments/1/SNX.json new file mode 100644 index 0000000..991d78c --- /dev/null +++ b/src/synthetix/contracts/deployments/1/SNX.json @@ -0,0 +1,418 @@ +{ + "address": "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_owner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "from", + "type": "address" + }, + { + "name": "to", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_target", + "type": "address" + } + ], + "name": "setTarget", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "callData", + "type": "bytes" + }, + { + "name": "numTopics", + "type": "uint256" + }, + { + "name": "topic1", + "type": "bytes32" + }, + { + "name": "topic2", + "type": "bytes32" + }, + { + "name": "topic3", + "type": "bytes32" + }, + { + "name": "topic4", + "type": "bytes32" + } + ], + "name": "_emit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "useDELEGATECALL", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "to", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "value", + "type": "bool" + } + ], + "name": "setUseDELEGATECALL", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "target", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "owner", + "type": "address" + }, + { + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "_owner", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "newTarget", + "type": "address" + } + ], + "name": "TargetUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + } + ] +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/1/WETH.json b/src/synthetix/contracts/deployments/1/WETH.json new file mode 100644 index 0000000..a2a7bf9 --- /dev/null +++ b/src/synthetix/contracts/deployments/1/WETH.json @@ -0,0 +1,282 @@ +{ + "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "wad", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "deposit", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + }, + { + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + } + ] +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/1/spotFactory/SpotMarketProxy.json b/src/synthetix/contracts/deployments/1/spotFactory/SpotMarketProxy.json new file mode 100644 index 0000000..3c16c49 --- /dev/null +++ b/src/synthetix/contracts/deployments/1/spotFactory/SpotMarketProxy.json @@ -0,0 +1,3946 @@ +{ + "address": "0x2CD12CcAc6F869650bA88a220b2eb91a937FA5c0", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ImplementationIsSterile", + "type": "error" + }, + { + "inputs": [], + "name": "NoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contr", + "type": "address" + } + ], + "name": "NotAContract", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "NotNominated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "UpgradeSimulationFailed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "self", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newNominatedOwner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "simulateUpgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "which", + "type": "bytes32" + } + ], + "name": "FeatureUnavailable", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidMarketOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "synthImplementation", + "type": "uint256" + } + ], + "name": "InvalidSynthImplementation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "MismatchAssociatedSystemKind", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "MissingAssociatedSystem", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "marketOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "OnlyMarketOwner", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt256ToUint256", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "AssociatedSystemSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rate", + "type": "uint256" + } + ], + "name": "DecayRateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "nominee", + "type": "address" + } + ], + "name": "MarketNominationRenounced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "MarketOwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "MarketOwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "synthImplementation", + "type": "address" + } + ], + "name": "SynthImplementationSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "SynthImplementationUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "buyFeedId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "sellFeedId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "strictStalenessTolerance", + "type": "uint256" + } + ], + "name": "SynthPriceDataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "synthTokenAddress", + "type": "address" + } + ], + "name": "SynthRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "synthetix", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "usdTokenAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oracleManager", + "type": "address" + } + ], + "name": "SynthetixSystemSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "acceptMarketOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "tokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "tokenSymbol", + "type": "string" + }, + { + "internalType": "address", + "name": "synthOwner", + "type": "address" + } + ], + "name": "createSynth", + "outputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "getAssociatedSystem", + "outputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "getMarketOwner", + "outputs": [ + { + "internalType": "address", + "name": "marketOwner", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "getNominatedMarketOwner", + "outputs": [ + { + "internalType": "address", + "name": "marketOwner", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "getPriceData", + "outputs": [ + { + "internalType": "bytes32", + "name": "buyFeedId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "sellFeedId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "strictPriceStalenessTolerance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getSynth", + "outputs": [ + { + "internalType": "address", + "name": "synthAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getSynthImpl", + "outputs": [ + { + "internalType": "address", + "name": "implAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeNft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "minimumCredit", + "outputs": [ + { + "internalType": "uint256", + "name": "lockedAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "marketName", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "newNominatedOwner", + "type": "address" + } + ], + "name": "nominateMarketOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "endpoint", + "type": "address" + } + ], + "name": "registerUnmanagedSystem", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "renounceMarketNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "renounceMarketOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "reportedDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "reportedDebtAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "rate", + "type": "uint256" + } + ], + "name": "setDecayRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "synthImplementation", + "type": "address" + } + ], + "name": "setSynthImplementation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISynthetixSystem", + "name": "synthetix", + "type": "address" + } + ], + "name": "setSynthetix", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "isSupported", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "buyFeedId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "sellFeedId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "strictPriceStalenessTolerance", + "type": "uint256" + } + ], + "name": "updatePriceData", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "upgradeSynthImpl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxSynthAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "synthAmountCharged", + "type": "uint256" + } + ], + "name": "ExceedsMaxSynthAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxUsdAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "usdAmountCharged", + "type": "uint256" + } + ], + "name": "ExceedsMaxUsdAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "current", + "type": "uint256" + } + ], + "name": "InsufficientAmountReceived", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "InvalidMarket", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidPrices", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToInt256", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "synthReturned", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "indexed": false, + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collectedFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "SynthBought", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountReturned", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "indexed": false, + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collectedFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "SynthSold", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "usdAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountReceived", + "type": "uint256" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "buy", + "outputs": [ + { + "internalType": "uint256", + "name": "synthAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "usdAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountReceived", + "type": "uint256" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "buyExactIn", + "outputs": [ + { + "internalType": "uint256", + "name": "synthAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "synthAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxUsdAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "buyExactOut", + "outputs": [ + { + "internalType": "uint256", + "name": "usdAmountCharged", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketSkew", + "outputs": [ + { + "internalType": "int256", + "name": "marketSkew", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "usdAmount", + "type": "uint256" + }, + { + "internalType": "enum Price.Tolerance", + "name": "stalenessTolerance", + "type": "uint8" + } + ], + "name": "quoteBuyExactIn", + "outputs": [ + { + "internalType": "uint256", + "name": "synthAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "synthAmount", + "type": "uint256" + }, + { + "internalType": "enum Price.Tolerance", + "name": "stalenessTolerance", + "type": "uint8" + } + ], + "name": "quoteBuyExactOut", + "outputs": [ + { + "internalType": "uint256", + "name": "usdAmountCharged", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "synthAmount", + "type": "uint256" + }, + { + "internalType": "enum Price.Tolerance", + "name": "stalenessTolerance", + "type": "uint8" + } + ], + "name": "quoteSellExactIn", + "outputs": [ + { + "internalType": "uint256", + "name": "returnAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "usdAmount", + "type": "uint256" + }, + { + "internalType": "enum Price.Tolerance", + "name": "stalenessTolerance", + "type": "uint8" + } + ], + "name": "quoteSellExactOut", + "outputs": [ + { + "internalType": "uint256", + "name": "synthToBurn", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "synthAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minUsdAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "sell", + "outputs": [ + { + "internalType": "uint256", + "name": "usdAmountReceived", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "synthAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountReceived", + "type": "uint256" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "sellExactIn", + "outputs": [ + { + "internalType": "uint256", + "name": "returnAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "usdAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSynthAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "sellExactOut", + "outputs": [ + { + "internalType": "uint256", + "name": "synthToBurn", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expirationTime", + "type": "uint256" + } + ], + "name": "IneligibleForCancellation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actual", + "type": "uint256" + } + ], + "name": "InsufficientSharesAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum Transaction.Type", + "name": "transactionType", + "type": "uint8" + } + ], + "name": "InvalidAsyncTransactionType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "asyncOrderId", + "type": "uint256" + } + ], + "name": "InvalidClaim", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minimumAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "InvalidCommitmentAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "settlementStrategyId", + "type": "uint256" + } + ], + "name": "InvalidSettlementStrategy", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "asyncOrderId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settledAt", + "type": "uint256" + } + ], + "name": "OrderAlreadySettled", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "asyncOrderId", + "type": "uint128" + }, + { + "components": [ + { + "internalType": "uint128", + "name": "id", + "type": "uint128" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "enum Transaction.Type", + "name": "orderType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amountEscrowed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementStrategyId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "commitmentTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumSettlementAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settledAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "indexed": false, + "internalType": "struct AsyncOrderClaim.Data", + "name": "asyncOrderClaim", + "type": "tuple" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "OrderCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "enum Transaction.Type", + "name": "orderType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountProvided", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "asyncOrderId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "OrderCommitted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "asyncOrderId", + "type": "uint128" + } + ], + "name": "cancelOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "enum Transaction.Type", + "name": "orderType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amountProvided", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementStrategyId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumSettlementAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "commitOrder", + "outputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "id", + "type": "uint128" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "enum Transaction.Type", + "name": "orderType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amountEscrowed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementStrategyId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "commitmentTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumSettlementAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settledAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "internalType": "struct AsyncOrderClaim.Data", + "name": "asyncOrderClaim", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "asyncOrderId", + "type": "uint128" + } + ], + "name": "getAsyncOrderClaim", + "outputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "id", + "type": "uint128" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "enum Transaction.Type", + "name": "orderType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "amountEscrowed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementStrategyId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "commitmentTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumSettlementAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settledAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "internalType": "struct AsyncOrderClaim.Data", + "name": "asyncOrderClaim", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum SettlementStrategy.Type", + "name": "strategyType", + "type": "uint8" + } + ], + "name": "InvalidSettlementStrategy", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidVerificationResponse", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minimum", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actual", + "type": "uint256" + } + ], + "name": "MinimumSettlementAmountNotMet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expirationTime", + "type": "uint256" + } + ], + "name": "OutsideSettlementWindow", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint64", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum SettlementStrategy.Type", + "name": "strategyType", + "type": "uint8" + } + ], + "name": "SettlementStrategyNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "asyncOrderId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "finalOrderAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "indexed": false, + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collectedFees", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "settler", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum Transaction.Type", + "name": "orderType", + "type": "uint8" + } + ], + "name": "OrderSettled", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "asyncOrderId", + "type": "uint128" + } + ], + "name": "settleOrder", + "outputs": [ + { + "internalType": "uint256", + "name": "finalOrderAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "InvalidSettlementWindowDuration", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "strategyId", + "type": "uint256" + } + ], + "name": "SettlementStrategyAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "strategyId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "enum SettlementStrategy.Type", + "name": "strategyType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "settlementDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementWindowDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "priceVerificationContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "feedId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceDeviationTolerance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumUsdExchangeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxRoundingLoss", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "indexed": false, + "internalType": "struct SettlementStrategy.Data", + "name": "strategy", + "type": "tuple" + } + ], + "name": "SettlementStrategySet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "components": [ + { + "internalType": "enum SettlementStrategy.Type", + "name": "strategyType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "settlementDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementWindowDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "priceVerificationContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "feedId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceDeviationTolerance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumUsdExchangeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxRoundingLoss", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "internalType": "struct SettlementStrategy.Data", + "name": "strategy", + "type": "tuple" + } + ], + "name": "addSettlementStrategy", + "outputs": [ + { + "internalType": "uint256", + "name": "strategyId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "strategyId", + "type": "uint256" + } + ], + "name": "getSettlementStrategy", + "outputs": [ + { + "components": [ + { + "internalType": "enum SettlementStrategy.Type", + "name": "strategyType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "settlementDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementWindowDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "priceVerificationContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "feedId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceDeviationTolerance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumUsdExchangeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxRoundingLoss", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "internalType": "struct SettlementStrategy.Data", + "name": "settlementStrategy", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "strategyId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "enum SettlementStrategy.Type", + "name": "strategyType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "settlementDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementWindowDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "priceVerificationContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "feedId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceDeviationTolerance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumUsdExchangeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxRoundingLoss", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "internalType": "struct SettlementStrategy.Data", + "name": "strategy", + "type": "tuple" + } + ], + "name": "setSettlementStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "strategyId", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "setSettlementStrategyEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "FailedTransfer", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "configuredCollateralType", + "type": "address" + } + ], + "name": "InvalidCollateralType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxWrappableAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountToWrap", + "type": "uint256" + } + ], + "name": "WrapperExceedsMaxAmount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountUnwrapped", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "indexed": false, + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feesCollected", + "type": "uint256" + } + ], + "name": "SynthUnwrapped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountWrapped", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "indexed": false, + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feesCollected", + "type": "uint256" + } + ], + "name": "SynthWrapped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "wrapCollateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxWrappableAmount", + "type": "uint256" + } + ], + "name": "WrapperSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getWrapper", + "outputs": [ + { + "internalType": "address", + "name": "wrapCollateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maxWrappableAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "wrapCollateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maxWrappableAmount", + "type": "uint256" + } + ], + "name": "setWrapper", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "unwrapAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountReceived", + "type": "uint256" + } + ], + "name": "unwrap", + "outputs": [ + { + "internalType": "uint256", + "name": "returnCollateralAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "wrapAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountReceived", + "type": "uint256" + } + ], + "name": "wrap", + "outputs": [ + { + "internalType": "uint256", + "name": "amountToMint", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fixedFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "utilizationFees", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "skewFees", + "type": "int256" + }, + { + "internalType": "int256", + "name": "wrapperFees", + "type": "int256" + } + ], + "internalType": "struct OrderFees.Data", + "name": "fees", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "InvalidCollateralLeverage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "invalidFeeCollector", + "type": "address" + } + ], + "name": "InvalidFeeCollectorInterface", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidWrapperFees", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "asyncFixedFee", + "type": "uint256" + } + ], + "name": "AsyncFixedFeeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "atomicFixedFee", + "type": "uint256" + } + ], + "name": "AtomicFixedFeeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateralLeverage", + "type": "uint256" + } + ], + "name": "CollateralLeverageSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "feeCollector", + "type": "address" + } + ], + "name": "FeeCollectorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "skewScale", + "type": "uint256" + } + ], + "name": "MarketSkewScaleSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "utilizationFeeRate", + "type": "uint256" + } + ], + "name": "MarketUtilizationFeesSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sharePercentage", + "type": "uint256" + } + ], + "name": "ReferrerShareUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "transactor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fixedFeeAmount", + "type": "uint256" + } + ], + "name": "TransactorFixedFeeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "synthMarketId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "wrapFee", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "unwrapFee", + "type": "int256" + } + ], + "name": "WrapperFeesSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "getCollateralLeverage", + "outputs": [ + { + "internalType": "uint256", + "name": "collateralLeverage", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "transactor", + "type": "address" + } + ], + "name": "getCustomTransactorFees", + "outputs": [ + { + "internalType": "uint256", + "name": "fixedFeeAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "getFeeCollector", + "outputs": [ + { + "internalType": "address", + "name": "feeCollector", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "getMarketFees", + "outputs": [ + { + "internalType": "uint256", + "name": "atomicFixedFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "asyncFixedFee", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "wrapFee", + "type": "int256" + }, + { + "internalType": "int256", + "name": "unwrapFee", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "getMarketSkewScale", + "outputs": [ + { + "internalType": "uint256", + "name": "skewScale", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "getMarketUtilizationFees", + "outputs": [ + { + "internalType": "uint256", + "name": "utilizationFeeRate", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "getReferrerShare", + "outputs": [ + { + "internalType": "uint256", + "name": "sharePercentage", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "asyncFixedFee", + "type": "uint256" + } + ], + "name": "setAsyncFixedFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "atomicFixedFee", + "type": "uint256" + } + ], + "name": "setAtomicFixedFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "collateralLeverage", + "type": "uint256" + } + ], + "name": "setCollateralLeverage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "transactor", + "type": "address" + }, + { + "internalType": "uint256", + "name": "fixedFeeAmount", + "type": "uint256" + } + ], + "name": "setCustomTransactorFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "feeCollector", + "type": "address" + } + ], + "name": "setFeeCollector", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "skewScale", + "type": "uint256" + } + ], + "name": "setMarketSkewScale", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "utilizationFeeRate", + "type": "uint256" + } + ], + "name": "setMarketUtilizationFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "int256", + "name": "wrapFee", + "type": "int256" + }, + { + "internalType": "int256", + "name": "unwrapFee", + "type": "int256" + } + ], + "name": "setWrapperFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sharePercentage", + "type": "uint256" + } + ], + "name": "updateReferrerShare", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "ValueAlreadyInSet", + "type": "error" + }, + { + "inputs": [], + "name": "ValueNotInSet", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowAll", + "type": "bool" + } + ], + "name": "FeatureFlagAllowAllSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "FeatureFlagAllowlistAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "FeatureFlagAllowlistRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "deniers", + "type": "address[]" + } + ], + "name": "FeatureFlagDeniersReset", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "denyAll", + "type": "bool" + } + ], + "name": "FeatureFlagDenyAllSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "addToFeatureFlagAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getDeniers", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagAllowAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagAllowlist", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagDenyAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isFeatureAllowed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "removeFromFeatureFlagAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address[]", + "name": "deniers", + "type": "address[]" + } + ], + "name": "setDeniers", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "allowAll", + "type": "bool" + } + ], + "name": "setFeatureFlagAllowAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "denyAll", + "type": "bool" + } + ], + "name": "setFeatureFlagDenyAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "deployTxnHash": "", + "deployTxnBlockNumber": "", + "deployTimestamp": "", + "sourceName": "", + "contractName": "", + "deployedOn": "invoke.upgradeSpotMarketProxy", + "gasUsed": 0, + "gasCost": "0", + "highlight": true +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/1/system/AccountProxy.json b/src/synthetix/contracts/deployments/1/system/AccountProxy.json new file mode 100644 index 0000000..84b40ea --- /dev/null +++ b/src/synthetix/contracts/deployments/1/system/AccountProxy.json @@ -0,0 +1,820 @@ +{ + "address": "0x0E429603D3Cb1DFae4E6F52Add5fE82d96d77Dac", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ImplementationIsSterile", + "type": "error" + }, + { + "inputs": [], + "name": "NoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contr", + "type": "address" + } + ], + "name": "NotAContract", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "NotNominated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "UpgradeSimulationFailed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "self", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newNominatedOwner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "simulateUpgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "CannotSelfApprove", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestedIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "IndexOverrun", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "InvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "parameter", + "type": "string" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "InvalidParameter", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "InvalidTransferRecipient", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint128", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "TokenAlreadyMinted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "TokenDoesNotExist", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "tokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "tokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "setAllowance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "setBaseTokenURI", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenOfOwnerByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "deployTxnHash": "", + "deployTxnBlockNumber": "", + "deployTimestamp": "", + "sourceName": "", + "contractName": "", + "deployedOn": "invoke.init_account", + "gasUsed": 0, + "gasCost": "0", + "highlight": true +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/1/system/CoreProxy.json b/src/synthetix/contracts/deployments/1/system/CoreProxy.json new file mode 100644 index 0000000..4eab447 --- /dev/null +++ b/src/synthetix/contracts/deployments/1/system/CoreProxy.json @@ -0,0 +1,5327 @@ +{ + "address": "0xffffffaEff0B96Ea8e4f94b2253f31abdD875847", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ImplementationIsSterile", + "type": "error" + }, + { + "inputs": [], + "name": "NoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contr", + "type": "address" + } + ], + "name": "NotAContract", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "NotNominated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "UpgradeSimulationFailed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "self", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newNominatedOwner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "simulateUpgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "ValueAlreadyInSet", + "type": "error" + }, + { + "inputs": [], + "name": "ValueNotInSet", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowAll", + "type": "bool" + } + ], + "name": "FeatureFlagAllowAllSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "FeatureFlagAllowlistAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "FeatureFlagAllowlistRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "deniers", + "type": "address[]" + } + ], + "name": "FeatureFlagDeniersReset", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "denyAll", + "type": "bool" + } + ], + "name": "FeatureFlagDenyAllSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "addToFeatureFlagAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getDeniers", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagAllowAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagAllowlist", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagDenyAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isFeatureAllowed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "removeFromFeatureFlagAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address[]", + "name": "deniers", + "type": "address[]" + } + ], + "name": "setDeniers", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "allowAll", + "type": "bool" + } + ], + "name": "setFeatureFlagAllowAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "denyAll", + "type": "bool" + } + ], + "name": "setFeatureFlagDenyAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "which", + "type": "bytes32" + } + ], + "name": "FeatureUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "InvalidAccountId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + } + ], + "name": "InvalidPermission", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "origin", + "type": "address" + } + ], + "name": "OnlyAccountTokenProxy", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "PermissionDenied", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "PermissionNotGranted", + "type": "error" + }, + { + "inputs": [], + "name": "PositionOutOfBounds", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "AccountCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PermissionGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PermissionRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "createAccount", + "outputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "requestedAccountId", + "type": "uint128" + } + ], + "name": "createAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountLastInteraction", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountPermissions", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "bytes32[]", + "name": "permissions", + "type": "bytes32[]" + } + ], + "internalType": "struct IAccountModule.AccountPermissions[]", + "name": "accountPerms", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAccountTokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "grantPermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "hasPermission", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "notifyAccountTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + } + ], + "name": "renouncePermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "revokePermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "AccountNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyDistribution", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "collateralValue", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ratio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minRatio", + "type": "uint256" + } + ], + "name": "InsufficientCollateralRatio", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "MarketNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + } + ], + "name": "NotFundedByPool", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt256ToInt128", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt256ToUint256", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint128ToInt128", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToInt256", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint128", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "updatedDebt", + "type": "int256" + } + ], + "name": "DebtAssociated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "associateDebt", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "MismatchAssociatedSystemKind", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "MissingAssociatedSystem", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "AssociatedSystemSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "getAssociatedSystem", + "outputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeNft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "endpoint", + "type": "address" + } + ], + "name": "registerUnmanagedSystem", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "InvalidMessage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "NotCcipRouter", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "UnsupportedNetwork", + "type": "error" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "messageId", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "sourceChainSelector", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "sender", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct CcipClient.EVMTokenAmount[]", + "name": "tokenAmounts", + "type": "tuple[]" + } + ], + "internalType": "struct CcipClient.Any2EVMMessage", + "name": "message", + "type": "tuple" + } + ], + "name": "ccipReceive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "currentTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredTime", + "type": "uint256" + } + ], + "name": "AccountActivityTimeoutPending", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "CollateralDepositDisabled", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "FailedTransfer", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountAvailableForDelegationD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountD18", + "type": "uint256" + } + ], + "name": "InsufficentAvailableCollateral", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "InsufficientAccountCollateral", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "existing", + "type": "uint256" + } + ], + "name": "InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "parameter", + "type": "string" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "InvalidParameter", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint64", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + } + ], + "name": "PrecisionLost", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "expireTimestamp", + "type": "uint64" + } + ], + "name": "CollateralLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "expireTimestamp", + "type": "uint64" + } + ], + "name": "CollateralLockExpired", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "Deposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "Withdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "offset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "name": "cleanExpiredLocks", + "outputs": [ + { + "internalType": "uint256", + "name": "cleared", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "expireTimestamp", + "type": "uint64" + } + ], + "name": "createLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getAccountAvailableCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getAccountCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "totalDeposited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalAssigned", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalLocked", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "offset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "name": "getLocks", + "outputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "amountD18", + "type": "uint128" + }, + { + "internalType": "uint64", + "name": "lockExpirationTime", + "type": "uint64" + } + ], + "internalType": "struct CollateralLock.Data[]", + "name": "locks", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "components": [ + { + "internalType": "bool", + "name": "depositingEnabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRewardD18", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "oracleNodeId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minDelegationD18", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct CollateralConfiguration.Data", + "name": "config", + "type": "tuple" + } + ], + "name": "CollateralConfigured", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "depositingEnabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRewardD18", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "oracleNodeId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minDelegationD18", + "type": "uint256" + } + ], + "internalType": "struct CollateralConfiguration.Data", + "name": "config", + "type": "tuple" + } + ], + "name": "configureCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getCollateralConfiguration", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "depositingEnabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRewardD18", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "oracleNodeId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minDelegationD18", + "type": "uint256" + } + ], + "internalType": "struct CollateralConfiguration.Data", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "hideDisabled", + "type": "bool" + } + ], + "name": "getCollateralConfigurations", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "depositingEnabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRewardD18", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "oracleNodeId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minDelegationD18", + "type": "uint256" + } + ], + "internalType": "struct CollateralConfiguration.Data[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getCollateralPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requiredAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableAmount", + "type": "uint256" + } + ], + "name": "InsufficientCcipFee", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "destChainId", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "TransferCrossChainInitiated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "destChainId", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferCrossChain", + "outputs": [ + { + "internalType": "uint256", + "name": "gasTokenUsed", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "currentDebt", + "type": "int256" + } + ], + "name": "InsufficientDebt", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "PoolNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "name": "IssuanceFeePaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "UsdBurned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "UsdMinted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnUsd", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mintUsd", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "CannotScaleEmptyMapping", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "collateralValue", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "debt", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "currentCRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "cratio", + "type": "uint256" + } + ], + "name": "IneligibleForLiquidation", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientMappedAmount", + "type": "error" + }, + { + "inputs": [], + "name": "MustBeVaultLiquidated", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt128ToUint128", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "debtLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountRewarded", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct ILiquidationModule.LiquidationData", + "name": "liquidationData", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "liquidateAsAccountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "Liquidation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "debtLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountRewarded", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct ILiquidationModule.LiquidationData", + "name": "liquidationData", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "liquidateAsAccountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "VaultLiquidation", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "isPositionLiquidatable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "isVaultLiquidatable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint128", + "name": "liquidateAsAccountId", + "type": "uint128" + } + ], + "name": "liquidate", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "debtLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountRewarded", + "type": "uint256" + } + ], + "internalType": "struct ILiquidationModule.LiquidationData", + "name": "liquidationData", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint128", + "name": "liquidateAsAccountId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxUsd", + "type": "uint256" + } + ], + "name": "liquidateVault", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "debtLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountRewarded", + "type": "uint256" + } + ], + "internalType": "struct ILiquidationModule.LiquidationData", + "name": "liquidationData", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmountToDeposit", + "type": "uint256" + } + ], + "name": "InsufficientMarketCollateralDepositable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmountToWithdraw", + "type": "uint256" + } + ], + "name": "InsufficientMarketCollateralWithdrawable", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "int128", + "name": "creditCapacity", + "type": "int128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "netIssuance", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "depositedCollateralValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reportedDebt", + "type": "uint256" + } + ], + "name": "MarketCollateralDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "int128", + "name": "creditCapacity", + "type": "int128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "netIssuance", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "depositedCollateralValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reportedDebt", + "type": "uint256" + } + ], + "name": "MarketCollateralWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "systemAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "MaximumMarketCollateralConfigured", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "configureMaximumMarketCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + } + ], + "name": "depositMarketCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getMarketCollateralAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "collateralAmountD18", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketCollateralValue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getMaximumMarketCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + } + ], + "name": "withdrawMarketCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "IncorrectMarketInterface", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "NotEnoughLiquidity", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "MarketRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "name": "MarketSystemFeePaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "indexed": false, + "internalType": "int128", + "name": "creditCapacity", + "type": "int128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "netIssuance", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "depositedCollateralValue", + "type": "uint256" + } + ], + "name": "MarketUsdDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "indexed": false, + "internalType": "int128", + "name": "creditCapacity", + "type": "int128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "netIssuance", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "depositedCollateralValue", + "type": "uint256" + } + ], + "name": "MarketUsdWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minLiquidityRatio", + "type": "uint256" + } + ], + "name": "SetMarketMinLiquidityRatio", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "minDelegateTime", + "type": "uint32" + } + ], + "name": "SetMinDelegateTime", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "depositMarketUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxIter", + "type": "uint256" + } + ], + "name": "distributeDebtToPools", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketDebtPerShare", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "getMarketFees", + "outputs": [ + { + "internalType": "uint256", + "name": "depositFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawFeeAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketMinDelegateTime", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketNetIssuance", + "outputs": [ + { + "internalType": "int128", + "name": "", + "type": "int128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "getMarketPoolDebtDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "sharesD18", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "totalSharesD18", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "valuePerShareD27", + "type": "int128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketPools", + "outputs": [ + { + "internalType": "uint128[]", + "name": "inRangePoolIds", + "type": "uint128[]" + }, + { + "internalType": "uint128[]", + "name": "outRangePoolIds", + "type": "uint128[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketReportedDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketTotalDebt", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMinLiquidityRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOracleManager", + "outputs": [ + { + "internalType": "contract IOracleManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getUsdToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getWithdrawableMarketUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "isMarketCapacityLocked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "registerMarket", + "outputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint32", + "name": "minDelegateTime", + "type": "uint32" + } + ], + "name": "setMarketMinDelegateTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "minLiquidityRatio", + "type": "uint256" + } + ], + "name": "setMinLiquidityRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdrawMarketUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + } + ], + "name": "PoolApprovedAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + } + ], + "name": "PoolApprovedRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + } + ], + "name": "PreferredPoolSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "addApprovedPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getApprovedPools", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPreferredPool", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "removeApprovedPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "setPreferredPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketId", + "type": "uint256" + } + ], + "name": "CapacityLocked", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "uint32", + "name": "timeRemaining", + "type": "uint32" + } + ], + "name": "MinDelegationTimeoutPending", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "PoolAlreadyExists", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "collateralLimitD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct PoolCollateralConfiguration.Data", + "name": "config", + "type": "tuple" + } + ], + "name": "PoolCollateralConfigurationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "name": "PoolCollateralDisabledByDefaultSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "components": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "weightD18", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "maxDebtShareValueD18", + "type": "int128" + } + ], + "indexed": false, + "internalType": "struct MarketConfiguration.Data[]", + "name": "markets", + "type": "tuple[]" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PoolConfigurationSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PoolNameUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "PoolNominationRenounced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "PoolNominationRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "nominatedOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "PoolOwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "PoolOwnershipAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "PoolOwnershipRenounced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "minLiquidityRatio", + "type": "uint256" + } + ], + "name": "SetMinLiquidityRatio", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "acceptPoolOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "requestedPoolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "createPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getMinLiquidityRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "getNominatedPoolOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getPoolCollateralConfiguration", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "collateralLimitD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + } + ], + "internalType": "struct PoolCollateralConfiguration.Data", + "name": "config", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "getPoolCollateralIssuanceRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "getPoolConfiguration", + "outputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "weightD18", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "maxDebtShareValueD18", + "type": "int128" + } + ], + "internalType": "struct MarketConfiguration.Data[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "getPoolName", + "outputs": [ + { + "internalType": "string", + "name": "poolName", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "getPoolOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nominatedOwner", + "type": "address" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "nominatePoolOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "optionalCollateralType", + "type": "address" + } + ], + "name": "rebalancePool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "renouncePoolNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "renouncePoolOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "revokePoolNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minLiquidityRatio", + "type": "uint256" + } + ], + "name": "setMinLiquidityRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "collateralLimitD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + } + ], + "internalType": "struct PoolCollateralConfiguration.Data", + "name": "newConfig", + "type": "tuple" + } + ], + "name": "setPoolCollateralConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "name": "setPoolCollateralDisabledByDefault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "components": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "weightD18", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "maxDebtShareValueD18", + "type": "int128" + } + ], + "internalType": "struct MarketConfiguration.Data[]", + "name": "newMarketConfigurations", + "type": "tuple[]" + } + ], + "name": "setPoolConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setPoolName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint32", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint32ToInt32", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint64ToInt64", + "type": "error" + }, + { + "inputs": [], + "name": "RewardDistributorNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "RewardUnavailable", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "distributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "RewardsClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "distributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "RewardsDistributed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "RewardsDistributorRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "RewardsDistributorRemoved", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "claimRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "start", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "duration", + "type": "uint32" + } + ], + "name": "distributeRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "address", + "name": "rewardsDistributor", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "start", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "duration", + "type": "uint32" + } + ], + "name": "distributeRewardsByOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "getAvailableRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "getRewardRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "registerRewardsDistributor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "removeRewardsDistributor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "updateRewards", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "newChainId", + "type": "uint64" + } + ], + "name": "NewSupportedCrossChainNetwork", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ccipRouter", + "type": "address" + }, + { + "internalType": "address", + "name": "ccipTokenPool", + "type": "address" + } + ], + "name": "configureChainlinkCrossChain", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oracleManagerAddress", + "type": "address" + } + ], + "name": "configureOracleManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "k", + "type": "bytes32" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "bytes32", + "name": "v", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "k", + "type": "bytes32" + } + ], + "name": "getConfigAddress", + "outputs": [ + { + "internalType": "address", + "name": "v", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "k", + "type": "bytes32" + } + ], + "name": "getConfigUint", + "outputs": [ + { + "internalType": "uint256", + "name": "v", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTrustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "k", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "v", + "type": "bytes32" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64[]", + "name": "supportedNetworks", + "type": "uint64[]" + }, + { + "internalType": "uint64[]", + "name": "ccipSelectors", + "type": "uint64[]" + } + ], + "name": "setSupportedCrossChainNetworks", + "outputs": [ + { + "internalType": "uint256", + "name": "numRegistered", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minDelegation", + "type": "uint256" + } + ], + "name": "InsufficientDelegation", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidCollateralAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "leverage", + "type": "uint256" + } + ], + "name": "InvalidLeverage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentCollateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCollateral", + "type": "uint256" + } + ], + "name": "PoolCollateralLimitExceeded", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "leverage", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "DelegationUpdated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newCollateralAmountD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leverage", + "type": "uint256" + } + ], + "name": "delegateCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getPosition", + "outputs": [ + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralValue", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "debt", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "collateralizationRatio", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getPositionCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getPositionCollateralRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getPositionDebt", + "outputs": [ + { + "internalType": "int256", + "name": "debt", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getVaultCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getVaultCollateralRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getVaultDebt", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "deployTxnHash": "", + "deployTxnBlockNumber": "", + "deployTimestamp": "", + "sourceName": "", + "contractName": "", + "deployedOn": "invoke.upgrade_core_proxy", + "gasUsed": 0, + "gasCost": "0", + "highlight": true +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/1/system/USDProxy.json b/src/synthetix/contracts/deployments/1/system/USDProxy.json new file mode 100644 index 0000000..b59d94d --- /dev/null +++ b/src/synthetix/contracts/deployments/1/system/USDProxy.json @@ -0,0 +1,836 @@ +{ + "address": "0xb2F30A7C980f052f02563fb518dcc39e6bf38175", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ImplementationIsSterile", + "type": "error" + }, + { + "inputs": [], + "name": "NoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contr", + "type": "address" + } + ], + "name": "NotAContract", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "NotNominated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "UpgradeSimulationFailed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "self", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newNominatedOwner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "simulateUpgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "MismatchAssociatedSystemKind", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "MissingAssociatedSystem", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "AssociatedSystemSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "getAssociatedSystem", + "outputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeNft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "endpoint", + "type": "address" + } + ], + "name": "registerUnmanagedSystem", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "existing", + "type": "uint256" + } + ], + "name": "InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "existing", + "type": "uint256" + } + ], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "parameter", + "type": "string" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "InvalidParameter", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnWithAllowance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "tokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "tokenSymbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "tokenDecimals", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "setAllowance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "deployTxnHash": "", + "deployTxnBlockNumber": "", + "deployTimestamp": "", + "sourceName": "", + "contractName": "", + "deployedOn": "invoke.init_usd", + "gasUsed": 0, + "gasCost": "0", + "highlight": true +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/1/system/trusted_multicall_forwarder/TrustedMulticallForwarder.json b/src/synthetix/contracts/deployments/1/system/trusted_multicall_forwarder/TrustedMulticallForwarder.json new file mode 100644 index 0000000..e3635a6 --- /dev/null +++ b/src/synthetix/contracts/deployments/1/system/trusted_multicall_forwarder/TrustedMulticallForwarder.json @@ -0,0 +1,887 @@ +{ + "address": "0xE2C5658cC5C448B48141168f3e475dF8f65A1e3e", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "AddressInsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint48", + "name": "deadline", + "type": "uint48" + } + ], + "name": "ERC2771ForwarderExpiredRequest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + } + ], + "name": "ERC2771ForwarderInvalidSigner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestedValue", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "msgValue", + "type": "uint256" + } + ], + "name": "ERC2771ForwarderMismatchedValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "ERC2771UntrustfulTarget", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentNonce", + "type": "uint256" + } + ], + "name": "InvalidAccountNonce", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidShortString", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "StringTooLong", + "type": "error" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "name": "ExecutedForwardRequest", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "returnData", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Call3[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate3", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Call3Value[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate3Value", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "blockAndAggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "internalType": "uint48", + "name": "deadline", + "type": "uint48" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct ERC2771Forwarder.ForwardRequestData", + "name": "request", + "type": "tuple" + } + ], + "name": "execute", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "internalType": "uint48", + "name": "deadline", + "type": "uint48" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct ERC2771Forwarder.ForwardRequestData[]", + "name": "requests", + "type": "tuple[]" + } + ], + "name": "executeBatch", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "internalType": "uint48", + "name": "deadline", + "type": "uint48" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct ERC2771Forwarder.ForwardRequestData[]", + "name": "requests", + "type": "tuple[]" + }, + { + "internalType": "address payable", + "name": "refundReceiver", + "type": "address" + } + ], + "name": "executeBatch", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "getBasefee", + "outputs": [ + { + "internalType": "uint256", + "name": "basefee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "getBlockHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "chainid", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockCoinbase", + "outputs": [ + { + "internalType": "address", + "name": "coinbase", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "gaslimit", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "getEthBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastBlockHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPrevRandao", + "outputs": [ + { + "internalType": "uint256", + "name": "prevrandao", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "tryAggregate", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "tryBlockAndAggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "internalType": "uint48", + "name": "deadline", + "type": "uint48" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct ERC2771Forwarder.ForwardRequestData", + "name": "request", + "type": "tuple" + } + ], + "name": "verify", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "constructorArgs": [], + "linkedLibraries": {}, + "deployTxnHash": "", + "deployTxnBlockNumber": "", + "deployTimestamp": "1721305343", + "sourceName": "src/TrustedMulticallForwarder.sol", + "contractName": "TrustedMulticallForwarder", + "deployedOn": "contract.TrustedMulticallForwarder", + "gasUsed": 0, + "gasCost": "0" +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/11155111/Pyth.json b/src/synthetix/contracts/deployments/11155111/Pyth.json new file mode 100644 index 0000000..2cbe5ff --- /dev/null +++ b/src/synthetix/contracts/deployments/11155111/Pyth.json @@ -0,0 +1,1632 @@ +{ + "address": "0xDd24F84d36BF92C65F92307595335bdFab5Bbd21", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InsufficientFee", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidArgument", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidGovernanceDataSource", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidGovernanceMessage", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidGovernanceTarget", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidUpdateData", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidUpdateDataSource", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidWormholeAddressToSet", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidWormholeVaa", + "type": "error" + }, + { + "inputs": [], + "name": "NoFreshUpdate", + "type": "error" + }, + { + "inputs": [], + "name": "OldGovernanceMessage", + "type": "error" + }, + { + "inputs": [], + "name": "PriceFeedNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "PriceFeedNotFoundWithinRange", + "type": "error" + }, + { + "inputs": [], + "name": "StalePrice", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "sequenceNumber", + "type": "uint64" + } + ], + "name": "BatchPriceFeedUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldImplementation", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "ContractUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "emitterAddress", + "type": "bytes32" + } + ], + "indexed": false, + "internalType": "struct PythInternalStructs.DataSource[]", + "name": "oldDataSources", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "emitterAddress", + "type": "bytes32" + } + ], + "indexed": false, + "internalType": "struct PythInternalStructs.DataSource[]", + "name": "newDataSources", + "type": "tuple[]" + } + ], + "name": "DataSourcesSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newFee", + "type": "uint256" + } + ], + "name": "FeeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "emitterAddress", + "type": "bytes32" + } + ], + "indexed": false, + "internalType": "struct PythInternalStructs.DataSource", + "name": "oldDataSource", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "emitterAddress", + "type": "bytes32" + } + ], + "indexed": false, + "internalType": "struct PythInternalStructs.DataSource", + "name": "newDataSource", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "initialSequence", + "type": "uint64" + } + ], + "name": "GovernanceDataSourceSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "publishTime", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "int64", + "name": "price", + "type": "int64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "conf", + "type": "uint64" + } + ], + "name": "PriceFeedUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldValidPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newValidPeriod", + "type": "uint256" + } + ], + "name": "ValidPeriodSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldWormholeAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newWormholeAddress", + "type": "address" + } + ], + "name": "WormholeAddressSet", + "type": "event" + }, + { + "inputs": [], + "name": "chainId", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedVM", + "type": "bytes" + } + ], + "name": "executeGovernanceInstruction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "getEmaPrice", + "outputs": [ + { + "components": [ + { + "internalType": "int64", + "name": "price", + "type": "int64" + }, + { + "internalType": "uint64", + "name": "conf", + "type": "uint64" + }, + { + "internalType": "int32", + "name": "expo", + "type": "int32" + }, + { + "internalType": "uint256", + "name": "publishTime", + "type": "uint256" + } + ], + "internalType": "struct PythStructs.Price", + "name": "price", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "age", + "type": "uint256" + } + ], + "name": "getEmaPriceNoOlderThan", + "outputs": [ + { + "components": [ + { + "internalType": "int64", + "name": "price", + "type": "int64" + }, + { + "internalType": "uint64", + "name": "conf", + "type": "uint64" + }, + { + "internalType": "int32", + "name": "expo", + "type": "int32" + }, + { + "internalType": "uint256", + "name": "publishTime", + "type": "uint256" + } + ], + "internalType": "struct PythStructs.Price", + "name": "price", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "getEmaPriceUnsafe", + "outputs": [ + { + "components": [ + { + "internalType": "int64", + "name": "price", + "type": "int64" + }, + { + "internalType": "uint64", + "name": "conf", + "type": "uint64" + }, + { + "internalType": "int32", + "name": "expo", + "type": "int32" + }, + { + "internalType": "uint256", + "name": "publishTime", + "type": "uint256" + } + ], + "internalType": "struct PythStructs.Price", + "name": "price", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "getPrice", + "outputs": [ + { + "components": [ + { + "internalType": "int64", + "name": "price", + "type": "int64" + }, + { + "internalType": "uint64", + "name": "conf", + "type": "uint64" + }, + { + "internalType": "int32", + "name": "expo", + "type": "int32" + }, + { + "internalType": "uint256", + "name": "publishTime", + "type": "uint256" + } + ], + "internalType": "struct PythStructs.Price", + "name": "price", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "age", + "type": "uint256" + } + ], + "name": "getPriceNoOlderThan", + "outputs": [ + { + "components": [ + { + "internalType": "int64", + "name": "price", + "type": "int64" + }, + { + "internalType": "uint64", + "name": "conf", + "type": "uint64" + }, + { + "internalType": "int32", + "name": "expo", + "type": "int32" + }, + { + "internalType": "uint256", + "name": "publishTime", + "type": "uint256" + } + ], + "internalType": "struct PythStructs.Price", + "name": "price", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "getPriceUnsafe", + "outputs": [ + { + "components": [ + { + "internalType": "int64", + "name": "price", + "type": "int64" + }, + { + "internalType": "uint64", + "name": "conf", + "type": "uint64" + }, + { + "internalType": "int32", + "name": "expo", + "type": "int32" + }, + { + "internalType": "uint256", + "name": "publishTime", + "type": "uint256" + } + ], + "internalType": "struct PythStructs.Price", + "name": "price", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "updateData", + "type": "bytes[]" + } + ], + "name": "getUpdateFee", + "outputs": [ + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "updateDataSize", + "type": "uint256" + } + ], + "name": "getUpdateFee", + "outputs": [ + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getValidTimePeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governanceDataSource", + "outputs": [ + { + "components": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "emitterAddress", + "type": "bytes32" + } + ], + "internalType": "struct PythInternalStructs.DataSource", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governanceDataSourceIndex", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "emitterAddress", + "type": "bytes32" + } + ], + "internalType": "struct PythInternalStructs.DataSource", + "name": "ds", + "type": "tuple" + } + ], + "name": "hashDataSource", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "wormhole", + "type": "address" + }, + { + "internalType": "uint16[]", + "name": "dataSourceEmitterChainIds", + "type": "uint16[]" + }, + { + "internalType": "bytes32[]", + "name": "dataSourceEmitterAddresses", + "type": "bytes32[]" + }, + { + "internalType": "uint16", + "name": "governanceEmitterChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "governanceEmitterAddress", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "governanceInitialSequence", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "validTimePeriodSeconds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "singleUpdateFeeInWei", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "dataSourceChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "dataSourceEmitterAddress", + "type": "bytes32" + } + ], + "name": "isValidDataSource", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "governanceChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "governanceEmitterAddress", + "type": "bytes32" + } + ], + "name": "isValidGovernanceDataSource", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastExecutedGovernanceSequence", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "priceId", + "type": "bytes32" + } + ], + "name": "latestPriceInfoPublishTime", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedPayload", + "type": "bytes" + } + ], + "name": "parseAuthorizeGovernanceDataSourceTransferPayload", + "outputs": [ + { + "components": [ + { + "internalType": "bytes", + "name": "claimVaa", + "type": "bytes" + } + ], + "internalType": "struct PythGovernanceInstructions.AuthorizeGovernanceDataSourceTransferPayload", + "name": "sgds", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedInstruction", + "type": "bytes" + } + ], + "name": "parseGovernanceInstruction", + "outputs": [ + { + "components": [ + { + "internalType": "enum PythGovernanceInstructions.GovernanceModule", + "name": "module", + "type": "uint8" + }, + { + "internalType": "enum PythGovernanceInstructions.GovernanceAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "targetChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "payload", + "type": "bytes" + } + ], + "internalType": "struct PythGovernanceInstructions.GovernanceInstruction", + "name": "gi", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "updateData", + "type": "bytes[]" + }, + { + "internalType": "bytes32[]", + "name": "priceIds", + "type": "bytes32[]" + }, + { + "internalType": "uint64", + "name": "minPublishTime", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "maxPublishTime", + "type": "uint64" + } + ], + "name": "parsePriceFeedUpdates", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "int64", + "name": "price", + "type": "int64" + }, + { + "internalType": "uint64", + "name": "conf", + "type": "uint64" + }, + { + "internalType": "int32", + "name": "expo", + "type": "int32" + }, + { + "internalType": "uint256", + "name": "publishTime", + "type": "uint256" + } + ], + "internalType": "struct PythStructs.Price", + "name": "price", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "int64", + "name": "price", + "type": "int64" + }, + { + "internalType": "uint64", + "name": "conf", + "type": "uint64" + }, + { + "internalType": "int32", + "name": "expo", + "type": "int32" + }, + { + "internalType": "uint256", + "name": "publishTime", + "type": "uint256" + } + ], + "internalType": "struct PythStructs.Price", + "name": "emaPrice", + "type": "tuple" + } + ], + "internalType": "struct PythStructs.PriceFeed[]", + "name": "priceFeeds", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "updateData", + "type": "bytes[]" + }, + { + "internalType": "bytes32[]", + "name": "priceIds", + "type": "bytes32[]" + }, + { + "internalType": "uint64", + "name": "minPublishTime", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "maxPublishTime", + "type": "uint64" + } + ], + "name": "parsePriceFeedUpdatesUnique", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "int64", + "name": "price", + "type": "int64" + }, + { + "internalType": "uint64", + "name": "conf", + "type": "uint64" + }, + { + "internalType": "int32", + "name": "expo", + "type": "int32" + }, + { + "internalType": "uint256", + "name": "publishTime", + "type": "uint256" + } + ], + "internalType": "struct PythStructs.Price", + "name": "price", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "int64", + "name": "price", + "type": "int64" + }, + { + "internalType": "uint64", + "name": "conf", + "type": "uint64" + }, + { + "internalType": "int32", + "name": "expo", + "type": "int32" + }, + { + "internalType": "uint256", + "name": "publishTime", + "type": "uint256" + } + ], + "internalType": "struct PythStructs.Price", + "name": "emaPrice", + "type": "tuple" + } + ], + "internalType": "struct PythStructs.PriceFeed[]", + "name": "priceFeeds", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedPayload", + "type": "bytes" + } + ], + "name": "parseRequestGovernanceDataSourceTransferPayload", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "governanceDataSourceIndex", + "type": "uint32" + } + ], + "internalType": "struct PythGovernanceInstructions.RequestGovernanceDataSourceTransferPayload", + "name": "sgdsClaim", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedPayload", + "type": "bytes" + } + ], + "name": "parseSetDataSourcesPayload", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "emitterAddress", + "type": "bytes32" + } + ], + "internalType": "struct PythInternalStructs.DataSource[]", + "name": "dataSources", + "type": "tuple[]" + } + ], + "internalType": "struct PythGovernanceInstructions.SetDataSourcesPayload", + "name": "sds", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedPayload", + "type": "bytes" + } + ], + "name": "parseSetFeePayload", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "newFee", + "type": "uint256" + } + ], + "internalType": "struct PythGovernanceInstructions.SetFeePayload", + "name": "sf", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedPayload", + "type": "bytes" + } + ], + "name": "parseSetValidPeriodPayload", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "newValidPeriod", + "type": "uint256" + } + ], + "internalType": "struct PythGovernanceInstructions.SetValidPeriodPayload", + "name": "svp", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedPayload", + "type": "bytes" + } + ], + "name": "parseSetWormholeAddressPayload", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "newWormholeAddress", + "type": "address" + } + ], + "internalType": "struct PythGovernanceInstructions.SetWormholeAddressPayload", + "name": "sw", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedPayload", + "type": "bytes" + } + ], + "name": "parseUpgradeContractPayload", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "internalType": "struct PythGovernanceInstructions.UpgradeContractPayload", + "name": "uc", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "priceFeedExists", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pythUpgradableMagic", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "queryPriceFeed", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "int64", + "name": "price", + "type": "int64" + }, + { + "internalType": "uint64", + "name": "conf", + "type": "uint64" + }, + { + "internalType": "int32", + "name": "expo", + "type": "int32" + }, + { + "internalType": "uint256", + "name": "publishTime", + "type": "uint256" + } + ], + "internalType": "struct PythStructs.Price", + "name": "price", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "int64", + "name": "price", + "type": "int64" + }, + { + "internalType": "uint64", + "name": "conf", + "type": "uint64" + }, + { + "internalType": "int32", + "name": "expo", + "type": "int32" + }, + { + "internalType": "uint256", + "name": "publishTime", + "type": "uint256" + } + ], + "internalType": "struct PythStructs.Price", + "name": "emaPrice", + "type": "tuple" + } + ], + "internalType": "struct PythStructs.PriceFeed", + "name": "priceFeed", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "singleUpdateFeeInWei", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "updateData", + "type": "bytes[]" + } + ], + "name": "updatePriceFeeds", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "updateData", + "type": "bytes[]" + }, + { + "internalType": "bytes32[]", + "name": "priceIds", + "type": "bytes32[]" + }, + { + "internalType": "uint64[]", + "name": "publishTimes", + "type": "uint64[]" + } + ], + "name": "updatePriceFeedsIfNecessary", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "validDataSources", + "outputs": [ + { + "components": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "emitterAddress", + "type": "bytes32" + } + ], + "internalType": "struct PythInternalStructs.DataSource[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "validTimePeriodSeconds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "wormhole", + "outputs": [ + { + "internalType": "contract IWormhole", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/11155111/SNX.json b/src/synthetix/contracts/deployments/11155111/SNX.json new file mode 100644 index 0000000..0d77d0e --- /dev/null +++ b/src/synthetix/contracts/deployments/11155111/SNX.json @@ -0,0 +1,431 @@ +{ + "address": "0x079E7E1C0cBFee4B2D2798A9d426009D08b1F9cb", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract Proxyable", + "name": "newTarget", + "type": "address" + } + ], + "name": "TargetUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "numTopics", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "topic1", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "topic2", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "topic3", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "topic4", + "type": "bytes32" + } + ], + "name": "_emit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract Proxyable", + "name": "_target", + "type": "address" + } + ], + "name": "setTarget", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "target", + "outputs": [ + { + "internalType": "contract Proxyable", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/11155111/bfp_market_factory/BfpMarketProxy.json b/src/synthetix/contracts/deployments/11155111/bfp_market_factory/BfpMarketProxy.json new file mode 100644 index 0000000..1336409 --- /dev/null +++ b/src/synthetix/contracts/deployments/11155111/bfp_market_factory/BfpMarketProxy.json @@ -0,0 +1,4191 @@ +{ + "address": "0x07049D05FC829933511274F6e3A828d464d3517E", + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "which", + "type": "bytes32" + } + ], + "name": "FeatureUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "InvalidAccountId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + } + ], + "name": "InvalidPermission", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "origin", + "type": "address" + } + ], + "name": "OnlyAccountTokenProxy", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "PermissionDenied", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "PermissionNotGranted", + "type": "error" + }, + { + "inputs": [], + "name": "PositionOutOfBounds", + "type": "error" + }, + { + "inputs": [], + "name": "ValueAlreadyInSet", + "type": "error" + }, + { + "inputs": [], + "name": "ValueNotInSet", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "AccountCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PermissionGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PermissionRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "createAccount", + "outputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "requestedAccountId", + "type": "uint128" + } + ], + "name": "createAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountLastInteraction", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountPermissions", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "bytes32[]", + "name": "permissions", + "type": "bytes32[]" + } + ], + "internalType": "struct IAccountModule.AccountPermissions[]", + "name": "accountPerms", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAccountTokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "grantPermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "hasPermission", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "notifyAccountTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + } + ], + "name": "renouncePermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "revokePermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "MismatchAssociatedSystemKind", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "MissingAssociatedSystem", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "AssociatedSystemSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "getAssociatedSystem", + "outputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeNft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "endpoint", + "type": "address" + } + ], + "name": "registerUnmanagedSystem", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ImplementationIsSterile", + "type": "error" + }, + { + "inputs": [], + "name": "NoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contr", + "type": "address" + } + ], + "name": "NotAContract", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "NotNominated", + "type": "error" + }, + { + "inputs": [], + "name": "UpgradeSimulationFailed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "self", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newNominatedOwner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "simulateUpgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowAll", + "type": "bool" + } + ], + "name": "FeatureFlagAllowAllSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "FeatureFlagAllowlistAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "FeatureFlagAllowlistRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "deniers", + "type": "address[]" + } + ], + "name": "FeatureFlagDeniersReset", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "denyAll", + "type": "bool" + } + ], + "name": "FeatureFlagDenyAllSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "suspended", + "type": "bool" + } + ], + "name": "PerpMarketSuspended", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "addToFeatureFlagAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "enableAllFeatures", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getDeniers", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagAllowAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagAllowlist", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagDenyAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isFeatureAllowed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "removeFromFeatureFlagAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address[]", + "name": "deniers", + "type": "address[]" + } + ], + "name": "setDeniers", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "allowAll", + "type": "bool" + } + ], + "name": "setFeatureFlagAllowAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "denyAll", + "type": "bool" + } + ], + "name": "setFeatureFlagDenyAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "suspendAllFeatures", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_synthetix", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "synthetixCore", + "type": "address" + } + ], + "name": "InvalidCoreAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "MarketNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt256ToInt128", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt256ToUint256", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint128ToInt128", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToInt256", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint128", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint64", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "skew", + "type": "int128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "fundingRate", + "type": "int128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "fundingVelocity", + "type": "int128" + } + ], + "name": "FundingRecomputed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "id", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "name", + "type": "bytes32" + } + ], + "name": "MarketCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "size", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "skew", + "type": "int128" + } + ], + "name": "MarketSizeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "keeperFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "commitmentTime", + "type": "uint64" + } + ], + "name": "OrderCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "skew", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "utilizationRate", + "type": "uint128" + } + ], + "name": "UtilizationRecomputed", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "name", + "type": "bytes32" + } + ], + "internalType": "struct IPerpMarketFactoryModule.CreatePerpMarketParameters", + "name": "data", + "type": "tuple" + } + ], + "name": "createMarket", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getActiveMarketIds", + "outputs": [ + { + "internalType": "uint128[]", + "name": "", + "type": "uint128[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketDigest", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "collateralAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "available", + "type": "uint256" + } + ], + "internalType": "struct IPerpMarketFactoryModule.DepositedCollateral[]", + "name": "depositedCollaterals", + "type": "tuple[]" + }, + { + "internalType": "bytes32", + "name": "name", + "type": "bytes32" + }, + { + "internalType": "int128", + "name": "skew", + "type": "int128" + }, + { + "internalType": "uint128", + "name": "size", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "oraclePrice", + "type": "uint256" + }, + { + "internalType": "int128", + "name": "fundingVelocity", + "type": "int128" + }, + { + "internalType": "int128", + "name": "fundingRate", + "type": "int128" + }, + { + "internalType": "uint128", + "name": "utilizationRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "remainingLiquidatableSizeCapacity", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "lastLiquidationTime", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "totalTraderDebtUsd", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "totalCollateralValueUsd", + "type": "uint256" + }, + { + "internalType": "int128", + "name": "debtCorrection", + "type": "int128" + } + ], + "internalType": "struct IPerpMarketFactoryModule.MarketDigest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getUtilizationDigest", + "outputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "lastComputedUtilizationRate", + "type": "uint128" + }, + { + "internalType": "uint64", + "name": "lastComputedTimestamp", + "type": "uint64" + }, + { + "internalType": "uint128", + "name": "currentUtilizationRate", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "utilization", + "type": "uint256" + } + ], + "internalType": "struct IPerpMarketFactoryModule.UtilizationDigest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "minimumCredit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + } + ], + "name": "minimumCreditWithTradeSize", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "recomputeFunding", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "recomputeUtilization", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "reportedDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "ethOracleNodeId", + "type": "bytes32" + } + ], + "name": "setEthOracleNodeId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPyth", + "name": "pyth", + "type": "address" + } + ], + "name": "setPyth", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "setRewardDistributorImplementation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "parameter", + "type": "string" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "InvalidParameter", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + } + ], + "name": "GlobalMarketConfigured", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + } + ], + "name": "MarketConfigured", + "type": "event" + }, + { + "inputs": [], + "name": "getMarketConfiguration", + "outputs": [ + { + "components": [ + { + "internalType": "contract IPyth", + "name": "pyth", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "ethOracleNodeId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "rewardDistributorImplementation", + "type": "address" + }, + { + "internalType": "uint64", + "name": "pythPublishTimeMin", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "pythPublishTimeMax", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "minOrderAge", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "maxOrderAge", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "minKeeperFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxKeeperFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "keeperProfitMarginUsd", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "keeperProfitMarginPercent", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "keeperSettlementGasUnits", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "keeperCancellationGasUnits", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "keeperLiquidationGasUnits", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "keeperFlagGasUnits", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "keeperLiquidateMarginGasUnits", + "type": "uint128" + }, + { + "internalType": "address", + "name": "keeperLiquidationEndorsed", + "type": "address" + }, + { + "internalType": "uint128", + "name": "collateralDiscountScalar", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "minCollateralDiscount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "maxCollateralDiscount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "utilizationBreakpointPercent", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "lowUtilizationSlopePercent", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "highUtilizationSlopePercent", + "type": "uint128" + } + ], + "internalType": "struct PerpMarketConfiguration.GlobalData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketConfigurationById", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "oracleNodeId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "pythPriceFeedId", + "type": "bytes32" + }, + { + "internalType": "uint128", + "name": "makerFee", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerFee", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "maxMarketSize", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "maxFundingVelocity", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "skewScale", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "fundingVelocityClamp", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "minCreditPercent", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "minMarginUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minMarginRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "incrementalMarginScalar", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maintenanceMarginScalar", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxInitialMarginRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRewardPercent", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "liquidationLimitScalar", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "liquidationWindowDuration", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "liquidationMaxPd", + "type": "uint128" + } + ], + "internalType": "struct PerpMarketConfiguration.Data", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "pythPublishTimeMin", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "pythPublishTimeMax", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "minOrderAge", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "maxOrderAge", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "minKeeperFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxKeeperFeeUsd", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "keeperProfitMarginPercent", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "keeperProfitMarginUsd", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "keeperSettlementGasUnits", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "keeperCancellationGasUnits", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "keeperLiquidationGasUnits", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "keeperFlagGasUnits", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "keeperLiquidateMarginGasUnits", + "type": "uint128" + }, + { + "internalType": "address", + "name": "keeperLiquidationEndorsed", + "type": "address" + }, + { + "internalType": "uint128", + "name": "collateralDiscountScalar", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "minCollateralDiscount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "maxCollateralDiscount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "utilizationBreakpointPercent", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "lowUtilizationSlopePercent", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "highUtilizationSlopePercent", + "type": "uint128" + } + ], + "internalType": "struct IMarketConfigurationModule.GlobalMarketConfigureParameters", + "name": "data", + "type": "tuple" + } + ], + "name": "setMarketConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "oracleNodeId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "pythPriceFeedId", + "type": "bytes32" + }, + { + "internalType": "uint128", + "name": "makerFee", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerFee", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "maxMarketSize", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "maxFundingVelocity", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "skewScale", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "fundingVelocityClamp", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "minCreditPercent", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "minMarginUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minMarginRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "incrementalMarginScalar", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maintenanceMarginScalar", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxInitialMarginRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRewardPercent", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "liquidationLimitScalar", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "liquidationWindowDuration", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "liquidationMaxPd", + "type": "uint128" + } + ], + "internalType": "struct IMarketConfigurationModule.ConfigureByMarketParameters", + "name": "data", + "type": "tuple" + } + ], + "name": "setMarketConfigurationById", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "AccountNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "AccountSplitProportionTooLarge", + "type": "error" + }, + { + "inputs": [], + "name": "AccountSplitProportionTooSmall", + "type": "error" + }, + { + "inputs": [], + "name": "CanLiquidatePosition", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralFound", + "type": "error" + }, + { + "inputs": [], + "name": "DuplicateEntries", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientMargin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "hook", + "type": "address" + } + ], + "name": "InvalidHook", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidPositionSide", + "type": "error" + }, + { + "inputs": [], + "name": "OrderFound", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt128ToUint128", + "type": "error" + }, + { + "inputs": [], + "name": "PositionFlagged", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "PositionFound", + "type": "error" + }, + { + "inputs": [], + "name": "PositionNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroProportion", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "fromId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "toId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "AccountSplit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "fromId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "toId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "AccountsMerged", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getAccountDigest", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "collateralAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "available", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "oraclePrice", + "type": "uint256" + } + ], + "internalType": "struct IPerpAccountModule.DepositedCollateral[]", + "name": "depositedCollaterals", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "collateralUsd", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "debtUsd", + "type": "uint128" + }, + { + "components": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "remainingMarginUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "notionalValueUsd", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "pnl", + "type": "int256" + }, + { + "internalType": "int128", + "name": "accruedFunding", + "type": "int128" + }, + { + "internalType": "uint128", + "name": "accruedUtilization", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "entryPythPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "entryPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "oraclePrice", + "type": "uint256" + }, + { + "internalType": "int128", + "name": "size", + "type": "int128" + }, + { + "internalType": "uint256", + "name": "im", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mm", + "type": "uint256" + } + ], + "internalType": "struct IPerpAccountModule.PositionDigest", + "name": "position", + "type": "tuple" + } + ], + "internalType": "struct IPerpAccountModule.AccountDigest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getPositionDigest", + "outputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "remainingMarginUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "notionalValueUsd", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "pnl", + "type": "int256" + }, + { + "internalType": "int128", + "name": "accruedFunding", + "type": "int128" + }, + { + "internalType": "uint128", + "name": "accruedUtilization", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "entryPythPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "entryPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "oraclePrice", + "type": "uint256" + }, + { + "internalType": "int128", + "name": "size", + "type": "int128" + }, + { + "internalType": "uint256", + "name": "im", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mm", + "type": "uint256" + } + ], + "internalType": "struct IPerpAccountModule.PositionDigest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "fromId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "toId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "mergeAccounts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "fromId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "toId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "proportion", + "type": "uint128" + } + ], + "name": "splitAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "ArrayLengthMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "DebtFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "available", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "InsufficientCollateral", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "InvalidRewardDistributor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "MaxCollateralExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralAddress", + "type": "address" + } + ], + "name": "MissingRequiredCollateral", + "type": "error" + }, + { + "inputs": [], + "name": "NilCollateral", + "type": "error" + }, + { + "inputs": [], + "name": "NoDebt", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralAddress", + "type": "address" + } + ], + "name": "UnsupportedCollateral", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAmount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "oldDebt", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "newDebt", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "paidFromUsdCollateral", + "type": "uint128" + } + ], + "name": "DebtPaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collaterals", + "type": "uint256" + } + ], + "name": "MarginCollateralConfigured", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralAddress", + "type": "address" + } + ], + "name": "MarginDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralAddress", + "type": "address" + } + ], + "name": "MarginWithdraw", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "getDiscountedCollateralPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMarginCollateralConfiguration", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "collateralAddress", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "oracleNodeId", + "type": "bytes32" + }, + { + "internalType": "uint128", + "name": "maxAllowable", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "skewScale", + "type": "uint128" + }, + { + "internalType": "address", + "name": "rewardDistributor", + "type": "address" + } + ], + "internalType": "struct IMarginModule.ConfiguredCollateral[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarginDigest", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "discountedMarginUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marginUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "discountedCollateralUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralUsd", + "type": "uint256" + } + ], + "internalType": "struct Margin.MarginValues", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarginLiquidationOnlyReward", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "oraclePrice", + "type": "uint256" + } + ], + "name": "getNetAssetValue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getWithdrawableMargin", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralAddress", + "type": "address" + }, + { + "internalType": "int256", + "name": "amountDelta", + "type": "int256" + } + ], + "name": "modifyCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "amount", + "type": "uint128" + } + ], + "name": "payDebt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralAddress", + "type": "address" + }, + { + "internalType": "uint128", + "name": "maxAllowable", + "type": "uint128" + } + ], + "name": "setCollateralMaxAllowable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "collateralAddresses", + "type": "address[]" + }, + { + "internalType": "bytes32[]", + "name": "oracleNodeIds", + "type": "bytes32[]" + }, + { + "internalType": "uint128[]", + "name": "maxAllowables", + "type": "uint128[]" + }, + { + "internalType": "uint128[]", + "name": "skewScales", + "type": "uint128[]" + }, + { + "internalType": "address[]", + "name": "rewardDistributors", + "type": "address[]" + } + ], + "name": "setMarginCollateralConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "withdrawAllCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "InsufficientLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidPrice", + "type": "error" + }, + { + "inputs": [], + "name": "MaxHooksExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "MaxMarketSizeExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NilOrder", + "type": "error" + }, + { + "inputs": [], + "name": "OrderNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "OrderNotReady", + "type": "error" + }, + { + "inputs": [], + "name": "OrderNotStale", + "type": "error" + }, + { + "inputs": [], + "name": "OrderStale", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "limitPrice", + "type": "uint256" + } + ], + "name": "PriceToleranceExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "limitPrice", + "type": "uint256" + } + ], + "name": "PriceToleranceNotExceeded", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "commitmentTime", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "estimatedOrderFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "estimatedKeeperFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + } + ], + "name": "OrderCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "settlementTime", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "orderFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "keeperFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int128", + "name": "accruedFunding", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "accruedUtilization", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "int256", + "name": "pnl", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fillPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "accountDebt", + "type": "uint128" + } + ], + "name": "OrderSettled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "hook", + "type": "address" + } + ], + "name": "OrderSettlementHookExecuted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "bytes", + "name": "priceUpdateData", + "type": "bytes" + } + ], + "name": "cancelOrder", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "cancelStaleOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "internalType": "uint256", + "name": "limitPrice", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "keeperFeeBufferUsd", + "type": "uint128" + }, + { + "internalType": "address[]", + "name": "hooks", + "type": "address[]" + }, + { + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + } + ], + "name": "commitOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "size", + "type": "int128" + } + ], + "name": "getFillPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getOraclePrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getOrderDigest", + "outputs": [ + { + "components": [ + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "internalType": "uint64", + "name": "commitmentTime", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "limitPrice", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "keeperFeeBufferUsd", + "type": "uint128" + }, + { + "internalType": "address[]", + "name": "hooks", + "type": "address[]" + }, + { + "internalType": "bool", + "name": "isStale", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isReady", + "type": "bool" + } + ], + "internalType": "struct IOrderModule.OrderDigest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "internalType": "uint128", + "name": "keeperFeeBufferUsd", + "type": "uint128" + } + ], + "name": "getOrderFees", + "outputs": [ + { + "internalType": "uint256", + "name": "orderFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "keeperFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "bytes", + "name": "priceUpdateData", + "type": "bytes" + } + ], + "name": "settleOrder", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "CannotLiquidateMargin", + "type": "error" + }, + { + "inputs": [], + "name": "CannotLiquidatePosition", + "type": "error" + }, + { + "inputs": [], + "name": "LiquidationZeroCapacity", + "type": "error" + }, + { + "inputs": [], + "name": "PositionNotFlagged", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "keeperReward", + "type": "uint256" + } + ], + "name": "MarginLiquidated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "flagger", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "flagKeeperReward", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "flaggedPrice", + "type": "uint256" + } + ], + "name": "PositionFlaggedLiquidation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "sizeBeforeLiquidation", + "type": "int128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "remainingSize", + "type": "int128" + }, + { + "indexed": false, + "internalType": "address", + "name": "keeper", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "flagger", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liqKeeperFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationPrice", + "type": "uint256" + } + ], + "name": "PositionLiquidated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "flagPosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getHealthFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getLiquidationFees", + "outputs": [ + { + "internalType": "uint256", + "name": "flagKeeperReward", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liqKeeperFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + } + ], + "name": "getLiquidationMarginUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "im", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mm", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getRemainingLiquidatableSizeCapacity", + "outputs": [ + { + "internalType": "uint128", + "name": "maxLiquidatableCapacity", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "remainingCapacity", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "lastLiquidationTimestamp", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "isMarginLiquidatable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "isPositionLiquidatable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "liquidateMarginOnly", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "liquidatePosition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "ZeroLength", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "RewardDistributorCreated", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address[]", + "name": "collateralTypes", + "type": "address[]" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IPerpRewardDistributorFactoryModule.CreatePerpRewardDistributorParameters", + "name": "data", + "type": "tuple" + } + ], + "name": "createRewardDistributor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "hooks", + "type": "uint256" + } + ], + "name": "SettlementHookConfigured", + "type": "event" + }, + { + "inputs": [], + "name": "getSettlementHookConfiguration", + "outputs": [ + { + "components": [ + { + "internalType": "address[]", + "name": "whitelistedHookAddresses", + "type": "address[]" + }, + { + "internalType": "uint32", + "name": "maxHooksPerOrder", + "type": "uint32" + } + ], + "internalType": "struct ISettlementHookModule.SettlementHookConfigureParameters", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "hook", + "type": "address" + } + ], + "name": "isSettlementHookWhitelisted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address[]", + "name": "whitelistedHookAddresses", + "type": "address[]" + }, + { + "internalType": "uint32", + "name": "maxHooksPerOrder", + "type": "uint32" + } + ], + "internalType": "struct ISettlementHookModule.SettlementHookConfigureParameters", + "name": "data", + "type": "tuple" + } + ], + "name": "setSettlementHookConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "hooks", + "type": "uint256" + } + ], + "name": "SplitAccountConfigured", + "type": "event" + }, + { + "inputs": [], + "name": "getEndorsedSplitAccounts", + "outputs": [ + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isEndorsedForSplitAccount", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + } + ], + "name": "setEndorsedSplitAccounts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "deployTxnHash": "", + "deployTxnBlockNumber": "", + "deployTimestamp": "", + "sourceName": "", + "contractName": "", + "deployedOn": "invoke.upgrade_proxy", + "gasUsed": 0, + "gasCost": "0" +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/11155111/bfp_market_factory/PerpAccountProxy.json b/src/synthetix/contracts/deployments/11155111/bfp_market_factory/PerpAccountProxy.json new file mode 100644 index 0000000..e1ef8bb --- /dev/null +++ b/src/synthetix/contracts/deployments/11155111/bfp_market_factory/PerpAccountProxy.json @@ -0,0 +1,819 @@ +{ + "address": "0xBeE85D5Fc4D486D06086560928a79d9d016D8F2E", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ImplementationIsSterile", + "type": "error" + }, + { + "inputs": [], + "name": "NoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contr", + "type": "address" + } + ], + "name": "NotAContract", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "NotNominated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "UpgradeSimulationFailed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "self", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newNominatedOwner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "simulateUpgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "CannotSelfApprove", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestedIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "IndexOverrun", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "InvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "parameter", + "type": "string" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "InvalidParameter", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "InvalidTransferRecipient", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint128", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "TokenAlreadyMinted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "TokenDoesNotExist", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "tokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "tokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "setAllowance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "setBaseTokenURI", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenOfOwnerByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "deployTxnHash": "", + "deployTxnBlockNumber": "", + "deployTimestamp": "", + "sourceName": "", + "contractName": "", + "deployedOn": "invoke.init_or_upgrade_nft", + "gasUsed": 0, + "gasCost": "0" +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/11155111/pyth_erc7412_wrapper/PythERC7412Wrapper.json b/src/synthetix/contracts/deployments/11155111/pyth_erc7412_wrapper/PythERC7412Wrapper.json new file mode 100644 index 0000000..8030ae1 --- /dev/null +++ b/src/synthetix/contracts/deployments/11155111/pyth_erc7412_wrapper/PythERC7412Wrapper.json @@ -0,0 +1,171 @@ +{ + "address": "0x08C1F629Ec5935F95Ef3e614dF5B94086528C25c", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_pythAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "FeeRequired", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "updateType", + "type": "uint8" + } + ], + "name": "NotSupported", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oracleContract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "oracleQuery", + "type": "bytes" + } + ], + "name": "OracleDataRequired", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt256ToUint256", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToInt256", + "type": "error" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "signedOffchainData", + "type": "bytes" + } + ], + "name": "fulfillOracleQuery", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "priceId", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "requestedTime", + "type": "uint64" + } + ], + "name": "getBenchmarkPrice", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "priceId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "stalenessTolerance", + "type": "uint256" + } + ], + "name": "getLatestPrice", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracleId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "pythAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "constructorArgs": [ + "0xDd24F84d36BF92C65F92307595335bdFab5Bbd21" + ], + "linkedLibraries": {}, + "deployTxnHash": "", + "deployTxnBlockNumber": "", + "deployTimestamp": "1723469232", + "sourceName": "contracts/PythERC7412Wrapper.sol", + "contractName": "PythERC7412Wrapper", + "deployedOn": "contract.PythERC7412Wrapper", + "gasUsed": 0, + "gasCost": "0" +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/11155111/system/AccountProxy.json b/src/synthetix/contracts/deployments/11155111/system/AccountProxy.json new file mode 100644 index 0000000..4c836db --- /dev/null +++ b/src/synthetix/contracts/deployments/11155111/system/AccountProxy.json @@ -0,0 +1,818 @@ +{ + "address": "0xCb5D8fE2B4AfbedB1970CCDc2f2e2919a6114240", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ImplementationIsSterile", + "type": "error" + }, + { + "inputs": [], + "name": "NoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contr", + "type": "address" + } + ], + "name": "NotAContract", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "NotNominated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "UpgradeSimulationFailed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "self", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newNominatedOwner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "simulateUpgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "CannotSelfApprove", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestedIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "IndexOverrun", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "InvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "parameter", + "type": "string" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "InvalidParameter", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "InvalidTransferRecipient", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint128", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "TokenAlreadyMinted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "TokenDoesNotExist", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "tokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "tokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "setAllowance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "setBaseTokenURI", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenOfOwnerByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "deployTxnHash": "", + "sourceName": "", + "contractName": "", + "deployedOn": "invoke.init_account", + "gasUsed": 0, + "gasCost": "0", + "highlight": true +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/11155111/system/CoreProxy.json b/src/synthetix/contracts/deployments/11155111/system/CoreProxy.json new file mode 100644 index 0000000..787bc4e --- /dev/null +++ b/src/synthetix/contracts/deployments/11155111/system/CoreProxy.json @@ -0,0 +1,5327 @@ +{ + "address": "0x8715b7eaDC55DF39F0D7bd8D5Ae44BaD4A7a0a8f", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ImplementationIsSterile", + "type": "error" + }, + { + "inputs": [], + "name": "NoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contr", + "type": "address" + } + ], + "name": "NotAContract", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "NotNominated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "UpgradeSimulationFailed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "self", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newNominatedOwner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "simulateUpgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "ValueAlreadyInSet", + "type": "error" + }, + { + "inputs": [], + "name": "ValueNotInSet", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowAll", + "type": "bool" + } + ], + "name": "FeatureFlagAllowAllSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "FeatureFlagAllowlistAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "FeatureFlagAllowlistRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "deniers", + "type": "address[]" + } + ], + "name": "FeatureFlagDeniersReset", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "denyAll", + "type": "bool" + } + ], + "name": "FeatureFlagDenyAllSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "addToFeatureFlagAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getDeniers", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagAllowAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagAllowlist", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagDenyAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isFeatureAllowed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "removeFromFeatureFlagAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address[]", + "name": "deniers", + "type": "address[]" + } + ], + "name": "setDeniers", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "allowAll", + "type": "bool" + } + ], + "name": "setFeatureFlagAllowAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "denyAll", + "type": "bool" + } + ], + "name": "setFeatureFlagDenyAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "which", + "type": "bytes32" + } + ], + "name": "FeatureUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "InvalidAccountId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + } + ], + "name": "InvalidPermission", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "origin", + "type": "address" + } + ], + "name": "OnlyAccountTokenProxy", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "PermissionDenied", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "PermissionNotGranted", + "type": "error" + }, + { + "inputs": [], + "name": "PositionOutOfBounds", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "AccountCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PermissionGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PermissionRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "createAccount", + "outputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "requestedAccountId", + "type": "uint128" + } + ], + "name": "createAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountLastInteraction", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountPermissions", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "bytes32[]", + "name": "permissions", + "type": "bytes32[]" + } + ], + "internalType": "struct IAccountModule.AccountPermissions[]", + "name": "accountPerms", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAccountTokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "grantPermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "hasPermission", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "notifyAccountTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + } + ], + "name": "renouncePermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "revokePermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "AccountNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyDistribution", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "collateralValue", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ratio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minRatio", + "type": "uint256" + } + ], + "name": "InsufficientCollateralRatio", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "MarketNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + } + ], + "name": "NotFundedByPool", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt256ToInt128", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt256ToUint256", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint128ToInt128", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToInt256", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint128", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "updatedDebt", + "type": "int256" + } + ], + "name": "DebtAssociated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "associateDebt", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "MismatchAssociatedSystemKind", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "MissingAssociatedSystem", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "AssociatedSystemSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "getAssociatedSystem", + "outputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeNft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "endpoint", + "type": "address" + } + ], + "name": "registerUnmanagedSystem", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "InvalidMessage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "NotCcipRouter", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "UnsupportedNetwork", + "type": "error" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "messageId", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "sourceChainSelector", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "sender", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct CcipClient.EVMTokenAmount[]", + "name": "tokenAmounts", + "type": "tuple[]" + } + ], + "internalType": "struct CcipClient.Any2EVMMessage", + "name": "message", + "type": "tuple" + } + ], + "name": "ccipReceive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "currentTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredTime", + "type": "uint256" + } + ], + "name": "AccountActivityTimeoutPending", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "CollateralDepositDisabled", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "FailedTransfer", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountAvailableForDelegationD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountD18", + "type": "uint256" + } + ], + "name": "InsufficentAvailableCollateral", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "InsufficientAccountCollateral", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "existing", + "type": "uint256" + } + ], + "name": "InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "parameter", + "type": "string" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "InvalidParameter", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint64", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + } + ], + "name": "PrecisionLost", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "expireTimestamp", + "type": "uint64" + } + ], + "name": "CollateralLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "expireTimestamp", + "type": "uint64" + } + ], + "name": "CollateralLockExpired", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "Deposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "Withdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "offset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "name": "cleanExpiredLocks", + "outputs": [ + { + "internalType": "uint256", + "name": "cleared", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "expireTimestamp", + "type": "uint64" + } + ], + "name": "createLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getAccountAvailableCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getAccountCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "totalDeposited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalAssigned", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalLocked", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "offset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "name": "getLocks", + "outputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "amountD18", + "type": "uint128" + }, + { + "internalType": "uint64", + "name": "lockExpirationTime", + "type": "uint64" + } + ], + "internalType": "struct CollateralLock.Data[]", + "name": "locks", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "components": [ + { + "internalType": "bool", + "name": "depositingEnabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRewardD18", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "oracleNodeId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minDelegationD18", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct CollateralConfiguration.Data", + "name": "config", + "type": "tuple" + } + ], + "name": "CollateralConfigured", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "depositingEnabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRewardD18", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "oracleNodeId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minDelegationD18", + "type": "uint256" + } + ], + "internalType": "struct CollateralConfiguration.Data", + "name": "config", + "type": "tuple" + } + ], + "name": "configureCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getCollateralConfiguration", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "depositingEnabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRewardD18", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "oracleNodeId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minDelegationD18", + "type": "uint256" + } + ], + "internalType": "struct CollateralConfiguration.Data", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "hideDisabled", + "type": "bool" + } + ], + "name": "getCollateralConfigurations", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "depositingEnabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRewardD18", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "oracleNodeId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minDelegationD18", + "type": "uint256" + } + ], + "internalType": "struct CollateralConfiguration.Data[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getCollateralPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requiredAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableAmount", + "type": "uint256" + } + ], + "name": "InsufficientCcipFee", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "destChainId", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "TransferCrossChainInitiated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "destChainId", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferCrossChain", + "outputs": [ + { + "internalType": "uint256", + "name": "gasTokenUsed", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "currentDebt", + "type": "int256" + } + ], + "name": "InsufficientDebt", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "PoolNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "name": "IssuanceFeePaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "UsdBurned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "UsdMinted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnUsd", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mintUsd", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "CannotScaleEmptyMapping", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "collateralValue", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "debt", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "currentCRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "cratio", + "type": "uint256" + } + ], + "name": "IneligibleForLiquidation", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientMappedAmount", + "type": "error" + }, + { + "inputs": [], + "name": "MustBeVaultLiquidated", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt128ToUint128", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "debtLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountRewarded", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct ILiquidationModule.LiquidationData", + "name": "liquidationData", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "liquidateAsAccountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "Liquidation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "debtLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountRewarded", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct ILiquidationModule.LiquidationData", + "name": "liquidationData", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "liquidateAsAccountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "VaultLiquidation", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "isPositionLiquidatable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "isVaultLiquidatable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint128", + "name": "liquidateAsAccountId", + "type": "uint128" + } + ], + "name": "liquidate", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "debtLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountRewarded", + "type": "uint256" + } + ], + "internalType": "struct ILiquidationModule.LiquidationData", + "name": "liquidationData", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint128", + "name": "liquidateAsAccountId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxUsd", + "type": "uint256" + } + ], + "name": "liquidateVault", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "debtLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralLiquidated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountRewarded", + "type": "uint256" + } + ], + "internalType": "struct ILiquidationModule.LiquidationData", + "name": "liquidationData", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmountToDeposit", + "type": "uint256" + } + ], + "name": "InsufficientMarketCollateralDepositable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmountToWithdraw", + "type": "uint256" + } + ], + "name": "InsufficientMarketCollateralWithdrawable", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "int128", + "name": "creditCapacity", + "type": "int128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "netIssuance", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "depositedCollateralValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reportedDebt", + "type": "uint256" + } + ], + "name": "MarketCollateralDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "int128", + "name": "creditCapacity", + "type": "int128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "netIssuance", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "depositedCollateralValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reportedDebt", + "type": "uint256" + } + ], + "name": "MarketCollateralWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "systemAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "MaximumMarketCollateralConfigured", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "configureMaximumMarketCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + } + ], + "name": "depositMarketCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getMarketCollateralAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "collateralAmountD18", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketCollateralValue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getMaximumMarketCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + } + ], + "name": "withdrawMarketCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "IncorrectMarketInterface", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "NotEnoughLiquidity", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "MarketRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "name": "MarketSystemFeePaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "indexed": false, + "internalType": "int128", + "name": "creditCapacity", + "type": "int128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "netIssuance", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "depositedCollateralValue", + "type": "uint256" + } + ], + "name": "MarketUsdDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "indexed": false, + "internalType": "int128", + "name": "creditCapacity", + "type": "int128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "netIssuance", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "depositedCollateralValue", + "type": "uint256" + } + ], + "name": "MarketUsdWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minLiquidityRatio", + "type": "uint256" + } + ], + "name": "SetMarketMinLiquidityRatio", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "minDelegateTime", + "type": "uint32" + } + ], + "name": "SetMinDelegateTime", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "depositMarketUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxIter", + "type": "uint256" + } + ], + "name": "distributeDebtToPools", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketDebtPerShare", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "getMarketFees", + "outputs": [ + { + "internalType": "uint256", + "name": "depositFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawFeeAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketMinDelegateTime", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketNetIssuance", + "outputs": [ + { + "internalType": "int128", + "name": "", + "type": "int128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "getMarketPoolDebtDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "sharesD18", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "totalSharesD18", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "valuePerShareD27", + "type": "int128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketPools", + "outputs": [ + { + "internalType": "uint128[]", + "name": "inRangePoolIds", + "type": "uint128[]" + }, + { + "internalType": "uint128[]", + "name": "outRangePoolIds", + "type": "uint128[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketReportedDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketTotalDebt", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMinLiquidityRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOracleManager", + "outputs": [ + { + "internalType": "contract IOracleManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getUsdToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getWithdrawableMarketUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "isMarketCapacityLocked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "registerMarket", + "outputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint32", + "name": "minDelegateTime", + "type": "uint32" + } + ], + "name": "setMarketMinDelegateTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "minLiquidityRatio", + "type": "uint256" + } + ], + "name": "setMinLiquidityRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdrawMarketUsd", + "outputs": [ + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + } + ], + "name": "PoolApprovedAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + } + ], + "name": "PoolApprovedRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + } + ], + "name": "PreferredPoolSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "addApprovedPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getApprovedPools", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPreferredPool", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "removeApprovedPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "setPreferredPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketId", + "type": "uint256" + } + ], + "name": "CapacityLocked", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "uint32", + "name": "timeRemaining", + "type": "uint32" + } + ], + "name": "MinDelegationTimeoutPending", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "PoolAlreadyExists", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "collateralLimitD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct PoolCollateralConfiguration.Data", + "name": "config", + "type": "tuple" + } + ], + "name": "PoolCollateralConfigurationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "name": "PoolCollateralDisabledByDefaultSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "components": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "weightD18", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "maxDebtShareValueD18", + "type": "int128" + } + ], + "indexed": false, + "internalType": "struct MarketConfiguration.Data[]", + "name": "markets", + "type": "tuple[]" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PoolConfigurationSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PoolNameUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "PoolNominationRenounced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "PoolNominationRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "nominatedOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "PoolOwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "PoolOwnershipAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "PoolOwnershipRenounced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "minLiquidityRatio", + "type": "uint256" + } + ], + "name": "SetMinLiquidityRatio", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "acceptPoolOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "requestedPoolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "createPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getMinLiquidityRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "getNominatedPoolOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getPoolCollateralConfiguration", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "collateralLimitD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + } + ], + "internalType": "struct PoolCollateralConfiguration.Data", + "name": "config", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateral", + "type": "address" + } + ], + "name": "getPoolCollateralIssuanceRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "getPoolConfiguration", + "outputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "weightD18", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "maxDebtShareValueD18", + "type": "int128" + } + ], + "internalType": "struct MarketConfiguration.Data[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "getPoolName", + "outputs": [ + { + "internalType": "string", + "name": "poolName", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "getPoolOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nominatedOwner", + "type": "address" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "nominatePoolOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "optionalCollateralType", + "type": "address" + } + ], + "name": "rebalancePool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "renouncePoolNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "renouncePoolOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + } + ], + "name": "revokePoolNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minLiquidityRatio", + "type": "uint256" + } + ], + "name": "setMinLiquidityRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "collateralLimitD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "issuanceRatioD18", + "type": "uint256" + } + ], + "internalType": "struct PoolCollateralConfiguration.Data", + "name": "newConfig", + "type": "tuple" + } + ], + "name": "setPoolCollateralConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "name": "setPoolCollateralDisabledByDefault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "components": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "weightD18", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "maxDebtShareValueD18", + "type": "int128" + } + ], + "internalType": "struct MarketConfiguration.Data[]", + "name": "newMarketConfigurations", + "type": "tuple[]" + } + ], + "name": "setPoolConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setPoolName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint32", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint32ToInt32", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint64ToInt64", + "type": "error" + }, + { + "inputs": [], + "name": "RewardDistributorNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "RewardUnavailable", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "distributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "RewardsClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "distributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "RewardsDistributed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "RewardsDistributorRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "RewardsDistributorRemoved", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "claimRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "start", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "duration", + "type": "uint32" + } + ], + "name": "distributeRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "address", + "name": "rewardsDistributor", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "start", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "duration", + "type": "uint32" + } + ], + "name": "distributeRewardsByOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "getAvailableRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "getRewardRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "registerRewardsDistributor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "address", + "name": "distributor", + "type": "address" + } + ], + "name": "removeRewardsDistributor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "updateRewards", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "newChainId", + "type": "uint64" + } + ], + "name": "NewSupportedCrossChainNetwork", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ccipRouter", + "type": "address" + }, + { + "internalType": "address", + "name": "ccipTokenPool", + "type": "address" + } + ], + "name": "configureChainlinkCrossChain", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oracleManagerAddress", + "type": "address" + } + ], + "name": "configureOracleManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "k", + "type": "bytes32" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "bytes32", + "name": "v", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "k", + "type": "bytes32" + } + ], + "name": "getConfigAddress", + "outputs": [ + { + "internalType": "address", + "name": "v", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "k", + "type": "bytes32" + } + ], + "name": "getConfigUint", + "outputs": [ + { + "internalType": "uint256", + "name": "v", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTrustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "k", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "v", + "type": "bytes32" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64[]", + "name": "supportedNetworks", + "type": "uint64[]" + }, + { + "internalType": "uint64[]", + "name": "ccipSelectors", + "type": "uint64[]" + } + ], + "name": "setSupportedCrossChainNetworks", + "outputs": [ + { + "internalType": "uint256", + "name": "numRegistered", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minDelegation", + "type": "uint256" + } + ], + "name": "InsufficientDelegation", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidCollateralAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "leverage", + "type": "uint256" + } + ], + "name": "InvalidLeverage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentCollateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCollateral", + "type": "uint256" + } + ], + "name": "PoolCollateralLimitExceeded", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "leverage", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "DelegationUpdated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newCollateralAmountD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leverage", + "type": "uint256" + } + ], + "name": "delegateCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getPosition", + "outputs": [ + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralValue", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "debt", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "collateralizationRatio", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getPositionCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getPositionCollateralRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getPositionDebt", + "outputs": [ + { + "internalType": "int256", + "name": "debt", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getVaultCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getVaultCollateralRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "poolId", + "type": "uint128" + }, + { + "internalType": "address", + "name": "collateralType", + "type": "address" + } + ], + "name": "getVaultDebt", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "deployTxnHash": "", + "deployTxnBlockNumber": "", + "deployTimestamp": "", + "sourceName": "", + "contractName": "", + "deployedOn": "invoke.upgrade_core_proxy", + "gasUsed": 0, + "gasCost": "0", + "highlight": true +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/11155111/system/USDProxy.json b/src/synthetix/contracts/deployments/11155111/system/USDProxy.json new file mode 100644 index 0000000..460acf0 --- /dev/null +++ b/src/synthetix/contracts/deployments/11155111/system/USDProxy.json @@ -0,0 +1,834 @@ +{ + "address": "0xF87E23c41Ce898Ab7640FC3Ce2eb8B11f257e67a", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ImplementationIsSterile", + "type": "error" + }, + { + "inputs": [], + "name": "NoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contr", + "type": "address" + } + ], + "name": "NotAContract", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "NotNominated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "UpgradeSimulationFailed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "self", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newNominatedOwner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "simulateUpgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "MismatchAssociatedSystemKind", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "MissingAssociatedSystem", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "AssociatedSystemSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "getAssociatedSystem", + "outputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeNft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "endpoint", + "type": "address" + } + ], + "name": "registerUnmanagedSystem", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "existing", + "type": "uint256" + } + ], + "name": "InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "existing", + "type": "uint256" + } + ], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "parameter", + "type": "string" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "InvalidParameter", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnWithAllowance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "tokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "tokenSymbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "tokenDecimals", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "setAllowance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "deployTxnHash": "", + "sourceName": "", + "contractName": "", + "deployedOn": "invoke.init_usd", + "gasUsed": 0, + "gasCost": "0", + "highlight": true +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/11155111/system/trusted_multicall_forwarder/TrustedMulticallForwarder.json b/src/synthetix/contracts/deployments/11155111/system/trusted_multicall_forwarder/TrustedMulticallForwarder.json new file mode 100644 index 0000000..1d336d0 --- /dev/null +++ b/src/synthetix/contracts/deployments/11155111/system/trusted_multicall_forwarder/TrustedMulticallForwarder.json @@ -0,0 +1,885 @@ +{ + "address": "0xE2C5658cC5C448B48141168f3e475dF8f65A1e3e", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "AddressInsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint48", + "name": "deadline", + "type": "uint48" + } + ], + "name": "ERC2771ForwarderExpiredRequest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + } + ], + "name": "ERC2771ForwarderInvalidSigner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestedValue", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "msgValue", + "type": "uint256" + } + ], + "name": "ERC2771ForwarderMismatchedValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "ERC2771UntrustfulTarget", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentNonce", + "type": "uint256" + } + ], + "name": "InvalidAccountNonce", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidShortString", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "StringTooLong", + "type": "error" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "name": "ExecutedForwardRequest", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "returnData", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Call3[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate3", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Call3Value[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate3Value", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "blockAndAggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "internalType": "uint48", + "name": "deadline", + "type": "uint48" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct ERC2771Forwarder.ForwardRequestData", + "name": "request", + "type": "tuple" + } + ], + "name": "execute", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "internalType": "uint48", + "name": "deadline", + "type": "uint48" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct ERC2771Forwarder.ForwardRequestData[]", + "name": "requests", + "type": "tuple[]" + } + ], + "name": "executeBatch", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "internalType": "uint48", + "name": "deadline", + "type": "uint48" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct ERC2771Forwarder.ForwardRequestData[]", + "name": "requests", + "type": "tuple[]" + }, + { + "internalType": "address payable", + "name": "refundReceiver", + "type": "address" + } + ], + "name": "executeBatch", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "getBasefee", + "outputs": [ + { + "internalType": "uint256", + "name": "basefee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "getBlockHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "chainid", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockCoinbase", + "outputs": [ + { + "internalType": "address", + "name": "coinbase", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "gaslimit", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "getEthBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastBlockHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPrevRandao", + "outputs": [ + { + "internalType": "uint256", + "name": "prevrandao", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "tryAggregate", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "tryBlockAndAggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct TrustedMulticallForwarder.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "internalType": "uint48", + "name": "deadline", + "type": "uint48" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct ERC2771Forwarder.ForwardRequestData", + "name": "request", + "type": "tuple" + } + ], + "name": "verify", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "constructorArgs": [], + "linkedLibraries": {}, + "deployTxnHash": "", + "sourceName": "src/TrustedMulticallForwarder.sol", + "contractName": "TrustedMulticallForwarder", + "deployedOn": "contract.TrustedMulticallForwarder", + "gasUsed": 0, + "gasCost": "0" +} \ No newline at end of file diff --git a/src/synthetix/perps/__init__.py b/src/synthetix/perps/__init__.py index 62fe27a..2a40bd6 100644 --- a/src/synthetix/perps/__init__.py +++ b/src/synthetix/perps/__init__.py @@ -1,3 +1,3 @@ -from .perps import Perps +from .perps import PerpsV3, BfPerps -__all__ = ["Perps"] +__all__ = ["PerpsV3", "BfPerps"] diff --git a/src/synthetix/perps/perps.py b/src/synthetix/perps/perps.py index fed9027..a5fa4de 100644 --- a/src/synthetix/perps/perps.py +++ b/src/synthetix/perps/perps.py @@ -1,4 +1,4 @@ -"""Module for interacting with Synthetix Perps V3.""" +"""Modules for interacting with Synthetix Perps.""" import time from eth_utils import encode_hex, decode_hex @@ -10,9 +10,106 @@ make_fulfillment_request, ) from .constants import DISABLED_MARKETS +from .perps_utils import unpack_bfp_configuration, unpack_bfp_configuration_by_id -class Perps: +class BasePerps: + def _resolve_market(self, market_id: int, market_name: str): + """ + Look up the market_id and market_name for a market. If only one is provided, + the other is resolved. If both are provided, they are checked for consistency. + + :param int | None market_id: The id of the market. If not known, provide `None`. + :param str | None market_name: The name of the market. If not known, provide `None`. + + :return: The ``market_id`` and ``market_name`` for the market. + :rtype: (int, str) + """ + if market_id is None and market_name is None: + raise ValueError("Must provide a market_id or market_name") + + has_market_id = market_id is not None + has_market_name = market_name is not None + + if not has_market_id and has_market_name: + if market_name not in self.markets_by_name: + raise ValueError("Invalid market_name") + market_id = self.markets_by_name[market_name]["market_id"] + elif has_market_id and not has_market_name: + if market_id not in self.markets_by_id: + raise ValueError("Invalid market_id") + market_name = self.markets_by_id[market_id]["market_name"] + elif has_market_id and has_market_name: + market_name_lookup = self.markets_by_id[market_id]["market_id"] + if market_name != market_name_lookup: + raise ValueError( + f"Market name {market_name} does not match market id {market_id}" + ) + return market_id, market_name + + def get_account_ids(self, address: str = None, default_account_id: int = None): + """ + Fetch a list of perps ``account_id`` owned by an address. Perps accounts + are minted as an NFT to the owner's address. The ``account_id`` is the + token id of the NFTs held by the address. + + :param str | None address: The address to fetch the account ids for. If not provided, the default address is used. + :return: A list of account ids. + :rtype: [int] + """ + if not address: + address = self.snx.address + + balance = self.account_proxy.functions.balanceOf(address).call() + + # multicall the account ids + inputs = [(address, i) for i in range(balance)] + + account_ids = multicall_erc7412( + self.snx, self.account_proxy, "tokenOfOwnerByIndex", inputs + ) + + self.account_ids = account_ids + if default_account_id: + self.default_account_id = default_account_id + elif len(self.account_ids) > 0: + self.default_account_id = self.account_ids[0] + else: + self.default_account_id = None + return account_ids + + def create_account(self, account_id: int = None, submit: bool = False): + """ + Create a perps account. An account NFT is minted to the sender, who + owns the account. + + :param int | None account_id: Specify the id of the account. If the id already exists, + :param boolean submit: If ``True``, submit the transaction to the blockchain. + + :return: If `submit`, returns the trasaction hash. Otherwise, returns the transaction. + :rtype: str | dict + """ + if not account_id: + tx_args = [] + else: + tx_args = [account_id] + + tx_params = write_erc7412(self.snx, self.market_proxy, "createAccount", tx_args) + + if submit: + tx_hash = self.snx.execute_transaction(tx_params) + self.logger.info(f"Creating account for {self.snx.address}") + self.logger.info(f"create_account tx: {tx_hash}") + + # wait for the transaction, then refetch the ids + self.snx.wait(tx_hash) + self.get_account_ids() + return tx_hash + else: + return tx_params + + +class PerpsV3(BasePerps): """ Class for interacting with Synthetix Perps V3 contracts. Provides methods for creating and managing accounts, depositing and withdrawing collateral, @@ -86,40 +183,6 @@ def __init__(self, snx, default_account_id: int = None, disabled_markets=None): else: self.is_multicollateral = False - # internals - def _resolve_market(self, market_id: int, market_name: str): - """ - Look up the market_id and market_name for a market. If only one is provided, - the other is resolved. If both are provided, they are checked for consistency. - - :param int | None market_id: The id of the market. If not known, provide `None`. - :param str | None market_name: The name of the market. If not known, provide `None`. - - :return: The ``market_id`` and ``market_name`` for the market. - :rtype: (int, str) - """ - if market_id is None and market_name is None: - raise ValueError("Must provide a market_id or market_name") - - has_market_id = market_id is not None - has_market_name = market_name is not None - - if not has_market_id and has_market_name: - if market_name not in self.markets_by_name: - raise ValueError("Invalid market_name") - market_id = self.markets_by_name[market_name]["market_id"] - elif has_market_id and not has_market_name: - if market_id not in self.markets_by_id: - raise ValueError("Invalid market_id") - market_name = self.markets_by_id[market_id]["market_name"] - elif has_market_id and has_market_name: - market_name_lookup = self.markets_by_id[market_id]["market_id"] - if market_name != market_name_lookup: - raise ValueError( - f"Market name {market_name} does not match market id {market_id}" - ) - return market_id, market_name - def _prepare_oracle_call(self, market_names: [str] = []): """ Prepare a call to the external node with oracle updates for the specified market names. @@ -184,8 +247,6 @@ def _prepare_oracle_call(self, market_names: [str] = []): return [(to, False, value, data)], price_metadata # read - # TODO: get_market_settings - # TODO: get_order_fees def get_markets(self): """ Fetch the ids and summaries for all perps markets. Market summaries include @@ -477,37 +538,6 @@ def get_settlement_strategy( "commitment_price_delay": commitment_price_delay, } - def get_account_ids(self, address: str = None, default_account_id: int = None): - """ - Fetch a list of perps ``account_id`` owned by an address. Perps accounts - are minted as an NFT to the owner's address. The ``account_id`` is the - token id of the NFTs held by the address. - - :param str | None address: The address to fetch the account ids for. If not provided, the default address is used. - :return: A list of account ids. - :rtype: [int] - """ - if not address: - address = self.snx.address - - balance = self.account_proxy.functions.balanceOf(address).call() - - # multicall the account ids - inputs = [(address, i) for i in range(balance)] - - account_ids = multicall_erc7412( - self.snx, self.account_proxy, "tokenOfOwnerByIndex", inputs - ) - - self.account_ids = account_ids - if default_account_id: - self.default_account_id = default_account_id - elif len(self.account_ids) > 0: - self.default_account_id = self.account_ids[0] - else: - self.default_account_id = None - return account_ids - def get_margin_info(self, account_id: int = None): """ Fetch information about an account's margin requirements and balances. @@ -877,36 +907,6 @@ def get_quote( return result # transactions - def create_account(self, account_id: int = None, submit: bool = False): - """ - Create a perps account. An account NFT is minted to the sender, who - owns the account. - - :param int | None account_id: Specify the id of the account. If the id already exists, - :param boolean submit: If ``True``, submit the transaction to the blockchain. - - :return: If `submit`, returns the trasaction hash. Otherwise, returns the transaction. - :rtype: str | dict - """ - if not account_id: - tx_args = [] - else: - tx_args = [account_id] - - tx_params = write_erc7412(self.snx, self.market_proxy, "createAccount", tx_args) - - if submit: - tx_hash = self.snx.execute_transaction(tx_params) - self.logger.info(f"Creating account for {self.snx.address}") - self.logger.info(f"create_account tx: {tx_hash}") - - # wait for the transaction, then refetch the ids - self.snx.wait(tx_hash) - self.get_account_ids() - return tx_hash - else: - return tx_params - def modify_collateral( self, amount: int, @@ -1203,3 +1203,678 @@ def settle_order( time.sleep(tx_delay) else: return tx_params + + +class BfPerps(BasePerps): + """ + Class for interacting with Synthetix Perps contracts on L1. Provides methods for + creating and managing accounts, depositing and withdrawing collateral, + committing and settling orders, and liquidating accounts. + + Use ``get_`` methods to fetch information about accounts, markets, and orders:: + + markets = snx.perps.get_markets() + open_positions = snx.perps.get_open_positions() + + Other methods prepare transactions, and submit them to your RPC:: + + create_tx_hash = snx.perps.create_account(submit=True) + collateral_tx_hash = snx.perps.modify_collateral(amount=1000, market_name='sUSD', submit=True) + order_tx_hash = snx.perps.commit_order(size=10, market_name='ETH', desired_fill_price=2000, submit=True) + + An instance of this module is available as ``snx.perps``. If you are using a network without + perps deployed, the contracts will be unavailable and the methods will raise an error. + + The following contracts are required: + + - PerpsMarketProxy + - PerpsAccountProxy + - PythERC7412Wrapper + + :param Synthetix snx: An instance of the Synthetix class. + :param Pyth pyth: An instance of the Pyth class. + :param int | None default_account_id: The default ``account_id`` to use for transactions. + + :return: An instance of the Perps class. + :rtype: Perps + """ + + def __init__(self, snx, default_account_id: int = None): + self.snx = snx + self.logger = snx.logger + + # check if perps is deployed on this network + + if "bfp_market_factory" in snx.contracts: + self.market_proxy = snx.contracts["bfp_market_factory"]["BfpMarketProxy"][ + "contract" + ] + self.account_proxy = snx.contracts["bfp_market_factory"][ + "PerpAccountProxy" + ]["contract"] + + try: + self.get_account_ids(default_account_id=default_account_id) + except Exception as e: + self.account_ids = [] + self.default_account_id = None + self.logger.warning(f"Failed to fetch perps accounts: {e}") + + try: + self.get_markets() + pass + except Exception as e: + self.logger.warning(f"Failed to fetch markets: {e}") + + def get_markets(self): + """ + Fetch the ids and summaries for all perps markets. Market summaries include + information about the market's price, open interest, funding rate, + and skew:: + + markets_by_name = { + 'ETH': { + 'market_id': 100, + 'market_name': 'ETH', + 'skew': -15, + 'size': 100, + 'max_open_interest': 10000, + 'current_funding_rate': 0.000182, + 'current_funding_velocity': 0.00002765, + 'index_price': 1852.59, + ... + } + 'BTC': { + ... + } + } + + :return: Market summaries keyed by `market_id` and `market_name`. + :rtype: (dict, dict) + """ + market_ids = self.market_proxy.functions.getActiveMarketIds().call() + + # get market configurations + market_digests = multicall_erc7412( + self.snx, self.market_proxy, "getMarketDigest", market_ids + ) + market_config = call_erc7412( + self.snx, + self.market_proxy, + "getMarketConfiguration", + (), + ) + market_configs = multicall_erc7412( + self.snx, self.market_proxy, "getMarketConfigurationById", market_ids + ) + + self.market_meta = { + market_id: { + "market_id": market_id, + "market_name": market_digests[ind][1].decode("utf-8").strip("\x00"), + "symbol": market_digests[ind][1].decode("utf-8").strip("\x00")[:-4], + "feed_id": encode_hex(market_configs[ind][1]), + "system_config": unpack_bfp_configuration(market_config), + "market_config": unpack_bfp_configuration_by_id(market_configs[ind]), + } + for ind, market_id in enumerate(market_ids) + } + + # update pyth price feed ids + self.snx.pyth.update_price_feed_ids( + { + self.market_meta[market]["symbol"]: self.market_meta[market]["feed_id"] + for market in self.market_meta + } + ) + + # fetch the market summaries + self.markets_by_id = { + market_id: { + "market_id": market_id, + "market_name": self.market_meta[market_id]["market_name"], + "feed_id": self.market_meta[market_id]["feed_id"], + "skew": wei_to_ether(market_digests[ind][2]), + "size": wei_to_ether(market_digests[ind][3]), + "oracle_price": wei_to_ether(market_digests[ind][4]), + "funding_velocity": wei_to_ether(market_digests[ind][5]), + "funding_rate": wei_to_ether(market_digests[ind][6]), + "utilization_rate": wei_to_ether(market_digests[ind][7]), + "remaining_liquidatable_size_capacity": wei_to_ether( + market_digests[ind][8] + ), + "last_liquidation_time": market_digests[ind][9], + "total_trader_debt_usd": wei_to_ether(market_digests[ind][10]), + "total_collateral_value_usd": wei_to_ether(market_digests[ind][11]), + "debt_correction": wei_to_ether(market_digests[ind][12]), + "market_config": unpack_bfp_configuration_by_id(market_configs[ind]), + } + for ind, market_id in enumerate(market_ids) + } + + # make markets by market name + self.markets_by_name = { + summary["market_name"]: summary for summary in self.markets_by_id.values() + } + return self.markets_by_id, self.markets_by_name + + def get_order( + self, account_id: int = None, market_id: int = None, market_name: str = None + ): + """ + Fetches the open order for an account. + + :param int | None account_id: The id of the account. If not provided, the default account is used. + :return: A dictionary with order information. + :rtype: dict + """ + market_id, market_name = self._resolve_market(market_id, market_name) + if not account_id: + account_id = self.default_account_id + + order = call_erc7412( + self.snx, self.market_proxy, "getOrderDigest", (account_id, market_id) + ) + + return { + "market_id": market_id, + "market_name": market_name, + "size_delta": wei_to_ether(order[0]), + "commitment_time": order[1], + "limit_price": wei_to_ether(order[2]), + "keeper_fee_buffer_usd": wei_to_ether(order[3]), + "hooks": order[4], + "is_stale": order[5], + "is_ready": order[6], + } + + def get_margin_info(self, account_id: int = None, market_id: int = None): + """ + Fetch comprehensive information about an account's margin requirements, balances, and position. + + :param int | None account_id: The id of the account to fetch the margin info for. If not provided, the default account is used. + :param int | None market_id: The id of the market to fetch the margin info for. Required parameter. + :return: A dictionary with detailed margin and position information. + :rtype: dict + """ + if not account_id: + account_id = self.default_account_id + + if market_id is None: + raise ValueError("market_id must be provided") + + account_digest = call_erc7412( + self.snx, self.market_proxy, "getAccountDigest", (account_id, market_id) + ) + + deposited_collaterals = { + self.snx.web3.to_checksum_address(collateral[0]): { + "collateral_address": self.snx.web3.to_checksum_address(collateral[0]), + "available": wei_to_ether(collateral[1]), + "oracle_price": wei_to_ether(collateral[2]), + } + for collateral in account_digest[0] + } + + position_digest = account_digest[3] + + return { + "collateral_balances": deposited_collaterals, + "collateral_usd": wei_to_ether(account_digest[1]), + "debt_usd": wei_to_ether(account_digest[2]), + "position": { + "account_id": position_digest[0], + "market_id": position_digest[1], + "remaining_margin_usd": wei_to_ether(position_digest[2]), + "health_factor": wei_to_ether(position_digest[3]), + "notional_value_usd": wei_to_ether(position_digest[4]), + "pnl": wei_to_ether(position_digest[5]), + "accrued_funding": wei_to_ether(position_digest[6]), + "accrued_utilization": wei_to_ether(position_digest[7]), + "entry_pyth_price": wei_to_ether(position_digest[8]), + "entry_price": wei_to_ether(position_digest[9]), + "oracle_price": wei_to_ether(position_digest[10]), + "size": wei_to_ether(position_digest[11]), + "initial_margin": wei_to_ether(position_digest[12]), + "maintenance_margin": wei_to_ether(position_digest[13]), + }, + } + + def get_open_position( + self, market_id: int = None, market_name: str = None, account_id: int = None + ): + """ + Fetch the position for a specified account and market. The result includes detailed + information about the position, including unrealized PnL, funding, size, and various margins. + + :param int | None market_id: The id of the market to fetch the position for. + :param str | None market_name: The name of the market to fetch the position for. + :param int | None account_id: The id of the account to fetch the position for. If not provided, the default account is used. + :return: A dictionary with comprehensive position information. + :rtype: dict + """ + market_id, market_name = self._resolve_market(market_id, market_name) + if not account_id: + account_id = self.default_account_id + + position = call_erc7412( + self.snx, self.market_proxy, "getPositionDigest", (account_id, market_id) + ) + + return { + "account_id": position[0], + "market_id": position[1], + "remaining_margin_usd": wei_to_ether(position[2]), + "health_factor": wei_to_ether(position[3]), + "notional_value_usd": wei_to_ether(position[4]), + "pnl": wei_to_ether(position[5]), + "accrued_funding": wei_to_ether(position[6]), + "accrued_utilization": wei_to_ether(position[7]), + "entry_pyth_price": wei_to_ether(position[8]), + "entry_price": wei_to_ether(position[9]), + "oracle_price": wei_to_ether(position[10]), + "position_size": wei_to_ether(position[11]), + "initial_margin": wei_to_ether(position[12]), + "maintenance_margin": wei_to_ether(position[13]), + "market_name": market_name, + } + + def get_quote( + self, + size: float, + market_id: int = None, + market_name: str = None, + account_id: int = None, + keeper_fee_buffer_usd: float = 0, + ): + """ + Get a quote for the size of an order in a specified market. The quote includes + the fill price of the order after price impact, estimated fees, and other relevant information. + + :param float size: The size of the order to quote (positive for long, negative for short). + :param int | None market_id: The id of the market to quote the order for. + :param str | None market_name: The name of the market to quote the order for. + :param int | None account_id: The id of the account to quote the order for. If not provided, the default account is used. + :param float keeper_fee_buffer_usd: Additional keeper fee buffer in USD. + :return: A dictionary with the quote information. + :rtype: dict + """ + market_id, market_name = self._resolve_market(market_id, market_name) + if not account_id: + account_id = self.default_account_id + + # Convert size to wei + size_wei = ether_to_wei(size) + + # Get the current oracle price + oracle_price = call_erc7412( + self.snx, self.market_proxy, "getOraclePrice", (market_id,) + ) + + # Get the fill price + fill_price = call_erc7412( + self.snx, self.market_proxy, "getFillPrice", (market_id, size_wei) + ) + + # Get the order fees + keeper_fee_buffer_usd_wei = ether_to_wei(keeper_fee_buffer_usd) + order_fee, keeper_fee = call_erc7412( + self.snx, + self.market_proxy, + "getOrderFees", + (market_id, size_wei, keeper_fee_buffer_usd_wei), + ) + + # Calculate the price impact + price_impact = (fill_price - oracle_price) / oracle_price + + return { + "market_id": market_id, + "market_name": market_name, + "size": size, + "oracle_price": wei_to_ether(oracle_price), + "fill_price": wei_to_ether(fill_price), + "price_impact": float(price_impact), + "order_fee": wei_to_ether(order_fee), + "keeper_fee": wei_to_ether(keeper_fee), + "total_fee": wei_to_ether(order_fee + keeper_fee), + "notional_value": abs(size) * wei_to_ether(fill_price), + "side": "long" if size > 0 else "short", + } + + def get_can_liquidate( + self, account_id: int = None, market_id: int = None, market_name: str = None + ): + """ + Check if an ``account_id`` is eligible for liquidation on a specified market + + :param int | None account_id: The id of the account to check. If not provided, the default account is used. + :return: A boolean indicating if the account is eligible for liquidation. + :rtype: bool + """ + market_id, market_name = self._resolve_market(market_id, market_name) + if not account_id: + account_id = self.default_account_id + + # call the liquidation functions + is_position_liquidatable = call_erc7412( + self.snx, + self.market_proxy, + "isPositionLiquidatable", + (account_id, market_id), + ) + is_margin_liquidatable = call_erc7412( + self.snx, + self.market_proxy, + "isMarginLiquidatable", + (account_id, market_id), + ) + + return { + "is_position_liquidatable": is_position_liquidatable, + "is_margin_liquidatable": is_margin_liquidatable, + } + + def modify_collateral( + self, + amount: float, + collateral_address: str, + market_id: int = None, + market_name: str = None, + account_id: int = None, + submit: bool = False, + ): + """ + Modify the collateral for a specified account and market. Positive amounts deposit + collateral, while negative amounts withdraw collateral. + + :param float amount: The amount of collateral to modify. Positive values deposit, negative values withdraw. + :param str collateral_address: The address of the collateral token to modify. + :param int | None market_id: The id of the market to modify collateral for. + :param str | None market_name: The name of the market to modify collateral for. + :param int | None account_id: The id of the account to modify collateral for. If not provided, the default account is used. + :param bool submit: If True, submit the transaction to the blockchain. If False, return the transaction parameters. + :return: If submit is True, returns the transaction hash. Otherwise, returns the transaction parameters. + :rtype: str | dict + """ + market_id, market_name = self._resolve_market(market_id, market_name) + if not account_id: + account_id = self.default_account_id + + # Convert amount to wei + amount_wei = ether_to_wei(amount) + + # Prepare the transaction + tx_params = write_erc7412( + self.snx, + self.market_proxy, + "modifyCollateral", + [account_id, market_id, collateral_address, amount_wei], + ) + + if submit: + try: + tx_hash = self.snx.execute_transaction(tx_params) + self.logger.info( + f"Modifying collateral for account {account_id} in market {market_name}" + ) + self.logger.info(f"Moving {amount} of collateral {collateral_address}") + self.logger.info(f"modifyCollateral tx: {tx_hash}") + return tx_hash + except Exception as e: + self.logger.error(f"Failed to modify collateral: {str(e)}") + raise + else: + return tx_params + + def commit_order( + self, + size: float, + market_id: int = None, + market_name: str = None, + account_id: int = None, + limit_price: float = None, + keeper_fee_buffer_usd: float = 0, + hooks: list = None, + submit: bool = False, + ): + """ + Commit an order to the specified market. + + :param float size: The size of the order to submit. Positive for long, negative for short. + :param int | None market_id: The id of the market to submit the order to. + :param str | None market_name: The name of the market to submit the order to. + :param int | None account_id: The id of the account to submit the order for. Defaults to default_account_id. + :param float | None limit_price: The limit price for the order. If not provided, will use the current oracle price. + :param float keeper_fee_buffer_usd: Additional keeper fee buffer in USD. + :param list | None hooks: List of settlement hook addresses. + :param bool submit: If True, submit the transaction to the blockchain. If False, return the transaction parameters. + + :return: If submit is True, returns the transaction hash. Otherwise, returns the transaction parameters. + :rtype: str | dict + """ + market_id, market_name = self._resolve_market(market_id, market_name) + if not account_id: + account_id = self.default_account_id + + # Convert size to wei + size_wei = ether_to_wei(size) + + # If limit price is not provided, use the current oracle price + if limit_price is None: + oracle_price = call_erc7412( + self.snx, self.market_proxy, "getOraclePrice", (market_id,) + ) + limit_price = wei_to_ether(oracle_price) + + # Convert limit price to wei + limit_price_wei = ether_to_wei(limit_price) + + # Convert keeper fee buffer to wei + keeper_fee_buffer_usd_wei = ether_to_wei(keeper_fee_buffer_usd) + + # Prepare hooks + if hooks is None: + hooks = [] + + # Prepare the transaction + tx_params = write_erc7412( + self.snx, + self.market_proxy, + "commitOrder", + [ + account_id, + market_id, + size_wei, + limit_price_wei, + keeper_fee_buffer_usd_wei, + hooks, + self.snx.tracking_code, + ], + ) + + if submit: + try: + tx_hash = self.snx.execute_transaction(tx_params) + self.logger.info( + f"Committing order for account {account_id} in market {market_name}" + ) + self.logger.info(f"Order size: {size}, Limit Price: {limit_price}") + self.logger.info(f"commitOrder tx: {tx_hash}") + return tx_hash + except Exception as e: + self.logger.error(f"Failed to commit order: {str(e)}") + raise + else: + return tx_params + + def settle_order( + self, + account_id: int = None, + market_id: int = None, + market_name: str = None, + max_attempts: int = 3, + attempt_delay: int = 5, + submit: bool = False, + ): + """ + Settle an open order for the specified account and market. + + :param int | None account_id: The id of the account to settle the order for. If not provided, uses the default account. + :param int | None market_id: The id of the market to settle the order in. + :param str | None market_name: The name of the market to settle the order in. + :param int max_attempts: Maximum number of attempts to settle the order. + :param int attempt_delay: Delay in seconds between settlement attempts. + :param bool submit: If True, submit the transaction to the blockchain. If False, return the transaction parameters. + :return: If submit is True, returns the transaction hash. Otherwise, returns the transaction parameters. + :rtype: str | dict + """ + market_id, market_name = self._resolve_market(market_id, market_name) + if not account_id: + account_id = self.default_account_id + + # Fetch market configuration to get the Pyth price feed ID + pyth_price_feed_id = self.snx.perps.markets_by_id[market_id]["feed_id"] + order = self.get_order(account_id, market_id=market_id) + self.logger.info(f"Order: {order}") + + min_publish_delay = self.market_meta[market_id]["system_config"][ + "pyth_publish_time_min" + ] + max_publish_delay = self.market_meta[market_id]["system_config"][ + "pyth_publish_time_max" + ] + + commitment_time = order["commitment_time"] + publish_time = commitment_time + min_publish_delay + + wait_amount = publish_time - time.time() + if wait_amount > 0: + self.logger.info(f"Waiting {wait_amount} seconds to settle order") + time.sleep(wait_amount) + + for attempt in range(max_attempts): + try: + # Fetch the latest Pyth price update data + pyth_data = self.snx.pyth.get_price_from_ids( + [pyth_price_feed_id], publish_time=publish_time + ) + price_update_data = pyth_data["price_update_data"][0] + + # Prepare the transaction + tx_params = write_erc7412( + self.snx, + self.market_proxy, + "settleOrder", + [account_id, market_id, price_update_data], + tx_params={"value": 1}, + ) + + if submit: + tx_hash = self.snx.execute_transaction(tx_params) + self.logger.info( + f"Settling order for account {account_id} in market {market_name}" + ) + self.logger.info(f"settleOrder tx: {tx_hash}") + + # Wait for transaction to be mined + receipt = self.snx.wait(tx_hash) + if receipt["status"] == 1: + self.logger.info("Order settled successfully") + return tx_hash + else: + raise Exception("Transaction failed") + else: + return tx_params + + except Exception as e: + self.logger.warning( + f"Settlement attempt {attempt + 1} failed: {str(e)}" + ) + if attempt < max_attempts - 1: + self.logger.info(f"Retrying in {attempt_delay} seconds...") + time.sleep(attempt_delay) + else: + self.logger.error("Max attempts reached. Settlement failed.") + raise + + raise Exception("Failed to settle order after maximum attempts") + + def pay_debt( + self, + amount: int = None, + account_id: int = None, + market_id: int = None, + market_name: str = None, + submit: bool = False, + ): + """ + Pay the debt of a perps account. If no amount is provided, the full debt + of the account is repaid. Make sure to approve the proxy to transfer sUSD before + calling this function. + + :param int | None amount: The amount of debt to repay. If not provided, the full debt is repaid. + :param int | None account_id: The id of the account to repay the debt for. If not provided, the default account is used. + :param bool submit: If ``True``, submit the transaction to the blockchain. + :return: If ``submit``, returns the trasaction hash. Otherwise, returns the transaction. + :rtype: str | dict + """ + market_id, market_name = self._resolve_market(market_id, market_name) + if account_id is None: + account_id = self.default_account_id + + if amount is None: + account_digest = call_erc7412( + self.snx, + self.market_proxy, + "getAccountDigest", + (account_id, market_id), + ) + amount = account_digest[2] + else: + amount = ether_to_wei(amount) + + tx_params = write_erc7412( + self.snx, + self.market_proxy, + "payDebt", + [account_id, market_id, amount], + ) + if submit: + tx_hash = self.snx.execute_transaction(tx_params) + self.logger.info(f"Repaying debt of {amount} for account {account_id}") + self.logger.info(f"payDebt tx: {tx_hash}") + return tx_hash + else: + return tx_params + + def liquidate( + self, + account_id: int = None, + market_id: int = None, + market_name: str = None, + margin_only: bool = False, + submit: bool = False, + ): + """ """ + market_id, market_name = self._resolve_market(market_id, market_name) + if account_id is None: + account_id = self.default_account_id + + fn_name = "liquidatePosition" if not margin_only else "liquidateMarginOnly" + tx_params = write_erc7412( + self.snx, + self.market_proxy, + fn_name, + [account_id, market_id], + ) + if submit: + tx_hash = self.snx.execute_transaction(tx_params) + self.logger.info( + f"Liquidating account {account_id} in market {market_name}" + ) + + self.logger.info(f"{fn_name} tx: {tx_hash}") + return tx_hash + else: + return tx_params diff --git a/src/synthetix/perps/perps_utils.py b/src/synthetix/perps/perps_utils.py new file mode 100644 index 0000000..1009961 --- /dev/null +++ b/src/synthetix/perps/perps_utils.py @@ -0,0 +1,86 @@ +from eth_utils import encode_hex +from ..utils import wei_to_ether + + +def unpack_bfp_configuration(config_data): + """ + Unpacks the market configuration data returned by getMarketConfiguration. + + :param config_data: Tuple containing the raw configuration data + :return: Dictionary with decoded configuration values + """ + return { + "pyth": config_data[0], + "eth_oracle_node_id": config_data[1].hex(), + "reward_distributor_implementation": config_data[2], + "pyth_publish_time_min": config_data[3], + "pyth_publish_time_max": config_data[4], + "min_order_age": config_data[5], + "max_order_age": config_data[6], + "min_keeper_fee_usd": wei_to_ether(config_data[7]), + "max_keeper_fee_usd": wei_to_ether(config_data[8]), + "keeper_profit_margin_usd": wei_to_ether(config_data[9]), + "keeper_profit_margin_percent": wei_to_ether(config_data[10]), + "keeper_settlement_gas_units": config_data[11], + "keeper_cancellation_gas_units": config_data[12], + "keeper_liquidation_gas_units": config_data[13], + "keeper_flag_gas_units": config_data[14], + "keeper_liquidate_margin_gas_units": config_data[15], + "keeper_liquidation_endorsed": config_data[16], + "collateral_discount_scalar": config_data[17], + "min_collateral_discount": wei_to_ether(config_data[18]), + "max_collateral_discount": wei_to_ether(config_data[19]), + "utilization_breakpoint_percent": wei_to_ether(config_data[20]), + "low_utilization_slope_percent": wei_to_ether(config_data[21]), + "high_utilization_slope_percent": wei_to_ether(config_data[22]), + } + + +def unpack_bfp_configuration_by_id(config_data): + """ + Unpacks the market configuration data returned by getMarketConfigurationById. + + :param config_data: Tuple containing the raw configuration data + :return: Dictionary with decoded configuration values + """ + ( + oracle_node_id, + pyth_price_feed_id, + maker_fee, + taker_fee, + max_market_size, + max_funding_velocity, + skew_scale, + funding_velocity_clamp, + min_credit_percent, + min_margin_usd, + min_margin_ratio, + incremental_margin_scalar, + maintenance_margin_scalar, + max_initial_margin_ratio, + liquidation_reward_percent, + liquidation_limit_scalar, + liquidation_window_duration, + liquidation_max_pd, + ) = config_data + + return { + "oracle_node_id": encode_hex(oracle_node_id), + "pyth_price_feed_id": encode_hex(pyth_price_feed_id), + "maker_fee": wei_to_ether(maker_fee), + "taker_fee": wei_to_ether(taker_fee), + "max_market_size": wei_to_ether(max_market_size), + "max_funding_velocity": wei_to_ether(max_funding_velocity), + "skew_scale": wei_to_ether(skew_scale), + "funding_velocity_clamp": wei_to_ether(funding_velocity_clamp), + "min_credit_percent": wei_to_ether(min_credit_percent), + "min_margin_usd": wei_to_ether(min_margin_usd), + "min_margin_ratio": wei_to_ether(min_margin_ratio), + "incremental_margin_scalar": wei_to_ether(incremental_margin_scalar), + "maintenance_margin_scalar": wei_to_ether(maintenance_margin_scalar), + "max_initial_margin_ratio": wei_to_ether(max_initial_margin_ratio), + "liquidation_reward_percent": wei_to_ether(liquidation_reward_percent), + "liquidation_limit_scalar": wei_to_ether(liquidation_limit_scalar), + "liquidation_window_duration": wei_to_ether(liquidation_window_duration), + "liquidation_max_pd": wei_to_ether(liquidation_max_pd), + } diff --git a/src/synthetix/synthetix.py b/src/synthetix/synthetix.py index 69cca2b..c9af491 100644 --- a/src/synthetix/synthetix.py +++ b/src/synthetix/synthetix.py @@ -11,7 +11,7 @@ DEFAULT_GAS_MULTIPLIER, DEFAULT_GQL_ENDPOINT_PERPS, DEFAULT_GQL_ENDPOINT_RATES, - DEFAULT_PRICE_SERVICE_ENDPOINTS, + DEFAULT_PRICE_SERVICE_ENDPOINT, DEFAULT_REFERRER, DEFAULT_TRACKING_CODE, ) @@ -19,7 +19,7 @@ from .contracts import load_contracts from .pyth import Pyth from .core import Core -from .perps import Perps +from .perps import PerpsV3, BfPerps from .spot import Spot from .queries import Queries @@ -249,11 +249,8 @@ def __init__( ) # init pyth - if ( - not price_service_endpoint - and self.network_id in DEFAULT_PRICE_SERVICE_ENDPOINTS - ): - price_service_endpoint = DEFAULT_PRICE_SERVICE_ENDPOINTS[self.network_id] + if not price_service_endpoint: + price_service_endpoint = DEFAULT_PRICE_SERVICE_ENDPOINT self.pyth = Pyth( self, @@ -262,7 +259,11 @@ def __init__( ) self.core = Core(self, core_account_id) self.spot = Spot(self) - self.perps = Perps(self, perps_account_id, perps_disabled_markets) + + if "bfp_market_factory" in self.contracts: + self.perps = BfPerps(self, perps_account_id) + else: + self.perps = PerpsV3(self, perps_account_id) def _load_contracts(self): """