@wireio/stake 0.4.3 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/lib/stake.browser.js +12682 -6721
  2. package/lib/stake.browser.js.map +1 -1
  3. package/lib/stake.d.ts +158 -13
  4. package/lib/stake.js +12356 -6388
  5. package/lib/stake.js.map +1 -1
  6. package/lib/stake.m.js +12682 -6721
  7. package/lib/stake.m.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/assets/ethereum/ABI/common/Base58.sol/Base58.dbg.json +4 -0
  10. package/src/assets/ethereum/ABI/common/Base58.sol/Base58.json +164 -0
  11. package/src/assets/ethereum/ABI/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.dbg.json +4 -0
  12. package/src/assets/ethereum/ABI/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.json +76 -0
  13. package/src/assets/ethereum/ABI/common/RestrictedCallers.sol/RestrictedCallers.dbg.json +4 -0
  14. package/src/assets/ethereum/ABI/common/RestrictedCallers.sol/RestrictedCallers.json +10 -0
  15. package/src/assets/ethereum/ABI/common/iodata.sol/iodata.dbg.json +4 -0
  16. package/src/assets/ethereum/ABI/common/iodata.sol/iodata.json +618 -0
  17. package/src/assets/ethereum/ABI/common/iodata_util.sol/iodata_util.dbg.json +4 -0
  18. package/src/assets/ethereum/ABI/common/iodata_util.sol/iodata_util.json +40 -0
  19. package/src/assets/ethereum/ABI/common/sysio_data.sol/sysio_data.dbg.json +4 -0
  20. package/src/assets/ethereum/ABI/common/sysio_data.sol/sysio_data.json +10 -0
  21. package/src/assets/ethereum/ABI/common/sysio_errors.sol/sysio_errors.dbg.json +4 -0
  22. package/src/assets/ethereum/ABI/common/sysio_errors.sol/sysio_errors.json +10 -0
  23. package/src/assets/ethereum/ABI/common/sysio_merkle.sol/sysio_merkle.dbg.json +4 -0
  24. package/src/assets/ethereum/ABI/common/sysio_merkle.sol/sysio_merkle.json +233 -0
  25. package/src/assets/ethereum/ABI/common/sysio_name.sol/sysio_name.dbg.json +4 -0
  26. package/src/assets/ethereum/ABI/common/sysio_name.sol/sysio_name.json +49 -0
  27. package/src/assets/ethereum/ABI/common/sysio_pubkey.sol/sysio_pubkey.dbg.json +4 -0
  28. package/src/assets/ethereum/ABI/common/sysio_pubkey.sol/sysio_pubkey.json +64 -0
  29. package/src/assets/ethereum/ABI/common/sysio_read.sol/sysio_read.dbg.json +4 -0
  30. package/src/assets/ethereum/ABI/common/sysio_read.sol/sysio_read.json +1458 -0
  31. package/src/assets/ethereum/ABI/common/sysio_tester.sol/SysioTester.dbg.json +4 -0
  32. package/src/assets/ethereum/ABI/common/sysio_tester.sol/SysioTester.json +1532 -0
  33. package/src/assets/ethereum/ABI/common/sysio_verify.sol/sysio_verify.dbg.json +4 -0
  34. package/src/assets/ethereum/ABI/common/sysio_verify.sol/sysio_verify.json +1525 -0
  35. package/src/assets/ethereum/ABI/common/sysio_write.sol/sysio_write.dbg.json +4 -0
  36. package/src/assets/ethereum/ABI/common/sysio_write.sol/sysio_write.json +1076 -0
  37. package/src/assets/ethereum/ABI/liqEth/BeaconState.sol/BeaconState.dbg.json +1 -1
  38. package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.dbg.json +1 -1
  39. package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.json +28 -2
  40. package/src/assets/ethereum/ABI/liqEth/LiqEthAuthority.sol/LiqEthAuthority.dbg.json +1 -1
  41. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IAccounting.dbg.json +1 -1
  42. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +1 -1
  43. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +1 -1
  44. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +1 -1
  45. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +1 -1
  46. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +1 -1
  47. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +1 -1
  48. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +1 -1
  49. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +1 -1
  50. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +1 -1
  51. package/src/assets/ethereum/ABI/liqEth/LiqEthManaged.sol/LiqEthManaged.dbg.json +1 -1
  52. package/src/assets/ethereum/ABI/liqEth/RewardsERC20.sol/RewardsERC20Upgradeable.dbg.json +1 -1
  53. package/src/assets/ethereum/ABI/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.dbg.json +1 -1
  54. package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.dbg.json +1 -1
  55. package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.json +2 -2
  56. package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.dbg.json +1 -1
  57. package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.json +2 -15
  58. package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.dbg.json +1 -1
  59. package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.dbg.json +1 -1
  60. package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.json +6 -25
  61. package/src/assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +1 -1
  62. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +1 -1
  63. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.json +2 -2
  64. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +1 -1
  65. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.json +6 -25
  66. package/src/assets/ethereum/ABI/outpost/BAR.sol/BAR.dbg.json +1 -1
  67. package/src/assets/ethereum/ABI/outpost/Depositor.sol/Depositor.dbg.json +1 -1
  68. package/src/assets/ethereum/ABI/outpost/Depositor.sol/Depositor.json +26 -26
  69. package/src/assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.dbg.json +1 -1
  70. package/src/assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.dbg.json +1 -1
  71. package/src/assets/ethereum/ABI/outpost/OPP.sol/OPP.dbg.json +1 -1
  72. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPP.dbg.json +1 -1
  73. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPEndpoint.dbg.json +1 -1
  74. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPInbound.dbg.json +1 -1
  75. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPReceiver.dbg.json +1 -1
  76. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPSender.dbg.json +1 -1
  77. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/OPPCommon.dbg.json +1 -1
  78. package/src/assets/ethereum/ABI/outpost/OPPEndpoint.sol/OPPEndpoint.dbg.json +1 -1
  79. package/src/assets/ethereum/ABI/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.dbg.json +1 -1
  80. package/src/assets/ethereum/ABI/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.dbg.json +1 -1
  81. package/src/assets/ethereum/ABI/outpost/OPPErrors.sol/OPPErrors.dbg.json +1 -1
  82. package/src/assets/ethereum/ABI/outpost/OPPInbound.sol/OPPInbound.dbg.json +1 -1
  83. package/src/assets/ethereum/ABI/outpost/OPPReceiver.sol/OPPReceiver.dbg.json +1 -1
  84. package/src/assets/ethereum/ABI/outpost/OPPSender.sol/OPPSender.dbg.json +1 -1
  85. package/src/assets/ethereum/ABI/outpost/OutpostErrors.sol/OutpostErrors.dbg.json +1 -1
  86. package/src/assets/ethereum/ABI/outpost/OutpostManaged.sol/OutpostManaged.dbg.json +1 -1
  87. package/src/assets/ethereum/ABI/outpost/OutpostManager.sol/OutpostManager.dbg.json +1 -1
  88. package/src/assets/ethereum/ABI/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.dbg.json +1 -1
  89. package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/IOutpostManager.dbg.json +1 -1
  90. package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.dbg.json +1 -1
  91. package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.dbg.json +1 -1
  92. package/src/assets/ethereum/ABI/outpost/OutpostOwnable.sol/OutpostOwnable.dbg.json +1 -1
  93. package/src/assets/ethereum/ABI/outpost/Pool.sol/Pool.dbg.json +1 -1
  94. package/src/assets/ethereum/ABI/outpost/Pool.sol/Pool.json +2 -2
  95. package/src/assets/ethereum/ABI/outpost/Pretoken.sol/Pretoken.dbg.json +1 -1
  96. package/src/assets/ethereum/ABI/outpost/Pretoken.sol/Pretoken.json +9 -9
  97. package/src/assets/ethereum/ABI/outpost/ReceiptNFT.sol/ReceiptNFT.dbg.json +1 -1
  98. package/src/assets/ethereum/ABI/outpost/interfaces/IPretoken.sol/IPretoken.dbg.json +1 -1
  99. package/src/assets/ethereum/ABI/outpost/interfaces/IWarrant.sol/IWarrant.dbg.json +1 -1
  100. package/src/assets/ethereum/ABI/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.dbg.json +1 -1
  101. package/src/assets/ethereum/ABI/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.dbg.json +1 -1
  102. package/src/networks/ethereum/clients/convert.client.ts +2 -2
  103. package/src/networks/ethereum/clients/pretoken.client.ts +6 -4
  104. package/src/networks/ethereum/clients/stake.client.ts +2 -2
  105. package/src/networks/ethereum/contract.ts +102 -49
  106. package/src/networks/ethereum/ethereum.ts +64 -52
  107. package/src/networks/ethereum/types.ts +26 -17
  108. package/src/networks/ethereum/utils.ts +8 -8
  109. package/src/networks/solana/clients/distribution.client.ts +36 -1
  110. package/src/networks/solana/solana.ts +131 -7
  111. package/src/networks/solana/types.ts +129 -0
  112. package/src/types.ts +6 -2
  113. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.dbg.json +0 -4
  114. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.json +0 -10
  115. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.dbg.json +0 -4
  116. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.json +0 -10
  117. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZExtras.dbg.json +0 -4
  118. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZExtras.json +0 -10
  119. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZVec48.dbg.json +0 -4
  120. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZVec48.json +0 -10
  121. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.dbg.json +0 -4
  122. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.json +0 -291
  123. package/src/assets/ethereum/ABI/outpost/Aggregator.sol/Aggregator.json +0 -82
@@ -3,12 +3,16 @@
3
3
  *
4
4
  * Provides a unified service for interacting with Ethereum smart contracts using ethers.js.
5
5
  */
6
+
7
+ // LiqETH Artifacts
6
8
  import AccountingArtifact from '../../assets/ethereum/ABI/liqEth/accounting.sol/Accounting.json';
7
9
  import DepositManagerArtifact from '../../assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.json';
8
10
  import LiqEthArtifact from '../../assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.json';
9
11
  import StakingModuleArtifact from '../../assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.json';
10
12
  import WithdrawalQueueArtifact from '../../assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.json';
11
13
  import WithdrawalVaultArtifact from '../../assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.json';
14
+ import BeaconStateArtifact from '../../assets/ethereum/ABI/liqEth/BeaconState.sol/BeaconState.json';
15
+ import YieldOracleArtifact from '../../assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.json';
12
16
 
13
17
  // Outpost Artifacts
14
18
  import DepositorArtifact from '../../assets/ethereum/ABI/outpost/Depositor.sol/Depositor.json';
@@ -19,10 +23,18 @@ import OPPArtifact from '../../assets/ethereum/ABI/outpost/OPP.sol/OPP.json';
19
23
  import OPPCommonArtifact from '../../assets/ethereum/ABI/outpost/OPPCommon.sol/OPPCommon.json';
20
24
  import OPPInboundArtifact from '../../assets/ethereum/ABI/outpost/OPPInbound.sol/OPPInbound.json';
21
25
  import PretokenArtifact from '../../assets/ethereum/ABI/outpost/Pretoken.sol/Pretoken.json';
22
- import AggregatorArtifact from '../../assets/ethereum/ABI/outpost/Aggregator.sol/Aggregator.json';
26
+ import AggregatorArtifact from '../../assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.json';
23
27
  import EthUsdPriceConsumerArtifact from '../../assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.json';
24
28
  import PoolArtifact from '../../assets/ethereum/ABI/outpost/Pool.sol/Pool.json';
29
+ import OutpostManagerAuthorityArtifact from '../../assets/ethereum/ABI/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.json';
30
+
31
+ // Common Artifacts
32
+ import IodataArtifact from '../../assets/ethereum/ABI/common/iodata.sol/iodata.json';
33
+ import Base58Artifact from '../../assets/ethereum/ABI/common/Base58.sol/Base58.json';
34
+ import sysio_merkleArtifact from '../../assets/ethereum/ABI/common/sysio_merkle.sol/sysio_merkle.json';
35
+ import sysio_writeArtifact from '../../assets/ethereum/ABI/common/sysio_write.sol/sysio_write.json';
25
36
 
37
+ // ERC Token Artifacts
26
38
  import ERC20Artifact from '../../assets/ethereum/ABI/token/ERC20Token.sol/ERC20Token.json';
27
39
  import ERC721Artifact from '../../assets/ethereum/ABI/token/ERC721Token.sol/ERC721Token.json';
28
40
  import ERC1155Artifact from '../../assets/ethereum/ABI/token/ERC1155Token.sol/ERC1155Token.json';
@@ -43,25 +55,33 @@ export const ERC1155Abi = ERC1155Artifact.abi;
43
55
  // Make sure ContractName in ./types includes all of these keys.
44
56
  export const ADDRESSES: AddressBook = {
45
57
  // LiqETH contracts
46
- Accounting: "0xd333A03a44D5d602A98c1B7bcd7ED1f042DD0dEd",
47
- DepositManager: "0x601eaA31e8d33D8725786f1733f4cE6cCEf740D4",
48
- LiqEth: "0x08252e1Dcbaa86A2887927b02536CD3E67a802c8", // AKA LiqEthToken
49
- StakingModule: "0x7Aac2fCfc83d7F2f15eA53a10C1677CA377AFcF4",
50
- WithdrawalQueue: "0x951E413FC81a2CE133078ABE8B88677F5296abE7",
51
- WithdrawalVault: "0x0D2bf834DD560839e986d42D06DeE268A17c2d13",
58
+ LiqEthAuthority: "0x9686E04F30Fa93496B7d7fE0FBc2e4e0aD52891E",
59
+ BeaconState: "0x207b249d7a83F6E9FCa04a1CD9b484D4f4f9aD2D",
60
+ WithdrawalQueue: "0x9a575c7Acce9e616cD07A0BDb2D28866027b75Ae",
61
+ LiqEthToken: "0x5f7192fa756304b255F6F9C1123426Db6A1Db748",
62
+ Accounting: "0xBAbAd5219f022B29282b904ceEaeBB7ab1b069fC",
63
+ DepositManager: "0x2e1986508472805c1649e4BBB424879B89720741",
64
+ WithdrawalVault: "0xC82FAf3Fed135B70A7E797864F504819a98E96c4",
65
+ StakingModule: "0xdd24EffAa4B42f3273E2b44995639119c08daBea",
66
+ YieldOracle: "0x56A27E1d10d4aEc7402dC26693fb7c0Eb66eF802",
52
67
 
53
68
  //Outpost contracts
54
- Depositor: "0x69Aa53Ef02F124dB421AeDda509d6912341299Cc",
55
- ReceiptNFT: "0x13588fF41E2f47D047874162B1eD15AaF6818f5a",
56
- OutpostManager: "0x187f4fEDBCAD2f3150120B743b5d568F11dD3452",
57
- BAR: "0x27d4646abF638A13934c94f8bA9AC1Bda39F5dbb",
58
- OPP: "0x79CA2DE915C294593edc16b32CBA8B7866159205",
59
- OPPCommon: "0x8392ea945Cd8C03F5241d4964D20BB5A9c320c71",
60
- OPPInbound: "0xfDA9A2C7e395a9722d9fa506f5d67aba823298dd",
61
- Pretoken: "0xcf6A1209A7A391cc576174204386F4e5462323dC",
62
- EthUsdPriceConsumer: "0x1Ef180FF49313fCB8B5c0470268295d0d24CDE69",
63
- Aggregator: "0xFCfc3ddd4CBd9Ad3b3af3A374B8bdA1b66eE6FFF",
64
- Pool: "0x29DEf0fA009e02d108d9505018EAe0168F233e03",
69
+ OutpostManagerAuthority: "0xAEcd2aa6EeFa4Aa7Cb9368728aA89Ca59Aa9ea59",
70
+ iodata: "0x2c2ab53F6Bc146bd31B459E832Ce0B9Da78712d8",
71
+ Base58: "0x9F188Ec124c9ad9bF6D195650d8360Fd052F585A",
72
+ sysio_merkle: "0x6eDA3C4c34421Cd667800C17fe33E48f5698e004",
73
+ ReceiptNFT: "0xd083051d9bb8353875abCecAB50C6e4FB5e527a8",
74
+ MockAggregator: "0xD721d15Ae1D1bF58DF1B9471198d968A16B8e58D",
75
+ Pool: "0xee5F11aC9b104c18d2423f266c5E737fC95ebA92",
76
+ OutpostManager: "0xB1B6ba7FA156652849069aC7ADB281283D235B9f",
77
+ sysio_write: "0xEfA608136d372349C09a7aA57665C09Fb4a620Ca",
78
+ EthUsdPriceConsumer: "0x6337A23b61f98b1526faF2848385Abe9cB4cFF21",
79
+ BAR: "0x9264eAA449da94caF70Fc18522021a94C8DF32Fb",
80
+ OPPCommon: "0x86A8cA16ce521De3EBdd1C541fAf188795b59FD0",
81
+ OPP: "0x79e8395Bb5131FB285aCEE5329BB43E66f50F88C",
82
+ Pretoken: "0x62f98AF2f9C3EF4eF2fA7bc0245BD5a9315E7541",
83
+ OPPInbound: "0xC85f57Ff069711e0b3472De3963bd2fC2FEfF3e2",
84
+ Depositor: "0xb0BACAb6f13dd96281300be13a6346461b2f35F3"
65
85
  };
66
86
 
67
87
  export type Contracts<T extends string = ContractName> = Record<T, ContractConfig>;
@@ -76,76 +96,109 @@ export type ContractConfig = {
76
96
  // -----------------------------------------------------------------------------
77
97
 
78
98
  export const CONTRACTS: Contracts<ContractName> = {
99
+ // LiqETH Contracts
100
+ LiqEthAuthority: {
101
+ address: ADDRESSES.LiqEthAuthority,
102
+ abi: LiqEthArtifact.abi as JsonFragment[],
103
+ },
104
+ BeaconState: {
105
+ address: ADDRESSES.BeaconState,
106
+ abi: BeaconStateArtifact.abi as JsonFragment[]
107
+ },
108
+ WithdrawalQueue: {
109
+ address: ADDRESSES.WithdrawalQueue,
110
+ abi: WithdrawalQueueArtifact.abi as JsonFragment[],
111
+ },
112
+ LiqEthToken: {
113
+ address: ADDRESSES.LiqEthToken,
114
+ abi: LiqEthArtifact.abi as JsonFragment[],
115
+ },
79
116
  Accounting: {
80
117
  address: ADDRESSES.Accounting,
81
118
  abi: AccountingArtifact.abi as JsonFragment[],
82
119
  },
83
- LiqEth: {
84
- address: ADDRESSES.LiqEth,
85
- abi: LiqEthArtifact.abi as JsonFragment[],
86
- },
87
120
  DepositManager: {
88
121
  address: ADDRESSES.DepositManager,
89
122
  abi: DepositManagerArtifact.abi as JsonFragment[],
90
123
  },
124
+ WithdrawalVault: {
125
+ address: ADDRESSES.WithdrawalVault,
126
+ abi: WithdrawalVaultArtifact.abi as JsonFragment[],
127
+ },
91
128
  StakingModule: {
92
129
  address: ADDRESSES.StakingModule,
93
130
  abi: StakingModuleArtifact.abi as JsonFragment[],
94
131
  },
95
- WithdrawalQueue: {
96
- address: ADDRESSES.WithdrawalQueue,
97
- abi: WithdrawalQueueArtifact.abi as JsonFragment[],
98
- },
99
- WithdrawalVault: {
100
- address: ADDRESSES.WithdrawalVault,
101
- abi: WithdrawalVaultArtifact.abi as JsonFragment[],
132
+ YieldOracle: {
133
+ address: ADDRESSES.YieldOracle,
134
+ abi: YieldOracleArtifact.abi as JsonFragment[],
102
135
  },
103
136
 
104
137
  // Outpost Contracts
105
- Depositor: {
106
- address: ADDRESSES.Depositor,
107
- abi: DepositorArtifact.abi as JsonFragment[],
138
+ OutpostManagerAuthority: {
139
+ address: ADDRESSES.OutpostManagerAuthority,
140
+ abi: OutpostManagerAuthorityArtifact.abi as JsonFragment[],
141
+ },
142
+ iodata: {
143
+ address: ADDRESSES.iodata,
144
+ abi: IodataArtifact.abi as JsonFragment[],
145
+ },
146
+ Base58: {
147
+ address: ADDRESSES.Base58,
148
+ abi: Base58Artifact.abi as JsonFragment[],
149
+ },
150
+ sysio_merkle: {
151
+ address: ADDRESSES.sysio_merkle,
152
+ abi: sysio_merkleArtifact.abi as JsonFragment[],
108
153
  },
109
154
  ReceiptNFT: {
110
155
  address: ADDRESSES.ReceiptNFT,
111
156
  abi: ReceiptNFTArtifact.abi as JsonFragment[],
112
157
  },
158
+ MockAggregator: {
159
+ address: ADDRESSES.MockAggregator,
160
+ abi: AggregatorArtifact.abi as JsonFragment[],
161
+ },
162
+ Pool: {
163
+ address: ADDRESSES.Pool,
164
+ abi: PoolArtifact.abi as JsonFragment[],
165
+ },
113
166
  OutpostManager: {
114
167
  address: ADDRESSES.OutpostManager,
115
168
  abi: OutpostManagerArtifact.abi as JsonFragment[],
116
169
  },
170
+ sysio_write: {
171
+ address: ADDRESSES.sysio_write,
172
+ abi: sysio_writeArtifact.abi as JsonFragment[],
173
+ },
174
+ EthUsdPriceConsumer: {
175
+ address: ADDRESSES.EthUsdPriceConsumer,
176
+ abi: EthUsdPriceConsumerArtifact.abi as JsonFragment[],
177
+ },
117
178
  BAR: {
118
179
  address: ADDRESSES.BAR,
119
180
  abi: BARArtifact.abi as JsonFragment[],
120
181
  },
121
- OPP: {
122
- address: ADDRESSES.OPP,
123
- abi: OPPArtifact.abi as JsonFragment[],
124
- },
125
182
  OPPCommon: {
126
183
  address: ADDRESSES.OPPCommon,
127
184
  abi: OPPCommonArtifact.abi as JsonFragment[],
128
185
  },
129
- OPPInbound: {
130
- address: ADDRESSES.OPPInbound,
131
- abi: OPPInboundArtifact.abi as JsonFragment[],
186
+ OPP: {
187
+ address: ADDRESSES.OPP,
188
+ abi: OPPArtifact.abi as JsonFragment[],
132
189
  },
133
190
  Pretoken: {
134
191
  address: ADDRESSES.Pretoken,
135
192
  abi: PretokenArtifact.abi as JsonFragment[],
136
193
  },
137
- Aggregator: {
138
- address: ADDRESSES.Aggregator,
139
- abi: AggregatorArtifact.abi as JsonFragment[],
194
+ OPPInbound: {
195
+ address: ADDRESSES.OPPInbound,
196
+ abi: OPPInboundArtifact.abi as JsonFragment[],
140
197
  },
141
- EthUsdPriceConsumer: {
142
- address: ADDRESSES.EthUsdPriceConsumer,
143
- abi: EthUsdPriceConsumerArtifact.abi as JsonFragment[],
198
+ Depositor: {
199
+ address: ADDRESSES.Depositor,
200
+ abi: DepositorArtifact.abi as JsonFragment[],
144
201
  },
145
- Pool: {
146
- address: ADDRESSES.Pool,
147
- abi: PoolArtifact.abi as JsonFragment[],
148
- }
149
202
  };
150
203
 
151
204
  export interface ContractOptions {
@@ -165,7 +165,7 @@ export class EthereumStakingClient implements IStakingClient {
165
165
  const nativeSymbol = this.network?.nativeCurrency?.symbol ?? 'ETH';
166
166
 
167
167
  // 2) liqETH ERC-20 balance (actual)
168
- const liqBalance: ethers.BigNumber = await this.contract.LiqEth.balanceOf(walletAddress);
168
+ const liqBalance: ethers.BigNumber = await this.contract.LiqEthToken.balanceOf(walletAddress);
169
169
  const liqSymbol = 'Liq' + (this.network?.nativeCurrency?.symbol ?? 'ETH');
170
170
 
171
171
  // 3) staked liqEth ERC-20 balance (calculate from receipts)
@@ -304,7 +304,7 @@ export class EthereumStakingClient implements IStakingClient {
304
304
  }
305
305
 
306
306
  async getEthStats(): Promise<any> {
307
- let withdrawDelay = await this.contract.DepositManager.withdrawDelay();
307
+ let withdrawDelay = await this.contract.WithdrawalQueue.withdrawDelay();
308
308
  let minDeposit = await this.contract.DepositManager.minDeposit();
309
309
  let rewardCooldown = await this.contract.DepositManager.rewardCooldown();
310
310
 
@@ -332,55 +332,67 @@ export class EthereumStakingClient implements IStakingClient {
332
332
  } = options ?? {};
333
333
 
334
334
 
335
- const blockNumber = await this.provider.getBlockNumber();
336
- const blockTag = { blockTag: blockNumber };
337
-
338
- // Fetch all required contract data
339
- const [totalSharesBn, indexBn, trancheNumberBn, trancheSupplyBn, tranchePriceWadBn, totalSupplyBn, supplyGrowthBps, priceGrowthBps, minPriceUsd, maxPriceUsd] = await Promise.all([
340
- this.contract.Depositor.totalShares(blockTag),
341
- this.contract.Depositor.index(blockTag),
342
- this.contract.Pretoken.trancheNumber(blockTag),
343
- this.contract.Pretoken.trancheSupply(blockTag),
344
- this.contract.Pretoken.tranchePriceUsd(blockTag),
345
- this.contract.Pretoken.totalSupply(blockTag),
346
- this.contract.Pretoken.supplyGrowthBps(blockTag),
347
- this.contract.Pretoken.priceGrowthBps(blockTag),
348
- this.contract.EthUsdPriceConsumer.MIN_PRICE(),
349
- this.contract.EthUsdPriceConsumer.MAX_PRICE(),
350
- ]);
351
-
352
-
353
- const totalTrancheSupply = BigInt(totalSupplyBn.toString()) / BigInt(1e10);
354
- const currentTrancheSupply = BigInt(trancheSupplyBn.toString()) / BigInt(1e10);
355
-
356
-
357
- // fetch price and timestamp from aggregator
358
- const [roundId, answer, startedAt, updatedAt, answeredInRound] = await this.contract.Aggregator.latestRoundData();
359
- let ethPriceUsd: bigint = BigInt(answer.toString());
360
- let nativePriceTimestamp: number = Number(updatedAt);
361
-
362
- // ! Placeholder from hoodi deployment - don't think this can be fetched dynamically
363
- const initialTrancheSupply = BigInt(60000) * BigInt(1e8);
364
-
365
- return buildEthereumTrancheSnapshot({
366
- chainID,
367
- totalSharesBn,
368
- indexBn,
369
- trancheNumberBn,
370
- currentTrancheSupply,
371
- tranchePriceWadBn,
372
- totalTrancheSupply,
373
- initialTrancheSupply,
374
- supplyGrowthBps,
375
- priceGrowthBps,
376
- minPriceUsd,
377
- maxPriceUsd,
378
-
379
- ethPriceUsd,
380
- nativePriceTimestamp,
381
- ladderWindowBefore: windowBefore,
382
- ladderWindowAfter: windowAfter,
383
- });
335
+ try {
336
+
337
+ const blockNumber = await this.provider.getBlockNumber();
338
+ const blockTag = { blockTag: blockNumber };
339
+
340
+
341
+ // Fetch all required contract data
342
+ const [totalSharesBn, indexBn, trancheNumberBn, trancheSupplyBn, tranchePriceWadBn, totalSupplyBn, supplyGrowthBps, priceIncrementUsd, minPriceUsd, maxPriceUsd] = await Promise.all([
343
+ this.contract.Depositor.totalShares(blockTag),
344
+ this.contract.Depositor.index(blockTag),
345
+ this.contract.Pretoken.trancheNumber(blockTag),
346
+ this.contract.Pretoken.trancheSupply(blockTag),
347
+ this.contract.Pretoken.tranchePriceUsd(blockTag),
348
+ this.contract.Pretoken.totalSupply(blockTag),
349
+ this.contract.Pretoken.supplyGrowthBps(blockTag),
350
+ this.contract.Pretoken.priceIncrementUsd(blockTag),
351
+ this.contract.EthUsdPriceConsumer.MIN_PRICE(),
352
+ this.contract.EthUsdPriceConsumer.MAX_PRICE(),
353
+ ]);
354
+
355
+
356
+ const totalTrancheSupply = BigInt(totalSupplyBn.toString()) / BigInt(1e10);
357
+ const currentTrancheSupply = BigInt(trancheSupplyBn.toString()) / BigInt(1e10);
358
+
359
+
360
+ // fetch price and timestamp from aggregator
361
+ const [roundId, answer, startedAt, updatedAt, answeredInRound] = await this.contract.MockAggregator.latestRoundData();
362
+ let ethPriceUsd: bigint = BigInt(answer.toString());
363
+ let nativePriceTimestamp: number = Number(updatedAt);
364
+
365
+ // ! Placeholder from hoodi deployment - don't think this can be fetched dynamically
366
+ const initialTrancheSupply = BigInt(70000) * BigInt(1e8);
367
+
368
+ console.log('priceIncrementUsd',priceIncrementUsd);
369
+
370
+
371
+ return buildEthereumTrancheSnapshot({
372
+ chainID,
373
+ totalSharesBn,
374
+ indexBn,
375
+ trancheNumberBn,
376
+ currentTrancheSupply,
377
+ tranchePriceWadBn,
378
+ totalTrancheSupply,
379
+ initialTrancheSupply,
380
+ supplyGrowthBps,
381
+ priceIncrementUsd,
382
+ minPriceUsd,
383
+ maxPriceUsd,
384
+
385
+ ethPriceUsd,
386
+ nativePriceTimestamp,
387
+ ladderWindowBefore: windowBefore,
388
+ ladderWindowAfter: windowAfter,
389
+ });
390
+ }
391
+ catch (err: any) {
392
+ console.log(err);
393
+
394
+ throw new Error(`Error fetching Ethereum tranche snapshot: ${err?.message || err}`);
395
+ }
384
396
  }
385
397
 
386
398
  // ---------------------------------------------------------------------
@@ -389,7 +401,7 @@ export class EthereumStakingClient implements IStakingClient {
389
401
 
390
402
  // ! This is a temporary measure for Hoodi testnet because there is no aggregator deployed
391
403
  private async updateMockAggregatorPrice() {
392
- const aggregator = this.contract.Aggregator;
404
+ const aggregator = this.contract.MockAggregator;
393
405
 
394
406
  // read latest round & compute age
395
407
  const [roundId, answer, startedAt, updatedAt, answeredInRound] = await aggregator.latestRoundData();
@@ -2,25 +2,34 @@ import { BigNumber, ethers } from 'ethers';
2
2
  import { BalanceView } from '../../types';
3
3
 
4
4
  export const CONTRACT_NAMES = [
5
- 'Accounting',
6
- 'DepositManager',
7
- 'LiqEth',
8
- 'StakingModule',
9
- 'WithdrawalQueue',
10
- 'WithdrawalVault',
5
+ // LiqETH contracts
6
+ "LiqEthAuthority",
7
+ "BeaconState",
8
+ "WithdrawalQueue",
9
+ "LiqEthToken",
10
+ "Accounting",
11
+ "DepositManager",
12
+ "WithdrawalVault",
13
+ "StakingModule",
14
+ "YieldOracle",
11
15
 
12
16
  //Outpost contracts
13
- 'Depositor',
14
- 'ReceiptNFT',
15
- 'OutpostManager',
16
- 'BAR',
17
- 'OPP',
18
- 'OPPCommon',
19
- 'OPPInbound',
20
- 'Pretoken',
21
- 'Aggregator',
22
- 'EthUsdPriceConsumer',
23
- 'Pool',
17
+ "OutpostManagerAuthority",
18
+ "iodata",
19
+ "Base58",
20
+ "sysio_merkle",
21
+ "ReceiptNFT",
22
+ "MockAggregator",
23
+ "Pool",
24
+ "OutpostManager",
25
+ "sysio_write",
26
+ "EthUsdPriceConsumer",
27
+ "BAR",
28
+ "OPPCommon",
29
+ "OPP",
30
+ "Pretoken",
31
+ "OPPInbound",
32
+ "Depositor",
24
33
 
25
34
  ] as const;
26
35
 
@@ -157,7 +157,7 @@ export function buildEthereumTrancheLadder(options: {
157
157
  currentTrancheSupply: bigint;
158
158
  currentPriceUsd: bigint;
159
159
  supplyGrowthBps: number;
160
- priceGrowthBps: number;
160
+ priceIncrementUsd: number;
161
161
  windowBefore?: number;
162
162
  windowAfter?: number;
163
163
  }): TrancheLadderItem[] {
@@ -167,7 +167,7 @@ export function buildEthereumTrancheLadder(options: {
167
167
  currentTrancheSupply,
168
168
  currentPriceUsd,
169
169
  supplyGrowthBps,
170
- priceGrowthBps,
170
+ priceIncrementUsd,
171
171
  windowBefore = 5,
172
172
  windowAfter = 5,
173
173
  } = options;
@@ -190,7 +190,7 @@ export function buildEthereumTrancheLadder(options: {
190
190
  const prevCap = capacity.get(id - 1)!;
191
191
  const prevPrice = price.get(id - 1)!;
192
192
  capacity.set(id, growOnce(prevCap, supplyGrowthBps));
193
- price.set(id, growOnce(prevPrice, priceGrowthBps));
193
+ price.set(id, growOnce(prevPrice, priceIncrementUsd));
194
194
  }
195
195
 
196
196
  // Backward (past tranches)
@@ -198,7 +198,7 @@ export function buildEthereumTrancheLadder(options: {
198
198
  const nextCap = capacity.get(id + 1)!;
199
199
  const nextPrice = price.get(id + 1)!;
200
200
  capacity.set(id, shrinkOnce(nextCap, supplyGrowthBps));
201
- price.set(id, shrinkOnce(nextPrice, priceGrowthBps));
201
+ price.set(id, shrinkOnce(nextPrice, priceIncrementUsd));
202
202
  }
203
203
 
204
204
  const ladder: TrancheLadderItem[] = [];
@@ -240,7 +240,7 @@ export async function buildEthereumTrancheSnapshot(options: {
240
240
  totalTrancheSupply;
241
241
  initialTrancheSupply;
242
242
  supplyGrowthBps;
243
- priceGrowthBps;
243
+ priceIncrementUsd;
244
244
  minPriceUsd;
245
245
  maxPriceUsd;
246
246
 
@@ -264,7 +264,7 @@ export async function buildEthereumTrancheSnapshot(options: {
264
264
  totalTrancheSupply,
265
265
  initialTrancheSupply,
266
266
  supplyGrowthBps,
267
- priceGrowthBps,
267
+ priceIncrementUsd,
268
268
  minPriceUsd,
269
269
  maxPriceUsd,
270
270
  } = options;
@@ -284,7 +284,7 @@ export async function buildEthereumTrancheSnapshot(options: {
284
284
  currentTrancheSupply,
285
285
  currentPriceUsd,
286
286
  supplyGrowthBps,
287
- priceGrowthBps,
287
+ priceIncrementUsd,
288
288
  windowBefore: ladderWindowBefore,
289
289
  windowAfter: ladderWindowAfter,
290
290
  });
@@ -297,7 +297,7 @@ export async function buildEthereumTrancheSnapshot(options: {
297
297
  currentTranche,
298
298
  currentPriceUsd,
299
299
  supplyGrowthBps,
300
- priceGrowthBps,
300
+ priceIncrementUsd,
301
301
  currentTrancheSupply,
302
302
  initialTrancheSupply,
303
303
  totalPretokensSold: totalTrancheSupply,
@@ -5,10 +5,12 @@ import { SolanaProgramService } from '../program';
5
5
  import type { LiqsolCore } from '../../../assets/solana/types/liqsol_core';
6
6
  import {
7
7
  deriveDistributionStatePda,
8
+ deriveGlobalConfigPda,
8
9
  deriveLiqsolMintPda,
10
+ derivePayRateHistoryPda,
9
11
  deriveUserRecordPda,
10
12
  } from '../constants';
11
- import type { DistributionState, DistributionUserRecord } from '../types';
13
+ import type { DistributionState, DistributionUserRecord, GlobalConfig, PayRateHistory } from '../types';
12
14
  import { getAssociatedTokenAddressSync, TOKEN_2022_PROGRAM_ID } from '@solana/spl-token';
13
15
 
14
16
  /**
@@ -55,6 +57,39 @@ export class DistributionClient {
55
57
  }
56
58
  }
57
59
 
60
+
61
+ /**
62
+ * Fetch the global payRateHistory account (circular buffer of scaled pay rates).
63
+ *
64
+ * IDL account name: "payRateHistory"
65
+ */
66
+ async getPayRateHistory(): Promise<PayRateHistory | null> {
67
+ const pda = derivePayRateHistoryPda();
68
+ try {
69
+ // Anchor types map directly onto our PayRateHistory TS type
70
+ return (await this.program.account.payRateHistory.fetch(
71
+ pda,
72
+ )) as PayRateHistory;
73
+ } catch {
74
+ return null;
75
+ }
76
+ }
77
+
78
+ /**
79
+ * Fetch the globalConfig account (contains depositFeeMultiplier, etc).
80
+ *
81
+ * IDL account name: "globalConfig"
82
+ */
83
+ async getGlobalConfig(): Promise<GlobalConfig | null> {
84
+ const pda = deriveGlobalConfigPda();
85
+ try {
86
+ return (await this.program.account.globalConfig.fetch(
87
+ pda,
88
+ ));
89
+ } catch {
90
+ return null;
91
+ }
92
+ }
58
93
  /**
59
94
  * Fetch a user's distribution userRecord (or null if missing).
60
95
  *