UNPKG

@byzantine/vault-sdk

Version:

Byzantine Vault SDK for creating and managing vaults on Ethereum for restaking strategies

1,181 lines (1,180 loc) 36.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SYM_ERC20_ABI = void 0; exports.SYM_ERC20_ABI = [ { type: "constructor", inputs: [ { name: "_networkMiddlewareService", type: "address", internalType: "contract INetworkMiddlewareService", }, { name: "_byzantineFeeManager", type: "address", internalType: "contract IByzantineFeeManager", }, ], stateMutability: "nonpayable", }, { type: "function", name: "BYZANTINE_FEE_MANAGER", inputs: [], outputs: [ { name: "", type: "address", internalType: "contract IByzantineFeeManager", }, ], stateMutability: "view", }, { type: "function", name: "NETWORK_MIDDLEWARE_SERVICE", inputs: [], outputs: [ { name: "", type: "address", internalType: "contract INetworkMiddlewareService", }, ], stateMutability: "view", }, { type: "function", name: "activeShares", inputs: [], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "activeSharesAt", inputs: [ { name: "timestamp", type: "uint48", internalType: "uint48" }, { name: "hint", type: "bytes", internalType: "bytes" }, ], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "activeSharesCache", inputs: [{ name: "timestamp", type: "uint48", internalType: "uint48" }], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "activeSharesOf", inputs: [{ name: "account", type: "address", internalType: "address" }], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "activeSharesOfAt", inputs: [ { name: "account", type: "address", internalType: "address" }, { name: "timestamp", type: "uint48", internalType: "uint48" }, { name: "hint", type: "bytes", internalType: "bytes" }, ], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "activeStake", inputs: [], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "activeStakeAt", inputs: [ { name: "timestamp", type: "uint48", internalType: "uint48" }, { name: "hint", type: "bytes", internalType: "bytes" }, ], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "allowance", inputs: [ { name: "owner", type: "address", internalType: "address" }, { name: "spender", type: "address", internalType: "address" }, ], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "approve", inputs: [ { name: "spender", type: "address", internalType: "address" }, { name: "value", type: "uint256", internalType: "uint256" }, ], outputs: [{ name: "", type: "bool", internalType: "bool" }], stateMutability: "nonpayable", }, { type: "function", name: "asset", inputs: [], outputs: [{ name: "", type: "address", internalType: "address" }], stateMutability: "view", }, { type: "function", name: "balanceOf", inputs: [{ name: "account", type: "address", internalType: "address" }], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "canDeposit", inputs: [{ name: "addr", type: "address", internalType: "address" }], outputs: [{ name: "", type: "bool", internalType: "bool" }], stateMutability: "view", }, { type: "function", name: "claimCuratorFee", inputs: [ { name: "recipient", type: "address", internalType: "address" }, { name: "token", type: "address", internalType: "address" }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "claimRewards", inputs: [ { name: "recipient", type: "address", internalType: "address" }, { name: "token", type: "address", internalType: "address" }, { name: "data", type: "bytes", internalType: "bytes" }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "claimUnclaimedEpochs", inputs: [], outputs: [ { name: "unclaimedEpochs", type: "uint256[]", internalType: "uint256[]", }, { name: "claimedAmounts", type: "uint256[]", internalType: "uint256[]", }, ], stateMutability: "nonpayable", }, { type: "function", name: "claimable", inputs: [ { name: "token", type: "address", internalType: "address" }, { name: "account", type: "address", internalType: "address" }, { name: "data", type: "bytes", internalType: "bytes" }, ], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "claimableCuratorFee", inputs: [{ name: "token", type: "address", internalType: "address" }], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "completeWithdrawal", inputs: [{ name: "requestId", type: "bytes32", internalType: "bytes32" }], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "convertToAssets", inputs: [{ name: "shares", type: "uint256", internalType: "uint256" }], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "convertToShares", inputs: [{ name: "assets", type: "uint256", internalType: "uint256" }], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "curatorFee", inputs: [], outputs: [{ name: "", type: "uint16", internalType: "uint16" }], stateMutability: "view", }, { type: "function", name: "decimals", inputs: [], outputs: [{ name: "", type: "uint8", internalType: "uint8" }], stateMutability: "view", }, { type: "function", name: "deposit", inputs: [ { name: "assets", type: "uint256", internalType: "uint256" }, { name: "receiver", type: "address", internalType: "address" }, ], outputs: [{ name: "shares", type: "uint256", internalType: "uint256" }], stateMutability: "nonpayable", }, { type: "function", name: "depositLimit", inputs: [], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "distributeRewards", inputs: [ { name: "network", type: "address", internalType: "address" }, { name: "token", type: "address", internalType: "address" }, { name: "amount", type: "uint256", internalType: "uint256" }, { name: "data", type: "bytes", internalType: "bytes" }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "getEpochTotalRequestedAssets", inputs: [{ name: "epoch", type: "uint256", internalType: "uint256" }], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "getQueuedWithdrawalRequests", inputs: [{ name: "staker", type: "address", internalType: "address" }], outputs: [{ name: "", type: "bytes32[]", internalType: "bytes32[]" }], stateMutability: "view", }, { type: "function", name: "getRoleAdmin", inputs: [{ name: "role", type: "bytes32", internalType: "bytes32" }], outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }], stateMutability: "view", }, { type: "function", name: "getWithdrawalRequest", inputs: [{ name: "requestId", type: "bytes32", internalType: "bytes32" }], outputs: [ { name: "", type: "tuple", internalType: "struct BaseVaultLogicLib.WithdrawalRequest", components: [ { name: "receiver", type: "address", internalType: "address", }, { name: "owner", type: "address", internalType: "address" }, { name: "assets", type: "uint256", internalType: "uint256" }, { name: "shares", type: "uint256", internalType: "uint256" }, { name: "requestTimestamp", type: "uint256", internalType: "uint256", }, ], }, ], stateMutability: "view", }, { type: "function", name: "grantRole", inputs: [ { name: "role", type: "bytes32", internalType: "bytes32" }, { name: "account", type: "address", internalType: "address" }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "hasRole", inputs: [ { name: "role", type: "bytes32", internalType: "bytes32" }, { name: "account", type: "address", internalType: "address" }, ], outputs: [{ name: "", type: "bool", internalType: "bool" }], stateMutability: "view", }, { type: "function", name: "initialize", inputs: [ { name: "_byzVaultParams", type: "tuple", internalType: "struct IByzantineFactory.ByzVaultParams", components: [ { name: "token", type: "address", internalType: "contract IERC20", }, { name: "roleManager", type: "address", internalType: "address", }, { name: "versionManager", type: "address", internalType: "address", }, { name: "depositWhitelistManager", type: "address", internalType: "address", }, { name: "depositLimitManager", type: "address", internalType: "address", }, { name: "curatorFeeClaimer", type: "address", internalType: "address", }, { name: "curatorFeeClaimerRoleAdmin", type: "address", internalType: "address", }, { name: "depositLimit", type: "uint256", internalType: "uint256", }, { name: "curatorFee", type: "uint16", internalType: "uint16", }, { name: "isDepositLimit", type: "bool", internalType: "bool", }, { name: "isPrivateVault", type: "bool", internalType: "bool", }, { name: "isTokenized", type: "bool", internalType: "bool" }, { name: "name", type: "string", internalType: "string" }, { name: "symbol", type: "string", internalType: "string" }, { name: "metadataURI", type: "string", internalType: "string", }, ], }, { name: "_symVault", type: "address", internalType: "contract IVault", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "isDepositLimit", inputs: [], outputs: [{ name: "", type: "bool", internalType: "bool" }], stateMutability: "view", }, { type: "function", name: "isEpochClaimed", inputs: [{ name: "epoch", type: "uint256", internalType: "uint256" }], outputs: [{ name: "", type: "bool", internalType: "bool" }], stateMutability: "view", }, { type: "function", name: "isEpochTrackedForWithdrawals", inputs: [{ name: "epoch", type: "uint256", internalType: "uint256" }], outputs: [{ name: "", type: "bool", internalType: "bool" }], stateMutability: "view", }, { type: "function", name: "isPrivateVault", inputs: [], outputs: [{ name: "", type: "bool", internalType: "bool" }], stateMutability: "view", }, { type: "function", name: "isTokenized", inputs: [], outputs: [{ name: "", type: "bool", internalType: "bool" }], stateMutability: "view", }, { type: "function", name: "lastUnclaimedReward", inputs: [ { name: "account", type: "address", internalType: "address" }, { name: "token", type: "address", internalType: "address" }, { name: "network", type: "address", internalType: "address" }, ], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "manageNetworksDelegation", inputs: [ { name: "subnetworks", type: "bytes32[]", internalType: "bytes32[]", }, { name: "limits", type: "uint256[]", internalType: "uint256[]" }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "manageOperatorsDelegation", inputs: [ { name: "subnetworks", type: "bytes32[]", internalType: "bytes32[]", }, { name: "operators", type: "address[]", internalType: "address[]", }, { name: "sharesOrLimits", type: "uint256[]", internalType: "uint256[]", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "maxRedeem", inputs: [{ name: "owner", type: "address", internalType: "address" }], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "maxWithdraw", inputs: [{ name: "owner", type: "address", internalType: "address" }], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "migrateSymVault", inputs: [ { name: "newVersion", type: "uint64", internalType: "uint64" }, { name: "data", type: "bytes", internalType: "bytes" }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "name", inputs: [], outputs: [{ name: "", type: "string", internalType: "string" }], stateMutability: "view", }, { type: "function", name: "previewDeposit", inputs: [{ name: "assets", type: "uint256", internalType: "uint256" }], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "previewRedeem", inputs: [{ name: "shares", type: "uint256", internalType: "uint256" }], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "previewWithdraw", inputs: [{ name: "assets", type: "uint256", internalType: "uint256" }], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "redeem", inputs: [ { name: "shares", type: "uint256", internalType: "uint256" }, { name: "receiver", type: "address", internalType: "address" }, { name: "owner", type: "address", internalType: "address" }, ], outputs: [{ name: "assets", type: "uint256", internalType: "uint256" }], stateMutability: "nonpayable", }, { type: "function", name: "renounceRole", inputs: [{ name: "role", type: "bytes32", internalType: "bytes32" }], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "revokeRole", inputs: [ { name: "role", type: "bytes32", internalType: "bytes32" }, { name: "account", type: "address", internalType: "address" }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "rewardsByIndex", inputs: [ { name: "token", type: "address", internalType: "address" }, { name: "network", type: "address", internalType: "address" }, { name: "index", type: "uint256", internalType: "uint256" }, ], outputs: [ { name: "", type: "uint256", internalType: "uint256" }, { name: "", type: "uint48", internalType: "uint48" }, ], stateMutability: "view", }, { type: "function", name: "rewardsLength", inputs: [ { name: "token", type: "address", internalType: "address" }, { name: "network", type: "address", internalType: "address" }, ], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "setCanDeposit", inputs: [ { name: "_stakers", type: "address[]", internalType: "address[]", }, { name: "_canDeposit", type: "bool", internalType: "bool" }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "setCuratorFee", inputs: [{ name: "curatorFee_", type: "uint16", internalType: "uint16" }], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "setDepositLimit", inputs: [ { name: "_depositLimit", type: "uint256", internalType: "uint256", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "setIsDepositLimit", inputs: [{ name: "_isDepositLimit", type: "bool", internalType: "bool" }], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "setIsPrivateVault", inputs: [{ name: "_isPrivateVault", type: "bool", internalType: "bool" }], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "symVault", inputs: [], outputs: [{ name: "", type: "address", internalType: "contract IVault" }], stateMutability: "view", }, { type: "function", name: "symbol", inputs: [], outputs: [{ name: "", type: "string", internalType: "string" }], stateMutability: "view", }, { type: "function", name: "totalAssets", inputs: [], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "totalPendingWithdrawals", inputs: [], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "totalSupply", inputs: [], outputs: [{ name: "", type: "uint256", internalType: "uint256" }], stateMutability: "view", }, { type: "function", name: "transfer", inputs: [ { name: "to", type: "address", internalType: "address" }, { name: "value", type: "uint256", internalType: "uint256" }, ], outputs: [{ name: "", type: "bool", internalType: "bool" }], stateMutability: "nonpayable", }, { type: "function", name: "transferFrom", inputs: [ { name: "from", type: "address", internalType: "address" }, { name: "to", type: "address", internalType: "address" }, { name: "value", type: "uint256", internalType: "uint256" }, ], outputs: [{ name: "", type: "bool", internalType: "bool" }], stateMutability: "nonpayable", }, { type: "function", name: "updateMetadataURI", inputs: [{ name: "metadataURI", type: "string", internalType: "string" }], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "version", inputs: [], outputs: [{ name: "", type: "uint64", internalType: "uint64" }], stateMutability: "pure", }, { type: "function", name: "withdraw", inputs: [ { name: "assets", type: "uint256", internalType: "uint256" }, { name: "receiver", type: "address", internalType: "address" }, { name: "owner", type: "address", internalType: "address" }, ], outputs: [{ name: "shares", type: "uint256", internalType: "uint256" }], stateMutability: "nonpayable", }, { type: "event", name: "Approval", inputs: [ { name: "owner", type: "address", indexed: true, internalType: "address", }, { name: "spender", type: "address", indexed: true, internalType: "address", }, { name: "value", type: "uint256", indexed: false, internalType: "uint256", }, ], anonymous: false, }, { type: "event", name: "ClaimCuratorFee", inputs: [ { name: "recipient", type: "address", indexed: true, internalType: "address", }, { name: "amount", type: "uint256", indexed: false, internalType: "uint256", }, ], anonymous: false, }, { type: "event", name: "ClaimRewards", inputs: [ { name: "recipient", type: "address", indexed: true, internalType: "address", }, { name: "token", type: "address", indexed: true, internalType: "address", }, { name: "network", type: "address", indexed: true, internalType: "address", }, { name: "claimer", type: "address", indexed: false, internalType: "address", }, { name: "firstRewardIndex", type: "uint256", indexed: false, internalType: "uint256", }, { name: "numRewards", type: "uint256", indexed: false, internalType: "uint256", }, { name: "amount", type: "uint256", indexed: false, internalType: "uint256", }, ], anonymous: false, }, { type: "event", name: "DistributeRewards", inputs: [ { name: "network", type: "address", indexed: true, internalType: "address", }, { name: "token", type: "address", indexed: true, internalType: "address", }, { name: "amount", type: "uint256", indexed: false, internalType: "uint256", }, { name: "data", type: "bytes", indexed: false, internalType: "bytes", }, ], anonymous: false, }, { type: "event", name: "Initialized", inputs: [ { name: "version", type: "uint64", indexed: false, internalType: "uint64", }, ], anonymous: false, }, { type: "event", name: "ProtocolFeePaid", inputs: [ { name: "token", type: "address", indexed: true, internalType: "address", }, { name: "amount", type: "uint256", indexed: false, internalType: "uint256", }, ], anonymous: false, }, { type: "event", name: "RoleAdminChanged", inputs: [ { name: "role", type: "bytes32", indexed: true, internalType: "bytes32", }, { name: "newAdminRole", type: "bytes32", indexed: true, internalType: "bytes32", }, ], anonymous: false, }, { type: "event", name: "RoleHolderStatusChanged", inputs: [ { name: "role", type: "bytes32", indexed: true, internalType: "bytes32", }, { name: "account", type: "address", indexed: true, internalType: "address", }, { name: "sender", type: "address", indexed: true, internalType: "address", }, { name: "hasRole", type: "bool", indexed: false, internalType: "bool", }, ], anonymous: false, }, { type: "event", name: "Staked", inputs: [ { name: "amount", type: "uint256", indexed: false, internalType: "uint256", }, ], anonymous: false, }, { type: "event", name: "Transfer", inputs: [ { name: "from", type: "address", indexed: true, internalType: "address", }, { name: "to", type: "address", indexed: true, internalType: "address", }, { name: "value", type: "uint256", indexed: false, internalType: "uint256", }, ], anonymous: false, }, { type: "event", name: "VaultDepositLimitStatusChanged", inputs: [ { name: "isDepositLimit", type: "bool", indexed: false, internalType: "bool", }, ], anonymous: false, }, { type: "event", name: "VaultMetadataURIUpdated", inputs: [ { name: "metadataURI", type: "string", indexed: false, internalType: "string", }, ], anonymous: false, }, { type: "event", name: "VaultPrivateStatusChanged", inputs: [ { name: "isPrivateVault", type: "bool", indexed: false, internalType: "bool", }, ], anonymous: false, }, { type: "event", name: "WithdrawalClaimed", inputs: [ { name: "receiver", type: "address", indexed: true, internalType: "address", }, { name: "owner", type: "address", indexed: true, internalType: "address", }, { name: "requestId", type: "bytes32", indexed: true, internalType: "bytes32", }, { name: "assets", type: "uint256", indexed: false, internalType: "uint256", }, { name: "shares", type: "uint256", indexed: false, internalType: "uint256", }, ], anonymous: false, }, { type: "event", name: "WithdrawalRequestedFromRestaking", inputs: [ { name: "amount", type: "uint256", indexed: false, internalType: "uint256", }, ], anonymous: false, }, { type: "error", name: "AccessControlUnauthorizedAccount", inputs: [ { name: "account", type: "address", internalType: "address" }, { name: "neededRole", type: "bytes32", internalType: "bytes32" }, ], }, { type: "error", name: "CannotDeposit", inputs: [{ name: "addr", type: "address", internalType: "address" }], }, { type: "error", name: "ERC20InsufficientAllowance", inputs: [ { name: "spender", type: "address", internalType: "address" }, { name: "allowance", type: "uint256", internalType: "uint256" }, { name: "needed", type: "uint256", internalType: "uint256" }, ], }, { type: "error", name: "ERC20InsufficientBalance", inputs: [ { name: "sender", type: "address", internalType: "address" }, { name: "balance", type: "uint256", internalType: "uint256" }, { name: "needed", type: "uint256", internalType: "uint256" }, ], }, { type: "error", name: "ERC20InvalidApprover", inputs: [{ name: "approver", type: "address", internalType: "address" }], }, { type: "error", name: "ERC20InvalidReceiver", inputs: [{ name: "receiver", type: "address", internalType: "address" }], }, { type: "error", name: "ERC20InvalidSender", inputs: [{ name: "sender", type: "address", internalType: "address" }], }, { type: "error", name: "ERC20InvalidSpender", inputs: [{ name: "spender", type: "address", internalType: "address" }], }, { type: "error", name: "ERC4626ExceededMaxRedeem", inputs: [ { name: "owner", type: "address", internalType: "address" }, { name: "shares", type: "uint256", internalType: "uint256" }, { name: "max", type: "uint256", internalType: "uint256" }, ], }, { type: "error", name: "ERC4626ExceededMaxWithdraw", inputs: [ { name: "owner", type: "address", internalType: "address" }, { name: "assets", type: "uint256", internalType: "uint256" }, { name: "max", type: "uint256", internalType: "uint256" }, ], }, { type: "error", name: "InsufficientBalance", inputs: [ { name: "balance", type: "uint256", internalType: "uint256" }, { name: "requested", type: "uint256", internalType: "uint256" }, { name: "owner", type: "address", internalType: "address" }, ], }, { type: "error", name: "InvalidInitialization", inputs: [] }, { type: "error", name: "InvalidWithdrawalRequest", inputs: [{ name: "requestId", type: "bytes32", internalType: "bytes32" }], }, { type: "error", name: "MissingNetworkDelegationRole", inputs: [{ name: "sender", type: "address", internalType: "address" }], }, { type: "error", name: "MissingOperatorDelegationRole", inputs: [{ name: "sender", type: "address", internalType: "address" }], }, { type: "error", name: "MissingRoles", inputs: [] }, { type: "error", name: "NotInitializing", inputs: [] }, { type: "error", name: "ReentrancyGuardReentrantCall", inputs: [] }, { type: "error", name: "RoleMissing", inputs: [] }, { type: "error", name: "SafeERC20FailedOperation", inputs: [{ name: "token", type: "address", internalType: "address" }], }, { type: "error", name: "WithdrawalNotClaimable", inputs: [{ name: "requestId", type: "bytes32", internalType: "bytes32" }], }, { type: "error", name: "WithdrawalNotReadyToClaim", inputs: [] }, { type: "error", name: "WithdrawalStateInconsistency", inputs: [] }, { type: "error", name: "ZeroInput", inputs: [] }, ];