@wireio/stake 0.5.0 → 0.5.2

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.
@@ -604,25 +604,13 @@ export type LiqsolCore = {
604
604
  "writable": true
605
605
  },
606
606
  {
607
- "name": "controllerState",
608
- "docs": [
609
- "Stake controller state - used to verify authority"
610
- ]
611
- },
612
- {
613
- "name": "globalConfig",
614
- "docs": [
615
- "Global config for cooldown_epochs"
616
- ]
607
+ "name": "globalConfig"
617
608
  },
618
609
  {
619
610
  "name": "clock"
620
611
  },
621
612
  {
622
- "name": "authority",
623
- "docs": [
624
- "Authority must match the stored authority in controller_state"
625
- ],
613
+ "name": "cranky",
626
614
  "writable": true,
627
615
  "signer": true
628
616
  }
@@ -646,6 +634,9 @@ export type LiqsolCore = {
646
634
  "name": "admin",
647
635
  "signer": true
648
636
  },
637
+ {
638
+ "name": "globalConfig"
639
+ },
649
640
  {
650
641
  "name": "globalState"
651
642
  },
@@ -688,6 +679,9 @@ export type LiqsolCore = {
688
679
  "name": "admin",
689
680
  "signer": true
690
681
  },
682
+ {
683
+ "name": "globalConfig"
684
+ },
691
685
  {
692
686
  "name": "globalState",
693
687
  "writable": true
@@ -1347,14 +1341,17 @@ export type LiqsolCore = {
1347
1341
  "name": "globalConfig",
1348
1342
  "writable": true
1349
1343
  },
1350
- {
1351
- "name": "controllerState"
1352
- },
1353
1344
  {
1354
1345
  "name": "payer",
1355
1346
  "writable": true,
1356
1347
  "signer": true
1357
1348
  },
1349
+ {
1350
+ "name": "program"
1351
+ },
1352
+ {
1353
+ "name": "programData"
1354
+ },
1358
1355
  {
1359
1356
  "name": "systemProgram"
1360
1357
  }
@@ -1838,17 +1835,10 @@ export type LiqsolCore = {
1838
1835
  ],
1839
1836
  "accounts": [
1840
1837
  {
1841
- "name": "controllerState",
1842
- "docs": [
1843
- "Stake controller state - used to verify admin authority"
1844
- ]
1838
+ "name": "globalConfig"
1845
1839
  },
1846
1840
  {
1847
- "name": "admin",
1848
- "docs": [
1849
- "Admin must match the stored authority in controller_state"
1850
- ],
1851
- "writable": true,
1841
+ "name": "cranky",
1852
1842
  "signer": true
1853
1843
  },
1854
1844
  {
@@ -2874,6 +2864,9 @@ export type LiqsolCore = {
2874
2864
  "name": "admin",
2875
2865
  "signer": true
2876
2866
  },
2867
+ {
2868
+ "name": "globalConfig"
2869
+ },
2877
2870
  {
2878
2871
  "name": "globalState",
2879
2872
  "writable": true
@@ -2915,6 +2908,9 @@ export type LiqsolCore = {
2915
2908
  "writable": true,
2916
2909
  "signer": true
2917
2910
  },
2911
+ {
2912
+ "name": "globalConfig"
2913
+ },
2918
2914
  {
2919
2915
  "name": "trancheState",
2920
2916
  "writable": true
@@ -2947,6 +2943,9 @@ export type LiqsolCore = {
2947
2943
  "writable": true,
2948
2944
  "signer": true
2949
2945
  },
2946
+ {
2947
+ "name": "globalConfig"
2948
+ },
2950
2949
  {
2951
2950
  "name": "trancheState",
2952
2951
  "writable": true
@@ -2961,6 +2960,62 @@ export type LiqsolCore = {
2961
2960
  ],
2962
2961
  "args": []
2963
2962
  },
2963
+ {
2964
+ "name": "setAdmin",
2965
+ "discriminator": [
2966
+ 251,
2967
+ 163,
2968
+ 0,
2969
+ 52,
2970
+ 91,
2971
+ 194,
2972
+ 187,
2973
+ 92
2974
+ ],
2975
+ "accounts": [
2976
+ {
2977
+ "name": "globalConfig",
2978
+ "writable": true
2979
+ },
2980
+ {
2981
+ "name": "admin",
2982
+ "signer": true
2983
+ },
2984
+ {
2985
+ "name": "newAuthority",
2986
+ "signer": true
2987
+ }
2988
+ ],
2989
+ "args": []
2990
+ },
2991
+ {
2992
+ "name": "setCranky",
2993
+ "discriminator": [
2994
+ 232,
2995
+ 48,
2996
+ 178,
2997
+ 74,
2998
+ 194,
2999
+ 60,
3000
+ 143,
3001
+ 164
3002
+ ],
3003
+ "accounts": [
3004
+ {
3005
+ "name": "globalConfig",
3006
+ "writable": true
3007
+ },
3008
+ {
3009
+ "name": "admin",
3010
+ "signer": true
3011
+ },
3012
+ {
3013
+ "name": "newAuthority",
3014
+ "signer": true
3015
+ }
3016
+ ],
3017
+ "args": []
3018
+ },
2964
3019
  {
2965
3020
  "name": "setLastStateChangeEpoch",
2966
3021
  "docs": [
@@ -3017,6 +3072,9 @@ export type LiqsolCore = {
3017
3072
  "name": "admin",
3018
3073
  "signer": true
3019
3074
  },
3075
+ {
3076
+ "name": "globalConfig"
3077
+ },
3020
3078
  {
3021
3079
  "name": "globalState",
3022
3080
  "writable": true
@@ -3046,6 +3104,9 @@ export type LiqsolCore = {
3046
3104
  "name": "admin",
3047
3105
  "signer": true
3048
3106
  },
3107
+ {
3108
+ "name": "globalConfig"
3109
+ },
3049
3110
  {
3050
3111
  "name": "globalState",
3051
3112
  "writable": true
@@ -3083,6 +3144,9 @@ export type LiqsolCore = {
3083
3144
  "name": "admin",
3084
3145
  "signer": true
3085
3146
  },
3147
+ {
3148
+ "name": "globalConfig"
3149
+ },
3086
3150
  {
3087
3151
  "name": "globalState",
3088
3152
  "writable": true
@@ -3112,6 +3176,9 @@ export type LiqsolCore = {
3112
3176
  "name": "admin",
3113
3177
  "signer": true
3114
3178
  },
3179
+ {
3180
+ "name": "globalConfig"
3181
+ },
3115
3182
  {
3116
3183
  "name": "globalState",
3117
3184
  "writable": true
@@ -3194,6 +3261,9 @@ export type LiqsolCore = {
3194
3261
  "name": "admin",
3195
3262
  "signer": true
3196
3263
  },
3264
+ {
3265
+ "name": "globalConfig"
3266
+ },
3197
3267
  {
3198
3268
  "name": "globalState"
3199
3269
  },
@@ -3249,6 +3319,9 @@ export type LiqsolCore = {
3249
3319
  },
3250
3320
  {
3251
3321
  "name": "syncLeaderboardScoresBatch",
3322
+ "docs": [
3323
+ "region: Validator Leaderboard Syncing"
3324
+ ],
3252
3325
  "discriminator": [
3253
3326
  52,
3254
3327
  11,
@@ -3511,13 +3584,7 @@ export type LiqsolCore = {
3511
3584
  "writable": true
3512
3585
  },
3513
3586
  {
3514
- "name": "controllerState"
3515
- },
3516
- {
3517
- "name": "authority",
3518
- "docs": [
3519
- "Authority must match StakeControllerState.authority"
3520
- ],
3587
+ "name": "admin",
3521
3588
  "signer": true
3522
3589
  }
3523
3590
  ],
@@ -3554,13 +3621,7 @@ export type LiqsolCore = {
3554
3621
  "writable": true
3555
3622
  },
3556
3623
  {
3557
- "name": "controllerState"
3558
- },
3559
- {
3560
- "name": "authority",
3561
- "docs": [
3562
- "Authority must match StakeControllerState.authority"
3563
- ],
3624
+ "name": "admin",
3564
3625
  "signer": true
3565
3626
  }
3566
3627
  ],
@@ -3597,13 +3658,7 @@ export type LiqsolCore = {
3597
3658
  "writable": true
3598
3659
  },
3599
3660
  {
3600
- "name": "controllerState"
3601
- },
3602
- {
3603
- "name": "authority",
3604
- "docs": [
3605
- "Authority must match StakeControllerState.authority"
3606
- ],
3661
+ "name": "admin",
3607
3662
  "signer": true
3608
3663
  }
3609
3664
  ],
@@ -3640,13 +3695,7 @@ export type LiqsolCore = {
3640
3695
  "writable": true
3641
3696
  },
3642
3697
  {
3643
- "name": "controllerState"
3644
- },
3645
- {
3646
- "name": "authority",
3647
- "docs": [
3648
- "Authority must match StakeControllerState.authority"
3649
- ],
3698
+ "name": "admin",
3650
3699
  "signer": true
3651
3700
  }
3652
3701
  ],
@@ -3683,6 +3732,9 @@ export type LiqsolCore = {
3683
3732
  "writable": true,
3684
3733
  "signer": true
3685
3734
  },
3735
+ {
3736
+ "name": "globalConfig"
3737
+ },
3686
3738
  {
3687
3739
  "name": "trancheState",
3688
3740
  "writable": true
@@ -3701,7 +3753,7 @@ export type LiqsolCore = {
3701
3753
  "type": "u16"
3702
3754
  },
3703
3755
  {
3704
- "name": "priceGrowthBps",
3756
+ "name": "priceGrowthCents",
3705
3757
  "type": "u16"
3706
3758
  }
3707
3759
  ]
@@ -3724,6 +3776,9 @@ export type LiqsolCore = {
3724
3776
  "writable": true,
3725
3777
  "signer": true
3726
3778
  },
3779
+ {
3780
+ "name": "globalConfig"
3781
+ },
3727
3782
  {
3728
3783
  "name": "trancheState",
3729
3784
  "writable": true
@@ -4188,118 +4243,8 @@ export type LiqsolCore = {
4188
4243
  "errors": [
4189
4244
  {
4190
4245
  "code": 6000,
4191
- "name": "destinationAccountDoesNotExist",
4192
- "msg": "Destination stake account does not exist"
4193
- },
4194
- {
4195
- "code": 6001,
4196
- "name": "sourceAccountDoesNotExist",
4197
- "msg": "Source stake account does not exist"
4198
- },
4199
- {
4200
- "code": 6002,
4201
- "name": "invalidDestinationOwner",
4202
- "msg": "Destination account not owned by stake program"
4203
- },
4204
- {
4205
- "code": 6003,
4206
- "name": "invalidSourceOwner",
4207
- "msg": "Source account not owned by stake program"
4208
- },
4209
- {
4210
- "code": 6004,
4211
- "name": "clockBorrowFailed",
4212
- "msg": "Failed to borrow clock data"
4213
- },
4214
- {
4215
- "code": 6005,
4216
- "name": "clockDeserializeFailed",
4217
- "msg": "Failed to deserialize clock"
4218
- },
4219
- {
4220
- "code": 6006,
4221
- "name": "destinationAnalysisFailed",
4222
- "msg": "Failed to analyze destination stake account"
4223
- },
4224
- {
4225
- "code": 6007,
4226
- "name": "sourceAnalysisFailed",
4227
- "msg": "Failed to analyze source stake account"
4228
- },
4229
- {
4230
- "code": 6008,
4231
- "name": "destinationStillActivating",
4232
- "msg": "Destination stake is still activating"
4233
- },
4234
- {
4235
- "code": 6009,
4236
- "name": "destinationDeactivating",
4237
- "msg": "Destination stake is deactivating"
4238
- },
4239
- {
4240
- "code": 6010,
4241
- "name": "sourceStillActivating",
4242
- "msg": "Source stake is still activating"
4243
- },
4244
- {
4245
- "code": 6011,
4246
- "name": "sourceDeactivating",
4247
- "msg": "Source stake is deactivating"
4248
- },
4249
- {
4250
- "code": 6012,
4251
- "name": "destinationBorrowFailed",
4252
- "msg": "Failed to borrow destination account data"
4253
- },
4254
- {
4255
- "code": 6013,
4256
- "name": "destinationParseFailed",
4257
- "msg": "Failed to parse destination stake state"
4258
- },
4259
- {
4260
- "code": 6014,
4261
- "name": "sourceBorrowFailed",
4262
- "msg": "Failed to borrow source account data"
4263
- },
4264
- {
4265
- "code": 6015,
4266
- "name": "sourceParseFailed",
4267
- "msg": "Failed to parse source stake state"
4268
- },
4269
- {
4270
- "code": 6016,
4271
- "name": "differentValidators",
4272
- "msg": "Stakes are delegated to different validators"
4273
- },
4274
- {
4275
- "code": 6017,
4276
- "name": "differentStakers",
4277
- "msg": "Stakes have different staker authorities"
4278
- },
4279
- {
4280
- "code": 6018,
4281
- "name": "differentWithdrawers",
4282
- "msg": "Stakes have different withdrawer authorities"
4283
- },
4284
- {
4285
- "code": 6019,
4286
- "name": "authoritiesNotFound",
4287
- "msg": "Could not extract authorities from accounts"
4288
- },
4289
- {
4290
- "code": 6020,
4291
- "name": "mergeInstructionFailed",
4292
- "msg": "Merge instruction failed"
4293
- },
4294
- {
4295
- "code": 6021,
4296
- "name": "epochRewardsActive",
4297
- "msg": "Epoch rewards distribution is active - stake operations blocked"
4298
- },
4299
- {
4300
- "code": 6022,
4301
- "name": "differentCreditsObserved",
4302
- "msg": "Stakes have different credits_observed - cannot merge until both earn same rewards"
4246
+ "name": "accountBorrowFailed",
4247
+ "msg": "Util Acc borrow Failed"
4303
4248
  }
4304
4249
  ],
4305
4250
  "types": [
@@ -4685,8 +4630,7 @@ export type LiqsolCore = {
4685
4630
  {
4686
4631
  "name": "globalConfig",
4687
4632
  "docs": [
4688
- "Zero-copy global config PDA",
4689
- "Authority is taken from StakeControllerState, not stored here"
4633
+ "Zero-copy global config PDA"
4690
4634
  ],
4691
4635
  "serialization": "bytemuckunsafe",
4692
4636
  "repr": {
@@ -4708,6 +4652,23 @@ export type LiqsolCore = {
4708
4652
  ]
4709
4653
  }
4710
4654
  },
4655
+ {
4656
+ "name": "admin",
4657
+ "type": "pubkey"
4658
+ },
4659
+ {
4660
+ "name": "cranky",
4661
+ "type": "pubkey"
4662
+ },
4663
+ {
4664
+ "name": "reservedPubkey",
4665
+ "type": {
4666
+ "array": [
4667
+ "pubkey",
4668
+ 1
4669
+ ]
4670
+ }
4671
+ },
4711
4672
  {
4712
4673
  "name": "minUserDeposit",
4713
4674
  "docs": [
@@ -4894,10 +4855,6 @@ export type LiqsolCore = {
4894
4855
  "type": {
4895
4856
  "kind": "struct",
4896
4857
  "fields": [
4897
- {
4898
- "name": "admin",
4899
- "type": "pubkey"
4900
- },
4901
4858
  {
4902
4859
  "name": "deployedAt",
4903
4860
  "type": "i64"
@@ -5858,13 +5815,6 @@ export type LiqsolCore = {
5858
5815
  "type": {
5859
5816
  "kind": "struct",
5860
5817
  "fields": [
5861
- {
5862
- "name": "admin",
5863
- "docs": [
5864
- "Admin authority (can update growth parameters and price bounds)"
5865
- ],
5866
- "type": "pubkey"
5867
- },
5868
5818
  {
5869
5819
  "name": "currentTrancheNumber",
5870
5820
  "type": "u64"
@@ -5893,9 +5843,9 @@ export type LiqsolCore = {
5893
5843
  "type": "u16"
5894
5844
  },
5895
5845
  {
5896
- "name": "priceGrowthBps",
5846
+ "name": "priceGrowthCents",
5897
5847
  "docs": [
5898
- "Price growth in basis points (e.g., 200 = 2%, max 10000)"
5848
+ "Price growth in cents per tranche (0.01 USD units)"
5899
5849
  ],
5900
5850
  "type": "u16"
5901
5851
  },
@@ -38,12 +38,9 @@ export class PretokenClient {
38
38
  if (allowance.lt(amountLiq)) {
39
39
  const liqWrite = this.contractService.getWrite('LiqEthToken');
40
40
 
41
- // currently requested unlimited amount - potentially change to only request up to the current amount?
42
- const approveAmount = ethers.constants.MaxUint256;
41
+ console.warn(`allowance insufficient (${allowance.toString()} < ${amountLiq.toString()}); sending approve(${depositorAddr}, ${amountLiq.toString()})`);
43
42
 
44
- console.warn(`allowance insufficient (${allowance.toString()} < ${amountLiq.toString()}); sending approve(${depositorAddr}, ${approveAmount.toString()})`);
45
-
46
- const approveTx = await liqWrite.approve(depositorAddr, approveAmount);
43
+ const approveTx = await liqWrite.approve(depositorAddr, amountLiq);
47
44
  await approveTx.wait(1);
48
45
 
49
46
  // re-read allowance to ensure approval succeeded
@@ -50,11 +50,8 @@ export class StakeClient {
50
50
  if (allowance.lt(amountWei)) {
51
51
  const liqWrite = this.contractService.getWrite('LiqEthToken');
52
52
 
53
- // currently requested unlimited amount - potentially change to only request up to the current amount?
54
- const approveAmount = ethers.constants.MaxUint256;
55
-
56
- console.warn(`allowance insufficient (${allowance.toString()} < ${amountWei.toString()}); sending approve(${depositor}, ${approveAmount.toString()})`);
57
- const approveTx = await liqWrite.approve(depositor, approveAmount);
53
+ console.warn(`allowance insufficient (${allowance.toString()} < ${amountWei.toString()}); sending approve(${depositor}, ${amountWei.toString()})`);
54
+ const approveTx = await liqWrite.approve(depositor, amountWei);
58
55
  await approveTx.wait(1);
59
56
 
60
57
  // re-read allowance to ensure approval succeeded
@@ -23,7 +23,7 @@ import OPPArtifact from '../../assets/ethereum/ABI/outpost/OPP.sol/OPP.json';
23
23
  import OPPCommonArtifact from '../../assets/ethereum/ABI/outpost/OPPCommon.sol/OPPCommon.json';
24
24
  import OPPInboundArtifact from '../../assets/ethereum/ABI/outpost/OPPInbound.sol/OPPInbound.json';
25
25
  import PretokenArtifact from '../../assets/ethereum/ABI/outpost/Pretoken.sol/Pretoken.json';
26
- import AggregatorArtifact from '../../assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.json';
26
+ import AggregatorArtifact from '../../assets/ethereum/ABI/outpost/Aggregator.sol/Aggregator.json';
27
27
  import EthUsdPriceConsumerArtifact from '../../assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.json';
28
28
  import PoolArtifact from '../../assets/ethereum/ABI/outpost/Pool.sol/Pool.json';
29
29
  import OutpostManagerAuthorityArtifact from '../../assets/ethereum/ABI/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.json';
@@ -71,7 +71,7 @@ export const ADDRESSES: AddressBook = {
71
71
  Base58: "0x9F188Ec124c9ad9bF6D195650d8360Fd052F585A",
72
72
  sysio_merkle: "0x6eDA3C4c34421Cd667800C17fe33E48f5698e004",
73
73
  ReceiptNFT: "0xd083051d9bb8353875abCecAB50C6e4FB5e527a8",
74
- MockAggregator: "0xD721d15Ae1D1bF58DF1B9471198d968A16B8e58D",
74
+ MockAggregator: "0xFCfc3ddd4CBd9Ad3b3af3A374B8bdA1b66eE6FFF",
75
75
  Pool: "0xee5F11aC9b104c18d2423f266c5E737fC95ebA92",
76
76
  OutpostManager: "0xB1B6ba7FA156652849069aC7ADB281283D235B9f",
77
77
  sysio_write: "0xEfA608136d372349C09a7aA57665C09Fb4a620Ca",
@@ -281,17 +281,17 @@ export class EthereumContractService {
281
281
  ERC721Artifact,
282
282
  ERC1155Artifact,
283
283
 
284
- // liqETH suite
285
- AccountingArtifact,
286
- DepositManagerArtifact,
287
- LiqEthArtifact,
288
- // LiqEthBurnArtifact,
289
- // LiqEthMintArtifact,
290
- // RewardsERC20Artifact,
291
- StakingModuleArtifact,
292
- // ValidatorBalanceArtifact,
293
- WithdrawalQueueArtifact,
294
- WithdrawalVaultArtifact,
284
+ // // liqETH suite
285
+ // AccountingArtifact,
286
+ // DepositManagerArtifact,
287
+ // LiqEthArtifact,
288
+ // // LiqEthBurnArtifact,
289
+ // // LiqEthMintArtifact,
290
+ // // RewardsERC20Artifact,
291
+ // StakingModuleArtifact,
292
+ // // ValidatorBalanceArtifact,
293
+ // WithdrawalQueueArtifact,
294
+ // WithdrawalVaultArtifact,
295
295
  // YieldArtifact,
296
296
  ];
297
297