diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..a37c473 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,18 @@ +{ + "name": "Node", + "image": "mcr.microsoft.com/devcontainers/base:0", + + "features": { + "ghcr.io/devcontainers/features/node:1": {}, + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "configureZshAsDefaultShell": true, + "installOhMyZsh": true, + "installOhMyZshConfig": true, + "upgradePackages": true, + "username": "automatic", + "userUid": "automatic", + "userGid": "automatic" + } + } +} diff --git a/README.md b/README.md index 89bae76..5b5ee0d 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ This package is written as an ES6 module and `typechain` to generate ethers bind Steps: 1. If contract ABI is modified, remove all previously generated bindings in `src/types/contracts`. -2. Generate the bindings using: `npm run typechain --target ethers-v5 --out-dir src/types/contracts "./contracts/**/*.json"` +2. Generate the bindings using: `npx typechain --target ethers-v5 --out-dir src/types/contracts "./contracts/**/*.json"` 3. Manually edit the generated bindings to ensure that all import paths include the `.js` suffix, or when importing a directory, they import the `index.js` within that directory. ## Acknowledgements diff --git a/contracts/PostageStamp.json b/contracts/PostageStamp.json new file mode 100644 index 0000000..8afb5ec --- /dev/null +++ b/contracts/PostageStamp.json @@ -0,0 +1,1143 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_bzzToken", + "type": "address" + }, + { + "internalType": "uint8", + "name": "_minimumBucketDepth", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AdministratorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "BatchDoesNotExist", + "type": "error" + }, + { + "inputs": [], + "name": "BatchExists", + "type": "error" + }, + { + "inputs": [], + "name": "BatchExpired", + "type": "error" + }, + { + "inputs": [], + "name": "BatchTooSmall", + "type": "error" + }, + { + "inputs": [], + "name": "DepthNotIncreasing", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficienChunkCount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDepth", + "type": "error" + }, + { + "inputs": [], + "name": "NoBatchesExist", + "type": "error" + }, + { + "inputs": [], + "name": "NotBatchOwner", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyPauser", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyRedistributor", + "type": "error" + }, + { + "inputs": [], + "name": "PriceOracleOnly", + "type": "error" + }, + { + "inputs": [], + "name": "TotalOutpaymentDecreased", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "ValueCannotBeZero", + "type": "error" + }, + { + "inputs": [], + "name": "ValueDoesNotExist", + "type": "error" + }, + { + "inputs": [], + "name": "ValueKeyPairExists", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroBalance", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "batchId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "normalisedBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "depth", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "bucketDepth", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bool", + "name": "immutableFlag", + "type": "bool" + } + ], + "name": "BatchCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "batchId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "newDepth", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "normalisedBalance", + "type": "uint256" + } + ], + "name": "BatchDepthIncrease", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "batchId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "topupAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "normalisedBalance", + "type": "uint256" + } + ], + "name": "BatchTopUp", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "batchId", + "type": "bytes32" + } + ], + "name": "CopyBatchFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalAmount", + "type": "uint256" + } + ], + "name": "PotWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "PriceUpdate", + "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" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PAUSER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PRICE_ORACLE_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "REDISTRIBUTOR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_batchId", + "type": "bytes32" + } + ], + "name": "batchBucketDepth", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_batchId", + "type": "bytes32" + } + ], + "name": "batchDepth", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_batchId", + "type": "bytes32" + } + ], + "name": "batchImmutableFlag", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_batchId", + "type": "bytes32" + } + ], + "name": "batchLastUpdatedBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_batchId", + "type": "bytes32" + } + ], + "name": "batchNormalisedBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_batchId", + "type": "bytes32" + } + ], + "name": "batchOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "batches", + "outputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint8", + "name": "depth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "bucketDepth", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "immutableFlag", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "normalisedBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastUpdatedBlockNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bzzToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_initialBalancePerChunk", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "_depth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "_bucketDepth", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_batchId", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "_immutable", + "type": "bool" + } + ], + "name": "copyBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "batchId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint8", + "name": "depth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "bucketDepth", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "immutableFlag", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "remainingBalance", + "type": "uint256" + } + ], + "internalType": "struct PostageStamp.ImportBatch[]", + "name": "bulkBatches", + "type": "tuple[]" + } + ], + "name": "copyBatchBulk", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_initialBalancePerChunk", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "_depth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "_bucketDepth", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_nonce", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "_immutable", + "type": "bool" + } + ], + "name": "createBatch", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentTotalOutPayment", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], + "name": "expireLimited", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "expiredBatchesExist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "firstBatchId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "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": "_batchId", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "_newDepth", + "type": "uint8" + } + ], + "name": "increaseDepth", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isBatchesTreeEmpty", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastExpiryBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPrice", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastUpdatedBlock", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumBucketDepth", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumInitialBalancePerChunk", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumValidityBlocks", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_batchId", + "type": "bytes32" + } + ], + "name": "remainingBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": "uint64", + "name": "_value", + "type": "uint64" + } + ], + "name": "setMinimumValidityBlocks", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "name": "setPrice", + "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": "bytes32", + "name": "_batchId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_topupAmountPerChunk", + "type": "uint256" + } + ], + "name": "topUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalPot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unPause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "validChunkCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/contracts/Redistribution.json b/contracts/Redistribution.json index cbaca69..3a0495b 100644 --- a/contracts/Redistribution.json +++ b/contracts/Redistribution.json @@ -20,6 +20,249 @@ "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [], + "name": "AlreadyClaimed", + "type": "error" + }, + { + "inputs": [], + "name": "AlreadyCommited", + "type": "error" + }, + { + "inputs": [], + "name": "AlreadyRevealed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "BatchDoesNotExist", + "type": "error" + }, + { + "inputs": [], + "name": "BelowMinimumStake", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "BucketDiffers", + "type": "error" + }, + { + "inputs": [], + "name": "CommitRoundNotStarted", + "type": "error" + }, + { + "inputs": [], + "name": "CommitRoundOver", + "type": "error" + }, + { + "inputs": [], + "name": "FirstRevealDone", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "InclusionProofFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "IndexOutsideSet", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSignatureLength", + "type": "error" + }, + { + "inputs": [], + "name": "LastElementCheckFailed", + "type": "error" + }, + { + "inputs": [], + "name": "MustStake2Rounds", + "type": "error" + }, + { + "inputs": [], + "name": "NoCommitsReceived", + "type": "error" + }, + { + "inputs": [], + "name": "NoMatchingCommit", + "type": "error" + }, + { + "inputs": [], + "name": "NoReveals", + "type": "error" + }, + { + "inputs": [], + "name": "NotAdmin", + "type": "error" + }, + { + "inputs": [], + "name": "NotClaimPhase", + "type": "error" + }, + { + "inputs": [], + "name": "NotCommitPhase", + "type": "error" + }, + { + "inputs": [], + "name": "NotMatchingOwner", + "type": "error" + }, + { + "inputs": [], + "name": "NotRevealPhase", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyPauser", + "type": "error" + }, + { + "inputs": [], + "name": "OutOfDepth", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "name": "OutOfDepthClaim", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "OutOfDepthReveal", + "type": "error" + }, + { + "inputs": [], + "name": "PhaseLastBlock", + "type": "error" + }, + { + "inputs": [], + "name": "RandomElementCheckFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "trALast", + "type": "bytes32" + } + ], + "name": "ReserveCheckFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "SigRecoveryFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "SocCalcNotMatching", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "SocVerificationFailed", + "type": "error" + }, + { + "inputs": [], + "name": "WrongPhase", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "validChunkCount", + "type": "uint256" + } + ], + "name": "ChunkCount", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -65,6 +308,25 @@ "name": "CountReveals", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "roundNumber", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "anchor", + "type": "bytes32" + } + ], + "name": "CurrentRevealAnchor", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -233,15 +495,20 @@ "inputs": [ { "components": [ + { + "internalType": "bytes32", + "name": "overlay", + "type": "bytes32" + }, { "internalType": "address", "name": "owner", "type": "address" }, { - "internalType": "bytes32", - "name": "overlay", - "type": "bytes32" + "internalType": "uint8", + "name": "depth", + "type": "uint8" }, { "internalType": "uint256", @@ -257,11 +524,6 @@ "internalType": "bytes32", "name": "hash", "type": "bytes32" - }, - { - "internalType": "uint8", - "name": "depth", - "type": "uint8" } ], "indexed": false, @@ -274,26 +536,32 @@ "type": "event" }, { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "indexInRC", + "type": "uint256" + }, { + "indexed": false, "internalType": "bytes32", - "name": "", + "name": "chunkAddress", "type": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "name": "transformedChunkAddressFromInclusionProof", + "type": "event" }, { "inputs": [], - "name": "OracleContract", + "name": "DEFAULT_ADMIN_ROLE", "outputs": [ { - "internalType": "contract PriceOracle", + "internalType": "bytes32", "name": "", - "type": "address" + "type": "bytes32" } ], "stateMutability": "view", @@ -301,12 +569,12 @@ }, { "inputs": [], - "name": "PAUSER_ROLE", + "name": "OracleContract", "outputs": [ { - "internalType": "bytes32", + "internalType": "contract IPriceOracle", "name": "", - "type": "bytes32" + "type": "address" } ], "stateMutability": "view", @@ -317,7 +585,7 @@ "name": "PostageContract", "outputs": [ { - "internalType": "contract PostageStamp", + "internalType": "contract IPostageStamp", "name": "", "type": "address" } @@ -330,7 +598,7 @@ "name": "Stakes", "outputs": [ { - "internalType": "contract StakeRegistry", + "internalType": "contract IStakeRegistry", "name": "", "type": "address" } @@ -339,7 +607,281 @@ "type": "function" }, { - "inputs": [], + "inputs": [ + { + "components": [ + { + "internalType": "bytes32[]", + "name": "proofSegments", + "type": "bytes32[]" + }, + { + "internalType": "bytes32", + "name": "proveSegment", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "proofSegments2", + "type": "bytes32[]" + }, + { + "internalType": "bytes32", + "name": "proveSegment2", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "chunkSpan", + "type": "uint64" + }, + { + "internalType": "bytes32[]", + "name": "proofSegments3", + "type": "bytes32[]" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "postageId", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "index", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "timeStamp", + "type": "uint64" + } + ], + "internalType": "struct Redistribution.PostageProof", + "name": "postageProof", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "chunkAddr", + "type": "bytes32" + } + ], + "internalType": "struct Redistribution.SOCProof[]", + "name": "socProof", + "type": "tuple[]" + } + ], + "internalType": "struct Redistribution.ChunkInclusionProof", + "name": "entryProof1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes32[]", + "name": "proofSegments", + "type": "bytes32[]" + }, + { + "internalType": "bytes32", + "name": "proveSegment", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "proofSegments2", + "type": "bytes32[]" + }, + { + "internalType": "bytes32", + "name": "proveSegment2", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "chunkSpan", + "type": "uint64" + }, + { + "internalType": "bytes32[]", + "name": "proofSegments3", + "type": "bytes32[]" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "postageId", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "index", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "timeStamp", + "type": "uint64" + } + ], + "internalType": "struct Redistribution.PostageProof", + "name": "postageProof", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "chunkAddr", + "type": "bytes32" + } + ], + "internalType": "struct Redistribution.SOCProof[]", + "name": "socProof", + "type": "tuple[]" + } + ], + "internalType": "struct Redistribution.ChunkInclusionProof", + "name": "entryProof2", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes32[]", + "name": "proofSegments", + "type": "bytes32[]" + }, + { + "internalType": "bytes32", + "name": "proveSegment", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "proofSegments2", + "type": "bytes32[]" + }, + { + "internalType": "bytes32", + "name": "proveSegment2", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "chunkSpan", + "type": "uint64" + }, + { + "internalType": "bytes32[]", + "name": "proofSegments3", + "type": "bytes32[]" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "postageId", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "index", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "timeStamp", + "type": "uint64" + } + ], + "internalType": "struct Redistribution.PostageProof", + "name": "postageProof", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "chunkAddr", + "type": "bytes32" + } + ], + "internalType": "struct Redistribution.SOCProof[]", + "name": "socProof", + "type": "tuple[]" + } + ], + "internalType": "struct Redistribution.ChunkInclusionProof", + "name": "entryProofLast", + "type": "tuple" + } + ], "name": "claim", "outputs": [], "stateMutability": "nonpayable", @@ -358,9 +900,9 @@ "type": "bytes32" }, { - "internalType": "uint256", + "internalType": "uint64", "name": "_roundNumber", - "type": "uint256" + "type": "uint64" } ], "name": "commit", @@ -373,9 +915,9 @@ "name": "currentClaimRound", "outputs": [ { - "internalType": "uint256", + "internalType": "uint64", "name": "", - "type": "uint256" + "type": "uint64" } ], "stateMutability": "view", @@ -386,9 +928,9 @@ "name": "currentCommitRound", "outputs": [ { - "internalType": "uint256", + "internalType": "uint64", "name": "", - "type": "uint256" + "type": "uint64" } ], "stateMutability": "view", @@ -414,6 +956,11 @@ "name": "owner", "type": "address" }, + { + "internalType": "bool", + "name": "revealed", + "type": "bool" + }, { "internalType": "uint256", "name": "stake", @@ -424,11 +971,6 @@ "name": "obfuscatedHash", "type": "bytes32" }, - { - "internalType": "bool", - "name": "revealed", - "type": "bool" - }, { "internalType": "uint256", "name": "revealIndex", @@ -438,6 +980,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "currentMinimumDepth", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "currentPhaseClaim", @@ -482,9 +1037,9 @@ "name": "currentRevealRound", "outputs": [ { - "internalType": "uint256", + "internalType": "uint64", "name": "", - "type": "uint256" + "type": "uint64" } ], "stateMutability": "view", @@ -500,15 +1055,20 @@ ], "name": "currentReveals", "outputs": [ + { + "internalType": "bytes32", + "name": "overlay", + "type": "bytes32" + }, { "internalType": "address", "name": "owner", "type": "address" }, { - "internalType": "bytes32", - "name": "overlay", - "type": "bytes32" + "internalType": "uint8", + "name": "depth", + "type": "uint8" }, { "internalType": "uint256", @@ -524,11 +1084,6 @@ "internalType": "bytes32", "name": "hash", "type": "bytes32" - }, - { - "internalType": "uint8", - "name": "depth", - "type": "uint8" } ], "stateMutability": "view", @@ -539,9 +1094,9 @@ "name": "currentRound", "outputs": [ { - "internalType": "uint256", + "internalType": "uint64", "name": "", - "type": "uint256" + "type": "uint64" } ], "stateMutability": "view", @@ -566,15 +1121,20 @@ "outputs": [ { "components": [ + { + "internalType": "bytes32", + "name": "overlay", + "type": "bytes32" + }, { "internalType": "address", "name": "owner", "type": "address" }, { - "internalType": "bytes32", - "name": "overlay", - "type": "bytes32" + "internalType": "uint8", + "name": "depth", + "type": "uint8" }, { "internalType": "uint256", @@ -590,11 +1150,6 @@ "internalType": "bytes32", "name": "hash", "type": "bytes32" - }, - { - "internalType": "uint8", - "name": "depth", - "type": "uint8" } ], "internalType": "struct Redistribution.Reveal[]", @@ -751,19 +1306,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "minimumStake", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "nextSeed", @@ -797,32 +1339,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "penaltyMultiplierDisagreement", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "penaltyMultiplierNonRevealed", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -888,16 +1404,34 @@ "type": "function" }, { - "inputs": [], - "name": "roundLength", - "outputs": [ + "inputs": [ + { + "internalType": "uint8", + "name": "_penaltyMultiplierDisagreement", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "_penaltyMultiplierNonRevealed", + "type": "uint8" + } + ], + "name": "setFreezingParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "_sampleMaxValue", "type": "uint256" } ], - "stateMutability": "view", + "name": "setSampleMaxValue", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { @@ -930,15 +1464,20 @@ "inputs": [], "name": "winner", "outputs": [ + { + "internalType": "bytes32", + "name": "overlay", + "type": "bytes32" + }, { "internalType": "address", "name": "owner", "type": "address" }, { - "internalType": "bytes32", - "name": "overlay", - "type": "bytes32" + "internalType": "uint8", + "name": "depth", + "type": "uint8" }, { "internalType": "uint256", @@ -954,11 +1493,6 @@ "internalType": "bytes32", "name": "hash", "type": "bytes32" - }, - { - "internalType": "uint8", - "name": "depth", - "type": "uint8" } ], "stateMutability": "view", diff --git a/package-lock.json b/package-lock.json index af5171d..0db84f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,6 +40,9 @@ "ts-node": "^10.9.1", "typechain": "^8.1.0", "typescript": "^4.8.4" + }, + "engines": { + "node": ">=18" } }, "node_modules/@babel/code-frame": { diff --git a/src/config.ts b/src/config.ts index a9445f2..061cb87 100644 --- a/src/config.ts +++ b/src/config.ts @@ -96,13 +96,13 @@ export const chainConfig: Configs = { ), stakeDeployBlock: 25527075, postageStamp: utils.getAddress( - '0x30d155478eF27Ab32A1D578BE7b84BC5988aF381' + '0x45a1502382541Cd610CC9068e88727426b696293' ), priceOracle: utils.getAddress( '0x344A2CC7304B32A87EfDC5407cD4bEC7cf98F035' ), redistribution: utils.getAddress( - '0x1F9a1FDe5c6350E949C5E4aa163B4c97011199B4' + '0x0964c834C660C44E0afd3B7F10F19f275ee31411' ), }, }, diff --git a/src/types/contracts/BzzToken.ts b/src/types/contracts/BzzToken.ts index e760cab..12b685e 100644 --- a/src/types/contracts/BzzToken.ts +++ b/src/types/contracts/BzzToken.ts @@ -25,7 +25,7 @@ import type { TypedListener, OnEvent, PromiseOrValue, -} from "./common.js"; +} from "./common"; export interface BzzTokenInterface extends utils.Interface { functions: { diff --git a/src/types/contracts/PostageStamp.ts b/src/types/contracts/PostageStamp.ts new file mode 100644 index 0000000..ed61c0b --- /dev/null +++ b/src/types/contracts/PostageStamp.ts @@ -0,0 +1,1665 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, + PromiseOrValue, +} from "./common"; + +export declare namespace PostageStamp { + export type ImportBatchStruct = { + batchId: PromiseOrValue; + owner: PromiseOrValue; + depth: PromiseOrValue; + bucketDepth: PromiseOrValue; + immutableFlag: PromiseOrValue; + remainingBalance: PromiseOrValue; + }; + + export type ImportBatchStructOutput = [ + string, + string, + number, + number, + boolean, + BigNumber + ] & { + batchId: string; + owner: string; + depth: number; + bucketDepth: number; + immutableFlag: boolean; + remainingBalance: BigNumber; + }; +} + +export interface PostageStampInterface extends utils.Interface { + functions: { + "DEFAULT_ADMIN_ROLE()": FunctionFragment; + "PAUSER_ROLE()": FunctionFragment; + "PRICE_ORACLE_ROLE()": FunctionFragment; + "REDISTRIBUTOR_ROLE()": FunctionFragment; + "batchBucketDepth(bytes32)": FunctionFragment; + "batchDepth(bytes32)": FunctionFragment; + "batchImmutableFlag(bytes32)": FunctionFragment; + "batchLastUpdatedBlockNumber(bytes32)": FunctionFragment; + "batchNormalisedBalance(bytes32)": FunctionFragment; + "batchOwner(bytes32)": FunctionFragment; + "batches(bytes32)": FunctionFragment; + "bzzToken()": FunctionFragment; + "copyBatch(address,uint256,uint8,uint8,bytes32,bool)": FunctionFragment; + "copyBatchBulk((bytes32,address,uint8,uint8,bool,uint256)[])": FunctionFragment; + "createBatch(address,uint256,uint8,uint8,bytes32,bool)": FunctionFragment; + "currentTotalOutPayment()": FunctionFragment; + "expireLimited(uint256)": FunctionFragment; + "expiredBatchesExist()": FunctionFragment; + "firstBatchId()": FunctionFragment; + "getRoleAdmin(bytes32)": FunctionFragment; + "grantRole(bytes32,address)": FunctionFragment; + "hasRole(bytes32,address)": FunctionFragment; + "increaseDepth(bytes32,uint8)": FunctionFragment; + "isBatchesTreeEmpty()": FunctionFragment; + "lastExpiryBalance()": FunctionFragment; + "lastPrice()": FunctionFragment; + "lastUpdatedBlock()": FunctionFragment; + "minimumBucketDepth()": FunctionFragment; + "minimumInitialBalancePerChunk()": FunctionFragment; + "minimumValidityBlocks()": FunctionFragment; + "pause()": FunctionFragment; + "paused()": FunctionFragment; + "pot()": FunctionFragment; + "remainingBalance(bytes32)": FunctionFragment; + "renounceRole(bytes32,address)": FunctionFragment; + "revokeRole(bytes32,address)": FunctionFragment; + "setMinimumValidityBlocks(uint64)": FunctionFragment; + "setPrice(uint256)": FunctionFragment; + "supportsInterface(bytes4)": FunctionFragment; + "topUp(bytes32,uint256)": FunctionFragment; + "totalPot()": FunctionFragment; + "unPause()": FunctionFragment; + "validChunkCount()": FunctionFragment; + "withdraw(address)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "DEFAULT_ADMIN_ROLE" + | "PAUSER_ROLE" + | "PRICE_ORACLE_ROLE" + | "REDISTRIBUTOR_ROLE" + | "batchBucketDepth" + | "batchDepth" + | "batchImmutableFlag" + | "batchLastUpdatedBlockNumber" + | "batchNormalisedBalance" + | "batchOwner" + | "batches" + | "bzzToken" + | "copyBatch" + | "copyBatchBulk" + | "createBatch" + | "currentTotalOutPayment" + | "expireLimited" + | "expiredBatchesExist" + | "firstBatchId" + | "getRoleAdmin" + | "grantRole" + | "hasRole" + | "increaseDepth" + | "isBatchesTreeEmpty" + | "lastExpiryBalance" + | "lastPrice" + | "lastUpdatedBlock" + | "minimumBucketDepth" + | "minimumInitialBalancePerChunk" + | "minimumValidityBlocks" + | "pause" + | "paused" + | "pot" + | "remainingBalance" + | "renounceRole" + | "revokeRole" + | "setMinimumValidityBlocks" + | "setPrice" + | "supportsInterface" + | "topUp" + | "totalPot" + | "unPause" + | "validChunkCount" + | "withdraw" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "DEFAULT_ADMIN_ROLE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "PAUSER_ROLE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "PRICE_ORACLE_ROLE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "REDISTRIBUTOR_ROLE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "batchBucketDepth", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "batchDepth", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "batchImmutableFlag", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "batchLastUpdatedBlockNumber", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "batchNormalisedBalance", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "batchOwner", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "batches", + values: [PromiseOrValue] + ): string; + encodeFunctionData(functionFragment: "bzzToken", values?: undefined): string; + encodeFunctionData( + functionFragment: "copyBatch", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "copyBatchBulk", + values: [PostageStamp.ImportBatchStruct[]] + ): string; + encodeFunctionData( + functionFragment: "createBatch", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "currentTotalOutPayment", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "expireLimited", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "expiredBatchesExist", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "firstBatchId", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getRoleAdmin", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "grantRole", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "hasRole", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "increaseDepth", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "isBatchesTreeEmpty", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "lastExpiryBalance", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "lastPrice", values?: undefined): string; + encodeFunctionData( + functionFragment: "lastUpdatedBlock", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "minimumBucketDepth", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "minimumInitialBalancePerChunk", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "minimumValidityBlocks", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "pause", values?: undefined): string; + encodeFunctionData(functionFragment: "paused", values?: undefined): string; + encodeFunctionData(functionFragment: "pot", values?: undefined): string; + encodeFunctionData( + functionFragment: "remainingBalance", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "renounceRole", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "revokeRole", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setMinimumValidityBlocks", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setPrice", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "supportsInterface", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "topUp", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData(functionFragment: "totalPot", values?: undefined): string; + encodeFunctionData(functionFragment: "unPause", values?: undefined): string; + encodeFunctionData( + functionFragment: "validChunkCount", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "withdraw", + values: [PromiseOrValue] + ): string; + + decodeFunctionResult( + functionFragment: "DEFAULT_ADMIN_ROLE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "PAUSER_ROLE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "PRICE_ORACLE_ROLE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "REDISTRIBUTOR_ROLE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "batchBucketDepth", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "batchDepth", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "batchImmutableFlag", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "batchLastUpdatedBlockNumber", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "batchNormalisedBalance", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "batchOwner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "batches", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "bzzToken", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "copyBatch", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "copyBatchBulk", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createBatch", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "currentTotalOutPayment", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "expireLimited", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "expiredBatchesExist", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "firstBatchId", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getRoleAdmin", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "grantRole", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "hasRole", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "increaseDepth", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isBatchesTreeEmpty", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "lastExpiryBalance", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "lastPrice", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "lastUpdatedBlock", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "minimumBucketDepth", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "minimumInitialBalancePerChunk", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "minimumValidityBlocks", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "pause", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "paused", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "pot", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "remainingBalance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceRole", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "revokeRole", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setMinimumValidityBlocks", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "setPrice", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "supportsInterface", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "topUp", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "totalPot", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "unPause", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "validChunkCount", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result; + + events: { + "BatchCreated(bytes32,uint256,uint256,address,uint8,uint8,bool)": EventFragment; + "BatchDepthIncrease(bytes32,uint8,uint256)": EventFragment; + "BatchTopUp(bytes32,uint256,uint256)": EventFragment; + "CopyBatchFailed(uint256,bytes32)": EventFragment; + "Paused(address)": EventFragment; + "PotWithdrawn(address,uint256)": EventFragment; + "PriceUpdate(uint256)": EventFragment; + "RoleAdminChanged(bytes32,bytes32,bytes32)": EventFragment; + "RoleGranted(bytes32,address,address)": EventFragment; + "RoleRevoked(bytes32,address,address)": EventFragment; + "Unpaused(address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "BatchCreated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "BatchDepthIncrease"): EventFragment; + getEvent(nameOrSignatureOrTopic: "BatchTopUp"): EventFragment; + getEvent(nameOrSignatureOrTopic: "CopyBatchFailed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Paused"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PotWithdrawn"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PriceUpdate"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RoleAdminChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RoleGranted"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RoleRevoked"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Unpaused"): EventFragment; +} + +export interface BatchCreatedEventObject { + batchId: string; + totalAmount: BigNumber; + normalisedBalance: BigNumber; + owner: string; + depth: number; + bucketDepth: number; + immutableFlag: boolean; +} +export type BatchCreatedEvent = TypedEvent< + [string, BigNumber, BigNumber, string, number, number, boolean], + BatchCreatedEventObject +>; + +export type BatchCreatedEventFilter = TypedEventFilter; + +export interface BatchDepthIncreaseEventObject { + batchId: string; + newDepth: number; + normalisedBalance: BigNumber; +} +export type BatchDepthIncreaseEvent = TypedEvent< + [string, number, BigNumber], + BatchDepthIncreaseEventObject +>; + +export type BatchDepthIncreaseEventFilter = + TypedEventFilter; + +export interface BatchTopUpEventObject { + batchId: string; + topupAmount: BigNumber; + normalisedBalance: BigNumber; +} +export type BatchTopUpEvent = TypedEvent< + [string, BigNumber, BigNumber], + BatchTopUpEventObject +>; + +export type BatchTopUpEventFilter = TypedEventFilter; + +export interface CopyBatchFailedEventObject { + index: BigNumber; + batchId: string; +} +export type CopyBatchFailedEvent = TypedEvent< + [BigNumber, string], + CopyBatchFailedEventObject +>; + +export type CopyBatchFailedEventFilter = TypedEventFilter; + +export interface PausedEventObject { + account: string; +} +export type PausedEvent = TypedEvent<[string], PausedEventObject>; + +export type PausedEventFilter = TypedEventFilter; + +export interface PotWithdrawnEventObject { + recipient: string; + totalAmount: BigNumber; +} +export type PotWithdrawnEvent = TypedEvent< + [string, BigNumber], + PotWithdrawnEventObject +>; + +export type PotWithdrawnEventFilter = TypedEventFilter; + +export interface PriceUpdateEventObject { + price: BigNumber; +} +export type PriceUpdateEvent = TypedEvent<[BigNumber], PriceUpdateEventObject>; + +export type PriceUpdateEventFilter = TypedEventFilter; + +export interface RoleAdminChangedEventObject { + role: string; + previousAdminRole: string; + newAdminRole: string; +} +export type RoleAdminChangedEvent = TypedEvent< + [string, string, string], + RoleAdminChangedEventObject +>; + +export type RoleAdminChangedEventFilter = + TypedEventFilter; + +export interface RoleGrantedEventObject { + role: string; + account: string; + sender: string; +} +export type RoleGrantedEvent = TypedEvent< + [string, string, string], + RoleGrantedEventObject +>; + +export type RoleGrantedEventFilter = TypedEventFilter; + +export interface RoleRevokedEventObject { + role: string; + account: string; + sender: string; +} +export type RoleRevokedEvent = TypedEvent< + [string, string, string], + RoleRevokedEventObject +>; + +export type RoleRevokedEventFilter = TypedEventFilter; + +export interface UnpausedEventObject { + account: string; +} +export type UnpausedEvent = TypedEvent<[string], UnpausedEventObject>; + +export type UnpausedEventFilter = TypedEventFilter; + +export interface PostageStamp extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: PostageStampInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise<[string]>; + + PAUSER_ROLE(overrides?: CallOverrides): Promise<[string]>; + + PRICE_ORACLE_ROLE(overrides?: CallOverrides): Promise<[string]>; + + REDISTRIBUTOR_ROLE(overrides?: CallOverrides): Promise<[string]>; + + batchBucketDepth( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[number]>; + + batchDepth( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[number]>; + + batchImmutableFlag( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[boolean]>; + + batchLastUpdatedBlockNumber( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + batchNormalisedBalance( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + batchOwner( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[string]>; + + batches( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [string, number, number, boolean, BigNumber, BigNumber] & { + owner: string; + depth: number; + bucketDepth: number; + immutableFlag: boolean; + normalisedBalance: BigNumber; + lastUpdatedBlockNumber: BigNumber; + } + >; + + bzzToken(overrides?: CallOverrides): Promise<[string]>; + + copyBatch( + _owner: PromiseOrValue, + _initialBalancePerChunk: PromiseOrValue, + _depth: PromiseOrValue, + _bucketDepth: PromiseOrValue, + _batchId: PromiseOrValue, + _immutable: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + copyBatchBulk( + bulkBatches: PostageStamp.ImportBatchStruct[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + createBatch( + _owner: PromiseOrValue, + _initialBalancePerChunk: PromiseOrValue, + _depth: PromiseOrValue, + _bucketDepth: PromiseOrValue, + _nonce: PromiseOrValue, + _immutable: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + currentTotalOutPayment(overrides?: CallOverrides): Promise<[BigNumber]>; + + expireLimited( + limit: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + expiredBatchesExist(overrides?: CallOverrides): Promise<[boolean]>; + + firstBatchId(overrides?: CallOverrides): Promise<[string]>; + + getRoleAdmin( + role: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[string]>; + + grantRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + hasRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[boolean]>; + + increaseDepth( + _batchId: PromiseOrValue, + _newDepth: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + isBatchesTreeEmpty(overrides?: CallOverrides): Promise<[boolean]>; + + lastExpiryBalance(overrides?: CallOverrides): Promise<[BigNumber]>; + + lastPrice(overrides?: CallOverrides): Promise<[BigNumber]>; + + lastUpdatedBlock(overrides?: CallOverrides): Promise<[BigNumber]>; + + minimumBucketDepth(overrides?: CallOverrides): Promise<[number]>; + + minimumInitialBalancePerChunk( + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + minimumValidityBlocks(overrides?: CallOverrides): Promise<[BigNumber]>; + + pause( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + paused(overrides?: CallOverrides): Promise<[boolean]>; + + pot(overrides?: CallOverrides): Promise<[BigNumber]>; + + remainingBalance( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + renounceRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + revokeRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMinimumValidityBlocks( + _value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setPrice( + _price: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[boolean]>; + + topUp( + _batchId: PromiseOrValue, + _topupAmountPerChunk: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + totalPot( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + unPause( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + validChunkCount(overrides?: CallOverrides): Promise<[BigNumber]>; + + withdraw( + beneficiary: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise; + + PAUSER_ROLE(overrides?: CallOverrides): Promise; + + PRICE_ORACLE_ROLE(overrides?: CallOverrides): Promise; + + REDISTRIBUTOR_ROLE(overrides?: CallOverrides): Promise; + + batchBucketDepth( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchDepth( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchImmutableFlag( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchLastUpdatedBlockNumber( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchNormalisedBalance( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchOwner( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batches( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [string, number, number, boolean, BigNumber, BigNumber] & { + owner: string; + depth: number; + bucketDepth: number; + immutableFlag: boolean; + normalisedBalance: BigNumber; + lastUpdatedBlockNumber: BigNumber; + } + >; + + bzzToken(overrides?: CallOverrides): Promise; + + copyBatch( + _owner: PromiseOrValue, + _initialBalancePerChunk: PromiseOrValue, + _depth: PromiseOrValue, + _bucketDepth: PromiseOrValue, + _batchId: PromiseOrValue, + _immutable: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + copyBatchBulk( + bulkBatches: PostageStamp.ImportBatchStruct[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + createBatch( + _owner: PromiseOrValue, + _initialBalancePerChunk: PromiseOrValue, + _depth: PromiseOrValue, + _bucketDepth: PromiseOrValue, + _nonce: PromiseOrValue, + _immutable: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + currentTotalOutPayment(overrides?: CallOverrides): Promise; + + expireLimited( + limit: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + expiredBatchesExist(overrides?: CallOverrides): Promise; + + firstBatchId(overrides?: CallOverrides): Promise; + + getRoleAdmin( + role: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + grantRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + hasRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + increaseDepth( + _batchId: PromiseOrValue, + _newDepth: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + isBatchesTreeEmpty(overrides?: CallOverrides): Promise; + + lastExpiryBalance(overrides?: CallOverrides): Promise; + + lastPrice(overrides?: CallOverrides): Promise; + + lastUpdatedBlock(overrides?: CallOverrides): Promise; + + minimumBucketDepth(overrides?: CallOverrides): Promise; + + minimumInitialBalancePerChunk(overrides?: CallOverrides): Promise; + + minimumValidityBlocks(overrides?: CallOverrides): Promise; + + pause( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + paused(overrides?: CallOverrides): Promise; + + pot(overrides?: CallOverrides): Promise; + + remainingBalance( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + renounceRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + revokeRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMinimumValidityBlocks( + _value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setPrice( + _price: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + topUp( + _batchId: PromiseOrValue, + _topupAmountPerChunk: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + totalPot( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + unPause( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + validChunkCount(overrides?: CallOverrides): Promise; + + withdraw( + beneficiary: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + callStatic: { + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise; + + PAUSER_ROLE(overrides?: CallOverrides): Promise; + + PRICE_ORACLE_ROLE(overrides?: CallOverrides): Promise; + + REDISTRIBUTOR_ROLE(overrides?: CallOverrides): Promise; + + batchBucketDepth( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchDepth( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchImmutableFlag( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchLastUpdatedBlockNumber( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchNormalisedBalance( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchOwner( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batches( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [string, number, number, boolean, BigNumber, BigNumber] & { + owner: string; + depth: number; + bucketDepth: number; + immutableFlag: boolean; + normalisedBalance: BigNumber; + lastUpdatedBlockNumber: BigNumber; + } + >; + + bzzToken(overrides?: CallOverrides): Promise; + + copyBatch( + _owner: PromiseOrValue, + _initialBalancePerChunk: PromiseOrValue, + _depth: PromiseOrValue, + _bucketDepth: PromiseOrValue, + _batchId: PromiseOrValue, + _immutable: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + copyBatchBulk( + bulkBatches: PostageStamp.ImportBatchStruct[], + overrides?: CallOverrides + ): Promise; + + createBatch( + _owner: PromiseOrValue, + _initialBalancePerChunk: PromiseOrValue, + _depth: PromiseOrValue, + _bucketDepth: PromiseOrValue, + _nonce: PromiseOrValue, + _immutable: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + currentTotalOutPayment(overrides?: CallOverrides): Promise; + + expireLimited( + limit: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + expiredBatchesExist(overrides?: CallOverrides): Promise; + + firstBatchId(overrides?: CallOverrides): Promise; + + getRoleAdmin( + role: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + grantRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + hasRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + increaseDepth( + _batchId: PromiseOrValue, + _newDepth: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + isBatchesTreeEmpty(overrides?: CallOverrides): Promise; + + lastExpiryBalance(overrides?: CallOverrides): Promise; + + lastPrice(overrides?: CallOverrides): Promise; + + lastUpdatedBlock(overrides?: CallOverrides): Promise; + + minimumBucketDepth(overrides?: CallOverrides): Promise; + + minimumInitialBalancePerChunk( + overrides?: CallOverrides + ): Promise; + + minimumValidityBlocks(overrides?: CallOverrides): Promise; + + pause(overrides?: CallOverrides): Promise; + + paused(overrides?: CallOverrides): Promise; + + pot(overrides?: CallOverrides): Promise; + + remainingBalance( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + renounceRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + revokeRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setMinimumValidityBlocks( + _value: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setPrice( + _price: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + topUp( + _batchId: PromiseOrValue, + _topupAmountPerChunk: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + totalPot(overrides?: CallOverrides): Promise; + + unPause(overrides?: CallOverrides): Promise; + + validChunkCount(overrides?: CallOverrides): Promise; + + withdraw( + beneficiary: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "BatchCreated(bytes32,uint256,uint256,address,uint8,uint8,bool)"( + batchId?: PromiseOrValue | null, + totalAmount?: null, + normalisedBalance?: null, + owner?: null, + depth?: null, + bucketDepth?: null, + immutableFlag?: null + ): BatchCreatedEventFilter; + BatchCreated( + batchId?: PromiseOrValue | null, + totalAmount?: null, + normalisedBalance?: null, + owner?: null, + depth?: null, + bucketDepth?: null, + immutableFlag?: null + ): BatchCreatedEventFilter; + + "BatchDepthIncrease(bytes32,uint8,uint256)"( + batchId?: PromiseOrValue | null, + newDepth?: null, + normalisedBalance?: null + ): BatchDepthIncreaseEventFilter; + BatchDepthIncrease( + batchId?: PromiseOrValue | null, + newDepth?: null, + normalisedBalance?: null + ): BatchDepthIncreaseEventFilter; + + "BatchTopUp(bytes32,uint256,uint256)"( + batchId?: PromiseOrValue | null, + topupAmount?: null, + normalisedBalance?: null + ): BatchTopUpEventFilter; + BatchTopUp( + batchId?: PromiseOrValue | null, + topupAmount?: null, + normalisedBalance?: null + ): BatchTopUpEventFilter; + + "CopyBatchFailed(uint256,bytes32)"( + index?: null, + batchId?: null + ): CopyBatchFailedEventFilter; + CopyBatchFailed(index?: null, batchId?: null): CopyBatchFailedEventFilter; + + "Paused(address)"(account?: null): PausedEventFilter; + Paused(account?: null): PausedEventFilter; + + "PotWithdrawn(address,uint256)"( + recipient?: null, + totalAmount?: null + ): PotWithdrawnEventFilter; + PotWithdrawn(recipient?: null, totalAmount?: null): PotWithdrawnEventFilter; + + "PriceUpdate(uint256)"(price?: null): PriceUpdateEventFilter; + PriceUpdate(price?: null): PriceUpdateEventFilter; + + "RoleAdminChanged(bytes32,bytes32,bytes32)"( + role?: PromiseOrValue | null, + previousAdminRole?: PromiseOrValue | null, + newAdminRole?: PromiseOrValue | null + ): RoleAdminChangedEventFilter; + RoleAdminChanged( + role?: PromiseOrValue | null, + previousAdminRole?: PromiseOrValue | null, + newAdminRole?: PromiseOrValue | null + ): RoleAdminChangedEventFilter; + + "RoleGranted(bytes32,address,address)"( + role?: PromiseOrValue | null, + account?: PromiseOrValue | null, + sender?: PromiseOrValue | null + ): RoleGrantedEventFilter; + RoleGranted( + role?: PromiseOrValue | null, + account?: PromiseOrValue | null, + sender?: PromiseOrValue | null + ): RoleGrantedEventFilter; + + "RoleRevoked(bytes32,address,address)"( + role?: PromiseOrValue | null, + account?: PromiseOrValue | null, + sender?: PromiseOrValue | null + ): RoleRevokedEventFilter; + RoleRevoked( + role?: PromiseOrValue | null, + account?: PromiseOrValue | null, + sender?: PromiseOrValue | null + ): RoleRevokedEventFilter; + + "Unpaused(address)"(account?: null): UnpausedEventFilter; + Unpaused(account?: null): UnpausedEventFilter; + }; + + estimateGas: { + DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise; + + PAUSER_ROLE(overrides?: CallOverrides): Promise; + + PRICE_ORACLE_ROLE(overrides?: CallOverrides): Promise; + + REDISTRIBUTOR_ROLE(overrides?: CallOverrides): Promise; + + batchBucketDepth( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchDepth( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchImmutableFlag( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchLastUpdatedBlockNumber( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchNormalisedBalance( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchOwner( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batches( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + bzzToken(overrides?: CallOverrides): Promise; + + copyBatch( + _owner: PromiseOrValue, + _initialBalancePerChunk: PromiseOrValue, + _depth: PromiseOrValue, + _bucketDepth: PromiseOrValue, + _batchId: PromiseOrValue, + _immutable: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + copyBatchBulk( + bulkBatches: PostageStamp.ImportBatchStruct[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + createBatch( + _owner: PromiseOrValue, + _initialBalancePerChunk: PromiseOrValue, + _depth: PromiseOrValue, + _bucketDepth: PromiseOrValue, + _nonce: PromiseOrValue, + _immutable: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + currentTotalOutPayment(overrides?: CallOverrides): Promise; + + expireLimited( + limit: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + expiredBatchesExist(overrides?: CallOverrides): Promise; + + firstBatchId(overrides?: CallOverrides): Promise; + + getRoleAdmin( + role: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + grantRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + hasRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + increaseDepth( + _batchId: PromiseOrValue, + _newDepth: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + isBatchesTreeEmpty(overrides?: CallOverrides): Promise; + + lastExpiryBalance(overrides?: CallOverrides): Promise; + + lastPrice(overrides?: CallOverrides): Promise; + + lastUpdatedBlock(overrides?: CallOverrides): Promise; + + minimumBucketDepth(overrides?: CallOverrides): Promise; + + minimumInitialBalancePerChunk( + overrides?: CallOverrides + ): Promise; + + minimumValidityBlocks(overrides?: CallOverrides): Promise; + + pause( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + paused(overrides?: CallOverrides): Promise; + + pot(overrides?: CallOverrides): Promise; + + remainingBalance( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + renounceRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + revokeRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMinimumValidityBlocks( + _value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setPrice( + _price: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + topUp( + _batchId: PromiseOrValue, + _topupAmountPerChunk: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + totalPot( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + unPause( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + validChunkCount(overrides?: CallOverrides): Promise; + + withdraw( + beneficiary: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + populateTransaction: { + DEFAULT_ADMIN_ROLE( + overrides?: CallOverrides + ): Promise; + + PAUSER_ROLE(overrides?: CallOverrides): Promise; + + PRICE_ORACLE_ROLE(overrides?: CallOverrides): Promise; + + REDISTRIBUTOR_ROLE( + overrides?: CallOverrides + ): Promise; + + batchBucketDepth( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchDepth( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchImmutableFlag( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchLastUpdatedBlockNumber( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchNormalisedBalance( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batchOwner( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + batches( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + bzzToken(overrides?: CallOverrides): Promise; + + copyBatch( + _owner: PromiseOrValue, + _initialBalancePerChunk: PromiseOrValue, + _depth: PromiseOrValue, + _bucketDepth: PromiseOrValue, + _batchId: PromiseOrValue, + _immutable: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + copyBatchBulk( + bulkBatches: PostageStamp.ImportBatchStruct[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + createBatch( + _owner: PromiseOrValue, + _initialBalancePerChunk: PromiseOrValue, + _depth: PromiseOrValue, + _bucketDepth: PromiseOrValue, + _nonce: PromiseOrValue, + _immutable: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + currentTotalOutPayment( + overrides?: CallOverrides + ): Promise; + + expireLimited( + limit: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + expiredBatchesExist( + overrides?: CallOverrides + ): Promise; + + firstBatchId(overrides?: CallOverrides): Promise; + + getRoleAdmin( + role: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + grantRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + hasRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + increaseDepth( + _batchId: PromiseOrValue, + _newDepth: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + isBatchesTreeEmpty( + overrides?: CallOverrides + ): Promise; + + lastExpiryBalance(overrides?: CallOverrides): Promise; + + lastPrice(overrides?: CallOverrides): Promise; + + lastUpdatedBlock(overrides?: CallOverrides): Promise; + + minimumBucketDepth( + overrides?: CallOverrides + ): Promise; + + minimumInitialBalancePerChunk( + overrides?: CallOverrides + ): Promise; + + minimumValidityBlocks( + overrides?: CallOverrides + ): Promise; + + pause( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + paused(overrides?: CallOverrides): Promise; + + pot(overrides?: CallOverrides): Promise; + + remainingBalance( + _batchId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + renounceRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + revokeRole( + role: PromiseOrValue, + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMinimumValidityBlocks( + _value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setPrice( + _price: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + topUp( + _batchId: PromiseOrValue, + _topupAmountPerChunk: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + totalPot( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + unPause( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + validChunkCount(overrides?: CallOverrides): Promise; + + withdraw( + beneficiary: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; +} diff --git a/src/types/contracts/Redistribution.ts b/src/types/contracts/Redistribution.ts index a3e860e..840c308 100644 --- a/src/types/contracts/Redistribution.ts +++ b/src/types/contracts/Redistribution.ts @@ -25,32 +25,96 @@ import type { TypedListener, OnEvent, PromiseOrValue, -} from "./common.js"; +} from "./common"; export declare namespace Redistribution { export type RevealStruct = { - owner: PromiseOrValue; overlay: PromiseOrValue; + owner: PromiseOrValue; + depth: PromiseOrValue; stake: PromiseOrValue; stakeDensity: PromiseOrValue; hash: PromiseOrValue; - depth: PromiseOrValue; }; export type RevealStructOutput = [ string, string, + number, BigNumber, BigNumber, - string, - number + string ] & { - owner: string; overlay: string; + owner: string; + depth: number; stake: BigNumber; stakeDensity: BigNumber; hash: string; - depth: number; + }; + + export type PostageProofStruct = { + signature: PromiseOrValue; + postageId: PromiseOrValue; + index: PromiseOrValue; + timeStamp: PromiseOrValue; + }; + + export type PostageProofStructOutput = [ + string, + string, + BigNumber, + BigNumber + ] & { + signature: string; + postageId: string; + index: BigNumber; + timeStamp: BigNumber; + }; + + export type SOCProofStruct = { + signer: PromiseOrValue; + signature: PromiseOrValue; + identifier: PromiseOrValue; + chunkAddr: PromiseOrValue; + }; + + export type SOCProofStructOutput = [string, string, string, string] & { + signer: string; + signature: string; + identifier: string; + chunkAddr: string; + }; + + export type ChunkInclusionProofStruct = { + proofSegments: PromiseOrValue[]; + proveSegment: PromiseOrValue; + proofSegments2: PromiseOrValue[]; + proveSegment2: PromiseOrValue; + chunkSpan: PromiseOrValue; + proofSegments3: PromiseOrValue[]; + postageProof: Redistribution.PostageProofStruct; + socProof: Redistribution.SOCProofStruct[]; + }; + + export type ChunkInclusionProofStructOutput = [ + string[], + string, + string[], + string, + BigNumber, + string[], + Redistribution.PostageProofStructOutput, + Redistribution.SOCProofStructOutput[] + ] & { + proofSegments: string[]; + proveSegment: string; + proofSegments2: string[]; + proveSegment2: string; + chunkSpan: BigNumber; + proofSegments3: string[]; + postageProof: Redistribution.PostageProofStructOutput; + socProof: Redistribution.SOCProofStructOutput[]; }; } @@ -58,14 +122,14 @@ export interface RedistributionInterface extends utils.Interface { functions: { "DEFAULT_ADMIN_ROLE()": FunctionFragment; "OracleContract()": FunctionFragment; - "PAUSER_ROLE()": FunctionFragment; "PostageContract()": FunctionFragment; "Stakes()": FunctionFragment; - "claim()": FunctionFragment; - "commit(bytes32,bytes32,uint256)": FunctionFragment; + "claim((bytes32[],bytes32,bytes32[],bytes32,uint64,bytes32[],(bytes,bytes32,uint64,uint64),(address,bytes,bytes32,bytes32)[]),(bytes32[],bytes32,bytes32[],bytes32,uint64,bytes32[],(bytes,bytes32,uint64,uint64),(address,bytes,bytes32,bytes32)[]),(bytes32[],bytes32,bytes32[],bytes32,uint64,bytes32[],(bytes,bytes32,uint64,uint64),(address,bytes,bytes32,bytes32)[]))": FunctionFragment; + "commit(bytes32,bytes32,uint64)": FunctionFragment; "currentClaimRound()": FunctionFragment; "currentCommitRound()": FunctionFragment; "currentCommits(uint256)": FunctionFragment; + "currentMinimumDepth()": FunctionFragment; "currentPhaseClaim()": FunctionFragment; "currentPhaseCommit()": FunctionFragment; "currentPhaseReveal()": FunctionFragment; @@ -81,16 +145,14 @@ export interface RedistributionInterface extends utils.Interface { "inProximity(bytes32,bytes32,uint8)": FunctionFragment; "isParticipatingInUpcomingRound(bytes32,uint8)": FunctionFragment; "isWinner(bytes32)": FunctionFragment; - "minimumStake()": FunctionFragment; "nextSeed()": FunctionFragment; "pause()": FunctionFragment; "paused()": FunctionFragment; - "penaltyMultiplierDisagreement()": FunctionFragment; - "penaltyMultiplierNonRevealed()": FunctionFragment; "renounceRole(bytes32,address)": FunctionFragment; "reveal(bytes32,uint8,bytes32,bytes32)": FunctionFragment; "revokeRole(bytes32,address)": FunctionFragment; - "roundLength()": FunctionFragment; + "setFreezingParams(uint8,uint8)": FunctionFragment; + "setSampleMaxValue(uint256)": FunctionFragment; "supportsInterface(bytes4)": FunctionFragment; "unPause()": FunctionFragment; "winner()": FunctionFragment; @@ -101,7 +163,6 @@ export interface RedistributionInterface extends utils.Interface { nameOrSignatureOrTopic: | "DEFAULT_ADMIN_ROLE" | "OracleContract" - | "PAUSER_ROLE" | "PostageContract" | "Stakes" | "claim" @@ -109,6 +170,7 @@ export interface RedistributionInterface extends utils.Interface { | "currentClaimRound" | "currentCommitRound" | "currentCommits" + | "currentMinimumDepth" | "currentPhaseClaim" | "currentPhaseCommit" | "currentPhaseReveal" @@ -124,16 +186,14 @@ export interface RedistributionInterface extends utils.Interface { | "inProximity" | "isParticipatingInUpcomingRound" | "isWinner" - | "minimumStake" | "nextSeed" | "pause" | "paused" - | "penaltyMultiplierDisagreement" - | "penaltyMultiplierNonRevealed" | "renounceRole" | "reveal" | "revokeRole" - | "roundLength" + | "setFreezingParams" + | "setSampleMaxValue" | "supportsInterface" | "unPause" | "winner" @@ -148,16 +208,19 @@ export interface RedistributionInterface extends utils.Interface { functionFragment: "OracleContract", values?: undefined ): string; - encodeFunctionData( - functionFragment: "PAUSER_ROLE", - values?: undefined - ): string; encodeFunctionData( functionFragment: "PostageContract", values?: undefined ): string; encodeFunctionData(functionFragment: "Stakes", values?: undefined): string; - encodeFunctionData(functionFragment: "claim", values?: undefined): string; + encodeFunctionData( + functionFragment: "claim", + values: [ + Redistribution.ChunkInclusionProofStruct, + Redistribution.ChunkInclusionProofStruct, + Redistribution.ChunkInclusionProofStruct + ] + ): string; encodeFunctionData( functionFragment: "commit", values: [ @@ -178,6 +241,10 @@ export interface RedistributionInterface extends utils.Interface { functionFragment: "currentCommits", values: [PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "currentMinimumDepth", + values?: undefined + ): string; encodeFunctionData( functionFragment: "currentPhaseClaim", values?: undefined @@ -242,21 +309,9 @@ export interface RedistributionInterface extends utils.Interface { functionFragment: "isWinner", values: [PromiseOrValue] ): string; - encodeFunctionData( - functionFragment: "minimumStake", - values?: undefined - ): string; encodeFunctionData(functionFragment: "nextSeed", values?: undefined): string; encodeFunctionData(functionFragment: "pause", values?: undefined): string; encodeFunctionData(functionFragment: "paused", values?: undefined): string; - encodeFunctionData( - functionFragment: "penaltyMultiplierDisagreement", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "penaltyMultiplierNonRevealed", - values?: undefined - ): string; encodeFunctionData( functionFragment: "renounceRole", values: [PromiseOrValue, PromiseOrValue] @@ -275,8 +330,12 @@ export interface RedistributionInterface extends utils.Interface { values: [PromiseOrValue, PromiseOrValue] ): string; encodeFunctionData( - functionFragment: "roundLength", - values?: undefined + functionFragment: "setFreezingParams", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setSampleMaxValue", + values: [PromiseOrValue] ): string; encodeFunctionData( functionFragment: "supportsInterface", @@ -302,10 +361,6 @@ export interface RedistributionInterface extends utils.Interface { functionFragment: "OracleContract", data: BytesLike ): Result; - decodeFunctionResult( - functionFragment: "PAUSER_ROLE", - data: BytesLike - ): Result; decodeFunctionResult( functionFragment: "PostageContract", data: BytesLike @@ -325,6 +380,10 @@ export interface RedistributionInterface extends utils.Interface { functionFragment: "currentCommits", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "currentMinimumDepth", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "currentPhaseClaim", data: BytesLike @@ -376,21 +435,9 @@ export interface RedistributionInterface extends utils.Interface { data: BytesLike ): Result; decodeFunctionResult(functionFragment: "isWinner", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "minimumStake", - data: BytesLike - ): Result; decodeFunctionResult(functionFragment: "nextSeed", data: BytesLike): Result; decodeFunctionResult(functionFragment: "pause", data: BytesLike): Result; decodeFunctionResult(functionFragment: "paused", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "penaltyMultiplierDisagreement", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "penaltyMultiplierNonRevealed", - data: BytesLike - ): Result; decodeFunctionResult( functionFragment: "renounceRole", data: BytesLike @@ -398,7 +445,11 @@ export interface RedistributionInterface extends utils.Interface { decodeFunctionResult(functionFragment: "reveal", data: BytesLike): Result; decodeFunctionResult(functionFragment: "revokeRole", data: BytesLike): Result; decodeFunctionResult( - functionFragment: "roundLength", + functionFragment: "setFreezingParams", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setSampleMaxValue", data: BytesLike ): Result; decodeFunctionResult( @@ -410,9 +461,11 @@ export interface RedistributionInterface extends utils.Interface { decodeFunctionResult(functionFragment: "wrapCommit", data: BytesLike): Result; events: { + "ChunkCount(uint256)": EventFragment; "Committed(uint256,bytes32)": EventFragment; "CountCommits(uint256)": EventFragment; "CountReveals(uint256)": EventFragment; + "CurrentRevealAnchor(uint256,bytes32)": EventFragment; "Paused(address)": EventFragment; "Revealed(uint256,bytes32,uint256,uint256,bytes32,uint8)": EventFragment; "RoleAdminChanged(bytes32,bytes32,bytes32)": EventFragment; @@ -421,11 +474,14 @@ export interface RedistributionInterface extends utils.Interface { "TruthSelected(bytes32,uint8)": EventFragment; "Unpaused(address)": EventFragment; "WinnerSelected(tuple)": EventFragment; + "transformedChunkAddressFromInclusionProof(uint256,bytes32)": EventFragment; }; + getEvent(nameOrSignatureOrTopic: "ChunkCount"): EventFragment; getEvent(nameOrSignatureOrTopic: "Committed"): EventFragment; getEvent(nameOrSignatureOrTopic: "CountCommits"): EventFragment; getEvent(nameOrSignatureOrTopic: "CountReveals"): EventFragment; + getEvent(nameOrSignatureOrTopic: "CurrentRevealAnchor"): EventFragment; getEvent(nameOrSignatureOrTopic: "Paused"): EventFragment; getEvent(nameOrSignatureOrTopic: "Revealed"): EventFragment; getEvent(nameOrSignatureOrTopic: "RoleAdminChanged"): EventFragment; @@ -434,7 +490,17 @@ export interface RedistributionInterface extends utils.Interface { getEvent(nameOrSignatureOrTopic: "TruthSelected"): EventFragment; getEvent(nameOrSignatureOrTopic: "Unpaused"): EventFragment; getEvent(nameOrSignatureOrTopic: "WinnerSelected"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "transformedChunkAddressFromInclusionProof" + ): EventFragment; +} + +export interface ChunkCountEventObject { + validChunkCount: BigNumber; } +export type ChunkCountEvent = TypedEvent<[BigNumber], ChunkCountEventObject>; + +export type ChunkCountEventFilter = TypedEventFilter; export interface CommittedEventObject { roundNumber: BigNumber; @@ -467,6 +533,18 @@ export type CountRevealsEvent = TypedEvent< export type CountRevealsEventFilter = TypedEventFilter; +export interface CurrentRevealAnchorEventObject { + roundNumber: BigNumber; + anchor: string; +} +export type CurrentRevealAnchorEvent = TypedEvent< + [BigNumber, string], + CurrentRevealAnchorEventObject +>; + +export type CurrentRevealAnchorEventFilter = + TypedEventFilter; + export interface PausedEventObject { account: string; } @@ -554,6 +632,18 @@ export type WinnerSelectedEvent = TypedEvent< export type WinnerSelectedEventFilter = TypedEventFilter; +export interface transformedChunkAddressFromInclusionProofEventObject { + indexInRC: BigNumber; + chunkAddress: string; +} +export type transformedChunkAddressFromInclusionProofEvent = TypedEvent< + [BigNumber, string], + transformedChunkAddressFromInclusionProofEventObject +>; + +export type transformedChunkAddressFromInclusionProofEventFilter = + TypedEventFilter; + export interface Redistribution extends BaseContract { connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; @@ -585,13 +675,14 @@ export interface Redistribution extends BaseContract { OracleContract(overrides?: CallOverrides): Promise<[string]>; - PAUSER_ROLE(overrides?: CallOverrides): Promise<[string]>; - PostageContract(overrides?: CallOverrides): Promise<[string]>; Stakes(overrides?: CallOverrides): Promise<[string]>; claim( + entryProof1: Redistribution.ChunkInclusionProofStruct, + entryProof2: Redistribution.ChunkInclusionProofStruct, + entryProofLast: Redistribution.ChunkInclusionProofStruct, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -610,16 +701,18 @@ export interface Redistribution extends BaseContract { arg0: PromiseOrValue, overrides?: CallOverrides ): Promise< - [string, string, BigNumber, string, boolean, BigNumber] & { + [string, string, boolean, BigNumber, string, BigNumber] & { overlay: string; owner: string; + revealed: boolean; stake: BigNumber; obfuscatedHash: string; - revealed: boolean; revealIndex: BigNumber; } >; + currentMinimumDepth(overrides?: CallOverrides): Promise<[number]>; + currentPhaseClaim(overrides?: CallOverrides): Promise<[boolean]>; currentPhaseCommit(overrides?: CallOverrides): Promise<[boolean]>; @@ -632,13 +725,13 @@ export interface Redistribution extends BaseContract { arg0: PromiseOrValue, overrides?: CallOverrides ): Promise< - [string, string, BigNumber, BigNumber, string, number] & { - owner: string; + [string, string, number, BigNumber, BigNumber, string] & { overlay: string; + owner: string; + depth: number; stake: BigNumber; stakeDensity: BigNumber; hash: string; - depth: number; } >; @@ -689,8 +782,6 @@ export interface Redistribution extends BaseContract { overrides?: CallOverrides ): Promise<[boolean]>; - minimumStake(overrides?: CallOverrides): Promise<[BigNumber]>; - nextSeed(overrides?: CallOverrides): Promise<[string]>; pause( @@ -699,14 +790,6 @@ export interface Redistribution extends BaseContract { paused(overrides?: CallOverrides): Promise<[boolean]>; - penaltyMultiplierDisagreement( - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - penaltyMultiplierNonRevealed( - overrides?: CallOverrides - ): Promise<[BigNumber]>; - renounceRole( role: PromiseOrValue, account: PromiseOrValue, @@ -727,7 +810,16 @@ export interface Redistribution extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - roundLength(overrides?: CallOverrides): Promise<[BigNumber]>; + setFreezingParams( + _penaltyMultiplierDisagreement: PromiseOrValue, + _penaltyMultiplierNonRevealed: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setSampleMaxValue( + _sampleMaxValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; supportsInterface( interfaceId: PromiseOrValue, @@ -741,13 +833,13 @@ export interface Redistribution extends BaseContract { winner( overrides?: CallOverrides ): Promise< - [string, string, BigNumber, BigNumber, string, number] & { - owner: string; + [string, string, number, BigNumber, BigNumber, string] & { overlay: string; + owner: string; + depth: number; stake: BigNumber; stakeDensity: BigNumber; hash: string; - depth: number; } >; @@ -764,13 +856,14 @@ export interface Redistribution extends BaseContract { OracleContract(overrides?: CallOverrides): Promise; - PAUSER_ROLE(overrides?: CallOverrides): Promise; - PostageContract(overrides?: CallOverrides): Promise; Stakes(overrides?: CallOverrides): Promise; claim( + entryProof1: Redistribution.ChunkInclusionProofStruct, + entryProof2: Redistribution.ChunkInclusionProofStruct, + entryProofLast: Redistribution.ChunkInclusionProofStruct, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -789,16 +882,18 @@ export interface Redistribution extends BaseContract { arg0: PromiseOrValue, overrides?: CallOverrides ): Promise< - [string, string, BigNumber, string, boolean, BigNumber] & { + [string, string, boolean, BigNumber, string, BigNumber] & { overlay: string; owner: string; + revealed: boolean; stake: BigNumber; obfuscatedHash: string; - revealed: boolean; revealIndex: BigNumber; } >; + currentMinimumDepth(overrides?: CallOverrides): Promise; + currentPhaseClaim(overrides?: CallOverrides): Promise; currentPhaseCommit(overrides?: CallOverrides): Promise; @@ -811,13 +906,13 @@ export interface Redistribution extends BaseContract { arg0: PromiseOrValue, overrides?: CallOverrides ): Promise< - [string, string, BigNumber, BigNumber, string, number] & { - owner: string; + [string, string, number, BigNumber, BigNumber, string] & { overlay: string; + owner: string; + depth: number; stake: BigNumber; stakeDensity: BigNumber; hash: string; - depth: number; } >; @@ -866,8 +961,6 @@ export interface Redistribution extends BaseContract { overrides?: CallOverrides ): Promise; - minimumStake(overrides?: CallOverrides): Promise; - nextSeed(overrides?: CallOverrides): Promise; pause( @@ -876,10 +969,6 @@ export interface Redistribution extends BaseContract { paused(overrides?: CallOverrides): Promise; - penaltyMultiplierDisagreement(overrides?: CallOverrides): Promise; - - penaltyMultiplierNonRevealed(overrides?: CallOverrides): Promise; - renounceRole( role: PromiseOrValue, account: PromiseOrValue, @@ -900,7 +989,16 @@ export interface Redistribution extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - roundLength(overrides?: CallOverrides): Promise; + setFreezingParams( + _penaltyMultiplierDisagreement: PromiseOrValue, + _penaltyMultiplierNonRevealed: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setSampleMaxValue( + _sampleMaxValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; supportsInterface( interfaceId: PromiseOrValue, @@ -914,13 +1012,13 @@ export interface Redistribution extends BaseContract { winner( overrides?: CallOverrides ): Promise< - [string, string, BigNumber, BigNumber, string, number] & { - owner: string; + [string, string, number, BigNumber, BigNumber, string] & { overlay: string; + owner: string; + depth: number; stake: BigNumber; stakeDensity: BigNumber; hash: string; - depth: number; } >; @@ -937,13 +1035,16 @@ export interface Redistribution extends BaseContract { OracleContract(overrides?: CallOverrides): Promise; - PAUSER_ROLE(overrides?: CallOverrides): Promise; - PostageContract(overrides?: CallOverrides): Promise; Stakes(overrides?: CallOverrides): Promise; - claim(overrides?: CallOverrides): Promise; + claim( + entryProof1: Redistribution.ChunkInclusionProofStruct, + entryProof2: Redistribution.ChunkInclusionProofStruct, + entryProofLast: Redistribution.ChunkInclusionProofStruct, + overrides?: CallOverrides + ): Promise; commit( _obfuscatedHash: PromiseOrValue, @@ -960,16 +1061,18 @@ export interface Redistribution extends BaseContract { arg0: PromiseOrValue, overrides?: CallOverrides ): Promise< - [string, string, BigNumber, string, boolean, BigNumber] & { + [string, string, boolean, BigNumber, string, BigNumber] & { overlay: string; owner: string; + revealed: boolean; stake: BigNumber; obfuscatedHash: string; - revealed: boolean; revealIndex: BigNumber; } >; + currentMinimumDepth(overrides?: CallOverrides): Promise; + currentPhaseClaim(overrides?: CallOverrides): Promise; currentPhaseCommit(overrides?: CallOverrides): Promise; @@ -982,13 +1085,13 @@ export interface Redistribution extends BaseContract { arg0: PromiseOrValue, overrides?: CallOverrides ): Promise< - [string, string, BigNumber, BigNumber, string, number] & { - owner: string; + [string, string, number, BigNumber, BigNumber, string] & { overlay: string; + owner: string; + depth: number; stake: BigNumber; stakeDensity: BigNumber; hash: string; - depth: number; } >; @@ -1037,20 +1140,12 @@ export interface Redistribution extends BaseContract { overrides?: CallOverrides ): Promise; - minimumStake(overrides?: CallOverrides): Promise; - nextSeed(overrides?: CallOverrides): Promise; pause(overrides?: CallOverrides): Promise; paused(overrides?: CallOverrides): Promise; - penaltyMultiplierDisagreement( - overrides?: CallOverrides - ): Promise; - - penaltyMultiplierNonRevealed(overrides?: CallOverrides): Promise; - renounceRole( role: PromiseOrValue, account: PromiseOrValue, @@ -1071,7 +1166,16 @@ export interface Redistribution extends BaseContract { overrides?: CallOverrides ): Promise; - roundLength(overrides?: CallOverrides): Promise; + setFreezingParams( + _penaltyMultiplierDisagreement: PromiseOrValue, + _penaltyMultiplierNonRevealed: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setSampleMaxValue( + _sampleMaxValue: PromiseOrValue, + overrides?: CallOverrides + ): Promise; supportsInterface( interfaceId: PromiseOrValue, @@ -1083,13 +1187,13 @@ export interface Redistribution extends BaseContract { winner( overrides?: CallOverrides ): Promise< - [string, string, BigNumber, BigNumber, string, number] & { - owner: string; + [string, string, number, BigNumber, BigNumber, string] & { overlay: string; + owner: string; + depth: number; stake: BigNumber; stakeDensity: BigNumber; hash: string; - depth: number; } >; @@ -1103,6 +1207,9 @@ export interface Redistribution extends BaseContract { }; filters: { + "ChunkCount(uint256)"(validChunkCount?: null): ChunkCountEventFilter; + ChunkCount(validChunkCount?: null): ChunkCountEventFilter; + "Committed(uint256,bytes32)"( roundNumber?: null, overlay?: null @@ -1115,6 +1222,15 @@ export interface Redistribution extends BaseContract { "CountReveals(uint256)"(_count?: null): CountRevealsEventFilter; CountReveals(_count?: null): CountRevealsEventFilter; + "CurrentRevealAnchor(uint256,bytes32)"( + roundNumber?: null, + anchor?: null + ): CurrentRevealAnchorEventFilter; + CurrentRevealAnchor( + roundNumber?: null, + anchor?: null + ): CurrentRevealAnchorEventFilter; + "Paused(address)"(account?: null): PausedEventFilter; Paused(account?: null): PausedEventFilter; @@ -1179,6 +1295,15 @@ export interface Redistribution extends BaseContract { "WinnerSelected(tuple)"(winner?: null): WinnerSelectedEventFilter; WinnerSelected(winner?: null): WinnerSelectedEventFilter; + + "transformedChunkAddressFromInclusionProof(uint256,bytes32)"( + indexInRC?: null, + chunkAddress?: null + ): transformedChunkAddressFromInclusionProofEventFilter; + transformedChunkAddressFromInclusionProof( + indexInRC?: null, + chunkAddress?: null + ): transformedChunkAddressFromInclusionProofEventFilter; }; estimateGas: { @@ -1186,13 +1311,14 @@ export interface Redistribution extends BaseContract { OracleContract(overrides?: CallOverrides): Promise; - PAUSER_ROLE(overrides?: CallOverrides): Promise; - PostageContract(overrides?: CallOverrides): Promise; Stakes(overrides?: CallOverrides): Promise; claim( + entryProof1: Redistribution.ChunkInclusionProofStruct, + entryProof2: Redistribution.ChunkInclusionProofStruct, + entryProofLast: Redistribution.ChunkInclusionProofStruct, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1212,6 +1338,8 @@ export interface Redistribution extends BaseContract { overrides?: CallOverrides ): Promise; + currentMinimumDepth(overrides?: CallOverrides): Promise; + currentPhaseClaim(overrides?: CallOverrides): Promise; currentPhaseCommit(overrides?: CallOverrides): Promise; @@ -1268,8 +1396,6 @@ export interface Redistribution extends BaseContract { overrides?: CallOverrides ): Promise; - minimumStake(overrides?: CallOverrides): Promise; - nextSeed(overrides?: CallOverrides): Promise; pause( @@ -1278,12 +1404,6 @@ export interface Redistribution extends BaseContract { paused(overrides?: CallOverrides): Promise; - penaltyMultiplierDisagreement( - overrides?: CallOverrides - ): Promise; - - penaltyMultiplierNonRevealed(overrides?: CallOverrides): Promise; - renounceRole( role: PromiseOrValue, account: PromiseOrValue, @@ -1304,7 +1424,16 @@ export interface Redistribution extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - roundLength(overrides?: CallOverrides): Promise; + setFreezingParams( + _penaltyMultiplierDisagreement: PromiseOrValue, + _penaltyMultiplierNonRevealed: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setSampleMaxValue( + _sampleMaxValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; supportsInterface( interfaceId: PromiseOrValue, @@ -1333,13 +1462,14 @@ export interface Redistribution extends BaseContract { OracleContract(overrides?: CallOverrides): Promise; - PAUSER_ROLE(overrides?: CallOverrides): Promise; - PostageContract(overrides?: CallOverrides): Promise; Stakes(overrides?: CallOverrides): Promise; claim( + entryProof1: Redistribution.ChunkInclusionProofStruct, + entryProof2: Redistribution.ChunkInclusionProofStruct, + entryProofLast: Redistribution.ChunkInclusionProofStruct, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1361,6 +1491,10 @@ export interface Redistribution extends BaseContract { overrides?: CallOverrides ): Promise; + currentMinimumDepth( + overrides?: CallOverrides + ): Promise; + currentPhaseClaim(overrides?: CallOverrides): Promise; currentPhaseCommit( @@ -1427,8 +1561,6 @@ export interface Redistribution extends BaseContract { overrides?: CallOverrides ): Promise; - minimumStake(overrides?: CallOverrides): Promise; - nextSeed(overrides?: CallOverrides): Promise; pause( @@ -1437,14 +1569,6 @@ export interface Redistribution extends BaseContract { paused(overrides?: CallOverrides): Promise; - penaltyMultiplierDisagreement( - overrides?: CallOverrides - ): Promise; - - penaltyMultiplierNonRevealed( - overrides?: CallOverrides - ): Promise; - renounceRole( role: PromiseOrValue, account: PromiseOrValue, @@ -1465,7 +1589,16 @@ export interface Redistribution extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - roundLength(overrides?: CallOverrides): Promise; + setFreezingParams( + _penaltyMultiplierDisagreement: PromiseOrValue, + _penaltyMultiplierNonRevealed: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setSampleMaxValue( + _sampleMaxValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; supportsInterface( interfaceId: PromiseOrValue, diff --git a/src/types/contracts/StakeRegistry.ts b/src/types/contracts/StakeRegistry.ts index 6bdb31d..b89a84c 100644 --- a/src/types/contracts/StakeRegistry.ts +++ b/src/types/contracts/StakeRegistry.ts @@ -25,7 +25,7 @@ import type { TypedListener, OnEvent, PromiseOrValue, -} from "./common.js"; +} from "./common"; export interface StakeRegistryInterface extends utils.Interface { functions: { diff --git a/src/types/contracts/factories/BzzToken__factory.ts b/src/types/contracts/factories/BzzToken__factory.ts index b80fa9e..cdec0ba 100644 --- a/src/types/contracts/factories/BzzToken__factory.ts +++ b/src/types/contracts/factories/BzzToken__factory.ts @@ -4,7 +4,7 @@ import { Contract, Signer, utils } from "ethers"; import type { Provider } from "@ethersproject/providers"; -import type { BzzToken, BzzTokenInterface } from "../BzzToken.js"; +import type { BzzToken, BzzTokenInterface } from "../BzzToken"; const _abi = [ { diff --git a/src/types/contracts/factories/PostageStamp__factory.ts b/src/types/contracts/factories/PostageStamp__factory.ts new file mode 100644 index 0000000..1c691af --- /dev/null +++ b/src/types/contracts/factories/PostageStamp__factory.ts @@ -0,0 +1,1164 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { PostageStamp, PostageStampInterface } from "../PostageStamp"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "_bzzToken", + type: "address", + }, + { + internalType: "uint8", + name: "_minimumBucketDepth", + type: "uint8", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "AdministratorOnly", + type: "error", + }, + { + inputs: [], + name: "BatchDoesNotExist", + type: "error", + }, + { + inputs: [], + name: "BatchExists", + type: "error", + }, + { + inputs: [], + name: "BatchExpired", + type: "error", + }, + { + inputs: [], + name: "BatchTooSmall", + type: "error", + }, + { + inputs: [], + name: "DepthNotIncreasing", + type: "error", + }, + { + inputs: [], + name: "InsufficienChunkCount", + type: "error", + }, + { + inputs: [], + name: "InsufficientBalance", + type: "error", + }, + { + inputs: [], + name: "InvalidDepth", + type: "error", + }, + { + inputs: [], + name: "NoBatchesExist", + type: "error", + }, + { + inputs: [], + name: "NotBatchOwner", + type: "error", + }, + { + inputs: [], + name: "OnlyPauser", + type: "error", + }, + { + inputs: [], + name: "OnlyRedistributor", + type: "error", + }, + { + inputs: [], + name: "PriceOracleOnly", + type: "error", + }, + { + inputs: [], + name: "TotalOutpaymentDecreased", + type: "error", + }, + { + inputs: [], + name: "TransferFailed", + type: "error", + }, + { + inputs: [], + name: "ValueCannotBeZero", + type: "error", + }, + { + inputs: [], + name: "ValueDoesNotExist", + type: "error", + }, + { + inputs: [], + name: "ValueKeyPairExists", + type: "error", + }, + { + inputs: [], + name: "ZeroAddress", + type: "error", + }, + { + inputs: [], + name: "ZeroBalance", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "batchId", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "totalAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "normalisedBalance", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: false, + internalType: "uint8", + name: "depth", + type: "uint8", + }, + { + indexed: false, + internalType: "uint8", + name: "bucketDepth", + type: "uint8", + }, + { + indexed: false, + internalType: "bool", + name: "immutableFlag", + type: "bool", + }, + ], + name: "BatchCreated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "batchId", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint8", + name: "newDepth", + type: "uint8", + }, + { + indexed: false, + internalType: "uint256", + name: "normalisedBalance", + type: "uint256", + }, + ], + name: "BatchDepthIncrease", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "batchId", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "topupAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "normalisedBalance", + type: "uint256", + }, + ], + name: "BatchTopUp", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes32", + name: "batchId", + type: "bytes32", + }, + ], + name: "CopyBatchFailed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "Paused", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "recipient", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "totalAmount", + type: "uint256", + }, + ], + name: "PotWithdrawn", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "price", + type: "uint256", + }, + ], + name: "PriceUpdate", + 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", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "Unpaused", + type: "event", + }, + { + inputs: [], + name: "DEFAULT_ADMIN_ROLE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PAUSER_ROLE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PRICE_ORACLE_ROLE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "REDISTRIBUTOR_ROLE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_batchId", + type: "bytes32", + }, + ], + name: "batchBucketDepth", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_batchId", + type: "bytes32", + }, + ], + name: "batchDepth", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_batchId", + type: "bytes32", + }, + ], + name: "batchImmutableFlag", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_batchId", + type: "bytes32", + }, + ], + name: "batchLastUpdatedBlockNumber", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_batchId", + type: "bytes32", + }, + ], + name: "batchNormalisedBalance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_batchId", + type: "bytes32", + }, + ], + name: "batchOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "batches", + outputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint8", + name: "depth", + type: "uint8", + }, + { + internalType: "uint8", + name: "bucketDepth", + type: "uint8", + }, + { + internalType: "bool", + name: "immutableFlag", + type: "bool", + }, + { + internalType: "uint256", + name: "normalisedBalance", + type: "uint256", + }, + { + internalType: "uint256", + name: "lastUpdatedBlockNumber", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "bzzToken", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "uint256", + name: "_initialBalancePerChunk", + type: "uint256", + }, + { + internalType: "uint8", + name: "_depth", + type: "uint8", + }, + { + internalType: "uint8", + name: "_bucketDepth", + type: "uint8", + }, + { + internalType: "bytes32", + name: "_batchId", + type: "bytes32", + }, + { + internalType: "bool", + name: "_immutable", + type: "bool", + }, + ], + name: "copyBatch", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "bytes32", + name: "batchId", + type: "bytes32", + }, + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint8", + name: "depth", + type: "uint8", + }, + { + internalType: "uint8", + name: "bucketDepth", + type: "uint8", + }, + { + internalType: "bool", + name: "immutableFlag", + type: "bool", + }, + { + internalType: "uint256", + name: "remainingBalance", + type: "uint256", + }, + ], + internalType: "struct PostageStamp.ImportBatch[]", + name: "bulkBatches", + type: "tuple[]", + }, + ], + name: "copyBatchBulk", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "uint256", + name: "_initialBalancePerChunk", + type: "uint256", + }, + { + internalType: "uint8", + name: "_depth", + type: "uint8", + }, + { + internalType: "uint8", + name: "_bucketDepth", + type: "uint8", + }, + { + internalType: "bytes32", + name: "_nonce", + type: "bytes32", + }, + { + internalType: "bool", + name: "_immutable", + type: "bool", + }, + ], + name: "createBatch", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "currentTotalOutPayment", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "limit", + type: "uint256", + }, + ], + name: "expireLimited", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "expiredBatchesExist", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "firstBatchId", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + 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: "_batchId", + type: "bytes32", + }, + { + internalType: "uint8", + name: "_newDepth", + type: "uint8", + }, + ], + name: "increaseDepth", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "isBatchesTreeEmpty", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "lastExpiryBalance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "lastPrice", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "lastUpdatedBlock", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "minimumBucketDepth", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "minimumInitialBalancePerChunk", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "minimumValidityBlocks", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pause", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "paused", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pot", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_batchId", + type: "bytes32", + }, + ], + name: "remainingBalance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + 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: "uint64", + name: "_value", + type: "uint64", + }, + ], + name: "setMinimumValidityBlocks", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_price", + type: "uint256", + }, + ], + name: "setPrice", + 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: "bytes32", + name: "_batchId", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_topupAmountPerChunk", + type: "uint256", + }, + ], + name: "topUp", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "totalPot", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "unPause", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "validChunkCount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "beneficiary", + type: "address", + }, + ], + name: "withdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; + +export class PostageStamp__factory { + static readonly abi = _abi; + static createInterface(): PostageStampInterface { + return new utils.Interface(_abi) as PostageStampInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): PostageStamp { + return new Contract(address, _abi, signerOrProvider) as PostageStamp; + } +} diff --git a/src/types/contracts/factories/Redistribution__factory.ts b/src/types/contracts/factories/Redistribution__factory.ts index b3c682f..9759989 100644 --- a/src/types/contracts/factories/Redistribution__factory.ts +++ b/src/types/contracts/factories/Redistribution__factory.ts @@ -7,7 +7,7 @@ import type { Provider } from "@ethersproject/providers"; import type { Redistribution, RedistributionInterface, -} from "../Redistribution.js"; +} from "../Redistribution"; const _abi = [ { @@ -31,6 +31,249 @@ const _abi = [ stateMutability: "nonpayable", type: "constructor", }, + { + inputs: [], + name: "AlreadyClaimed", + type: "error", + }, + { + inputs: [], + name: "AlreadyCommited", + type: "error", + }, + { + inputs: [], + name: "AlreadyRevealed", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "BatchDoesNotExist", + type: "error", + }, + { + inputs: [], + name: "BelowMinimumStake", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "BucketDiffers", + type: "error", + }, + { + inputs: [], + name: "CommitRoundNotStarted", + type: "error", + }, + { + inputs: [], + name: "CommitRoundOver", + type: "error", + }, + { + inputs: [], + name: "FirstRevealDone", + type: "error", + }, + { + inputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "InclusionProofFailed", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "IndexOutsideSet", + type: "error", + }, + { + inputs: [], + name: "InvalidSignatureLength", + type: "error", + }, + { + inputs: [], + name: "LastElementCheckFailed", + type: "error", + }, + { + inputs: [], + name: "MustStake2Rounds", + type: "error", + }, + { + inputs: [], + name: "NoCommitsReceived", + type: "error", + }, + { + inputs: [], + name: "NoMatchingCommit", + type: "error", + }, + { + inputs: [], + name: "NoReveals", + type: "error", + }, + { + inputs: [], + name: "NotAdmin", + type: "error", + }, + { + inputs: [], + name: "NotClaimPhase", + type: "error", + }, + { + inputs: [], + name: "NotCommitPhase", + type: "error", + }, + { + inputs: [], + name: "NotMatchingOwner", + type: "error", + }, + { + inputs: [], + name: "NotRevealPhase", + type: "error", + }, + { + inputs: [], + name: "OnlyPauser", + type: "error", + }, + { + inputs: [], + name: "OutOfDepth", + type: "error", + }, + { + inputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + name: "OutOfDepthClaim", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "OutOfDepthReveal", + type: "error", + }, + { + inputs: [], + name: "PhaseLastBlock", + type: "error", + }, + { + inputs: [], + name: "RandomElementCheckFailed", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "trALast", + type: "bytes32", + }, + ], + name: "ReserveCheckFailed", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "SigRecoveryFailed", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "SocCalcNotMatching", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "SocVerificationFailed", + type: "error", + }, + { + inputs: [], + name: "WrongPhase", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "validChunkCount", + type: "uint256", + }, + ], + name: "ChunkCount", + type: "event", + }, { anonymous: false, inputs: [ @@ -76,6 +319,25 @@ const _abi = [ name: "CountReveals", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "roundNumber", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes32", + name: "anchor", + type: "bytes32", + }, + ], + name: "CurrentRevealAnchor", + type: "event", + }, { anonymous: false, inputs: [ @@ -244,15 +506,20 @@ const _abi = [ inputs: [ { components: [ + { + internalType: "bytes32", + name: "overlay", + type: "bytes32", + }, { internalType: "address", name: "owner", type: "address", }, { - internalType: "bytes32", - name: "overlay", - type: "bytes32", + internalType: "uint8", + name: "depth", + type: "uint8", }, { internalType: "uint256", @@ -269,11 +536,6 @@ const _abi = [ name: "hash", type: "bytes32", }, - { - internalType: "uint8", - name: "depth", - type: "uint8", - }, ], indexed: false, internalType: "struct Redistribution.Reveal", @@ -285,26 +547,32 @@ const _abi = [ type: "event", }, { - inputs: [], - name: "DEFAULT_ADMIN_ROLE", - outputs: [ + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "indexInRC", + type: "uint256", + }, { + indexed: false, internalType: "bytes32", - name: "", + name: "chunkAddress", type: "bytes32", }, ], - stateMutability: "view", - type: "function", + name: "transformedChunkAddressFromInclusionProof", + type: "event", }, { inputs: [], - name: "OracleContract", + name: "DEFAULT_ADMIN_ROLE", outputs: [ { - internalType: "contract PriceOracle", + internalType: "bytes32", name: "", - type: "address", + type: "bytes32", }, ], stateMutability: "view", @@ -312,12 +580,12 @@ const _abi = [ }, { inputs: [], - name: "PAUSER_ROLE", + name: "OracleContract", outputs: [ { - internalType: "bytes32", + internalType: "contract IPriceOracle", name: "", - type: "bytes32", + type: "address", }, ], stateMutability: "view", @@ -328,7 +596,7 @@ const _abi = [ name: "PostageContract", outputs: [ { - internalType: "contract PostageStamp", + internalType: "contract IPostageStamp", name: "", type: "address", }, @@ -341,7 +609,7 @@ const _abi = [ name: "Stakes", outputs: [ { - internalType: "contract StakeRegistry", + internalType: "contract IStakeRegistry", name: "", type: "address", }, @@ -350,7 +618,281 @@ const _abi = [ type: "function", }, { - inputs: [], + inputs: [ + { + components: [ + { + internalType: "bytes32[]", + name: "proofSegments", + type: "bytes32[]", + }, + { + internalType: "bytes32", + name: "proveSegment", + type: "bytes32", + }, + { + internalType: "bytes32[]", + name: "proofSegments2", + type: "bytes32[]", + }, + { + internalType: "bytes32", + name: "proveSegment2", + type: "bytes32", + }, + { + internalType: "uint64", + name: "chunkSpan", + type: "uint64", + }, + { + internalType: "bytes32[]", + name: "proofSegments3", + type: "bytes32[]", + }, + { + components: [ + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "bytes32", + name: "postageId", + type: "bytes32", + }, + { + internalType: "uint64", + name: "index", + type: "uint64", + }, + { + internalType: "uint64", + name: "timeStamp", + type: "uint64", + }, + ], + internalType: "struct Redistribution.PostageProof", + name: "postageProof", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "signer", + type: "address", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "bytes32", + name: "identifier", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "chunkAddr", + type: "bytes32", + }, + ], + internalType: "struct Redistribution.SOCProof[]", + name: "socProof", + type: "tuple[]", + }, + ], + internalType: "struct Redistribution.ChunkInclusionProof", + name: "entryProof1", + type: "tuple", + }, + { + components: [ + { + internalType: "bytes32[]", + name: "proofSegments", + type: "bytes32[]", + }, + { + internalType: "bytes32", + name: "proveSegment", + type: "bytes32", + }, + { + internalType: "bytes32[]", + name: "proofSegments2", + type: "bytes32[]", + }, + { + internalType: "bytes32", + name: "proveSegment2", + type: "bytes32", + }, + { + internalType: "uint64", + name: "chunkSpan", + type: "uint64", + }, + { + internalType: "bytes32[]", + name: "proofSegments3", + type: "bytes32[]", + }, + { + components: [ + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "bytes32", + name: "postageId", + type: "bytes32", + }, + { + internalType: "uint64", + name: "index", + type: "uint64", + }, + { + internalType: "uint64", + name: "timeStamp", + type: "uint64", + }, + ], + internalType: "struct Redistribution.PostageProof", + name: "postageProof", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "signer", + type: "address", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "bytes32", + name: "identifier", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "chunkAddr", + type: "bytes32", + }, + ], + internalType: "struct Redistribution.SOCProof[]", + name: "socProof", + type: "tuple[]", + }, + ], + internalType: "struct Redistribution.ChunkInclusionProof", + name: "entryProof2", + type: "tuple", + }, + { + components: [ + { + internalType: "bytes32[]", + name: "proofSegments", + type: "bytes32[]", + }, + { + internalType: "bytes32", + name: "proveSegment", + type: "bytes32", + }, + { + internalType: "bytes32[]", + name: "proofSegments2", + type: "bytes32[]", + }, + { + internalType: "bytes32", + name: "proveSegment2", + type: "bytes32", + }, + { + internalType: "uint64", + name: "chunkSpan", + type: "uint64", + }, + { + internalType: "bytes32[]", + name: "proofSegments3", + type: "bytes32[]", + }, + { + components: [ + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "bytes32", + name: "postageId", + type: "bytes32", + }, + { + internalType: "uint64", + name: "index", + type: "uint64", + }, + { + internalType: "uint64", + name: "timeStamp", + type: "uint64", + }, + ], + internalType: "struct Redistribution.PostageProof", + name: "postageProof", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "signer", + type: "address", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "bytes32", + name: "identifier", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "chunkAddr", + type: "bytes32", + }, + ], + internalType: "struct Redistribution.SOCProof[]", + name: "socProof", + type: "tuple[]", + }, + ], + internalType: "struct Redistribution.ChunkInclusionProof", + name: "entryProofLast", + type: "tuple", + }, + ], name: "claim", outputs: [], stateMutability: "nonpayable", @@ -369,9 +911,9 @@ const _abi = [ type: "bytes32", }, { - internalType: "uint256", + internalType: "uint64", name: "_roundNumber", - type: "uint256", + type: "uint64", }, ], name: "commit", @@ -384,9 +926,9 @@ const _abi = [ name: "currentClaimRound", outputs: [ { - internalType: "uint256", + internalType: "uint64", name: "", - type: "uint256", + type: "uint64", }, ], stateMutability: "view", @@ -397,9 +939,9 @@ const _abi = [ name: "currentCommitRound", outputs: [ { - internalType: "uint256", + internalType: "uint64", name: "", - type: "uint256", + type: "uint64", }, ], stateMutability: "view", @@ -425,6 +967,11 @@ const _abi = [ name: "owner", type: "address", }, + { + internalType: "bool", + name: "revealed", + type: "bool", + }, { internalType: "uint256", name: "stake", @@ -435,11 +982,6 @@ const _abi = [ name: "obfuscatedHash", type: "bytes32", }, - { - internalType: "bool", - name: "revealed", - type: "bool", - }, { internalType: "uint256", name: "revealIndex", @@ -449,6 +991,19 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [], + name: "currentMinimumDepth", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "currentPhaseClaim", @@ -493,9 +1048,9 @@ const _abi = [ name: "currentRevealRound", outputs: [ { - internalType: "uint256", + internalType: "uint64", name: "", - type: "uint256", + type: "uint64", }, ], stateMutability: "view", @@ -511,15 +1066,20 @@ const _abi = [ ], name: "currentReveals", outputs: [ + { + internalType: "bytes32", + name: "overlay", + type: "bytes32", + }, { internalType: "address", name: "owner", type: "address", }, { - internalType: "bytes32", - name: "overlay", - type: "bytes32", + internalType: "uint8", + name: "depth", + type: "uint8", }, { internalType: "uint256", @@ -536,11 +1096,6 @@ const _abi = [ name: "hash", type: "bytes32", }, - { - internalType: "uint8", - name: "depth", - type: "uint8", - }, ], stateMutability: "view", type: "function", @@ -550,9 +1105,9 @@ const _abi = [ name: "currentRound", outputs: [ { - internalType: "uint256", + internalType: "uint64", name: "", - type: "uint256", + type: "uint64", }, ], stateMutability: "view", @@ -577,15 +1132,20 @@ const _abi = [ outputs: [ { components: [ + { + internalType: "bytes32", + name: "overlay", + type: "bytes32", + }, { internalType: "address", name: "owner", type: "address", }, { - internalType: "bytes32", - name: "overlay", - type: "bytes32", + internalType: "uint8", + name: "depth", + type: "uint8", }, { internalType: "uint256", @@ -602,11 +1162,6 @@ const _abi = [ name: "hash", type: "bytes32", }, - { - internalType: "uint8", - name: "depth", - type: "uint8", - }, ], internalType: "struct Redistribution.Reveal[]", name: "", @@ -762,19 +1317,6 @@ const _abi = [ stateMutability: "view", type: "function", }, - { - inputs: [], - name: "minimumStake", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, { inputs: [], name: "nextSeed", @@ -808,32 +1350,6 @@ const _abi = [ stateMutability: "view", type: "function", }, - { - inputs: [], - name: "penaltyMultiplierDisagreement", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "penaltyMultiplierNonRevealed", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, { inputs: [ { @@ -899,16 +1415,34 @@ const _abi = [ type: "function", }, { - inputs: [], - name: "roundLength", - outputs: [ + inputs: [ + { + internalType: "uint8", + name: "_penaltyMultiplierDisagreement", + type: "uint8", + }, + { + internalType: "uint8", + name: "_penaltyMultiplierNonRevealed", + type: "uint8", + }, + ], + name: "setFreezingParams", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ { internalType: "uint256", - name: "", + name: "_sampleMaxValue", type: "uint256", }, ], - stateMutability: "view", + name: "setSampleMaxValue", + outputs: [], + stateMutability: "nonpayable", type: "function", }, { @@ -941,15 +1475,20 @@ const _abi = [ inputs: [], name: "winner", outputs: [ + { + internalType: "bytes32", + name: "overlay", + type: "bytes32", + }, { internalType: "address", name: "owner", type: "address", }, { - internalType: "bytes32", - name: "overlay", - type: "bytes32", + internalType: "uint8", + name: "depth", + type: "uint8", }, { internalType: "uint256", @@ -966,11 +1505,6 @@ const _abi = [ name: "hash", type: "bytes32", }, - { - internalType: "uint8", - name: "depth", - type: "uint8", - }, ], stateMutability: "view", type: "function", diff --git a/src/types/contracts/factories/StakeRegistry__factory.ts b/src/types/contracts/factories/StakeRegistry__factory.ts index 4f561d2..9926181 100644 --- a/src/types/contracts/factories/StakeRegistry__factory.ts +++ b/src/types/contracts/factories/StakeRegistry__factory.ts @@ -4,7 +4,7 @@ import { Contract, Signer, utils } from "ethers"; import type { Provider } from "@ethersproject/providers"; -import type { StakeRegistry, StakeRegistryInterface } from "../StakeRegistry.js"; +import type { StakeRegistry, StakeRegistryInterface } from "../StakeRegistry"; const _abi = [ { diff --git a/src/types/contracts/factories/index.ts b/src/types/contracts/factories/index.ts index 54da647..52b76df 100644 --- a/src/types/contracts/factories/index.ts +++ b/src/types/contracts/factories/index.ts @@ -1,6 +1,7 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ -export { BzzToken__factory } from "./BzzToken__factory.js"; -export { Redistribution__factory } from "./Redistribution__factory.js"; -export { StakeRegistry__factory } from "./StakeRegistry__factory.js"; +export { BzzToken__factory } from "./BzzToken__factory"; +export { PostageStamp__factory } from "./PostageStamp__factory"; +export { Redistribution__factory } from "./Redistribution__factory"; +export { StakeRegistry__factory } from "./StakeRegistry__factory"; diff --git a/src/types/contracts/index.ts b/src/types/contracts/index.ts index 3f7d3b8..9765c27 100644 --- a/src/types/contracts/index.ts +++ b/src/types/contracts/index.ts @@ -1,10 +1,12 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ -export type { BzzToken } from "./BzzToken.js"; -export type { Redistribution } from "./Redistribution.js"; -export type { StakeRegistry } from "./StakeRegistry.js"; -export * as factories from "./factories/index.js"; -export { BzzToken__factory } from "./factories/BzzToken__factory.js"; -export { Redistribution__factory } from "./factories/Redistribution__factory.js"; -export { StakeRegistry__factory } from "./factories/StakeRegistry__factory.js"; +export type { BzzToken } from "./BzzToken"; +export type { PostageStamp } from "./PostageStamp"; +export type { Redistribution } from "./Redistribution"; +export type { StakeRegistry } from "./StakeRegistry"; +export * as factories from "./factories"; +export { BzzToken__factory } from "./factories/BzzToken__factory"; +export { PostageStamp__factory } from "./factories/PostageStamp__factory"; +export { Redistribution__factory } from "./factories/Redistribution__factory"; +export { StakeRegistry__factory } from "./factories/StakeRegistry__factory";