From b114c6259160879a9742497f801ea7107aff4a9e Mon Sep 17 00:00:00 2001 From: Howard Date: Thu, 8 Aug 2024 14:10:10 -0700 Subject: [PATCH] Fix serde for Validator struct (#10) --- LitContracts/ABIs/ArbitrumKeyDeriver.abi | 346 +++++ LitContracts/ABIs/BackupRecovery.abi | 120 ++ LitContracts/ABIs/ContractResolver.abi | 45 +- LitContracts/ABIs/DevKeyDeriver.abi | 53 - LitContracts/ABIs/DomainWalletOracle.abi | 730 ---------- LitContracts/ABIs/DomainWalletRegistry.abi | 892 ++++++++---- LitContracts/ABIs/IHDKeyDeriver.abi | 21 + LitContracts/ABIs/LITToken.abi | 12 +- LitContracts/ABIs/Ledger.abi | 843 +++++++++++ LitContracts/ABIs/PKPNFTMetadata.abi | 243 ---- LitContracts/ABIs/PaymentDelegation.abi | 606 ++++++++ LitContracts/ABIs/PriceFeed.abi | 758 ++++++++++ LitContracts/ABIs/PubkeyRouter.abi | 13 + LitContracts/ABIs/Staking.abi | 1288 +++++++++++------ LitContracts/ABIs/StakingBalances.abi | 23 + .../Staking/ContractDefinition/Validator.cs | 2 + 16 files changed, 4198 insertions(+), 1797 deletions(-) create mode 100644 LitContracts/ABIs/ArbitrumKeyDeriver.abi delete mode 100644 LitContracts/ABIs/DevKeyDeriver.abi delete mode 100644 LitContracts/ABIs/DomainWalletOracle.abi create mode 100644 LitContracts/ABIs/IHDKeyDeriver.abi create mode 100644 LitContracts/ABIs/Ledger.abi create mode 100644 LitContracts/ABIs/PaymentDelegation.abi create mode 100644 LitContracts/ABIs/PriceFeed.abi diff --git a/LitContracts/ABIs/ArbitrumKeyDeriver.abi b/LitContracts/ABIs/ArbitrumKeyDeriver.abi new file mode 100644 index 0000000..5618706 --- /dev/null +++ b/LitContracts/ABIs/ArbitrumKeyDeriver.abi @@ -0,0 +1,346 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_resolver", + "type": "address" + }, + { + "internalType": "enum ContractResolver.Env", + "name": "_env", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "HD_KDF_K256", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "HD_KDF_P256", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "derivedKeyId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "keyType", + "type": "uint256" + } + ], + "internalType": "struct IPubkeyRouter.RootKey[]", + "name": "rootHDKeys", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "keyType", + "type": "uint256" + } + ], + "name": "computeHDPubKey", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "contractResolver", + "outputs": [ + { + "internalType": "contract ContractResolver", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "env", + "outputs": [ + { + "internalType": "enum ContractResolver.Env", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractResolverAddress", + "type": "address" + } + ], + "name": "setContractResolver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/LitContracts/ABIs/BackupRecovery.abi b/LitContracts/ABIs/BackupRecovery.abi index d6d9653..5eb9152 100644 --- a/LitContracts/ABIs/BackupRecovery.abi +++ b/LitContracts/ABIs/BackupRecovery.abi @@ -525,6 +525,19 @@ "name": "BackupPartyRegistered", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newResolverAddress", + "type": "address" + } + ], + "name": "ContractResolverAddressSet", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -979,6 +992,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "newResolverAddress", + "type": "address" + } + ], + "name": "setContractResolver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "setMemberForDkg", @@ -991,5 +1017,99 @@ ], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [], + "name": "CURRENT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "clearNodeRecoveryStatus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getNodeRecoveryStatus", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "node_address", + "type": "address" + }, + { + "internalType": "enum LibBackupRecoveryStorage.NodeRecoveryStatus", + "name": "status", + "type": "uint8" + } + ], + "internalType": "struct LibBackupRecoveryStorage.NodeRecoveryStatusMap[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum LibBackupRecoveryStorage.NodeRecoveryStatus", + "name": "status", + "type": "uint8" + } + ], + "name": "setNodeRecoveryStatus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "bls12381G1EncKey", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "secp256K1EcdsaPubKey", + "type": "bytes" + }, + { + "internalType": "address[]", + "name": "partyMembers", + "type": "address[]" + } + ], + "name": "setBackupPartyState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getNonSubmitingBackupMembersInNextState", + "outputs": [ + { + "internalType": "address[]", + "name": "missingRecoveryMembers", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" } ] diff --git a/LitContracts/ABIs/ContractResolver.abi b/LitContracts/ABIs/ContractResolver.abi index 367e2f0..0c18d20 100644 --- a/LitContracts/ABIs/ContractResolver.abi +++ b/LitContracts/ABIs/ContractResolver.abi @@ -195,7 +195,7 @@ }, { "inputs": [], - "name": "DOMAIN_WALLET_ORACLE", + "name": "DOMAIN_WALLET_REGISTRY", "outputs": [ { "internalType": "bytes32", @@ -208,7 +208,7 @@ }, { "inputs": [], - "name": "DOMAIN_WALLET_REGISTRY", + "name": "HD_KEY_DERIVER_CONTRACT", "outputs": [ { "internalType": "bytes32", @@ -221,7 +221,7 @@ }, { "inputs": [], - "name": "HD_KEY_DERIVER_CONTRACT", + "name": "LEDGER_CONTRACT", "outputs": [ { "internalType": "bytes32", @@ -258,6 +258,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "PAYMENT_DELEGATION_CONTRACT", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "PKP_HELPER_CONTRACT", @@ -271,6 +284,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "PKP_HELPER_V2_CONTRACT", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "PKP_NFT_CONTRACT", @@ -310,6 +336,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "PRICE_FEED_CONTRACT", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "PUB_KEY_ROUTER_CONTRACT", diff --git a/LitContracts/ABIs/DevKeyDeriver.abi b/LitContracts/ABIs/DevKeyDeriver.abi deleted file mode 100644 index 5d9ee47..0000000 --- a/LitContracts/ABIs/DevKeyDeriver.abi +++ /dev/null @@ -1,53 +0,0 @@ -[ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "derivedKeyId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "pubkey", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "keyType", - "type": "uint256" - } - ], - "internalType": "struct IPubkeyRouter.RootKey[]", - "name": "rootHDKeys", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "keyType", - "type": "uint256" - } - ], - "name": "computeHDPubKey", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - } -] diff --git a/LitContracts/ABIs/DomainWalletOracle.abi b/LitContracts/ABIs/DomainWalletOracle.abi deleted file mode 100644 index a66e9fb..0000000 --- a/LitContracts/ABIs/DomainWalletOracle.abi +++ /dev/null @@ -1,730 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "_contractResolver", - "type": "address" - }, - { - "internalType": "enum ContractResolver.Env", - "name": "_env", - "type": "uint8" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "uri", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - } - ], - "name": "DomainAlreadyRegistered", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "registryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "NonRegistryCaller", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "subDomain", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ttl", - "type": "uint256" - } - ], - "name": "Expired", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "id", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "subDomain", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ttl", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Registered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "subDomain", - "type": "bytes" - } - ], - "name": "Removed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "subDomain", - "type": "bytes" - } - ], - "name": "Revoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "addAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "uri", - "type": "bytes" - } - ], - "name": "checkRegistration", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "contractResolver", - "outputs": [ - { - "internalType": "contract ContractResolver", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "env", - "outputs": [ - { - "internalType": "enum ContractResolver.Env", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - } - ], - "name": "getDomainIdByTokenId", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "uri", - "type": "bytes" - } - ], - "name": "getDomainTokenIdByUri", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - } - ], - "name": "getDomainUri", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - } - ], - "name": "getExpiration", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "id", - "type": "uint64" - } - ], - "name": "getPkpTokenId", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - } - ], - "name": "getRecord", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - } - ], - "name": "hasExpired", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - } - ], - "name": "hasOwner", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - } - ], - "name": "isOwner", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - } - ], - "name": "isRouted", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "userId", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "uri", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ttl", - "type": "uint256" - } - ], - "name": "registerDomain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "id", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - } - ], - "name": "registerPKP", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "adminBeingRemoved", - "type": "address" - } - ], - "name": "removeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - } - ], - "name": "removeDomain", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - } - ], - "name": "revokeDomain", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "record", - "type": "bytes" - } - ], - "name": "updateDomainRecord", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/LitContracts/ABIs/DomainWalletRegistry.abi b/LitContracts/ABIs/DomainWalletRegistry.abi index d84e5ef..50f240a 100644 --- a/LitContracts/ABIs/DomainWalletRegistry.abi +++ b/LitContracts/ABIs/DomainWalletRegistry.abi @@ -1,19 +1,8 @@ [ { - "inputs": [ - { - "internalType": "address", - "name": "_resolver", - "type": "address" - }, - { - "internalType": "enum ContractResolver.Env", - "name": "_env", - "type": "uint8" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" + "inputs": [], + "name": "CallerNotOwner", + "type": "error" }, { "inputs": [ @@ -34,187 +23,215 @@ { "inputs": [ { - "internalType": "address", - "name": "adminAddress", - "type": "address" + "internalType": "uint256", + "name": "length", + "type": "uint256" }, { - "internalType": "address", - "name": "account", - "type": "address" + "internalType": "bytes", + "name": "uri", + "type": "bytes" } ], - "name": "NonAdminCaller", + "name": "MaximumCharacterLimitExceeded", "type": "error" }, { "anonymous": false, "inputs": [ { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" + "indexed": false, + "internalType": "bytes", + "name": "subDomain", + "type": "bytes" }, { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" }, { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" + "indexed": false, + "internalType": "uint256", + "name": "ttl", + "type": "uint256" } ], - "name": "RoleAdminChanged", + "name": "Expired", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" + "indexed": false, + "internalType": "uint64", + "name": "id", + "type": "uint64" }, { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" + "indexed": false, + "internalType": "bytes", + "name": "subDomain", + "type": "bytes" }, { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" + "indexed": false, + "internalType": "uint256", + "name": "ttl", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" } ], - "name": "RoleGranted", + "name": "Registered", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" }, { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" + "indexed": false, + "internalType": "bytes", + "name": "subDomain", + "type": "bytes" } ], - "name": "RoleRevoked", + "name": "Removed", "type": "event" }, { - "inputs": [], - "name": "ADMIN_ROLE", - "outputs": [ + "anonymous": false, + "inputs": [ { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, { - "internalType": "bytes32", - "name": "", - "type": "bytes32" + "indexed": false, + "internalType": "bytes", + "name": "subDomain", + "type": "bytes" } ], - "stateMutability": "view", - "type": "function" + "name": "Revoked", + "type": "event" }, { "inputs": [ { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "addAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "contractResolver", - "outputs": [ - { - "internalType": "contract ContractResolver", - "name": "", - "type": "address" + "internalType": "uint256", + "name": "pkpTokenId", + "type": "uint256" } ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "env", + "name": "hasExpired", "outputs": [ { - "internalType": "enum ContractResolver.Env", + "internalType": "bool", "name": "", - "type": "uint8" + "type": "bool" } ], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ + { + "internalType": "bytes", + "name": "userId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "uri", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "ttl", + "type": "uint256" + }, { "internalType": "uint256", "name": "pkpTokenId", "type": "uint256" + }, + { + "internalType": "string[]", + "name": "nftMetadata", + "type": "string[]" } ], - "name": "getDomainIdByTokenId", + "name": "registerDomain", "outputs": [ { - "internalType": "uint64", + "internalType": "uint256", "name": "", - "type": "uint64" + "type": "uint256" } ], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ + { + "internalType": "bytes", + "name": "userId", + "type": "bytes" + }, { "internalType": "bytes", "name": "uri", "type": "bytes" + }, + { + "internalType": "uint256", + "name": "ttl", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "permittedAuthMethodTypes", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "permittedAuthMethodIds", + "type": "bytes[]" + }, + { + "internalType": "bytes[]", + "name": "permittedAuthMethodPubkeys", + "type": "bytes[]" + }, + { + "internalType": "uint256[][]", + "name": "permittedAuthMethodScopes", + "type": "uint256[][]" + }, + { + "internalType": "string[]", + "name": "nftMetadata", + "type": "string[]" } ], - "name": "getDomainTokenIdByUri", + "name": "registerDomainAndMintNext", "outputs": [ { "internalType": "uint256", @@ -222,26 +239,31 @@ "type": "uint256" } ], - "stateMutability": "view", + "stateMutability": "payable", "type": "function" }, { "inputs": [ + { + "internalType": "uint64", + "name": "id", + "type": "uint64" + }, { "internalType": "uint256", "name": "pkpTokenId", "type": "uint256" } ], - "name": "getDomainUri", + "name": "registerPKP", "outputs": [ { - "internalType": "bytes", + "internalType": "bool", "name": "", - "type": "bytes" + "type": "bool" } ], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { @@ -252,69 +274,50 @@ "type": "uint256" } ], - "name": "getExpiration", + "name": "removeDomain", "outputs": [ { - "internalType": "uint256", + "internalType": "bool", "name": "", - "type": "uint256" + "type": "bool" } ], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { - "internalType": "uint64", - "name": "id", - "type": "uint64" - } - ], - "name": "getPkpTokenId", - "outputs": [ { "internalType": "uint256", - "name": "", + "name": "pkpTokenId", "type": "uint256" } ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", + "name": "revokeDomain", "outputs": [ { - "internalType": "bytes32", + "internalType": "bool", "name": "", - "type": "bytes32" + "type": "bool" } ], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" + "internalType": "uint256", + "name": "pkpTokenId", + "type": "uint256" }, { - "internalType": "address", - "name": "account", - "type": "address" + "internalType": "string[]", + "name": "nftMetadata", + "type": "string[]" } ], - "name": "grantRole", + "name": "setPKPMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -325,9 +328,14 @@ "internalType": "uint256", "name": "pkpTokenId", "type": "uint256" + }, + { + "internalType": "bytes", + "name": "record", + "type": "bytes" } ], - "name": "hasExpired", + "name": "updateDomainRecord", "outputs": [ { "internalType": "bool", @@ -340,42 +348,41 @@ }, { "inputs": [ + { + "internalType": "bytes", + "name": "uri", + "type": "bytes" + }, { "internalType": "uint256", "name": "pkpTokenId", "type": "uint256" } ], - "name": "hasOwner", - "outputs": [ + "name": "DomainAlreadyRegistered", + "type": "error" + }, + { + "inputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "internalType": "bytes", + "name": "uri", + "type": "bytes" } ], + "name": "checkRegistration", + "outputs": [], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", + "inputs": [], + "name": "getDomainCharacterLimit", "outputs": [ { - "internalType": "bool", + "internalType": "uint256", "name": "", - "type": "bool" + "type": "uint256" } ], "stateMutability": "view", @@ -389,12 +396,12 @@ "type": "uint256" } ], - "name": "isOwner", + "name": "getDomainIdByTokenId", "outputs": [ { - "internalType": "bool", + "internalType": "uint64", "name": "", - "type": "bool" + "type": "uint64" } ], "stateMutability": "view", @@ -403,17 +410,17 @@ { "inputs": [ { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" + "internalType": "bytes", + "name": "uri", + "type": "bytes" } ], - "name": "isRouted", + "name": "getDomainTokenIdByUri", "outputs": [ { - "internalType": "bool", + "internalType": "uint256", "name": "", - "type": "bool" + "type": "uint256" } ], "stateMutability": "view", @@ -422,32 +429,44 @@ { "inputs": [ { - "internalType": "bytes", - "name": "userId", - "type": "bytes" - }, + "internalType": "uint256", + "name": "pkpTokenId", + "type": "uint256" + } + ], + "name": "getDomainUri", + "outputs": [ { "internalType": "bytes", - "name": "uri", + "name": "", "type": "bytes" - }, + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDomainWalletRegistryAddress", + "outputs": [ { - "internalType": "uint256", - "name": "ttl", - "type": "uint256" - }, + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ { "internalType": "uint256", "name": "pkpTokenId", "type": "uint256" - }, - { - "internalType": "string[]", - "name": "nftMetadata", - "type": "string[]" } ], - "name": "registerDomain", + "name": "getExpiration", "outputs": [ { "internalType": "uint256", @@ -455,77 +474,69 @@ "type": "uint256" } ], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "inputs": [ + "inputs": [], + "name": "getPkpHelperAddress", + "outputs": [ { - "internalType": "bytes", - "name": "userId", - "type": "bytes" - }, + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ { - "internalType": "bytes", - "name": "uri", - "type": "bytes" - }, + "internalType": "uint64", + "name": "id", + "type": "uint64" + } + ], + "name": "getPkpTokenId", + "outputs": [ { "internalType": "uint256", - "name": "ttl", + "name": "", "type": "uint256" - }, - { - "internalType": "uint256[]", - "name": "permittedAuthMethodTypes", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "permittedAuthMethodIds", - "type": "bytes[]" - }, - { - "internalType": "bytes[]", - "name": "permittedAuthMethodPubkeys", - "type": "bytes[]" - }, - { - "internalType": "uint256[][]", - "name": "permittedAuthMethodScopes", - "type": "uint256[][]" - }, + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ { - "internalType": "string[]", - "name": "nftMetadata", - "type": "string[]" + "internalType": "uint256", + "name": "pkpTokenId", + "type": "uint256" } ], - "name": "registerDomainAndMintNext", + "name": "getRecord", "outputs": [ { - "internalType": "uint256", + "internalType": "bytes", "name": "", - "type": "uint256" + "type": "bytes" } ], - "stateMutability": "payable", + "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "uint64", - "name": "id", - "type": "uint64" - }, { "internalType": "uint256", "name": "pkpTokenId", "type": "uint256" } ], - "name": "registerPKP", + "name": "hasOwner", "outputs": [ { "internalType": "bool", @@ -533,20 +544,26 @@ "type": "bool" } ], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "inputs": [ { - "internalType": "address", - "name": "adminBeingRemoved", - "type": "address" + "internalType": "uint256", + "name": "pkpTokenId", + "type": "uint256" } ], - "name": "removeAdmin", - "outputs": [], - "stateMutability": "nonpayable", + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", "type": "function" }, { @@ -557,7 +574,7 @@ "type": "uint256" } ], - "name": "removeDomain", + "name": "isRouted", "outputs": [ { "internalType": "bool", @@ -565,78 +582,256 @@ "type": "bool" } ], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "inputs": [ { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotAddFunctionToDiamondThatAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4[]", + "name": "_selectors", + "type": "bytes4[]" + } + ], + "name": "CannotAddSelectorsToZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotRemoveFunctionThatDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotRemoveImmutableFunction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceFunctionThatDoesNotExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4[]", + "name": "_selectors", + "type": "bytes4[]" + } + ], + "name": "CannotReplaceFunctionsFromFacetWithZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceImmutableFunction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "_action", + "type": "uint8" + } + ], + "name": "IncorrectFacetCutAction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_initializationContractAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "InitializationFunctionReverted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_contractAddress", + "type": "address" }, + { + "internalType": "string", + "name": "_message", + "type": "string" + } + ], + "name": "NoBytecodeAtAddress", + "type": "error" + }, + { + "inputs": [ { "internalType": "address", - "name": "account", + "name": "_facetAddress", "type": "address" } ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "NoSelectorsProvidedForFacetForCut", + "type": "error" }, { "inputs": [ { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" + "internalType": "address", + "name": "_user", + "type": "address" + }, + { + "internalType": "address", + "name": "_contractOwner", + "type": "address" } ], - "name": "revokeDomain", - "outputs": [ + "name": "NotContractOwner", + "type": "error" + }, + { + "inputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "internalType": "address", + "name": "_facetAddress", + "type": "address" } ], - "stateMutability": "nonpayable", - "type": "function" + "name": "RemoveFacetAddressMustBeZeroAddress", + "type": "error" }, { + "anonymous": false, "inputs": [ { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamond.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "indexed": false, + "internalType": "struct IDiamond.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" }, { + "indexed": false, "internalType": "address", - "name": "account", + "name": "_init", "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" } ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "DiamondCut", + "type": "event" }, { "inputs": [ { - "internalType": "uint256", - "name": "pkpTokenId", - "type": "uint256" + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamond.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamond.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" }, { - "internalType": "string[]", - "name": "nftMetadata", - "type": "string[]" + "internalType": "address", + "name": "_init", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" } ], - "name": "setPKPMetadata", + "name": "diamondCut", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -645,7 +840,83 @@ "inputs": [ { "internalType": "bytes4", - "name": "interfaceId", + "name": "_functionSelector", + "type": "bytes4" + } + ], + "name": "facetAddress", + "outputs": [ + { + "internalType": "address", + "name": "facetAddress_", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facetAddresses", + "outputs": [ + { + "internalType": "address[]", + "name": "facetAddresses_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facet", + "type": "address" + } + ], + "name": "facetFunctionSelectors", + "outputs": [ + { + "internalType": "bytes4[]", + "name": "_facetFunctionSelectors", + "type": "bytes4[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamondLoupe.Facet[]", + "name": "facets_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_interfaceId", "type": "bytes4" } ], @@ -659,5 +930,50 @@ ], "stateMutability": "view", "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "owner_", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } ] diff --git a/LitContracts/ABIs/IHDKeyDeriver.abi b/LitContracts/ABIs/IHDKeyDeriver.abi new file mode 100644 index 0000000..0ef8c16 --- /dev/null +++ b/LitContracts/ABIs/IHDKeyDeriver.abi @@ -0,0 +1,21 @@ +[ + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "hdKeyDerive", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/LitContracts/ABIs/LITToken.abi b/LitContracts/ABIs/LITToken.abi index ce23d8b..44dedd1 100644 --- a/LitContracts/ABIs/LITToken.abi +++ b/LitContracts/ABIs/LITToken.abi @@ -430,9 +430,9 @@ "type": "address" }, { - "internalType": "uint32", + "internalType": "uint128", "name": "pos", - "type": "uint32" + "type": "uint128" } ], "name": "checkpoints", @@ -440,9 +440,9 @@ { "components": [ { - "internalType": "uint32", + "internalType": "uint128", "name": "fromBlock", - "type": "uint32" + "type": "uint128" }, { "internalType": "uint224", @@ -829,9 +829,9 @@ "name": "numCheckpoints", "outputs": [ { - "internalType": "uint32", + "internalType": "uint128", "name": "", - "type": "uint32" + "type": "uint128" } ], "stateMutability": "view", diff --git a/LitContracts/ABIs/Ledger.abi b/LitContracts/ABIs/Ledger.abi new file mode 100644 index 0000000..a4b5662 --- /dev/null +++ b/LitContracts/ABIs/Ledger.abi @@ -0,0 +1,843 @@ +[ + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotAddFunctionToDiamondThatAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4[]", + "name": "_selectors", + "type": "bytes4[]" + } + ], + "name": "CannotAddSelectorsToZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotRemoveFunctionThatDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotRemoveImmutableFunction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceFunctionThatDoesNotExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4[]", + "name": "_selectors", + "type": "bytes4[]" + } + ], + "name": "CannotReplaceFunctionsFromFacetWithZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceImmutableFunction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "_action", + "type": "uint8" + } + ], + "name": "IncorrectFacetCutAction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_initializationContractAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "InitializationFunctionReverted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_contractAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "_message", + "type": "string" + } + ], + "name": "NoBytecodeAtAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facetAddress", + "type": "address" + } + ], + "name": "NoSelectorsProvidedForFacetForCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_user", + "type": "address" + }, + { + "internalType": "address", + "name": "_contractOwner", + "type": "address" + } + ], + "name": "NotContractOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facetAddress", + "type": "address" + } + ], + "name": "RemoveFacetAddressMustBeZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamond.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "indexed": false, + "internalType": "struct IDiamond.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + }, + { + "indexed": false, + "internalType": "address", + "name": "_init", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "DiamondCut", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamond.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamond.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "_init", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "diamondCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_functionSelector", + "type": "bytes4" + } + ], + "name": "facetAddress", + "outputs": [ + { + "internalType": "address", + "name": "facetAddress_", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facetAddresses", + "outputs": [ + { + "internalType": "address[]", + "name": "facetAddresses_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facet", + "type": "address" + } + ], + "name": "facetFunctionSelectors", + "outputs": [ + { + "internalType": "bytes4[]", + "name": "_facetFunctionSelectors", + "type": "bytes4[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamondLoupe.Facet[]", + "name": "facets_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "owner_", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "AmountMustBePositive", + "type": "error" + }, + { + "inputs": [], + "name": "ArrayLengthsMustMatch", + "type": "error" + }, + { + "inputs": [], + "name": "CallerNotOwner", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientFunds", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientWithdrawAmount", + "type": "error" + }, + { + "inputs": [], + "name": "MustBeNonzero", + "type": "error" + }, + { + "inputs": [], + "name": "NodeNotStakingNode", + "type": "error" + }, + { + "inputs": [], + "name": "SessionAlreadyUsed", + "type": "error" + }, + { + "inputs": [], + "name": "ValueExceedsUint128MaxLimit", + "type": "error" + }, + { + "inputs": [], + "name": "WithdrawalDelayNotPassed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "RewardWithdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "delay", + "type": "uint256" + } + ], + "name": "RewardWithdrawDelaySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "RewardWithdrawRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "int256", + "name": "amount", + "type": "int256" + } + ], + "name": "UserCharged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "delay", + "type": "uint256" + } + ], + "name": "UserWithdrawDelaySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "int256", + "name": "amount", + "type": "int256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "int256", + "name": "amount", + "type": "int256" + } + ], + "name": "WithdrawRequest", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "balance", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "int256", + "name": "amount", + "type": "int256" + } + ], + "name": "chargeUser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "users", + "type": "address[]" + }, + { + "internalType": "int256[]", + "name": "amounts", + "type": "int256[]" + } + ], + "name": "chargeUsers", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "getStakingAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "latestRewardWithdrawRequest", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct LibLedgerStorage.WithdrawRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "latestWithdrawRequest", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct LibLedgerStorage.WithdrawRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "requestRewardWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "amount", + "type": "int256" + } + ], + "name": "requestWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "rewardBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardWithdrawDelay", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "delay", + "type": "uint256" + } + ], + "name": "setRewardWithdrawDelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "delay", + "type": "uint256" + } + ], + "name": "setUserWithdrawDelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "userWithdrawDelay", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "amount", + "type": "int256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdrawRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/LitContracts/ABIs/PKPNFTMetadata.abi b/LitContracts/ABIs/PKPNFTMetadata.abi index 5f51e8e..0592fd9 100644 --- a/LitContracts/ABIs/PKPNFTMetadata.abi +++ b/LitContracts/ABIs/PKPNFTMetadata.abi @@ -15,120 +15,6 @@ "stateMutability": "nonpayable", "type": "constructor" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "WRITER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -174,67 +60,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -261,55 +86,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pkpHelperWriterAddress", - "type": "address" - } - ], - "name": "setPKPHelperWriterAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -346,25 +122,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { diff --git a/LitContracts/ABIs/PaymentDelegation.abi b/LitContracts/ABIs/PaymentDelegation.abi new file mode 100644 index 0000000..6aa317e --- /dev/null +++ b/LitContracts/ABIs/PaymentDelegation.abi @@ -0,0 +1,606 @@ +[ + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotAddFunctionToDiamondThatAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4[]", + "name": "_selectors", + "type": "bytes4[]" + } + ], + "name": "CannotAddSelectorsToZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotRemoveFunctionThatDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotRemoveImmutableFunction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceFunctionThatDoesNotExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4[]", + "name": "_selectors", + "type": "bytes4[]" + } + ], + "name": "CannotReplaceFunctionsFromFacetWithZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceImmutableFunction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "_action", + "type": "uint8" + } + ], + "name": "IncorrectFacetCutAction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_initializationContractAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "InitializationFunctionReverted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_contractAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "_message", + "type": "string" + } + ], + "name": "NoBytecodeAtAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facetAddress", + "type": "address" + } + ], + "name": "NoSelectorsProvidedForFacetForCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_user", + "type": "address" + }, + { + "internalType": "address", + "name": "_contractOwner", + "type": "address" + } + ], + "name": "NotContractOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facetAddress", + "type": "address" + } + ], + "name": "RemoveFacetAddressMustBeZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamond.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "indexed": false, + "internalType": "struct IDiamond.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + }, + { + "indexed": false, + "internalType": "address", + "name": "_init", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "DiamondCut", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamond.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamond.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "_init", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "diamondCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_functionSelector", + "type": "bytes4" + } + ], + "name": "facetAddress", + "outputs": [ + { + "internalType": "address", + "name": "facetAddress_", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facetAddresses", + "outputs": [ + { + "internalType": "address[]", + "name": "facetAddresses_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facet", + "type": "address" + } + ], + "name": "facetFunctionSelectors", + "outputs": [ + { + "internalType": "bytes4[]", + "name": "_facetFunctionSelectors", + "type": "bytes4[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamondLoupe.Facet[]", + "name": "facets_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "owner_", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "requestsPerPeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "periodSeconds", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct LibPaymentDelegationStorage.Restriction", + "name": "restriction", + "type": "tuple" + } + ], + "name": "RestrictionSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "delegatePayments", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "users", + "type": "address[]" + } + ], + "name": "delegatePaymentsBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getPayers", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "users", + "type": "address[]" + } + ], + "name": "getPayersAndRestrictions", + "outputs": [ + { + "internalType": "address[][]", + "name": "", + "type": "address[][]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "requestsPerPeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "periodSeconds", + "type": "uint256" + } + ], + "internalType": "struct LibPaymentDelegationStorage.Restriction[][]", + "name": "", + "type": "tuple[][]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + } + ], + "name": "getRestriction", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "requestsPerPeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "periodSeconds", + "type": "uint256" + } + ], + "internalType": "struct LibPaymentDelegationStorage.Restriction", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + } + ], + "name": "getUsers", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "requestsPerPeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "periodSeconds", + "type": "uint256" + } + ], + "internalType": "struct LibPaymentDelegationStorage.Restriction", + "name": "r", + "type": "tuple" + } + ], + "name": "setRestriction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "undelegatePayments", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "users", + "type": "address[]" + } + ], + "name": "undelegatePaymentsBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/LitContracts/ABIs/PriceFeed.abi b/LitContracts/ABIs/PriceFeed.abi new file mode 100644 index 0000000..fbf3077 --- /dev/null +++ b/LitContracts/ABIs/PriceFeed.abi @@ -0,0 +1,758 @@ +[ + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotAddFunctionToDiamondThatAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4[]", + "name": "_selectors", + "type": "bytes4[]" + } + ], + "name": "CannotAddSelectorsToZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotRemoveFunctionThatDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotRemoveImmutableFunction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceFunctionThatDoesNotExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4[]", + "name": "_selectors", + "type": "bytes4[]" + } + ], + "name": "CannotReplaceFunctionsFromFacetWithZeroAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "CannotReplaceImmutableFunction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "_action", + "type": "uint8" + } + ], + "name": "IncorrectFacetCutAction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_initializationContractAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "InitializationFunctionReverted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_contractAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "_message", + "type": "string" + } + ], + "name": "NoBytecodeAtAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facetAddress", + "type": "address" + } + ], + "name": "NoSelectorsProvidedForFacetForCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_user", + "type": "address" + }, + { + "internalType": "address", + "name": "_contractOwner", + "type": "address" + } + ], + "name": "NotContractOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facetAddress", + "type": "address" + } + ], + "name": "RemoveFacetAddressMustBeZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamond.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "indexed": false, + "internalType": "struct IDiamond.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + }, + { + "indexed": false, + "internalType": "address", + "name": "_init", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "DiamondCut", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamond.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamond.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "_init", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "diamondCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_functionSelector", + "type": "bytes4" + } + ], + "name": "facetAddress", + "outputs": [ + { + "internalType": "address", + "name": "facetAddress_", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facetAddresses", + "outputs": [ + { + "internalType": "address[]", + "name": "facetAddresses_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facet", + "type": "address" + } + ], + "name": "facetFunctionSelectors", + "outputs": [ + { + "internalType": "bytes4[]", + "name": "_facetFunctionSelectors", + "type": "bytes4[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamondLoupe.Facet[]", + "name": "facets_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "owner_", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "CallerNotOwner", + "type": "error" + }, + { + "inputs": [], + "name": "MustBeLessThan100", + "type": "error" + }, + { + "inputs": [], + "name": "MustBeNonzero", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newPrice", + "type": "uint256" + } + ], + "name": "BaseNetworkPriceSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newPrice", + "type": "uint256" + } + ], + "name": "MaxNetworkPriceSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "stakingAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "usagePercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "newPrices", + "type": "uint256[]" + } + ], + "name": "UsageSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "productIds", + "type": "uint256[]" + } + ], + "name": "baseNetworkPrices", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "productIds", + "type": "uint256[]" + } + ], + "name": "getNodesForRequest", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "components": [ + { + "components": [ + { + "internalType": "uint128", + "name": "ip", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "ipv6", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "port", + "type": "uint128" + }, + { + "internalType": "address", + "name": "nodeAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "senderPubKey", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "receiverPubKey", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastActiveEpoch", + "type": "uint256" + } + ], + "internalType": "struct LibStakingStorage.Validator", + "name": "validator", + "type": "tuple" + }, + { + "internalType": "uint256[]", + "name": "prices", + "type": "uint256[]" + } + ], + "internalType": "struct LibPriceFeedStorage.NodeInfoAndPrices[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getStakingAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "productIds", + "type": "uint256[]" + } + ], + "name": "maxNetworkPrices", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "node", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "productIds", + "type": "uint256[]" + } + ], + "name": "price", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "stakerAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "productId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "internalType": "struct LibPriceFeedStorage.NodePriceData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "productId", + "type": "uint256" + } + ], + "name": "prices", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "stakerAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "productId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "internalType": "struct LibPriceFeedStorage.NodePriceData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newPrice", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "productIds", + "type": "uint256[]" + } + ], + "name": "setBaseNetworkPrices", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newPrice", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "productIds", + "type": "uint256[]" + } + ], + "name": "setMaxNetworkPrices", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "usagePercent", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "productIds", + "type": "uint256[]" + } + ], + "name": "setUsage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "usagePercent", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "productIds", + "type": "uint256[]" + } + ], + "name": "usagePercentToPrices", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/LitContracts/ABIs/PubkeyRouter.abi b/LitContracts/ABIs/PubkeyRouter.abi index ba114fd..de8c858 100644 --- a/LitContracts/ABIs/PubkeyRouter.abi +++ b/LitContracts/ABIs/PubkeyRouter.abi @@ -476,6 +476,19 @@ "name": "RootKeySet", "type": "event" }, + { + "inputs": [ + { + "internalType": "address", + "name": "stakingContract", + "type": "address" + } + ], + "name": "adminResetRootKeys", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { diff --git a/LitContracts/ABIs/Staking.abi b/LitContracts/ABIs/Staking.abi index b943fb8..924c8c6 100644 --- a/LitContracts/ABIs/Staking.abi +++ b/LitContracts/ABIs/Staking.abi @@ -392,12 +392,517 @@ }, { "inputs": [], - "name": "ActiveValidatorsCannotLeave", + "name": "CallerNotOwner", "type": "error" }, + { + "inputs": [ + { + "internalType": "enum LibStakingStorage.States", + "name": "state", + "type": "uint8" + } + ], + "name": "MustBeInActiveOrUnlockedOrPausedState", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum LibStakingStorage.States", + "name": "state", + "type": "uint8" + } + ], + "name": "MustBeInNextValidatorSetLockedOrReadyForNextEpochState", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "reason", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "tolerance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "intervalSecs", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "kickPenaltyPercent", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct LibStakingStorage.ComplaintConfig", + "name": "config", + "type": "tuple" + } + ], + "name": "ComplaintConfigSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newTokenRewardPerTokenPerEpoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "newKeyTypes", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMinimumValidatorCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxConcurrentRequests", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxTripleCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMinTripleCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newPeerCheckingIntervalSecs", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxTripleConcurrency", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newRpcHealthcheckEnabled", + "type": "bool" + } + ], + "name": "ConfigSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newEpochEndTime", + "type": "uint256" + } + ], + "name": "EpochEndTimeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newEpochLength", + "type": "uint256" + } + ], + "name": "EpochLengthSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newEpochTimeout", + "type": "uint256" + } + ], + "name": "EpochTimeoutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "reason", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newKickPenaltyPercent", + "type": "uint256" + } + ], + "name": "KickPenaltyPercentSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newResolverContractAddress", + "type": "address" + } + ], + "name": "ResolverContractAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newStakingTokenAddress", + "type": "address" + } + ], + "name": "StakingTokenSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum LibStakingStorage.States", + "name": "newState", + "type": "uint8" + } + ], + "name": "StateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountBurned", + "type": "uint256" + } + ], + "name": "ValidatorKickedFromNextEpoch", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "staker", + "type": "address" + } + ], + "name": "ValidatorRejoinedNextEpoch", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "validatorStakerAddress", + "type": "address" + } + ], + "name": "adminKickValidatorInNextEpoch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + } + ], + "name": "adminRejoinValidator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "adminResetEpoch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "validatorStakerAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountToPenalize", + "type": "uint256" + } + ], + "name": "adminSlashValidator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "adminStakeForValidator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "reason", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "tolerance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "intervalSecs", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "kickPenaltyPercent", + "type": "uint256" + } + ], + "internalType": "struct LibStakingStorage.ComplaintConfig", + "name": "config", + "type": "tuple" + } + ], + "name": "setComplaintConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenRewardPerTokenPerEpoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "DEPRECATED_complaintTolerance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "DEPRECATED_complaintIntervalSecs", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "keyTypes", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "minimumValidatorCount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxConcurrentRequests", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTripleCount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTripleCount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "peerCheckingIntervalSecs", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTripleConcurrency", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "rpcHealthcheckEnabled", + "type": "bool" + } + ], + "internalType": "struct LibStakingStorage.Config", + "name": "newConfig", + "type": "tuple" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newResolverAddress", + "type": "address" + } + ], + "name": "setContractResolver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newEpochEndTime", + "type": "uint256" + } + ], + "name": "setEpochEndTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newEpochLength", + "type": "uint256" + } + ], + "name": "setEpochLength", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum LibStakingStorage.States", + "name": "newState", + "type": "uint8" + } + ], + "name": "setEpochState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newEpochTimeout", + "type": "uint256" + } + ], + "name": "setEpochTimeout", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "reason", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newKickPenaltyPercent", + "type": "uint256" + } + ], + "name": "setKickPenaltyPercent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], - "name": "CallerNotOwner", + "name": "ActiveValidatorsCannotLeave", "type": "error" }, { @@ -464,17 +969,6 @@ "name": "CouldNotMapNodeAddressToStakerAddress", "type": "error" }, - { - "inputs": [ - { - "internalType": "enum LibStakingStorage.States", - "name": "state", - "type": "uint8" - } - ], - "name": "MustBeInActiveOrUnlockedOrPausedState", - "type": "error" - }, { "inputs": [ { @@ -628,269 +1122,51 @@ "type": "address" } ], - "name": "StakerNotPermitted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "yourBalance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requestedWithdrawlAmount", - "type": "uint256" - } - ], - "name": "TryingToWithdrawMoreThanStaked", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "internalType": "address[]", - "name": "validatorsInNextEpoch", - "type": "address[]" - } - ], - "name": "ValidatorIsNotInNextEpoch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "newTokenRewardPerTokenPerEpoch", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newComplaintTolerance", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newComplaintIntervalSecs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "newKeyTypes", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newMinimumValidatorCount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newMaxConcurrentRequests", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newMaxTripleCount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newMinTripleCount", - "type": "uint256" - } - ], - "name": "ConfigSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "newEpochEndTime", - "type": "uint256" - } - ], - "name": "EpochEndTimeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "newEpochLength", - "type": "uint256" - } - ], - "name": "EpochLengthSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "newEpochTimeout", - "type": "uint256" - } - ], - "name": "EpochTimeoutSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "reason", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newKickPenaltyPercent", - "type": "uint256" - } - ], - "name": "KickPenaltyPercentSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "epochNumber", - "type": "uint256" - } - ], - "name": "ReadyForNextEpoch", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Recovered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "staker", - "type": "address" - } - ], - "name": "RequestToJoin", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "staker", - "type": "address" - } - ], - "name": "RequestToLeave", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newResolverContractAddress", - "type": "address" - } - ], - "name": "ResolverContractAddressSet", - "type": "event" + "name": "StakerNotPermitted", + "type": "error" }, { - "anonymous": false, "inputs": [ { - "indexed": false, "internalType": "uint256", - "name": "newDuration", + "name": "yourBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requestedWithdrawlAmount", "type": "uint256" } ], - "name": "RewardsDurationUpdated", - "type": "event" + "name": "TryingToWithdrawMoreThanStaked", + "type": "error" }, { - "anonymous": false, "inputs": [ { - "indexed": false, "internalType": "address", - "name": "newStakingTokenAddress", + "name": "validator", "type": "address" + }, + { + "internalType": "address[]", + "name": "validatorsInNextEpoch", + "type": "address[]" } ], - "name": "StakingTokenSet", - "type": "event" + "name": "ValidatorIsNotInNextEpoch", + "type": "error" }, { - "anonymous": false, "inputs": [ { - "indexed": false, - "internalType": "enum LibStakingStorage.States", - "name": "newState", - "type": "uint8" + "internalType": "string", + "name": "valueName", + "type": "string" } ], - "name": "StateChanged", - "type": "event" + "name": "ValueMustBeNonzero", + "type": "error" }, { "anonymous": false, @@ -904,11 +1180,11 @@ { "indexed": false, "internalType": "uint256", - "name": "amountBurned", + "name": "epochNumber", "type": "uint256" } ], - "name": "ValidatorKickedFromNextEpoch", + "name": "ReadyForNextEpoch", "type": "event" }, { @@ -917,293 +1193,136 @@ { "indexed": false, "internalType": "address", - "name": "staker", - "type": "address" - } - ], - "name": "ValidatorRejoinedNextEpoch", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "reporter", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "validatorStakerAddress", + "name": "token", "type": "address" }, { - "indexed": true, + "indexed": false, "internalType": "uint256", - "name": "reason", + "name": "amount", "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" } ], - "name": "VotedToKickValidatorInNextEpoch", + "name": "Recovered", "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "validatorStakerAddress", + "name": "staker", "type": "address" } ], - "name": "adminKickValidatorInNextEpoch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "RequestToJoin", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", "name": "staker", "type": "address" } ], - "name": "adminRejoinValidator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "RequestToLeave", + "type": "event" }, { + "anonymous": false, "inputs": [ { - "internalType": "address", - "name": "validatorStakerAddress", - "type": "address" - }, - { + "indexed": false, "internalType": "uint256", - "name": "amountToPenalize", + "name": "newDuration", "type": "uint256" } ], - "name": "adminSlashValidator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "advanceEpoch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "exit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getReward", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "RewardsDurationUpdated", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, + "internalType": "address", + "name": "reporter", + "type": "address" + }, + { + "indexed": true, "internalType": "address", "name": "validatorStakerAddress", "type": "address" }, { + "indexed": true, "internalType": "uint256", "name": "reason", "type": "uint256" }, { + "indexed": false, "internalType": "bytes", "name": "data", "type": "bytes" } ], - "name": "kickValidatorInNextEpoch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "VotedToKickValidatorInNextEpoch", + "type": "event" }, { "inputs": [], - "name": "lockValidatorsForNextEpoch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "ip", - "type": "uint32" - }, - { - "internalType": "uint128", - "name": "ipv6", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "port", - "type": "uint32" - }, - { - "internalType": "address", - "name": "nodeAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "senderPubKey", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "receiverPubKey", - "type": "uint256" - } - ], - "name": "requestToJoin", + "name": "advanceEpoch", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], - "name": "requestToLeave", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newTokenRewardPerTokenPerEpoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "newComplaintTolerance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "newComplaintIntervalSecs", - "type": "uint256" - }, - { - "internalType": "uint256[]", - "name": "newKeyTypes", - "type": "uint256[]" - }, - { - "internalType": "uint256", - "name": "newMinimumValidatorCount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "newMaxConcurrentRequests", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "newMaxTripleCount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "newMinTripleCount", - "type": "uint256" - } - ], - "name": "setConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newResolverAddress", - "type": "address" - } - ], - "name": "setContractResolver", + "name": "exit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "newEpochEndTime", - "type": "uint256" - } - ], - "name": "setEpochEndTime", + "inputs": [], + "name": "getReward", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ + { + "internalType": "address", + "name": "validatorStakerAddress", + "type": "address" + }, { "internalType": "uint256", - "name": "newEpochLength", + "name": "reason", "type": "uint256" - } - ], - "name": "setEpochLength", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ + }, { - "internalType": "enum LibStakingStorage.States", - "name": "newState", - "type": "uint8" + "internalType": "bytes", + "name": "data", + "type": "bytes" } ], - "name": "setEpochState", + "name": "kickValidatorInNextEpoch", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "newEpochTimeout", - "type": "uint256" - } - ], - "name": "setEpochTimeout", + "inputs": [], + "name": "lockValidatorsForNextEpoch", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1241,25 +1360,59 @@ "type": "uint256" } ], - "name": "setIpPortNodeAddressAndCommunicationPubKeys", + "name": "requestToJoin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "requestToLeave", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "requestToLeaveAsNode", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ + { + "internalType": "uint32", + "name": "ip", + "type": "uint32" + }, + { + "internalType": "uint128", + "name": "ipv6", + "type": "uint128" + }, + { + "internalType": "uint32", + "name": "port", + "type": "uint32" + }, + { + "internalType": "address", + "name": "nodeAddress", + "type": "address" + }, { "internalType": "uint256", - "name": "reason", + "name": "senderPubKey", "type": "uint256" }, { "internalType": "uint256", - "name": "newKickPenaltyPercent", + "name": "receiverPubKey", "type": "uint256" } ], - "name": "setKickPenaltyPercent", + "name": "setIpPortNodeAddressAndCommunicationPubKeys", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1333,13 +1486,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "unlockValidatorsForNextEpoch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -1353,6 +1499,42 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "major", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "patch", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct LibStakingStorage.Version", + "name": "version", + "type": "tuple" + } + ], + "name": "VersionRequirementsUpdated", + "type": "event" + }, { "inputs": [ { @@ -1535,6 +1717,42 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "reason", + "type": "uint256" + } + ], + "name": "complaintConfig", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tolerance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "intervalSecs", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "kickPenaltyPercent", + "type": "uint256" + } + ], + "internalType": "struct LibStakingStorage.ComplaintConfig", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "config", @@ -1548,12 +1766,12 @@ }, { "internalType": "uint256", - "name": "complaintTolerance", + "name": "DEPRECATED_complaintTolerance", "type": "uint256" }, { "internalType": "uint256", - "name": "complaintIntervalSecs", + "name": "DEPRECATED_complaintIntervalSecs", "type": "uint256" }, { @@ -1580,6 +1798,21 @@ "internalType": "uint256", "name": "minTripleCount", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "peerCheckingIntervalSecs", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTripleConcurrency", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "rpcHealthcheckEnabled", + "type": "bool" } ], "internalType": "struct LibStakingStorage.Config", @@ -1682,6 +1915,74 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "getActiveUnkickedValidatorStructs", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "ip", + "type": "uint32" + }, + { + "internalType": "uint128", + "name": "ipv6", + "type": "uint128" + }, + { + "internalType": "uint32", + "name": "port", + "type": "uint32" + }, + { + "internalType": "address", + "name": "nodeAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "senderPubKey", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "receiverPubKey", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastActiveEpoch", + "type": "uint256" + } + ], + "internalType": "struct LibStakingStorage.Validator[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getActiveUnkickedValidators", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getKeyTypes", @@ -1850,6 +2151,11 @@ "internalType": "uint256", "name": "receiverPubKey", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastActiveEpoch", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Validator[]", @@ -1900,6 +2206,11 @@ "internalType": "uint256", "name": "receiverPubKey", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastActiveEpoch", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Validator[]", @@ -1950,6 +2261,11 @@ "internalType": "uint256", "name": "receiverPubKey", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastActiveEpoch", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Validator[]", @@ -2045,6 +2361,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isRecentValidator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -2193,6 +2528,11 @@ "internalType": "uint256", "name": "receiverPubKey", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastActiveEpoch", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Validator", @@ -2203,4 +2543,4 @@ "stateMutability": "view", "type": "function" } -] +] \ No newline at end of file diff --git a/LitContracts/ABIs/StakingBalances.abi b/LitContracts/ABIs/StakingBalances.abi index e091f21..25ba9e1 100644 --- a/LitContracts/ABIs/StakingBalances.abi +++ b/LitContracts/ABIs/StakingBalances.abi @@ -1143,6 +1143,29 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "stakeForValidator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "totalStaked", diff --git a/LitContracts/Staking/ContractDefinition/Validator.cs b/LitContracts/Staking/ContractDefinition/Validator.cs index 1520482..4a86f37 100644 --- a/LitContracts/Staking/ContractDefinition/Validator.cs +++ b/LitContracts/Staking/ContractDefinition/Validator.cs @@ -25,5 +25,7 @@ public class ValidatorBase public virtual BigInteger SenderPubKey { get; set; } [Parameter("uint256", "receiverPubKey", 7)] public virtual BigInteger ReceiverPubKey { get; set; } + [Parameter("uint256", "lastActiveEpoch", 8)] + public virtual BigInteger LastActiveEpoch { get; set; } } }