diff --git a/src/synthetix/constants.py b/src/synthetix/constants.py index 56c2542..250d90a 100644 --- a/src/synthetix/constants.py +++ b/src/synthetix/constants.py @@ -21,6 +21,7 @@ 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", } diff --git a/src/synthetix/contracts/deployments/42161/AccountProxy.json b/src/synthetix/contracts/deployments/42161/AccountProxy.json new file mode 100644 index 0000000..a8c489b --- /dev/null +++ b/src/synthetix/contracts/deployments/42161/AccountProxy.json @@ -0,0 +1,818 @@ +{ + "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": "", + "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/42161/CoreProxy.json b/src/synthetix/contracts/deployments/42161/CoreProxy.json new file mode 100644 index 0000000..de9cac2 --- /dev/null +++ b/src/synthetix/contracts/deployments/42161/CoreProxy.json @@ -0,0 +1,5325 @@ +{ + "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": "", + "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/42161/PerpsAccountProxy.json b/src/synthetix/contracts/deployments/42161/PerpsAccountProxy.json new file mode 100644 index 0000000..0e9f30f --- /dev/null +++ b/src/synthetix/contracts/deployments/42161/PerpsAccountProxy.json @@ -0,0 +1,818 @@ +{ + "address": "0xD935444f5dc75A407ed475C9F387e124911d36C6", + "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/42161/PerpsMarketProxy.json b/src/synthetix/contracts/deployments/42161/PerpsMarketProxy.json new file mode 100644 index 0000000..f8550c9 --- /dev/null +++ b/src/synthetix/contracts/deployments/42161/PerpsMarketProxy.json @@ -0,0 +1,4680 @@ +{ + "address": "0xd762960c31210Cf1bDf75b06A5192d395EEDC659", + "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" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "InvalidMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "parameter", + "type": "string" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "InvalidParameter", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt256ToUint256", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToInt256", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint128", + "type": "error" + }, + { + "inputs": [], + "name": "PerpsMarketAlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "PerpsMarketNotInitialized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "globalPerpsMarketId", + "type": "uint128" + } + ], + "name": "FactoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "perpsMarketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "string", + "name": "marketName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "marketSymbol", + "type": "string" + } + ], + "name": "MarketCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "requestedMarketId", + "type": "uint128" + }, + { + "internalType": "string", + "name": "marketName", + "type": "string" + }, + { + "internalType": "string", + "name": "marketSymbol", + "type": "string" + } + ], + "name": "createMarket", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISynthetixSystem", + "name": "synthetix", + "type": "address" + }, + { + "internalType": "contract ISpotMarketSystem", + "name": "spotMarket", + "type": "address" + } + ], + "name": "initializeFactory", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "interestRate", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "perpsMarketId", + "type": "uint128" + } + ], + "name": "minimumCredit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "perpsMarketId", + "type": "uint128" + } + ], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "perpsMarketId", + "type": "uint128" + } + ], + "name": "reportedDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "marketName", + "type": "string" + } + ], + "name": "setPerpsMarketName", + "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": "utilizationRate", + "outputs": [ + { + "internalType": "uint256", + "name": "rate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "delegatedCollateral", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedCredit", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "AccountLiquidatable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "AccountNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawAmount", + "type": "uint256" + } + ], + "name": "InsufficientCollateral", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "availableUsdDenominated", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredUsdDenominated", + "type": "uint256" + } + ], + "name": "InsufficientCollateralAvailableForWithdraw", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawAmount", + "type": "uint256" + } + ], + "name": "InsufficientSynthCollateral", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "amountDelta", + "type": "int256" + } + ], + "name": "InvalidAmountDelta", + "type": "error" + }, + { + "inputs": [], + "name": "KeeperCostsNotSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositAmount", + "type": "uint256" + } + ], + "name": "MaxCollateralExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "maxCollateralsPerAccount", + "type": "uint128" + } + ], + "name": "MaxCollateralsPerAccountReached", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint128ToInt128", + "type": "error" + }, + { + "inputs": [], + "name": "PendingOrderExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "PriceFeedNotSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "SynthNotEnabledForCollateral", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "int256", + "name": "amountDelta", + "type": "int256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "CollateralModified", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountCollateralIds", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountOpenPositions", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAvailableMargin", + "outputs": [ + { + "internalType": "int256", + "name": "availableMargin", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "getCollateralAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getOpenPosition", + "outputs": [ + { + "internalType": "int256", + "name": "totalPnl", + "type": "int256" + }, + { + "internalType": "int256", + "name": "accruedFunding", + "type": "int256" + }, + { + "internalType": "int128", + "name": "positionSize", + "type": "int128" + }, + { + "internalType": "uint256", + "name": "owedInterest", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getOpenPositionSize", + "outputs": [ + { + "internalType": "int128", + "name": "positionSize", + "type": "int128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getRequiredMargins", + "outputs": [ + { + "internalType": "uint256", + "name": "requiredInitialMargin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredMaintenanceMargin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLiquidationReward", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getWithdrawableMargin", + "outputs": [ + { + "internalType": "int256", + "name": "withdrawableMargin", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "int256", + "name": "amountDelta", + "type": "int256" + } + ], + "name": "modifyCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "totalAccountOpenInterest", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "totalCollateralValue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "currentFundingRate", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "currentFundingVelocity", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "orderSize", + "type": "int128" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "fillPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketSummary", + "outputs": [ + { + "components": [ + { + "internalType": "int256", + "name": "skew", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxOpenInterest", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "currentFundingRate", + "type": "int256" + }, + { + "internalType": "int256", + "name": "currentFundingVelocity", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "indexPrice", + "type": "uint256" + } + ], + "internalType": "struct IPerpsMarketModule.MarketSummary", + "name": "summary", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "indexPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "maxOpenInterest", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "metadata", + "outputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "size", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "skew", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "fillPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + } + ], + "name": "AcceptablePriceExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "availableMargin", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "minMargin", + "type": "uint256" + } + ], + "name": "InsufficientMargin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "settlementStrategyId", + "type": "uint256" + } + ], + "name": "InvalidSettlementStrategy", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxMarketSize", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "newSideSize", + "type": "int256" + } + ], + "name": "MaxOpenInterestReached", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "maxPositionsPerAccount", + "type": "uint128" + } + ], + "name": "MaxPositionsPerAccountReached", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxMarketValue", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "newSideSize", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "MaxUSDOpenInterestReached", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt256ToInt128", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroSizeOrder", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "enum SettlementStrategy.Type", + "name": "orderType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "commitmentTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expectedPriceTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "settlementTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expirationTime", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "OrderCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "commitmentTime", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + } + ], + "name": "PreviousOrderExpired", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "internalType": "uint128", + "name": "settlementStrategyId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "internalType": "struct AsyncOrder.OrderCommitmentRequest", + "name": "commitment", + "type": "tuple" + } + ], + "name": "commitOrder", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "commitmentTime", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "internalType": "uint128", + "name": "settlementStrategyId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "internalType": "struct AsyncOrder.OrderCommitmentRequest", + "name": "request", + "type": "tuple" + } + ], + "internalType": "struct AsyncOrder.Data", + "name": "retOrder", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "fees", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + } + ], + "name": "computeOrderFees", + "outputs": [ + { + "internalType": "uint256", + "name": "orderFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fillPrice", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "computeOrderFeesWithPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "orderFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fillPrice", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getOrder", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "commitmentTime", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "internalType": "uint128", + "name": "settlementStrategyId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "internalType": "struct AsyncOrder.OrderCommitmentRequest", + "name": "request", + "type": "tuple" + } + ], + "internalType": "struct AsyncOrder.Data", + "name": "order", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "settlementStrategyId", + "type": "uint128" + } + ], + "name": "getSettlementRewardCost", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "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": "requiredMarginForOrder", + "outputs": [ + { + "internalType": "uint256", + "name": "requiredMargin", + "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" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "requiredMarginForOrderWithPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "requiredMargin", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "leftover", + "type": "uint256" + } + ], + "name": "InsufficientAccountMargin", + "type": "error" + }, + { + "inputs": [], + "name": "OrderNotValid", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt128ToUint128", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint64", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum SettlementStrategy.Type", + "name": "strategyType", + "type": "uint8" + } + ], + "name": "SettlementStrategyNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementExpiration", + "type": "uint256" + } + ], + "name": "SettlementWindowExpired", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementTime", + "type": "uint256" + } + ], + "name": "SettlementWindowNotOpen", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "account", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "CollateralDeducted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "interest", + "type": "uint256" + } + ], + "name": "InterestCharged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "skew", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "sizeDelta", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "currentFundingRate", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "currentFundingVelocity", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "interestRate", + "type": "uint128" + } + ], + "name": "MarketUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fillPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "pnl", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "accruedFunding", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "newSize", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "referralFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collectedFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "settler", + "type": "address" + } + ], + "name": "OrderSettled", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "settleOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "fillPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + } + ], + "name": "AcceptablePriceNotExceeded", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "desiredPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fillPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "settler", + "type": "address" + } + ], + "name": "OrderCancelled", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "cancelOrder", + "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" + }, + { + "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": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "NotEligibleForLiquidation", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "int256", + "name": "availableMargin", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "requiredMaintenanceMargin", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationReward", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "flagReward", + "type": "uint256" + } + ], + "name": "AccountFlaggedForLiquidation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "fullLiquidation", + "type": "bool" + } + ], + "name": "AccountLiquidationAttempt", + "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": "amountLiquidated", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int128", + "name": "currentPositionSize", + "type": "int128" + } + ], + "name": "PositionLiquidated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "canLiquidate", + "outputs": [ + { + "internalType": "bool", + "name": "isEligible", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "flaggedAccounts", + "outputs": [ + { + "internalType": "uint256[]", + "name": "accountIds", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "liquidate", + "outputs": [ + { + "internalType": "uint256", + "name": "liquidationReward", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxNumberOfAccounts", + "type": "uint256" + } + ], + "name": "liquidateFlagged", + "outputs": [ + { + "internalType": "uint256", + "name": "liquidationReward", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128[]", + "name": "accountIds", + "type": "uint128[]" + } + ], + "name": "liquidateFlaggedAccounts", + "outputs": [ + { + "internalType": "uint256", + "name": "liquidationReward", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "liquidationCapacity", + "outputs": [ + { + "internalType": "uint256", + "name": "capacity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLiquidationInWindow", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "latestLiquidationTimestamp", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "InvalidSettlementWindowDuration", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "skewScale", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxFundingVelocity", + "type": "uint256" + } + ], + "name": "FundingParametersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "initialMarginRatioD18", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maintenanceMarginRatioD18", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minimumInitialMarginRatioD18", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "flagRewardRatioD18", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minimumPositionMargin", + "type": "uint256" + } + ], + "name": "LiquidationParametersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lockedOiRatioD18", + "type": "uint256" + } + ], + "name": "LockedOiRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "feedId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "strictStalenessTolerance", + "type": "uint256" + } + ], + "name": "MarketPriceDataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxLiquidationLimitAccumulationMultiplier", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxSecondsInLiquidationWindow", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxLiquidationPd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "endorsedLiquidator", + "type": "address" + } + ], + "name": "MaxLiquidationParametersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxMarketSize", + "type": "uint256" + } + ], + "name": "MaxMarketSizeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxMarketValue", + "type": "uint256" + } + ], + "name": "MaxMarketValueSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "makerFeeRatio", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "takerFeeRatio", + "type": "uint256" + } + ], + "name": "OrderFeesSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "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": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "commitmentPriceDelay", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct SettlementStrategy.Data", + "name": "strategy", + "type": "tuple" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "strategyId", + "type": "uint256" + } + ], + "name": "SettlementStrategyAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "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": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "commitmentPriceDelay", + "type": "uint256" + } + ], + "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": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "commitmentPriceDelay", + "type": "uint256" + } + ], + "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" + } + ], + "name": "getFundingParameters", + "outputs": [ + { + "internalType": "uint256", + "name": "skewScale", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFundingVelocity", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getLiquidationParameters", + "outputs": [ + { + "internalType": "uint256", + "name": "initialMarginRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumInitialMarginRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maintenanceMarginScalarD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "flagRewardRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumPositionMargin", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getLockedOiRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMaxLiquidationParameters", + "outputs": [ + { + "internalType": "uint256", + "name": "maxLiquidationLimitAccumulationMultiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSecondsInLiquidationWindow", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLiquidationPd", + "type": "uint256" + }, + { + "internalType": "address", + "name": "endorsedLiquidator", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMaxMarketSize", + "outputs": [ + { + "internalType": "uint256", + "name": "maxMarketSize", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMaxMarketValue", + "outputs": [ + { + "internalType": "uint256", + "name": "maxMarketValue", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getOrderFees", + "outputs": [ + { + "internalType": "uint256", + "name": "makerFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takerFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "perpsMarketId", + "type": "uint128" + } + ], + "name": "getPriceData", + "outputs": [ + { + "internalType": "bytes32", + "name": "feedId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "strictStalenessTolerance", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "commitmentPriceDelay", + "type": "uint256" + } + ], + "internalType": "struct SettlementStrategy.Data", + "name": "settlementStrategy", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "skewScale", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFundingVelocity", + "type": "uint256" + } + ], + "name": "setFundingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "initialMarginRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumInitialMarginRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maintenanceMarginScalarD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "flagRewardRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumPositionMargin", + "type": "uint256" + } + ], + "name": "setLiquidationParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "lockedOiRatioD18", + "type": "uint256" + } + ], + "name": "setLockedOiRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxLiquidationLimitAccumulationMultiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSecondsInLiquidationWindow", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLiquidationPd", + "type": "uint256" + }, + { + "internalType": "address", + "name": "endorsedLiquidator", + "type": "address" + } + ], + "name": "setMaxLiquidationParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxMarketSize", + "type": "uint256" + } + ], + "name": "setMaxMarketSize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxMarketValue", + "type": "uint256" + } + ], + "name": "setMaxMarketValue", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "makerFeeRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takerFeeRatio", + "type": "uint256" + } + ], + "name": "setOrderFees", + "outputs": [], + "stateMutability": "nonpayable", + "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": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "commitmentPriceDelay", + "type": "uint256" + } + ], + "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": "uint128", + "name": "perpsMarketId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "feedId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "strictStalenessTolerance", + "type": "uint256" + } + ], + "name": "updatePriceData", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "invalidFeeCollector", + "type": "address" + } + ], + "name": "InvalidFeeCollectorInterface", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "lowUtilizationInterestRateGradient", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "highUtilizationInterestRateGradient", + "type": "uint128" + } + ], + "name": "InvalidInterestRateParameters", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shareRatioD18", + "type": "uint256" + } + ], + "name": "InvalidReferrerShareRatio", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxCollateralAmount", + "type": "uint256" + } + ], + "name": "CollateralConfigurationSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "feeCollector", + "type": "address" + } + ], + "name": "FeeCollectorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "lowUtilizationInterestRateGradient", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "interestRateGradientBreakpoint", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "highUtilizationInterestRateGradient", + "type": "uint256" + } + ], + "name": "InterestRateParametersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "superMarketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "interestRate", + "type": "uint128" + } + ], + "name": "InterestRateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "keeperCostNodeId", + "type": "bytes32" + } + ], + "name": "KeeperCostNodeIdUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "minKeeperRewardUsd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minKeeperProfitRatioD18", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxKeeperRewardUsd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxKeeperScalingRatioD18", + "type": "uint256" + } + ], + "name": "KeeperRewardGuardsSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "maxPositionsPerAccount", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "maxCollateralsPerAccount", + "type": "uint128" + } + ], + "name": "PerAccountCapsSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shareRatioD18", + "type": "uint256" + } + ], + "name": "ReferrerShareUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128[]", + "name": "newSynthDeductionPriority", + "type": "uint128[]" + } + ], + "name": "SynthDeductionPrioritySet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "getCollateralConfiguration", + "outputs": [ + { + "internalType": "uint256", + "name": "maxCollateralAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFeeCollector", + "outputs": [ + { + "internalType": "address", + "name": "feeCollector", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getInterestRateParameters", + "outputs": [ + { + "internalType": "uint128", + "name": "lowUtilizationInterestRateGradient", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "interestRateGradientBreakpoint", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "highUtilizationInterestRateGradient", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getKeeperCostNodeId", + "outputs": [ + { + "internalType": "bytes32", + "name": "keeperCostNodeId", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getKeeperRewardGuards", + "outputs": [ + { + "internalType": "uint256", + "name": "minKeeperRewardUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minKeeperProfitRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxKeeperRewardUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxKeeperScalingRatioD18", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMarkets", + "outputs": [ + { + "internalType": "uint256[]", + "name": "marketIds", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPerAccountCaps", + "outputs": [ + { + "internalType": "uint128", + "name": "maxPositionsPerAccount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "maxCollateralsPerAccount", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "getReferrerShare", + "outputs": [ + { + "internalType": "uint256", + "name": "shareRatioD18", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSupportedCollaterals", + "outputs": [ + { + "internalType": "uint256[]", + "name": "supportedCollaterals", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSynthDeductionPriority", + "outputs": [ + { + "internalType": "uint128[]", + "name": "", + "type": "uint128[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxCollateralAmount", + "type": "uint256" + } + ], + "name": "setCollateralConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeCollector", + "type": "address" + } + ], + "name": "setFeeCollector", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "lowUtilizationInterestRateGradient", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "interestRateGradientBreakpoint", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "highUtilizationInterestRateGradient", + "type": "uint128" + } + ], + "name": "setInterestRateParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minKeeperRewardUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minKeeperProfitRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxKeeperRewardUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxKeeperScalingRatioD18", + "type": "uint256" + } + ], + "name": "setKeeperRewardGuards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "maxPositionsPerAccount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "maxCollateralsPerAccount", + "type": "uint128" + } + ], + "name": "setPerAccountCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128[]", + "name": "newSynthDeductionPriority", + "type": "uint128[]" + } + ], + "name": "setSynthDeductionPriority", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalGlobalCollateralValue", + "outputs": [ + { + "internalType": "uint256", + "name": "totalCollateralValue", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "updateInterestRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "keeperCostNodeId", + "type": "bytes32" + } + ], + "name": "updateKeeperCostNodeId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shareRatioD18", + "type": "uint256" + } + ], + "name": "updateReferrerShare", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "deployTxnHash": "", + "sourceName": "", + "contractName": "", + "deployedOn": "invoke.upgrade_proxy", + "gasUsed": 0, + "gasCost": "0", + "highlight": true +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/42161/PythERC7412Wrapper.json b/src/synthetix/contracts/deployments/42161/PythERC7412Wrapper.json new file mode 100644 index 0000000..527940e --- /dev/null +++ b/src/synthetix/contracts/deployments/42161/PythERC7412Wrapper.json @@ -0,0 +1,169 @@ +{ + "address": "0x7b118596be900f3c0feB2f23758d9798965B72a3", + "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": [ + "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C" + ], + "linkedLibraries": {}, + "deployTxnHash": "", + "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/42161/SpotMarketProxy.json b/src/synthetix/contracts/deployments/42161/SpotMarketProxy.json new file mode 100644 index 0000000..cae2305 --- /dev/null +++ b/src/synthetix/contracts/deployments/42161/SpotMarketProxy.json @@ -0,0 +1,3944 @@ +{ + "address": "0xa65538A6B9A8442854dEcB6E3F85782C60757D60", + "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": "", + "sourceName": "", + "contractName": "", + "deployedOn": "invoke.upgradeSpotMarketProxy", + "gasUsed": 0, + "gasCost": "0", + "highlight": true +} \ No newline at end of file diff --git a/src/synthetix/contracts/deployments/42161/TrustedMulticallForwarder.json b/src/synthetix/contracts/deployments/42161/TrustedMulticallForwarder.json new file mode 100644 index 0000000..1d336d0 --- /dev/null +++ b/src/synthetix/contracts/deployments/42161/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/contracts/deployments/42161/USDProxy.json b/src/synthetix/contracts/deployments/42161/USDProxy.json new file mode 100644 index 0000000..7e6fbe5 --- /dev/null +++ b/src/synthetix/contracts/deployments/42161/USDProxy.json @@ -0,0 +1,834 @@ +{ + "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": "", + "sourceName": "", + "contractName": "", + "deployedOn": "invoke.init_usd", + "gasUsed": 0, + "gasCost": "0", + "highlight": true +} \ No newline at end of file diff --git a/src/tests/e2e/arbitrum-mainnet-fork/conftest.py b/src/tests/e2e/arbitrum-mainnet-fork/conftest.py index 3704960..581ceb7 100644 --- a/src/tests/e2e/arbitrum-mainnet-fork/conftest.py +++ b/src/tests/e2e/arbitrum-mainnet-fork/conftest.py @@ -23,6 +23,13 @@ def snx(pytestconfig): snx = Synthetix( provider_rpc=RPC, op_mainnet_rpc=OP_MAINNET_RPC, + is_fork=True, + request_kwargs={"timeout": 120}, + cannon_config={ + "package": "synthetix-omnibus", + "version": "latest", + "preset": "main", + }, ) return snx diff --git a/src/tests/e2e/arbitrum-mainnet-fork/test_arb_mainnet_spot.py b/src/tests/e2e/arbitrum-mainnet-fork/test_arb_mainnet_spot.py index 61c563b..571a11e 100644 --- a/src/tests/e2e/arbitrum-mainnet-fork/test_arb_mainnet_spot.py +++ b/src/tests/e2e/arbitrum-mainnet-fork/test_arb_mainnet_spot.py @@ -100,20 +100,22 @@ def test_spot_wrapper(snx, contracts, steal_usdc, token_name, test_amount, decim ("USDC", TEST_AMOUNT, 6), ], ) -@pytest.mark.skip("Async orders are not working") def test_spot_async_order( snx, contracts, steal_usdc, logger, token_name, test_amount, decimals ): """The instance can wrap USDC for sUSDC and commit an async order to sell for sUSD""" token = contracts[token_name] market_id = snx.spot.markets_by_name[f"s{token_name}"]["market_id"] + wrapped_token = snx.spot.markets_by_id[market_id]["contract"] + susd_token = snx.spot.markets_by_id[0]["contract"] # make sure we have some USDC starting_balance_wei = token.functions.balanceOf(snx.address).call() starting_balance = format_wei(starting_balance_wei, decimals) starting_synth_balance = snx.spot.get_balance(market_id=market_id) + starting_susd_balance = snx.spot.get_balance(market_id=0) assert starting_balance > test_amount @@ -131,14 +133,16 @@ def test_spot_async_order( wrap_tx = snx.spot.wrap(test_amount, market_id=market_id, submit=True) snx.wait(wrap_tx) - # get new balances + # check balances wrapped_balance_wei = token.functions.balanceOf(snx.address).call() wrapped_balance = format_wei(wrapped_balance_wei, decimals) wrapped_synth_balance = snx.spot.get_balance(market_id=market_id) + wrapped_susd_balance = snx.spot.get_balance(market_id=0) assert wrapped_balance == starting_balance - test_amount assert wrapped_synth_balance == starting_synth_balance + test_amount + assert wrapped_susd_balance == starting_susd_balance ## sell it # check the allowance @@ -155,7 +159,7 @@ def test_spot_async_order( # commit order commit_tx = snx.spot.commit_order( - "sell", test_amount, market_id=market_id, submit=True + "sell", test_amount, slippage_tolerance=0.001, market_id=market_id, submit=True ) commit_receipt = snx.wait(commit_tx) @@ -172,9 +176,90 @@ def test_spot_async_order( # settle the order settle_tx = snx.spot.settle_order(async_order_id, market_id=market_id, submit=True) - snx.logger.info(f"settle_tx: {settle_tx}") + settle_receipt = snx.wait(settle_tx) assert settle_tx is not None + assert settle_receipt is not None + + # check balances + sold_balance_wei = token.functions.balanceOf(snx.address).call() + sold_balance = format_wei(sold_balance_wei, decimals) + + sold_synth_balance = snx.spot.get_balance(market_id=market_id) + sold_susd_balance = snx.spot.get_balance(market_id=0) + + assert sold_balance == wrapped_balance + assert sold_synth_balance >= wrapped_synth_balance - test_amount - 1 + assert sold_susd_balance >= wrapped_susd_balance + + ## buy it back + # check the allowance + sold_allowance = snx.allowance(susd_token.address, snx.spot.market_proxy.address) + + if sold_allowance < test_amount: + # approve + approve_tx = snx.approve( + susd_token.address, snx.spot.market_proxy.address, submit=True + ) + snx.wait(approve_tx) + + # commit order + commit_buy_tx = snx.spot.commit_order( + "buy", + test_amount - 1, + slippage_tolerance=0.001, + market_id=market_id, + submit=True, + ) + commit_buy_receipt = snx.wait(commit_buy_tx) + + # get the event to check the order id + event_data_buy = snx.spot.market_proxy.events.OrderCommitted().process_receipt( + commit_buy_receipt + ) + assert len(event_data_buy) == 1 + + # unpack the event + event_buy = event_data_buy[0]["args"] + market_id_buy = event_buy["marketId"] + async_order_id_buy = event_buy["asyncOrderId"] + + # settle the order + settle_buy_tx = snx.spot.settle_order( + async_order_id_buy, market_id=market_id_buy, submit=True + ) + settle_buy_receipt = snx.wait(settle_buy_tx) + + assert settle_buy_tx is not None + assert settle_buy_receipt is not None + + # check balances + buy_balance_wei = token.functions.balanceOf(snx.address).call() + buy_balance = format_wei(buy_balance_wei, decimals) + + buy_synth_balance = snx.spot.get_balance(market_id=market_id) + buy_susd_balance = snx.spot.get_balance(market_id=0) + + assert buy_balance == sold_balance + assert buy_synth_balance >= sold_synth_balance + test_amount - 2 + assert buy_susd_balance >= sold_susd_balance - test_amount + + ## unwrap + unwrap_tx = snx.spot.wrap(-test_amount + 2, market_id=market_id, submit=True) + unwrap_receipt = snx.wait(unwrap_tx) + + assert unwrap_tx is not None + assert unwrap_receipt is not None + assert unwrap_receipt.status == 1 + + # get new balances + unwrapped_balance_wei = token.functions.balanceOf(snx.address).call() + unwrapped_balance = format_wei(unwrapped_balance_wei, decimals) + + unwrapped_synth_balance = snx.spot.get_balance(market_id=market_id) + + assert unwrapped_balance == starting_balance - 2 + assert unwrapped_synth_balance >= buy_synth_balance - test_amount - 1 @pytest.mark.parametrize( diff --git a/src/tests/e2e/arbitrum-sepolia-fork/test_arb_sepolia_spot.py b/src/tests/e2e/arbitrum-sepolia-fork/test_arb_sepolia_spot.py index 2e753e1..d402bbc 100644 --- a/src/tests/e2e/arbitrum-sepolia-fork/test_arb_sepolia_spot.py +++ b/src/tests/e2e/arbitrum-sepolia-fork/test_arb_sepolia_spot.py @@ -181,11 +181,6 @@ def test_spot_async_order( assert settle_tx is not None assert settle_receipt is not None - # check the events - settle_event_data = snx.spot.market_proxy.events.OrderSettled().process_receipt( - settle_receipt - ) - # check balances sold_balance_wei = token.functions.balanceOf(snx.address).call() sold_balance = format_wei(sold_balance_wei, decimals) @@ -197,6 +192,75 @@ def test_spot_async_order( assert sold_synth_balance == wrapped_synth_balance - test_amount assert sold_susd_balance >= wrapped_susd_balance + ## buy it back + # check the allowance + sold_allowance = snx.allowance(susd_token.address, snx.spot.market_proxy.address) + + if sold_allowance < test_amount: + # approve + approve_tx = snx.approve( + susd_token.address, snx.spot.market_proxy.address, submit=True + ) + snx.wait(approve_tx) + + # commit order + commit_buy_tx = snx.spot.commit_order( + "buy", + test_amount - 1, + slippage_tolerance=0.001, + market_id=market_id, + submit=True, + ) + commit_buy_receipt = snx.wait(commit_buy_tx) + + # get the event to check the order id + event_data_buy = snx.spot.market_proxy.events.OrderCommitted().process_receipt( + commit_buy_receipt + ) + assert len(event_data_buy) == 1 + + # unpack the event + event_buy = event_data_buy[0]["args"] + market_id_buy = event_buy["marketId"] + async_order_id_buy = event_buy["asyncOrderId"] + + # settle the order + settle_buy_tx = snx.spot.settle_order( + async_order_id_buy, market_id=market_id_buy, submit=True + ) + settle_buy_receipt = snx.wait(settle_buy_tx) + + assert settle_buy_tx is not None + assert settle_buy_receipt is not None + + # check balances + buy_balance_wei = token.functions.balanceOf(snx.address).call() + buy_balance = format_wei(buy_balance_wei, decimals) + + buy_synth_balance = snx.spot.get_balance(market_id=market_id) + buy_susd_balance = snx.spot.get_balance(market_id=0) + + assert buy_balance == sold_balance + assert buy_synth_balance >= sold_synth_balance + test_amount - 2 + assert buy_susd_balance >= sold_susd_balance - test_amount + + ## unwrap + unwrap_tx = snx.spot.wrap(-test_amount + 1, market_id=market_id, submit=True) + unwrap_receipt = snx.wait(unwrap_tx) + + assert unwrap_tx is not None + assert unwrap_receipt is not None + assert unwrap_receipt.status == 1 + + # get new balances + unwrapped_balance_wei = token.functions.balanceOf(snx.address).call() + unwrapped_balance = format_wei(unwrapped_balance_wei, decimals) + + unwrapped_synth_balance = snx.spot.get_balance(market_id=market_id) + + assert unwrapped_balance == starting_balance - 1 + assert unwrapped_synth_balance == buy_synth_balance - test_amount + 1 + @pytest.mark.parametrize( "token_name, test_amount, decimals", diff --git a/src/tests/e2e/arbitrum-sepolia/test_arb_sepolia_spot.py b/src/tests/e2e/arbitrum-sepolia/test_arb_sepolia_spot.py index 02aa103..651f8e6 100644 --- a/src/tests/e2e/arbitrum-sepolia/test_arb_sepolia_spot.py +++ b/src/tests/e2e/arbitrum-sepolia/test_arb_sepolia_spot.py @@ -23,300 +23,3 @@ def test_spot_markets(snx, logger): assert len(snx.spot.markets_by_name) == len(snx.spot.markets_by_id) assert "sUSD" in snx.spot.markets_by_name assert "sUSDC" in snx.spot.markets_by_name - assert "sDAI" in snx.spot.markets_by_name - - -@pytest.mark.parametrize( - "token_name, test_amount, decimals", - [ - # ("USDC", TEST_AMOUNT, 6), - ("DAI", TEST_AMOUNT, 18), - ], -) -def test_spot_wrapper(snx, contracts, token_name, test_amount, decimals): - """The instance can wrap and unwrap an asset""" - token = contracts[token_name] - market_id = snx.spot.markets_by_name[f"s{token_name}"]["market_id"] - wrapped_token = snx.spot.markets_by_id[market_id]["contract"] - - # make sure we have some USDC - starting_balance_wei = token.functions.balanceOf(snx.address).call() - starting_balance = format_wei(starting_balance_wei, decimals) - - starting_synth_balance = snx.spot.get_balance(market_id=market_id) - - assert starting_balance > test_amount - - ## wrap - # check the allowance - allowance = snx.allowance(token.address, snx.spot.market_proxy.address) - - if allowance < test_amount: - # approve - approve_tx = snx.approve( - token.address, snx.spot.market_proxy.address, submit=True - ) - snx.wait(approve_tx) - - wrap_tx = snx.spot.wrap(test_amount, market_id=market_id, submit=True) - snx.wait(wrap_tx) - - # get new balances - wrapped_balance_wei = token.functions.balanceOf(snx.address).call() - wrapped_balance = format_wei(wrapped_balance_wei, decimals) - - wrapped_synth_balance = snx.spot.get_balance(market_id=market_id) - - assert wrapped_balance == starting_balance - test_amount - assert wrapped_synth_balance == starting_synth_balance + test_amount - - ## unwrap - # check the allowance - wrapped_allowance = snx.allowance( - wrapped_token.address, snx.spot.market_proxy.address - ) - - if wrapped_allowance < test_amount: - # approve - approve_tx = snx.approve( - wrapped_token.address, snx.spot.market_proxy.address, submit=True - ) - snx.wait(approve_tx) - - unwrap_tx = snx.spot.wrap(-test_amount, market_id=market_id, submit=True) - snx.wait(unwrap_tx) - - # get new balances - unwrapped_balance_wei = token.functions.balanceOf(snx.address).call() - unwrapped_balance = format_wei(unwrapped_balance_wei, decimals) - - unwrapped_synth_balance = snx.spot.get_balance(market_id=market_id) - - assert unwrapped_balance == wrapped_balance + test_amount - assert unwrapped_synth_balance == wrapped_synth_balance - test_amount - - -@pytest.mark.parametrize( - "token_name, test_amount, decimals", - [ - # ("USDC", TEST_AMOUNT, 6), - ("DAI", TEST_AMOUNT, 18), - ], -) -@pytest.mark.skip("Async orders are not working") -def test_spot_async_order(snx, contracts, logger, token_name, test_amount, decimals): - """The instance can wrap USDC for sUSDC and commit an async order to sell for sUSD""" - token = contracts[token_name] - market_id = snx.spot.markets_by_name[f"s{token_name}"]["market_id"] - wrapped_token = snx.spot.markets_by_id[market_id]["contract"] - - # make sure we have some USDC - starting_balance_wei = token.functions.balanceOf(snx.address).call() - starting_balance = format_wei(starting_balance_wei, decimals) - - starting_synth_balance = snx.spot.get_balance(market_id=market_id) - - assert starting_balance > test_amount - - ## wrap - # check the allowance - allowance = snx.allowance(token.address, snx.spot.market_proxy.address) - - if allowance < test_amount: - # approve - approve_tx = snx.approve( - token.address, snx.spot.market_proxy.address, submit=True - ) - snx.wait(approve_tx) - - wrap_tx = snx.spot.wrap(test_amount, market_id=market_id, submit=True) - snx.wait(wrap_tx) - - # get new balances - wrapped_balance_wei = token.functions.balanceOf(snx.address).call() - wrapped_balance = format_wei(wrapped_balance_wei, decimals) - - wrapped_synth_balance = snx.spot.get_balance(market_id=market_id) - - assert wrapped_balance == starting_balance - test_amount - assert wrapped_synth_balance == starting_synth_balance + test_amount - - ## sell it - # check the allowance - wrapped_allowance = snx.allowance( - wrapped_token.address, snx.spot.market_proxy.address - ) - - if wrapped_allowance < test_amount: - # approve - approve_tx = snx.approve( - wrapped_token.address, snx.spot.market_proxy.address, submit=True - ) - snx.wait(approve_tx) - - # commit order - commit_tx = snx.spot.commit_order( - "sell", test_amount, market_id=market_id, submit=True - ) - commit_receipt = snx.wait(commit_tx) - - # get the event to check the order id - event_data = snx.spot.market_proxy.events.OrderCommitted().process_receipt( - commit_receipt - ) - assert len(event_data) == 1 - - # unpack the event - event = event_data[0]["args"] - market_id = event["marketId"] - async_order_id = event["asyncOrderId"] - - # settle the order - settle_tx = snx.spot.settle_order(async_order_id, market_id=market_id, submit=True) - snx.logger.info(f"settle_tx: {settle_tx}") - - assert settle_tx is not None - - -@pytest.mark.parametrize( - "token_name, test_amount, decimals", - [ - # ("USDC", TEST_AMOUNT, 6), - ("DAI", TEST_AMOUNT, 18), - ], -) -def test_spot_atomic_order(snx, contracts, logger, token_name, test_amount, decimals): - """The instance can wrap USDC for sUSDC and commit an atomic order to sell for sUSD""" - token = contracts[token_name] - market_id = snx.spot.markets_by_name[f"s{token_name}"]["market_id"] - wrapped_token = snx.spot.markets_by_id[market_id]["contract"] - susd_token = snx.spot.markets_by_id[0]["contract"] - - # make sure we have some USDC - starting_balance_wei = token.functions.balanceOf(snx.address).call() - starting_balance = format_wei(starting_balance_wei, decimals) - - starting_synth_balance = snx.spot.get_balance(market_id=market_id) - starting_susd_balance = snx.spot.get_balance(market_id=0) - - assert starting_balance > test_amount - - ## wrap - # check the allowance - allowance = snx.allowance(token.address, snx.spot.market_proxy.address) - - if allowance < test_amount: - # approve - approve_tx = snx.approve( - token.address, snx.spot.market_proxy.address, submit=True - ) - snx.wait(approve_tx) - - wrap_tx = snx.spot.wrap(test_amount, market_id=market_id, submit=True) - snx.wait(wrap_tx) - - # get new balances - wrapped_balance_wei = token.functions.balanceOf(snx.address).call() - wrapped_balance = format_wei(wrapped_balance_wei, decimals) - - wrapped_synth_balance = snx.spot.get_balance(market_id=market_id) - - assert wrapped_balance == starting_balance - test_amount - assert wrapped_synth_balance == starting_synth_balance + test_amount - - ## sell for sUSD - # check the allowance - wrapped_allowance = snx.allowance( - wrapped_token.address, snx.spot.market_proxy.address - ) - - if wrapped_allowance < test_amount: - # approve - approve_tx = snx.approve( - wrapped_token.address, snx.spot.market_proxy.address, submit=True - ) - snx.wait(approve_tx) - - # atomic swap - swap_tx = snx.spot.atomic_order( - "sell", test_amount, slippage_tolerance=0.001, market_id=market_id, submit=True - ) - swap_receipt = snx.wait(swap_tx) - - assert swap_receipt is not None - assert swap_receipt.status == 1 - - # check balances - swapped_balance_wei = token.functions.balanceOf(snx.address).call() - swapped_balance = format_wei(swapped_balance_wei, decimals) - - swapped_synth_balance = snx.spot.get_balance(market_id=market_id) - swapped_susd_balance = snx.spot.get_balance(market_id=0) - - assert swapped_balance == starting_balance - test_amount - assert swapped_synth_balance == wrapped_synth_balance - test_amount - assert swapped_susd_balance > starting_susd_balance + (test_amount * 0.999) - - ## buy wrapped token back - # check the allowance - susd_allowance = snx.allowance(susd_token.address, snx.spot.market_proxy.address) - - if susd_allowance < test_amount: - # approve - approve_tx = snx.approve( - susd_token.address, snx.spot.market_proxy.address, submit=True - ) - snx.wait(approve_tx) - - # atomic swap - buy_tx = snx.spot.atomic_order( - "buy", - swapped_susd_balance, - slippage_tolerance=0.001, - market_id=market_id, - submit=True, - ) - buy_receipt = snx.wait(buy_tx) - - assert buy_receipt is not None - assert buy_receipt.status == 1 - - # check balances - bought_balance_wei = token.functions.balanceOf(snx.address).call() - bought_balance = format_wei(bought_balance_wei, decimals) - - bought_synth_balance = snx.spot.get_balance(market_id=market_id) - bought_susd_balance = snx.spot.get_balance(market_id=0) - - assert bought_balance == swapped_balance - assert bought_synth_balance >= swapped_synth_balance + test_amount - assert bought_susd_balance == 0 - - ## unwrap - # check the allowance - wrapped_allowance = snx.allowance( - wrapped_token.address, snx.spot.market_proxy.address - ) - - if wrapped_allowance < bought_synth_balance: - # approve - approve_tx = snx.approve( - wrapped_token.address, snx.spot.market_proxy.address, submit=True - ) - snx.wait(approve_tx) - - unwrap_tx = snx.spot.wrap(-test_amount, market_id=market_id, submit=True) - unwrap_receipt = snx.wait(unwrap_tx) - - assert unwrap_tx is not None - assert unwrap_receipt is not None - assert unwrap_receipt.status == 1 - - # get new balances - unwrapped_balance_wei = token.functions.balanceOf(snx.address).call() - unwrapped_balance = format_wei(unwrapped_balance_wei, decimals) - - unwrapped_synth_balance = snx.spot.get_balance(market_id=market_id) - - assert unwrapped_balance == starting_balance - assert unwrapped_synth_balance == bought_synth_balance - test_amount diff --git a/src/tests/e2e/arbitrum-sepolia/test_arb_sepolia_synthetix.py b/src/tests/e2e/arbitrum-sepolia/test_arb_sepolia_synthetix.py index d148113..2512175 100644 --- a/src/tests/e2e/arbitrum-sepolia/test_arb_sepolia_synthetix.py +++ b/src/tests/e2e/arbitrum-sepolia/test_arb_sepolia_synthetix.py @@ -9,7 +9,6 @@ def test_snx(snx): def test_contracts(contracts): """The instance has necessary contracts""" assert contracts["WETH"] is not None - assert contracts["DAI"] is not None assert contracts["USDC"] is not None assert contracts["ARB"] is not None