@byzantine/vault-sdk
Version:
Byzantine Vault SDK for creating and managing vaults on Ethereum for restaking strategies
1,139 lines (1,138 loc) • 39.4 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SUPER_ERC20_ABI = void 0;
exports.SUPER_ERC20_ABI = [
{ type: "constructor", inputs: [], stateMutability: "nonpayable" },
{
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: "token",
type: "address",
internalType: "contract IERC20",
},
{ name: "recipient", type: "address", internalType: "address" },
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "completeRebalancing",
inputs: [],
outputs: [],
stateMutability: "nonpayable",
},
{
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: "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: "", type: "uint256", internalType: "uint256" }],
stateMutability: "nonpayable",
},
{
type: "function",
name: "depositLimit",
inputs: [],
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
stateMutability: "view",
},
{
type: "function",
name: "getDistributionRatio",
inputs: [],
outputs: [
{ name: "symRatio", type: "uint256", internalType: "uint256" },
{ name: "eigenRatio", 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: "getUnderlyingVaults",
inputs: [],
outputs: [
{ name: "symVault", type: "address", internalType: "address" },
{ name: "eigenVault", type: "address", internalType: "address" },
],
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: "_params",
type: "tuple",
internalType: "struct ISuperERC20Vault.SuperVaultParams",
components: [
{
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: "symRatio",
type: "uint256",
internalType: "uint256",
},
{
name: "eigenParams",
type: "tuple",
internalType: "struct IByzantineFactory.EigenParams",
components: [
{
name: "delegationSetRoleHolder",
type: "address",
internalType: "address",
},
{
name: "operator",
type: "address",
internalType: "address",
},
{
name: "approverSignatureAndExpiry",
type: "tuple",
internalType: "struct ISignatureUtilsMixinTypes.SignatureWithExpiry",
components: [
{
name: "signature",
type: "bytes",
internalType: "bytes",
},
{
name: "expiry",
type: "uint256",
internalType: "uint256",
},
],
},
{
name: "approverSalt",
type: "bytes32",
internalType: "bytes32",
},
],
},
{
name: "symParams",
type: "tuple",
internalType: "struct IByzantineFactory.SymParams",
components: [
{
name: "burnerParams",
type: "tuple",
internalType: "struct IByzantineFactory.BurnerParams",
components: [
{
name: "owner",
type: "address",
internalType: "address",
},
{
name: "delay",
type: "uint48",
internalType: "uint48",
},
{
name: "globalReceiver",
type: "address",
internalType: "address",
},
{
name: "networkReceivers",
type: "tuple[]",
internalType: "struct IBurnerRouter.NetworkReceiver[]",
components: [
{
name: "network",
type: "address",
internalType: "address",
},
{
name: "receiver",
type: "address",
internalType: "address",
},
],
},
{
name: "operatorNetworkReceivers",
type: "tuple[]",
internalType: "struct IBurnerRouter.OperatorNetworkReceiver[]",
components: [
{
name: "network",
type: "address",
internalType: "address",
},
{
name: "operator",
type: "address",
internalType: "address",
},
{
name: "receiver",
type: "address",
internalType: "address",
},
],
},
],
},
{
name: "vaultParams",
type: "tuple",
internalType: "struct IByzantineFactory.VaultParams",
components: [
{
name: "version",
type: "uint64",
internalType: "uint64",
},
{
name: "epochDuration",
type: "uint48",
internalType: "uint48",
},
],
},
{
name: "delegatorParams",
type: "tuple",
internalType: "struct IByzantineFactory.DelegatorParams",
components: [
{
name: "delegatorType",
type: "uint8",
internalType: "enum IByzantineFactory.DelegatorType",
},
{
name: "hook",
type: "address",
internalType: "address",
},
{
name: "hookSetRoleHolder",
type: "address",
internalType: "address",
},
{
name: "networkLimitSetRoleHolders",
type: "address[]",
internalType: "address[]",
},
{
name: "operatorNetworkLimitOrSharesSetRoleHolders",
type: "address[]",
internalType: "address[]",
},
{
name: "operator",
type: "address",
internalType: "address",
},
{
name: "network",
type: "address",
internalType: "address",
},
],
},
{
name: "slasherParams",
type: "tuple",
internalType: "struct IByzantineFactory.SlasherParams",
components: [
{
name: "slasherType",
type: "uint8",
internalType: "enum IByzantineFactory.SlasherType",
},
{
name: "vetoDuration",
type: "uint48",
internalType: "uint48",
},
{
name: "resolverSetEpochsDelay",
type: "uint256",
internalType: "uint256",
},
],
},
],
},
{ name: "curator", type: "address", internalType: "address" },
],
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "isDepositLimit",
inputs: [],
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: "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: "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: "rebalance",
inputs: [
{ name: "_newSymRatio", type: "uint256", internalType: "uint256" },
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "rebalancingStatus",
inputs: [],
outputs: [
{ name: "isRebalancing", type: "bool", internalType: "bool" },
{
name: "targetSymRatio",
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: "", 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: "setCanDeposit",
inputs: [
{
name: "_stakers",
type: "address[]",
internalType: "address[]",
},
{ name: "_canDeposit", type: "bool", internalType: "bool" },
],
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: "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: "withdraw",
inputs: [
{ name: "assets", type: "uint256", internalType: "uint256" },
{ name: "receiver", type: "address", internalType: "address" },
{ name: "owner", type: "address", internalType: "address" },
],
outputs: [{ name: "", 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: "Deposit",
inputs: [
{
name: "sender",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "owner",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "assets",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "shares",
type: "uint256",
indexed: false,
internalType: "uint256",
},
],
anonymous: false,
},
{
type: "event",
name: "DepositSplit",
inputs: [
{
name: "user",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "symAmount",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "eigenAmount",
type: "uint256",
indexed: false,
internalType: "uint256",
},
],
anonymous: false,
},
{
type: "event",
name: "DistributionRatioUpdated",
inputs: [
{
name: "symRatio",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "eigenRatio",
type: "uint256",
indexed: false,
internalType: "uint256",
},
],
anonymous: false,
},
{
type: "event",
name: "Initialized",
inputs: [
{
name: "version",
type: "uint64",
indexed: false,
internalType: "uint64",
},
],
anonymous: false,
},
{
type: "event",
name: "Rebalanced",
inputs: [
{
name: "previousRatio",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "newRatio",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
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: "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: "WithdrawalRequested",
inputs: [
{
name: "receiver",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "owner",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "assets",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "shares",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "requestId",
type: "bytes32",
indexed: false,
internalType: "bytes32",
},
],
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: "InvalidRatio", inputs: [] },
{
type: "error",
name: "InvalidWithdrawalRequest",
inputs: [{ name: "requestId", type: "bytes32", internalType: "bytes32" }],
},
{ type: "error", name: "MissingRoles", inputs: [] },
{ type: "error", name: "NoAssets", inputs: [] },
{ type: "error", name: "NoRebalancingInProgress", inputs: [] },
{ type: "error", name: "NotInitializing", inputs: [] },
{ type: "error", name: "OnlyCurator", inputs: [] },
{ type: "error", name: "RebalancingInProgress", inputs: [] },
{ type: "error", name: "RebalancingNotInProgress", inputs: [] },
{ type: "error", name: "ReentrancyGuardReentrantCall", inputs: [] },
{
type: "error",
name: "SafeERC20FailedOperation",
inputs: [{ name: "token", type: "address", internalType: "address" }],
},
{ type: "error", name: "VaultsAlreadyInitialized", inputs: [] },
{
type: "error",
name: "WithdrawalNotClaimable",
inputs: [{ name: "requestId", type: "bytes32", internalType: "bytes32" }],
},
{ type: "error", name: "WithdrawalNotReadyToClaim", inputs: [] },
{ type: "error", name: "WithdrawalStateInconsistency", inputs: [] },
{ type: "error", name: "ZeroAddressBeacon", inputs: [] },
{ type: "error", name: "ZeroAddressFactory", inputs: [] },
];