diff --git a/.changeset/salty-hands-laugh.md b/.changeset/salty-hands-laugh.md new file mode 100644 index 000000000..d5bb299ed --- /dev/null +++ b/.changeset/salty-hands-laugh.md @@ -0,0 +1,10 @@ +--- +'@lit-protocol/contracts': patch +'@lit-protocol/e2e': patch +'@lit-protocol/auth': patch +'@lit-protocol/auth-services': patch +'@lit-protocol/lit-client': patch +'@lit-protocol/networks': patch +--- + +update naga-test contract addresses. Users are expected to update and reinstall the SDK to continue using naga-test. diff --git a/.github/workflows/e2e-naga.yml b/.github/workflows/e2e-naga.yml index 1bc3e69b6..231fa7e70 100644 --- a/.github/workflows/e2e-naga.yml +++ b/.github/workflows/e2e-naga.yml @@ -56,9 +56,9 @@ jobs: # - environment: naga-staging # network: naga-staging # privateKey: LIVE_MASTER_ACCOUNT_NAGA_STAGING - # - environment: naga-test - # network: naga-test - # privateKey: LIVE_MASTER_ACCOUNT_NAGA_TEST + - environment: naga-test + network: naga-test + privateKey: LIVE_MASTER_ACCOUNT_NAGA_TEST env: LOG_LEVEL: debug2 LIVE_MASTER_ACCOUNT: ${{ secrets[matrix.privateKey] }} diff --git a/README.md b/README.md index 721fa441f..d73f77775 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,31 @@ LOCAL_MASTER_ACCOUNT=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf NETWORK= pnpm run test:e2e all ``` +### Target a specific spec + +Use `test:target` when you only need to exercise one file: + +```bash +pnpm run test:target packages/e2e/src/tickets/delegation.spec.ts +``` + +Append additional Jest flags after the path if you need finer filtering. + +## QA Starter Kit workflow + +When you need to validate SDK integrations against backend or node features, lean on the [QA Starter Kit](https://github.com/LIT-Protocol/QA-kit). That repo installs published packages, so it mirrors how downstream teams will consume the SDK. + +1. The node team opens a feature branch for their service. +2. Create a matching SDK branch and build the integration for that node change. +3. Publish a snapshot (prerelease) of the SDK packages so the QA Starter Kit can install them from npm. +4. Point the QA Starter Kit to that snapshot to perform the e2e flow before promoting the release. + +This keeps QA aligned with the packages that will actually ship and avoids the drift that comes with local linking. + # Running it against a local network +Generate a fresh `networkContext.json` for local nodes with `pnpm run gen:local-network-context` before running the e2e tests against the `naga-local` local network. + ## Required Environment Variables ```bash @@ -132,6 +155,18 @@ This command must be run manually and is NOT part of the build process, as it re DEV_BRANCH=develop GH_API_KEY=github_pat_xxx pnpm run sync:contracts ``` +## Keeping the docs changelog in sync with the public site + +Use the `sync:docs-changelog` script to refresh the changelog that powers [naga.developer.litprotocol.com/changelog](https://naga.developer.litprotocol.com/changelog). + +```shell +pnpm run sync:docs-changelog +``` + +> Note: we currently run this manually after the Changeset PR lands in the `naga` main branch, though we expect to automate it in CI in the future. + +The script collates the latest entries from `packages/*/CHANGELOG.md` and rewrites the target `changelog.mdx`. Commit and publish the regenerated file in the docs repo so the public changelog stays current. + --- # Legacy Documentation for V7 and Earlier diff --git a/package.json b/package.json index ccf847d99..cc4c59d6e 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "lint": "npx nx run-many --target=lint --all", "lint:fix": "npx nx run-many --target=lint --all -- --fix", "format:check": "npx nx format:check --all", - "test:e2e": "npx jest --clearCache --config ./jest.e2e.config.ts && LOG_LEVEL=${LOG_LEVEL:-silent} dotenvx run --env-file=.env -- jest --runInBand --detectOpenHandles --forceExit --config ./jest.e2e.config.ts --testTimeout=50000000 -t", - "test:custom": "npx jest --clearCache --config ./jest.e2e.config.ts && LOG_LEVEL=${LOG_LEVEL:-silent} dotenvx run --env-file=.env -- jest --runInBand --detectOpenHandles --forceExit --config ./jest.e2e.config.ts --testTimeout=50000000", + "test:e2e": "npx jest --clearCache --config ./jest.e2e.config.ts && LOG_LEVEL=${LOG_LEVEL:-silent} dotenvx run --env-file=.env -- jest --runInBand --detectOpenHandles --forceExit --config ./jest.e2e.config.ts --testTimeout=50000000 --runTestsByPath packages/e2e/src/e2e.spec.ts", + "test:target": "npx jest --clearCache --config ./jest.e2e.config.ts && LOG_LEVEL=${LOG_LEVEL:-silent} dotenvx run --env-file=.env -- jest --runInBand --detectOpenHandles --forceExit --config ./jest.e2e.config.ts --testTimeout=50000000", "test:e2e:ci": "npx jest --clearCache --config ./jest.e2e.config.ts && LOG_LEVEL=${LOG_LEVEL:-silent} npx jest --runInBand --detectOpenHandles --forceExit --config ./jest.e2e.config.ts --testTimeout=50000000 --runTestsByPath", "test:health": "LOG_LEVEL=${LOG_LEVEL:-silent} dotenvx run --env-file=.env -- tsx packages/e2e/src/health/index.ts", "ci:health": "LOG_LEVEL=${LOG_LEVEL:-silent} tsx packages/e2e/src/health/index.ts" diff --git a/packages/contracts/dist/prod/naga-test.cjs b/packages/contracts/dist/prod/naga-test.cjs index d32061bbc..4ce75ad67 100644 --- a/packages/contracts/dist/prod/naga-test.cjs +++ b/packages/contracts/dist/prod/naga-test.cjs @@ -7,8 +7,8 @@ module.exports = { "contracts": [ { "network": "naga-test", - "address_hash": "0x28C626d92c5061AdeeDF59d483304b8d35613212", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x9f3cE810695180C5f693a7cD2a0203A381fd57E1", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -716,6 +716,11 @@ module.exports = { "name": "CannotModifyUnfrozen", "type": "error" }, + { + "inputs": [], + "name": "CannotMoveToLockedValidatorStateBeforeEpochEnds", + "type": "error" + }, { "inputs": [], "name": "CannotStakeZero", @@ -1433,6 +1438,11 @@ module.exports = { "internalType": "uint256", "name": "minThresholdToClampAt", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voteToAdvanceTimeOut", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.GlobalConfig", @@ -2633,6 +2643,132 @@ module.exports = { "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "string", + "name": "identifier", + "type": "string" + } + ], + "name": "getKeySet", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "minimumThreshold", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "monetaryValue", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "completeIsolation", + "type": "bool" + }, + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "realms", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "curves", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "counts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "recoveryPartyMembers", + "type": "address[]" + } + ], + "internalType": "struct LibStakingStorage.KeySetConfig", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "keySets", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "minimumThreshold", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "monetaryValue", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "completeIsolation", + "type": "bool" + }, + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "realms", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "curves", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "counts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "recoveryPartyMembers", + "type": "address[]" + } + ], + "internalType": "struct LibStakingStorage.KeySetConfig[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -2693,6 +2829,47 @@ module.exports = { "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "keyType", + "type": "uint256" + } + ], + "internalType": "struct IPubkeyRouter.RootKey[]", + "name": "newRootKeys", + "type": "tuple[]" + } + ], + "name": "verifyKeySetCounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "ActiveValidatorsCannotLeave", @@ -3309,6 +3486,19 @@ module.exports = { "name": "StakingTokenSet", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "realmId", + "type": "uint256" + } + ], + "name": "VoteToAdvanceTimeOutElapsed", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -3373,25 +3563,6 @@ module.exports = { "stateMutability": "pure", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "attestedAddress", - "type": "address" - } - ], - "name": "getAttestedPubKey", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -4094,6 +4265,11 @@ module.exports = { "internalType": "uint256", "name": "startTime", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastAdvanceVoteTime", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Epoch", @@ -4285,6 +4461,11 @@ module.exports = { "internalType": "uint256", "name": "startTime", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastAdvanceVoteTime", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Epoch", @@ -4442,6 +4623,25 @@ module.exports = { "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "attestedAddress", + "type": "address" + } + ], + "name": "getAttestedPubKey", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -4490,72 +4690,6 @@ module.exports = { "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "string", - "name": "identifier", - "type": "string" - } - ], - "name": "getKeySet", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "minimumThreshold", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "monetaryValue", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "completeIsolation", - "type": "bool" - }, - { - "internalType": "string", - "name": "identifier", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "realms", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "curves", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "counts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "recoveryPartyMembers", - "type": "address[]" - } - ], - "internalType": "struct LibStakingStorage.KeySetConfig", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "getKeyTypes", @@ -5962,6 +6096,11 @@ module.exports = { "internalType": "uint256", "name": "minThresholdToClampAt", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voteToAdvanceTimeOut", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.GlobalConfig", @@ -6142,73 +6281,13 @@ module.exports = { "name": "validator", "type": "address" } - ], - "name": "isValidatorBanned", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "keySets", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "minimumThreshold", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "monetaryValue", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "completeIsolation", - "type": "bool" - }, - { - "internalType": "string", - "name": "identifier", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "realms", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "curves", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "counts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "recoveryPartyMembers", - "type": "address[]" - } - ], - "internalType": "struct LibStakingStorage.KeySetConfig[]", + ], + "name": "isValidatorBanned", + "outputs": [ + { + "internalType": "bool", "name": "", - "type": "tuple[]" + "type": "bool" } ], "stateMutability": "view", @@ -6784,47 +6863,6 @@ module.exports = { ], "stateMutability": "view", "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "identifier", - "type": "string" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "pubkey", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "keyType", - "type": "uint256" - } - ], - "internalType": "struct IPubkeyRouter.RootKey[]", - "name": "newRootKeys", - "type": "tuple[]" - } - ], - "name": "verifyKeySetCounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" } ] } @@ -6835,8 +6873,8 @@ module.exports = { "contracts": [ { "network": "naga-test", - "address_hash": "0x729D481064fBFfB6E58C915A19eB77BDcc1f4d13", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x077eFcaBFF62391b6fd438034fb21E2484C5B9FF", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "anonymous": false, @@ -6974,7 +7012,7 @@ module.exports = { { "network": "naga-test", "address_hash": "0x5E8db2E7af793f4095c4843C8cBD87C5D8604838", - "inserted_at": "2025-09-21T14:02:13Z", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -8027,8 +8065,8 @@ module.exports = { "contracts": [ { "network": "naga-test", - "address_hash": "0xcBF65D0d3a3Dc3a1E7BcAC4ef34128a52F51E600", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x054Ddcfef7E9434413ad62A6F37946Bf6B6CFc1A", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -8781,6 +8819,78 @@ module.exports = { "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "ethAddresses", + "type": "address[]" + } + ], + "name": "getPkpInfoFromEthAddresses", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "name": "getPkpInfoFromTokenIds", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getPkpNftAddress", @@ -9089,8 +9199,8 @@ module.exports = { "contracts": [ { "network": "naga-test", - "address_hash": "0xAf49B3Dd17F0D251E7E0ED510b22B7624c6878CA", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xaf4Dddb07Cdde48042e93eb5bf266b49950bC5BD", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -9835,6 +9945,170 @@ module.exports = { "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "ethAddresses", + "type": "address[]" + } + ], + "name": "getPkpInfoFromEthAddresses", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageIndex", + "type": "uint256" + } + ], + "name": "getPkpInfoFromOwnerAddress", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageIndex", + "type": "uint256" + } + ], + "name": "getPkpInfoFromOwnerTokenId", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "name": "getPkpInfoFromTokenIds", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getPkpNftMetadataAddress", @@ -10353,8 +10627,8 @@ module.exports = { "contracts": [ { "network": "naga-test", - "address_hash": "0x3229379bA31Bb916F73842409cdB909De9c8cD33", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x13428A18C0b181344F97ceaC5596F31a9d182e5c", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -11368,8 +11642,8 @@ module.exports = { "contracts": [ { "network": "naga-test", - "address_hash": "0x093A9046766A67cC4b207fC782A53785267B9E45", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x7255737630fCFb4914cF51552123eEe9abEc6120", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -12703,8 +12977,8 @@ module.exports = { "contracts": [ { "network": "naga-test", - "address_hash": "0x288204FB05F904BD28bB474Af51618271698943E", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xE77d6EBD151c02e05a4d9645f816F68f55730733", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -12867,8 +13141,8 @@ module.exports = { "contracts": [ { "network": "naga-test", - "address_hash": "0xa9D639c6Bb52BD3B30EB46a9B5E5f2eE90977888", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x934d3190ff3A92eB1Cfb6CbD3617629322897969", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [], @@ -13104,8 +13378,8 @@ module.exports = { "contracts": [ { "network": "naga-test", - "address_hash": "0x1E383465eC19650D6a02a32105D4b0508B8712b0", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xd1E59c174BcF85012c54086AB600Dd0aB032e88B", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -13740,8 +14014,8 @@ module.exports = { "contracts": [ { "network": "naga-test", - "address_hash": "0x9197a98E6E127B0540A73da4F06f548FbF66f75F", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xbA0aEB6Bbf58F1B74E896416A20DB5be51C991f2", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -14796,8 +15070,8 @@ module.exports = { "contracts": [ { "network": "naga-test", - "address_hash": "0xD6228351719509393be4d0D97C293407Beadf56f", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x556955025dD0981Bac684fbDEcE14cDa897d0837", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -15195,11 +15469,6 @@ module.exports = { "name": "CallerNotOwner", "type": "error" }, - { - "inputs": [], - "name": "MustBeLessThan100", - "type": "error" - }, { "inputs": [], "name": "MustBeNonzero", diff --git a/packages/contracts/dist/prod/naga-test.js b/packages/contracts/dist/prod/naga-test.js index 3056aa7b4..480b5809c 100644 --- a/packages/contracts/dist/prod/naga-test.js +++ b/packages/contracts/dist/prod/naga-test.js @@ -5,8 +5,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x28C626d92c5061AdeeDF59d483304b8d35613212", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x9f3cE810695180C5f693a7cD2a0203A381fd57E1", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -714,6 +714,11 @@ export const nagaTest = { "name": "CannotModifyUnfrozen", "type": "error" }, + { + "inputs": [], + "name": "CannotMoveToLockedValidatorStateBeforeEpochEnds", + "type": "error" + }, { "inputs": [], "name": "CannotStakeZero", @@ -1431,6 +1436,11 @@ export const nagaTest = { "internalType": "uint256", "name": "minThresholdToClampAt", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voteToAdvanceTimeOut", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.GlobalConfig", @@ -2631,6 +2641,132 @@ export const nagaTest = { "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "string", + "name": "identifier", + "type": "string" + } + ], + "name": "getKeySet", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "minimumThreshold", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "monetaryValue", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "completeIsolation", + "type": "bool" + }, + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "realms", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "curves", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "counts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "recoveryPartyMembers", + "type": "address[]" + } + ], + "internalType": "struct LibStakingStorage.KeySetConfig", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "keySets", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "minimumThreshold", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "monetaryValue", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "completeIsolation", + "type": "bool" + }, + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "realms", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "curves", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "counts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "recoveryPartyMembers", + "type": "address[]" + } + ], + "internalType": "struct LibStakingStorage.KeySetConfig[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -2691,6 +2827,47 @@ export const nagaTest = { "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "keyType", + "type": "uint256" + } + ], + "internalType": "struct IPubkeyRouter.RootKey[]", + "name": "newRootKeys", + "type": "tuple[]" + } + ], + "name": "verifyKeySetCounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "ActiveValidatorsCannotLeave", @@ -3307,6 +3484,19 @@ export const nagaTest = { "name": "StakingTokenSet", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "realmId", + "type": "uint256" + } + ], + "name": "VoteToAdvanceTimeOutElapsed", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -3371,25 +3561,6 @@ export const nagaTest = { "stateMutability": "pure", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "attestedAddress", - "type": "address" - } - ], - "name": "getAttestedPubKey", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -4092,6 +4263,11 @@ export const nagaTest = { "internalType": "uint256", "name": "startTime", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastAdvanceVoteTime", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Epoch", @@ -4283,6 +4459,11 @@ export const nagaTest = { "internalType": "uint256", "name": "startTime", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastAdvanceVoteTime", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Epoch", @@ -4440,6 +4621,25 @@ export const nagaTest = { "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "attestedAddress", + "type": "address" + } + ], + "name": "getAttestedPubKey", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -4488,72 +4688,6 @@ export const nagaTest = { "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "string", - "name": "identifier", - "type": "string" - } - ], - "name": "getKeySet", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "minimumThreshold", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "monetaryValue", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "completeIsolation", - "type": "bool" - }, - { - "internalType": "string", - "name": "identifier", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "realms", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "curves", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "counts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "recoveryPartyMembers", - "type": "address[]" - } - ], - "internalType": "struct LibStakingStorage.KeySetConfig", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "getKeyTypes", @@ -5960,6 +6094,11 @@ export const nagaTest = { "internalType": "uint256", "name": "minThresholdToClampAt", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voteToAdvanceTimeOut", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.GlobalConfig", @@ -6140,73 +6279,13 @@ export const nagaTest = { "name": "validator", "type": "address" } - ], - "name": "isValidatorBanned", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "keySets", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "minimumThreshold", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "monetaryValue", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "completeIsolation", - "type": "bool" - }, - { - "internalType": "string", - "name": "identifier", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "realms", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "curves", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "counts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "recoveryPartyMembers", - "type": "address[]" - } - ], - "internalType": "struct LibStakingStorage.KeySetConfig[]", + ], + "name": "isValidatorBanned", + "outputs": [ + { + "internalType": "bool", "name": "", - "type": "tuple[]" + "type": "bool" } ], "stateMutability": "view", @@ -6782,47 +6861,6 @@ export const nagaTest = { ], "stateMutability": "view", "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "identifier", - "type": "string" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "pubkey", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "keyType", - "type": "uint256" - } - ], - "internalType": "struct IPubkeyRouter.RootKey[]", - "name": "newRootKeys", - "type": "tuple[]" - } - ], - "name": "verifyKeySetCounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" } ] } @@ -6833,8 +6871,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x729D481064fBFfB6E58C915A19eB77BDcc1f4d13", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x077eFcaBFF62391b6fd438034fb21E2484C5B9FF", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "anonymous": false, @@ -6972,7 +7010,7 @@ export const nagaTest = { { "network": "naga-test", "address_hash": "0x5E8db2E7af793f4095c4843C8cBD87C5D8604838", - "inserted_at": "2025-09-21T14:02:13Z", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -8025,8 +8063,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0xcBF65D0d3a3Dc3a1E7BcAC4ef34128a52F51E600", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x054Ddcfef7E9434413ad62A6F37946Bf6B6CFc1A", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -8779,6 +8817,78 @@ export const nagaTest = { "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "ethAddresses", + "type": "address[]" + } + ], + "name": "getPkpInfoFromEthAddresses", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "name": "getPkpInfoFromTokenIds", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getPkpNftAddress", @@ -9087,8 +9197,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0xAf49B3Dd17F0D251E7E0ED510b22B7624c6878CA", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xaf4Dddb07Cdde48042e93eb5bf266b49950bC5BD", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -9833,6 +9943,170 @@ export const nagaTest = { "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "ethAddresses", + "type": "address[]" + } + ], + "name": "getPkpInfoFromEthAddresses", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageIndex", + "type": "uint256" + } + ], + "name": "getPkpInfoFromOwnerAddress", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageIndex", + "type": "uint256" + } + ], + "name": "getPkpInfoFromOwnerTokenId", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "name": "getPkpInfoFromTokenIds", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getPkpNftMetadataAddress", @@ -10351,8 +10625,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x3229379bA31Bb916F73842409cdB909De9c8cD33", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x13428A18C0b181344F97ceaC5596F31a9d182e5c", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -11366,8 +11640,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x093A9046766A67cC4b207fC782A53785267B9E45", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x7255737630fCFb4914cF51552123eEe9abEc6120", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -12701,8 +12975,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x288204FB05F904BD28bB474Af51618271698943E", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xE77d6EBD151c02e05a4d9645f816F68f55730733", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -12865,8 +13139,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0xa9D639c6Bb52BD3B30EB46a9B5E5f2eE90977888", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x934d3190ff3A92eB1Cfb6CbD3617629322897969", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [], @@ -13102,8 +13376,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x1E383465eC19650D6a02a32105D4b0508B8712b0", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xd1E59c174BcF85012c54086AB600Dd0aB032e88B", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -13738,8 +14012,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x9197a98E6E127B0540A73da4F06f548FbF66f75F", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xbA0aEB6Bbf58F1B74E896416A20DB5be51C991f2", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -14794,8 +15068,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0xD6228351719509393be4d0D97C293407Beadf56f", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x556955025dD0981Bac684fbDEcE14cDa897d0837", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -15193,11 +15467,6 @@ export const nagaTest = { "name": "CallerNotOwner", "type": "error" }, - { - "inputs": [], - "name": "MustBeLessThan100", - "type": "error" - }, { "inputs": [], "name": "MustBeNonzero", diff --git a/packages/contracts/dist/prod/naga-test.json b/packages/contracts/dist/prod/naga-test.json index 10e1c056b..8fa469811 100644 --- a/packages/contracts/dist/prod/naga-test.json +++ b/packages/contracts/dist/prod/naga-test.json @@ -5,8 +5,8 @@ "contracts": [ { "network": "naga-test", - "address_hash": "0x28C626d92c5061AdeeDF59d483304b8d35613212", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x9f3cE810695180C5f693a7cD2a0203A381fd57E1", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -714,6 +714,11 @@ "name": "CannotModifyUnfrozen", "type": "error" }, + { + "inputs": [], + "name": "CannotMoveToLockedValidatorStateBeforeEpochEnds", + "type": "error" + }, { "inputs": [], "name": "CannotStakeZero", @@ -1431,6 +1436,11 @@ "internalType": "uint256", "name": "minThresholdToClampAt", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voteToAdvanceTimeOut", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.GlobalConfig", @@ -2631,6 +2641,132 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "string", + "name": "identifier", + "type": "string" + } + ], + "name": "getKeySet", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "minimumThreshold", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "monetaryValue", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "completeIsolation", + "type": "bool" + }, + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "realms", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "curves", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "counts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "recoveryPartyMembers", + "type": "address[]" + } + ], + "internalType": "struct LibStakingStorage.KeySetConfig", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "keySets", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "minimumThreshold", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "monetaryValue", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "completeIsolation", + "type": "bool" + }, + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "realms", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "curves", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "counts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "recoveryPartyMembers", + "type": "address[]" + } + ], + "internalType": "struct LibStakingStorage.KeySetConfig[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -2691,6 +2827,47 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "keyType", + "type": "uint256" + } + ], + "internalType": "struct IPubkeyRouter.RootKey[]", + "name": "newRootKeys", + "type": "tuple[]" + } + ], + "name": "verifyKeySetCounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "ActiveValidatorsCannotLeave", @@ -3307,6 +3484,19 @@ "name": "StakingTokenSet", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "realmId", + "type": "uint256" + } + ], + "name": "VoteToAdvanceTimeOutElapsed", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -3371,25 +3561,6 @@ "stateMutability": "pure", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "attestedAddress", - "type": "address" - } - ], - "name": "getAttestedPubKey", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -4092,6 +4263,11 @@ "internalType": "uint256", "name": "startTime", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastAdvanceVoteTime", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Epoch", @@ -4283,6 +4459,11 @@ "internalType": "uint256", "name": "startTime", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastAdvanceVoteTime", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Epoch", @@ -4440,6 +4621,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "attestedAddress", + "type": "address" + } + ], + "name": "getAttestedPubKey", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -4488,72 +4688,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "string", - "name": "identifier", - "type": "string" - } - ], - "name": "getKeySet", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "minimumThreshold", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "monetaryValue", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "completeIsolation", - "type": "bool" - }, - { - "internalType": "string", - "name": "identifier", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "realms", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "curves", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "counts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "recoveryPartyMembers", - "type": "address[]" - } - ], - "internalType": "struct LibStakingStorage.KeySetConfig", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "getKeyTypes", @@ -5960,6 +6094,11 @@ "internalType": "uint256", "name": "minThresholdToClampAt", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voteToAdvanceTimeOut", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.GlobalConfig", @@ -6140,73 +6279,13 @@ "name": "validator", "type": "address" } - ], - "name": "isValidatorBanned", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "keySets", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "minimumThreshold", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "monetaryValue", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "completeIsolation", - "type": "bool" - }, - { - "internalType": "string", - "name": "identifier", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "realms", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "curves", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "counts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "recoveryPartyMembers", - "type": "address[]" - } - ], - "internalType": "struct LibStakingStorage.KeySetConfig[]", + ], + "name": "isValidatorBanned", + "outputs": [ + { + "internalType": "bool", "name": "", - "type": "tuple[]" + "type": "bool" } ], "stateMutability": "view", @@ -6782,47 +6861,6 @@ ], "stateMutability": "view", "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "identifier", - "type": "string" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "pubkey", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "keyType", - "type": "uint256" - } - ], - "internalType": "struct IPubkeyRouter.RootKey[]", - "name": "newRootKeys", - "type": "tuple[]" - } - ], - "name": "verifyKeySetCounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" } ] } @@ -6833,8 +6871,8 @@ "contracts": [ { "network": "naga-test", - "address_hash": "0x729D481064fBFfB6E58C915A19eB77BDcc1f4d13", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x077eFcaBFF62391b6fd438034fb21E2484C5B9FF", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "anonymous": false, @@ -6972,7 +7010,7 @@ { "network": "naga-test", "address_hash": "0x5E8db2E7af793f4095c4843C8cBD87C5D8604838", - "inserted_at": "2025-09-21T14:02:13Z", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -8025,8 +8063,8 @@ "contracts": [ { "network": "naga-test", - "address_hash": "0xcBF65D0d3a3Dc3a1E7BcAC4ef34128a52F51E600", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x054Ddcfef7E9434413ad62A6F37946Bf6B6CFc1A", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -8779,6 +8817,78 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "ethAddresses", + "type": "address[]" + } + ], + "name": "getPkpInfoFromEthAddresses", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "name": "getPkpInfoFromTokenIds", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getPkpNftAddress", @@ -9087,8 +9197,8 @@ "contracts": [ { "network": "naga-test", - "address_hash": "0xAf49B3Dd17F0D251E7E0ED510b22B7624c6878CA", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xaf4Dddb07Cdde48042e93eb5bf266b49950bC5BD", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -9833,6 +9943,170 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "ethAddresses", + "type": "address[]" + } + ], + "name": "getPkpInfoFromEthAddresses", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageIndex", + "type": "uint256" + } + ], + "name": "getPkpInfoFromOwnerAddress", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageIndex", + "type": "uint256" + } + ], + "name": "getPkpInfoFromOwnerTokenId", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "name": "getPkpInfoFromTokenIds", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getPkpNftMetadataAddress", @@ -10351,8 +10625,8 @@ "contracts": [ { "network": "naga-test", - "address_hash": "0x3229379bA31Bb916F73842409cdB909De9c8cD33", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x13428A18C0b181344F97ceaC5596F31a9d182e5c", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -11366,8 +11640,8 @@ "contracts": [ { "network": "naga-test", - "address_hash": "0x093A9046766A67cC4b207fC782A53785267B9E45", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x7255737630fCFb4914cF51552123eEe9abEc6120", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -12701,8 +12975,8 @@ "contracts": [ { "network": "naga-test", - "address_hash": "0x288204FB05F904BD28bB474Af51618271698943E", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xE77d6EBD151c02e05a4d9645f816F68f55730733", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -12865,8 +13139,8 @@ "contracts": [ { "network": "naga-test", - "address_hash": "0xa9D639c6Bb52BD3B30EB46a9B5E5f2eE90977888", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x934d3190ff3A92eB1Cfb6CbD3617629322897969", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [], @@ -13102,8 +13376,8 @@ "contracts": [ { "network": "naga-test", - "address_hash": "0x1E383465eC19650D6a02a32105D4b0508B8712b0", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xd1E59c174BcF85012c54086AB600Dd0aB032e88B", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -13738,8 +14012,8 @@ "contracts": [ { "network": "naga-test", - "address_hash": "0x9197a98E6E127B0540A73da4F06f548FbF66f75F", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xbA0aEB6Bbf58F1B74E896416A20DB5be51C991f2", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -14794,8 +15068,8 @@ "contracts": [ { "network": "naga-test", - "address_hash": "0xD6228351719509393be4d0D97C293407Beadf56f", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x556955025dD0981Bac684fbDEcE14cDa897d0837", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -15193,11 +15467,6 @@ "name": "CallerNotOwner", "type": "error" }, - { - "inputs": [], - "name": "MustBeLessThan100", - "type": "error" - }, { "inputs": [], "name": "MustBeNonzero", diff --git a/packages/contracts/dist/prod/naga-test.ts b/packages/contracts/dist/prod/naga-test.ts index 5f0f58a13..83d8b40de 100644 --- a/packages/contracts/dist/prod/naga-test.ts +++ b/packages/contracts/dist/prod/naga-test.ts @@ -5,8 +5,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x28C626d92c5061AdeeDF59d483304b8d35613212", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x9f3cE810695180C5f693a7cD2a0203A381fd57E1", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -714,6 +714,11 @@ export const nagaTest = { "name": "CannotModifyUnfrozen", "type": "error" }, + { + "inputs": [], + "name": "CannotMoveToLockedValidatorStateBeforeEpochEnds", + "type": "error" + }, { "inputs": [], "name": "CannotStakeZero", @@ -1431,6 +1436,11 @@ export const nagaTest = { "internalType": "uint256", "name": "minThresholdToClampAt", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voteToAdvanceTimeOut", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.GlobalConfig", @@ -2631,6 +2641,132 @@ export const nagaTest = { "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "string", + "name": "identifier", + "type": "string" + } + ], + "name": "getKeySet", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "minimumThreshold", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "monetaryValue", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "completeIsolation", + "type": "bool" + }, + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "realms", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "curves", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "counts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "recoveryPartyMembers", + "type": "address[]" + } + ], + "internalType": "struct LibStakingStorage.KeySetConfig", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "keySets", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "minimumThreshold", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "monetaryValue", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "completeIsolation", + "type": "bool" + }, + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "realms", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "curves", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "counts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "recoveryPartyMembers", + "type": "address[]" + } + ], + "internalType": "struct LibStakingStorage.KeySetConfig[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -2691,6 +2827,47 @@ export const nagaTest = { "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "string", + "name": "identifier", + "type": "string" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "keyType", + "type": "uint256" + } + ], + "internalType": "struct IPubkeyRouter.RootKey[]", + "name": "newRootKeys", + "type": "tuple[]" + } + ], + "name": "verifyKeySetCounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "ActiveValidatorsCannotLeave", @@ -3307,6 +3484,19 @@ export const nagaTest = { "name": "StakingTokenSet", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "realmId", + "type": "uint256" + } + ], + "name": "VoteToAdvanceTimeOutElapsed", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -3371,25 +3561,6 @@ export const nagaTest = { "stateMutability": "pure", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "attestedAddress", - "type": "address" - } - ], - "name": "getAttestedPubKey", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -4092,6 +4263,11 @@ export const nagaTest = { "internalType": "uint256", "name": "startTime", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastAdvanceVoteTime", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Epoch", @@ -4283,6 +4459,11 @@ export const nagaTest = { "internalType": "uint256", "name": "startTime", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastAdvanceVoteTime", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Epoch", @@ -4440,6 +4621,25 @@ export const nagaTest = { "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "attestedAddress", + "type": "address" + } + ], + "name": "getAttestedPubKey", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -4488,72 +4688,6 @@ export const nagaTest = { "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "string", - "name": "identifier", - "type": "string" - } - ], - "name": "getKeySet", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "minimumThreshold", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "monetaryValue", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "completeIsolation", - "type": "bool" - }, - { - "internalType": "string", - "name": "identifier", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "realms", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "curves", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "counts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "recoveryPartyMembers", - "type": "address[]" - } - ], - "internalType": "struct LibStakingStorage.KeySetConfig", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "getKeyTypes", @@ -5960,6 +6094,11 @@ export const nagaTest = { "internalType": "uint256", "name": "minThresholdToClampAt", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voteToAdvanceTimeOut", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.GlobalConfig", @@ -6140,73 +6279,13 @@ export const nagaTest = { "name": "validator", "type": "address" } - ], - "name": "isValidatorBanned", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "keySets", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "minimumThreshold", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "monetaryValue", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "completeIsolation", - "type": "bool" - }, - { - "internalType": "string", - "name": "identifier", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "realms", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "curves", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "counts", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "recoveryPartyMembers", - "type": "address[]" - } - ], - "internalType": "struct LibStakingStorage.KeySetConfig[]", + ], + "name": "isValidatorBanned", + "outputs": [ + { + "internalType": "bool", "name": "", - "type": "tuple[]" + "type": "bool" } ], "stateMutability": "view", @@ -6782,47 +6861,6 @@ export const nagaTest = { ], "stateMutability": "view", "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "identifier", - "type": "string" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "pubkey", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "keyType", - "type": "uint256" - } - ], - "internalType": "struct IPubkeyRouter.RootKey[]", - "name": "newRootKeys", - "type": "tuple[]" - } - ], - "name": "verifyKeySetCounts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" } ] } @@ -6833,8 +6871,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x729D481064fBFfB6E58C915A19eB77BDcc1f4d13", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x077eFcaBFF62391b6fd438034fb21E2484C5B9FF", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "anonymous": false, @@ -6972,7 +7010,7 @@ export const nagaTest = { { "network": "naga-test", "address_hash": "0x5E8db2E7af793f4095c4843C8cBD87C5D8604838", - "inserted_at": "2025-09-21T14:02:13Z", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -8025,8 +8063,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0xcBF65D0d3a3Dc3a1E7BcAC4ef34128a52F51E600", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x054Ddcfef7E9434413ad62A6F37946Bf6B6CFc1A", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -8779,6 +8817,78 @@ export const nagaTest = { "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "ethAddresses", + "type": "address[]" + } + ], + "name": "getPkpInfoFromEthAddresses", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "name": "getPkpInfoFromTokenIds", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getPkpNftAddress", @@ -9087,8 +9197,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0xAf49B3Dd17F0D251E7E0ED510b22B7624c6878CA", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xaf4Dddb07Cdde48042e93eb5bf266b49950bC5BD", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -9833,6 +9943,170 @@ export const nagaTest = { "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "ethAddresses", + "type": "address[]" + } + ], + "name": "getPkpInfoFromEthAddresses", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageIndex", + "type": "uint256" + } + ], + "name": "getPkpInfoFromOwnerAddress", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageIndex", + "type": "uint256" + } + ], + "name": "getPkpInfoFromOwnerTokenId", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "name": "getPkpInfoFromTokenIds", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "pubkey", + "type": "bytes" + }, + { + "internalType": "address", + "name": "ethAddress", + "type": "address" + } + ], + "internalType": "struct LibPubkeyRouterStorage.PkpInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getPkpNftMetadataAddress", @@ -10351,8 +10625,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x3229379bA31Bb916F73842409cdB909De9c8cD33", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x13428A18C0b181344F97ceaC5596F31a9d182e5c", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -11366,8 +11640,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x093A9046766A67cC4b207fC782A53785267B9E45", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x7255737630fCFb4914cF51552123eEe9abEc6120", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -12701,8 +12975,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x288204FB05F904BD28bB474Af51618271698943E", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xE77d6EBD151c02e05a4d9645f816F68f55730733", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -12865,8 +13139,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0xa9D639c6Bb52BD3B30EB46a9B5E5f2eE90977888", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x934d3190ff3A92eB1Cfb6CbD3617629322897969", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [], @@ -13102,8 +13376,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x1E383465eC19650D6a02a32105D4b0508B8712b0", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xd1E59c174BcF85012c54086AB600Dd0aB032e88B", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -13738,8 +14012,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0x9197a98E6E127B0540A73da4F06f548FbF66f75F", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0xbA0aEB6Bbf58F1B74E896416A20DB5be51C991f2", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -14794,8 +15068,8 @@ export const nagaTest = { "contracts": [ { "network": "naga-test", - "address_hash": "0xD6228351719509393be4d0D97C293407Beadf56f", - "inserted_at": "2025-09-21T14:02:13Z", + "address_hash": "0x556955025dD0981Bac684fbDEcE14cDa897d0837", + "inserted_at": "2025-10-30T16:03:28Z", "ABI": [ { "inputs": [ @@ -15193,11 +15467,6 @@ export const nagaTest = { "name": "CallerNotOwner", "type": "error" }, - { - "inputs": [], - "name": "MustBeLessThan100", - "type": "error" - }, { "inputs": [], "name": "MustBeNonzero", diff --git a/packages/contracts/dist/signatures/naga-test.cjs b/packages/contracts/dist/signatures/naga-test.cjs index 0af31a7c0..e965d7f7f 100644 --- a/packages/contracts/dist/signatures/naga-test.cjs +++ b/packages/contracts/dist/signatures/naga-test.cjs @@ -5,7 +5,7 @@ const signatures = { "Staking": { - "address": "0x28C626d92c5061AdeeDF59d483304b8d35613212", + "address": "0x9f3cE810695180C5f693a7cD2a0203A381fd57E1", "methods": { "getActiveUnkickedValidatorStructsAndCounts": { "inputs": [ @@ -58,6 +58,11 @@ const signatures = { "internalType": "uint256", "name": "startTime", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastAdvanceVoteTime", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Epoch", @@ -956,6 +961,19 @@ const signatures = { "name": "StakingTokenSet", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "realmId", + "type": "uint256" + } + ], + "name": "VoteToAdvanceTimeOutElapsed", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -1032,7 +1050,7 @@ const signatures = { ] }, "PubkeyRouter": { - "address": "0xcBF65D0d3a3Dc3a1E7BcAC4ef34128a52F51E600", + "address": "0x054Ddcfef7E9434413ad62A6F37946Bf6B6CFc1A", "methods": { "deriveEthAddressFromPubkey": { "inputs": [ @@ -1343,7 +1361,7 @@ const signatures = { ] }, "PKPNFT": { - "address": "0xAf49B3Dd17F0D251E7E0ED510b22B7624c6878CA", + "address": "0xaf4Dddb07Cdde48042e93eb5bf266b49950bC5BD", "methods": { "claimAndMint": { "inputs": [ @@ -1733,7 +1751,7 @@ const signatures = { ] }, "PKPHelper": { - "address": "0x3229379bA31Bb916F73842409cdB909De9c8cD33", + "address": "0x13428A18C0b181344F97ceaC5596F31a9d182e5c", "methods": { "claimAndMintNextAndAddAuthMethodsWithTypes": { "inputs": [ @@ -2016,7 +2034,7 @@ const signatures = { ] }, "PKPPermissions": { - "address": "0x093A9046766A67cC4b207fC782A53785267B9E45", + "address": "0x7255737630fCFb4914cF51552123eEe9abEc6120", "methods": { "addPermittedAction": { "inputs": [ @@ -2634,7 +2652,7 @@ const signatures = { ] }, "PaymentDelegation": { - "address": "0x1E383465eC19650D6a02a32105D4b0508B8712b0", + "address": "0xd1E59c174BcF85012c54086AB600Dd0aB032e88B", "methods": { "delegatePayments": { "inputs": [ @@ -2935,7 +2953,7 @@ const signatures = { ] }, "Ledger": { - "address": "0x9197a98E6E127B0540A73da4F06f548FbF66f75F", + "address": "0xbA0aEB6Bbf58F1B74E896416A20DB5be51C991f2", "methods": { "withdraw": { "inputs": [ @@ -3354,7 +3372,7 @@ const signatures = { ] }, "PriceFeed": { - "address": "0xD6228351719509393be4d0D97C293407Beadf56f", + "address": "0x556955025dD0981Bac684fbDEcE14cDa897d0837", "methods": { "getNodesForRequest": { "inputs": [ diff --git a/packages/contracts/dist/signatures/naga-test.d.ts b/packages/contracts/dist/signatures/naga-test.d.ts index be18c1a33..619c61166 100644 --- a/packages/contracts/dist/signatures/naga-test.d.ts +++ b/packages/contracts/dist/signatures/naga-test.d.ts @@ -5,7 +5,7 @@ export const signatures = { "Staking": { - "address": "0x28C626d92c5061AdeeDF59d483304b8d35613212", + "address": "0x9f3cE810695180C5f693a7cD2a0203A381fd57E1", "methods": { "getActiveUnkickedValidatorStructsAndCounts": { "inputs": [ @@ -58,6 +58,11 @@ export const signatures = { "internalType": "uint256", "name": "startTime", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastAdvanceVoteTime", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Epoch", @@ -956,6 +961,19 @@ export const signatures = { "name": "StakingTokenSet", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "realmId", + "type": "uint256" + } + ], + "name": "VoteToAdvanceTimeOutElapsed", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -1032,7 +1050,7 @@ export const signatures = { ] }, "PubkeyRouter": { - "address": "0xcBF65D0d3a3Dc3a1E7BcAC4ef34128a52F51E600", + "address": "0x054Ddcfef7E9434413ad62A6F37946Bf6B6CFc1A", "methods": { "deriveEthAddressFromPubkey": { "inputs": [ @@ -1343,7 +1361,7 @@ export const signatures = { ] }, "PKPNFT": { - "address": "0xAf49B3Dd17F0D251E7E0ED510b22B7624c6878CA", + "address": "0xaf4Dddb07Cdde48042e93eb5bf266b49950bC5BD", "methods": { "claimAndMint": { "inputs": [ @@ -1733,7 +1751,7 @@ export const signatures = { ] }, "PKPHelper": { - "address": "0x3229379bA31Bb916F73842409cdB909De9c8cD33", + "address": "0x13428A18C0b181344F97ceaC5596F31a9d182e5c", "methods": { "claimAndMintNextAndAddAuthMethodsWithTypes": { "inputs": [ @@ -2016,7 +2034,7 @@ export const signatures = { ] }, "PKPPermissions": { - "address": "0x093A9046766A67cC4b207fC782A53785267B9E45", + "address": "0x7255737630fCFb4914cF51552123eEe9abEc6120", "methods": { "addPermittedAction": { "inputs": [ @@ -2634,7 +2652,7 @@ export const signatures = { ] }, "PaymentDelegation": { - "address": "0x1E383465eC19650D6a02a32105D4b0508B8712b0", + "address": "0xd1E59c174BcF85012c54086AB600Dd0aB032e88B", "methods": { "delegatePayments": { "inputs": [ @@ -2935,7 +2953,7 @@ export const signatures = { ] }, "Ledger": { - "address": "0x9197a98E6E127B0540A73da4F06f548FbF66f75F", + "address": "0xbA0aEB6Bbf58F1B74E896416A20DB5be51C991f2", "methods": { "withdraw": { "inputs": [ @@ -3354,7 +3372,7 @@ export const signatures = { ] }, "PriceFeed": { - "address": "0xD6228351719509393be4d0D97C293407Beadf56f", + "address": "0x556955025dD0981Bac684fbDEcE14cDa897d0837", "methods": { "getNodesForRequest": { "inputs": [ diff --git a/packages/contracts/dist/signatures/naga-test.js b/packages/contracts/dist/signatures/naga-test.js index 302113c9f..7e2910626 100644 --- a/packages/contracts/dist/signatures/naga-test.js +++ b/packages/contracts/dist/signatures/naga-test.js @@ -5,7 +5,7 @@ export const signatures = { "Staking": { - "address": "0x28C626d92c5061AdeeDF59d483304b8d35613212", + "address": "0x9f3cE810695180C5f693a7cD2a0203A381fd57E1", "methods": { "getActiveUnkickedValidatorStructsAndCounts": { "inputs": [ @@ -58,6 +58,11 @@ export const signatures = { "internalType": "uint256", "name": "startTime", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastAdvanceVoteTime", + "type": "uint256" } ], "internalType": "struct LibStakingStorage.Epoch", @@ -956,6 +961,19 @@ export const signatures = { "name": "StakingTokenSet", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "realmId", + "type": "uint256" + } + ], + "name": "VoteToAdvanceTimeOutElapsed", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -1032,7 +1050,7 @@ export const signatures = { ] }, "PubkeyRouter": { - "address": "0xcBF65D0d3a3Dc3a1E7BcAC4ef34128a52F51E600", + "address": "0x054Ddcfef7E9434413ad62A6F37946Bf6B6CFc1A", "methods": { "deriveEthAddressFromPubkey": { "inputs": [ @@ -1343,7 +1361,7 @@ export const signatures = { ] }, "PKPNFT": { - "address": "0xAf49B3Dd17F0D251E7E0ED510b22B7624c6878CA", + "address": "0xaf4Dddb07Cdde48042e93eb5bf266b49950bC5BD", "methods": { "claimAndMint": { "inputs": [ @@ -1733,7 +1751,7 @@ export const signatures = { ] }, "PKPHelper": { - "address": "0x3229379bA31Bb916F73842409cdB909De9c8cD33", + "address": "0x13428A18C0b181344F97ceaC5596F31a9d182e5c", "methods": { "claimAndMintNextAndAddAuthMethodsWithTypes": { "inputs": [ @@ -2016,7 +2034,7 @@ export const signatures = { ] }, "PKPPermissions": { - "address": "0x093A9046766A67cC4b207fC782A53785267B9E45", + "address": "0x7255737630fCFb4914cF51552123eEe9abEc6120", "methods": { "addPermittedAction": { "inputs": [ @@ -2634,7 +2652,7 @@ export const signatures = { ] }, "PaymentDelegation": { - "address": "0x1E383465eC19650D6a02a32105D4b0508B8712b0", + "address": "0xd1E59c174BcF85012c54086AB600Dd0aB032e88B", "methods": { "delegatePayments": { "inputs": [ @@ -2935,7 +2953,7 @@ export const signatures = { ] }, "Ledger": { - "address": "0x9197a98E6E127B0540A73da4F06f548FbF66f75F", + "address": "0xbA0aEB6Bbf58F1B74E896416A20DB5be51C991f2", "methods": { "withdraw": { "inputs": [ @@ -3354,7 +3372,7 @@ export const signatures = { ] }, "PriceFeed": { - "address": "0xD6228351719509393be4d0D97C293407Beadf56f", + "address": "0x556955025dD0981Bac684fbDEcE14cDa897d0837", "methods": { "getNodesForRequest": { "inputs": [ diff --git a/packages/e2e/src/e2e.spec.ts b/packages/e2e/src/e2e.spec.ts index f3b2a98e0..b00707756 100644 --- a/packages/e2e/src/e2e.spec.ts +++ b/packages/e2e/src/e2e.spec.ts @@ -16,6 +16,7 @@ import { init, } from '@lit-protocol/e2e'; import type { AuthContext } from '@lit-protocol/e2e'; +import { registerPaymentDelegationTicketSuite } from './tickets/delegation.suite'; const RPC_OVERRIDE = process.env['LIT_YELLOWSTONE_PRIVATE_RPC_URL']; if (RPC_OVERRIDE) { @@ -173,3 +174,10 @@ describe('all', () => { }); }); }); + +// ====== These tests only run on paid networks ====== +if (process.env['NETWORK'] !== 'naga-dev') { + describe('Paid networks tests', () => { + registerPaymentDelegationTicketSuite(); + }); +} diff --git a/packages/e2e/src/helper/createTestEnv.ts b/packages/e2e/src/helper/createTestEnv.ts index 598744cb7..ea04c75d0 100644 --- a/packages/e2e/src/helper/createTestEnv.ts +++ b/packages/e2e/src/helper/createTestEnv.ts @@ -16,8 +16,8 @@ export const CONFIG = { ledgerDepositAmount: '2', }, LIVE: { - nativeFundingAmount: '0.01', - ledgerDepositAmount: '0.01', + nativeFundingAmount: '0.1', + ledgerDepositAmount: '0.1', }, }; diff --git a/packages/e2e/src/tickets/delegation.spec.ts b/packages/e2e/src/tickets/delegation.spec.ts index 1a907e97f..db3a4261b 100644 --- a/packages/e2e/src/tickets/delegation.spec.ts +++ b/packages/e2e/src/tickets/delegation.spec.ts @@ -1,112 +1,3 @@ -import { createEnvVars } from '../helper/createEnvVars'; -import { - createTestAccount, - CreateTestAccountResult, -} from '../helper/createTestAccount'; -import { createTestEnv } from '../helper/createTestEnv'; +import { registerPaymentDelegationTicketSuite } from './delegation.suite'; -describe('payment delegation test', () => { - let envVars: ReturnType; - let testEnv: Awaited>; - let alice: CreateTestAccountResult; - let bobAccount: CreateTestAccountResult; - - beforeAll(async () => { - envVars = createEnvVars(); - testEnv = await createTestEnv(envVars); - }); - - it("should allow Bob to use Alice's sponsorship to pay for PKP execution", async () => { - // 1. First, create Bob - bobAccount = await createTestAccount(testEnv, { - label: 'Bob', - fundAccount: true, - hasEoaAuthContext: true, - fundLedger: false, - hasPKP: true, - fundPKP: false, - hasPKPAuthContext: false, - fundPKPLedger: false, - }); - - console.log('bobAccount:', bobAccount); - - if (!bobAccount.pkp?.ethAddress) { - throw new Error("Bob's PKP does not have an ethAddress"); - } - - // 2. Next, create Alice, who will sponsor Bob - alice = await createTestAccount(testEnv, { - label: 'Alice', - fundAccount: true, - fundLedger: true, - hasPKP: true, - fundPKP: true, - fundPKPLedger: true, - sponsor: { - restrictions: { - totalMaxPriceInWei: '1000000000000000000', - requestsPerPeriod: '100', - periodSeconds: '5', - }, - userAddresses: [bobAccount.account.address], - }, - }); - - // 3. Take a snapshot of Alice's Ledger balance before Bob's request - const aliceBeforeBalance = await testEnv.masterPaymentManager.getBalance({ - userAddress: alice.account.address, - }); - - console.log( - "[BEFORE] Alice's Ledger balance before Bob's request:", - aliceBeforeBalance - ); - - // 3. Now, Bob tries to sign with his PKP using Alice's sponsorship - await testEnv.litClient.chain.ethereum.pkpSign({ - authContext: bobAccount.eoaAuthContext!, - pubKey: bobAccount.pkp?.pubkey!, - toSign: 'Hello, world!', - userMaxPrice: 200000000000000000n, // 0.2 ETH in Wei - }); - - // 4. Finally, check that Alice's Ledger balance has decreased - const aliceBalanceAfter = await testEnv.masterPaymentManager.getBalance({ - userAddress: alice.account.address, - }); - - console.log( - "[AFTER] Alice's Ledger balance after Bob's request:", - aliceBalanceAfter - ); - - expect(BigInt(aliceBalanceAfter.raw.availableBalance)).toBeLessThan( - BigInt(aliceBeforeBalance.raw.availableBalance) - ); - - // 5. Now, Alice removes Bob from her sponsorship - await alice.paymentManager!.undelegatePaymentsBatch({ - userAddresses: [bobAccount.account.address], - }); - - // 6. Bob should now fail to sign with his PKP due to lack of sponsorship - let didFail = false; - try { - await testEnv.litClient.chain.ethereum.pkpSign({ - authContext: bobAccount.eoaAuthContext!, - pubKey: bobAccount.pkp?.pubkey!, - toSign: 'Hello again, world!', - userMaxPrice: 200000000000000000n, // 0.2 ETH in Wei - }); - } catch (e) { - didFail = true; - console.log( - "As expected, Bob's PKP sign failed after Alice removed sponsorship:", - e - ); - } - - expect(didFail).toBe(true); - }); -}); +registerPaymentDelegationTicketSuite(); diff --git a/packages/e2e/src/tickets/delegation.suite.ts b/packages/e2e/src/tickets/delegation.suite.ts new file mode 100644 index 000000000..2a7da888a --- /dev/null +++ b/packages/e2e/src/tickets/delegation.suite.ts @@ -0,0 +1,116 @@ +import { createEnvVars } from '../helper/createEnvVars'; +import { + createTestAccount, + CreateTestAccountResult, +} from '../helper/createTestAccount'; +import { createTestEnv } from '../helper/createTestEnv'; + +export function registerPaymentDelegationTicketSuite() { + describe('payment delegation test', () => { + let envVars: ReturnType; + let testEnv: Awaited>; + let alice: CreateTestAccountResult; + let bobAccount: CreateTestAccountResult; + + beforeAll(async () => { + envVars = createEnvVars(); + testEnv = await createTestEnv(envVars); + }); + + it("should allow Bob to use Alice's sponsorship to pay for PKP execution", async () => { + // 1. First, create Bob + bobAccount = await createTestAccount(testEnv, { + label: 'Bob', + fundAccount: true, + hasEoaAuthContext: true, + fundLedger: false, + hasPKP: true, + fundPKP: false, + hasPKPAuthContext: false, + fundPKPLedger: false, + }); + + console.log('bobAccount:', bobAccount); + + if (!bobAccount.pkp?.ethAddress) { + throw new Error("Bob's PKP does not have an ethAddress"); + } + + // 2. Next, create Alice, who will sponsor Bob + alice = await createTestAccount(testEnv, { + label: 'Alice', + fundAccount: true, + fundLedger: true, + hasPKP: true, + fundPKP: true, + fundPKPLedger: true, + sponsor: { + restrictions: { + totalMaxPriceInWei: '1000000000000000000', + requestsPerPeriod: '100', + periodSeconds: '600', + }, + userAddresses: [bobAccount.account.address], + }, + }); + + // 3. Take a snapshot of Alice's Ledger balance before Bob's request + const aliceBeforeBalance = await testEnv.masterPaymentManager.getBalance({ + userAddress: alice.account.address, + }); + + console.log( + "[BEFORE] Alice's Ledger balance before Bob's request:", + aliceBeforeBalance + ); + + // 4. Now, Bob tries to sign with his PKP using Alice's sponsorship + await testEnv.litClient.chain.ethereum.pkpSign({ + authContext: bobAccount.eoaAuthContext!, + pubKey: bobAccount.pkp?.pubkey!, + toSign: 'Hello, world!', + userMaxPrice: 1000000000000000000n, // 0.05 ETH in Wei + }); + + // 5. Now, Alice removes Bob from her sponsorship + await alice.paymentManager!.undelegatePaymentsBatch({ + userAddresses: [bobAccount.account.address], + }); + + // 6. Bob should now fail to sign with his PKP due to lack of sponsorship + let didFail = false; + try { + await testEnv.litClient.chain.ethereum.pkpSign({ + authContext: bobAccount.eoaAuthContext!, + pubKey: bobAccount.pkp?.pubkey!, + toSign: 'Hello again, world!', + userMaxPrice: 1000000000000000000n, // 0.05 ETH in Wei + }); + } catch (e) { + didFail = true; + console.log( + "As expected, Bob's PKP sign failed after Alice removed sponsorship:", + e + ); + } + + expect(didFail).toBe(true); + + // 7. Finally, check that Alice's Ledger balance has decreased + // let's wait a big longer for the payment to be processed + await new Promise((resolve) => setTimeout(resolve, 5000)); + const aliceBalanceAfter = await testEnv.masterPaymentManager.getBalance({ + userAddress: alice.account.address, + }); + + console.log( + "[AFTER] Alice's Ledger balance after Bob's request:", + aliceBalanceAfter + ); + + expect(BigInt(aliceBalanceAfter.raw.availableBalance)).toBeLessThan( + BigInt(aliceBeforeBalance.raw.availableBalance) + ); + }); + }); +}