@juicedollar/jusd 1.0.4 → 1.0.5
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.
- package/contracts/MintingHubV2/MintingHub.sol +110 -17
- package/contracts/MintingHubV2/interface/IMintingHub.sol +7 -1
- package/contracts/test/PositionExpirationTest.sol +1 -1
- package/contracts/test/PositionRollingTest.sol +1 -1
- package/dist/index.d.mts +140 -2
- package/dist/index.d.ts +140 -2
- package/dist/index.js +190 -12
- package/dist/index.mjs +190 -12
- package/exports/abis/core/MintingHubGateway.ts +90 -1
- package/exports/abis/utils/MintingHubV2.ts +90 -1
- package/exports/address.config.ts +10 -10
- package/package.json +1 -1
|
@@ -85,6 +85,7 @@ contract MintingHub is IMintingHub, ERC165 {
|
|
|
85
85
|
error InitPeriodTooShort();
|
|
86
86
|
error NativeOnlyForWCBTC();
|
|
87
87
|
error ValueMismatch();
|
|
88
|
+
error NativeTransferFailed();
|
|
88
89
|
|
|
89
90
|
modifier validPos(address position) {
|
|
90
91
|
if (JUSD.getPositionParent(position) != address(this)) revert InvalidPos();
|
|
@@ -236,6 +237,7 @@ contract MintingHub is IMintingHub, ERC165 {
|
|
|
236
237
|
|
|
237
238
|
/**
|
|
238
239
|
* @notice Launch a challenge (Dutch auction) on a position
|
|
240
|
+
* @dev For native coin positions (WcBTC), send msg.value equal to _collateralAmount.
|
|
239
241
|
* @param _positionAddr address of the position we want to challenge
|
|
240
242
|
* @param _collateralAmount amount of the collateral we want to challenge
|
|
241
243
|
* @param minimumPrice guards against the minter front-running with a price change
|
|
@@ -245,14 +247,24 @@ contract MintingHub is IMintingHub, ERC165 {
|
|
|
245
247
|
address _positionAddr,
|
|
246
248
|
uint256 _collateralAmount,
|
|
247
249
|
uint256 minimumPrice
|
|
248
|
-
) external validPos(_positionAddr) returns (uint256) {
|
|
250
|
+
) external payable validPos(_positionAddr) returns (uint256) {
|
|
249
251
|
IPosition position = IPosition(_positionAddr);
|
|
250
252
|
// challenger should be ok if front-run by owner with a higher price
|
|
251
253
|
// in case owner front-runs challenger with small price decrease to prevent challenge,
|
|
252
254
|
// the challenger should set minimumPrice to market price
|
|
253
255
|
uint256 liqPrice = position.virtualPrice();
|
|
254
256
|
if (liqPrice < minimumPrice) revert UnexpectedPrice();
|
|
255
|
-
|
|
257
|
+
|
|
258
|
+
// Transfer collateral (handles native coin positions)
|
|
259
|
+
address collateralAddr = address(position.collateral());
|
|
260
|
+
if (msg.value > 0) {
|
|
261
|
+
if (collateralAddr != WCBTC) revert NativeOnlyForWCBTC();
|
|
262
|
+
if (msg.value != _collateralAmount) revert ValueMismatch();
|
|
263
|
+
IWrappedNative(WCBTC).deposit{value: msg.value}();
|
|
264
|
+
} else {
|
|
265
|
+
IERC20(collateralAddr).transferFrom(msg.sender, address(this), _collateralAmount);
|
|
266
|
+
}
|
|
267
|
+
|
|
256
268
|
uint256 pos = challenges.length;
|
|
257
269
|
challenges.push(Challenge(msg.sender, uint40(block.timestamp), position, _collateralAmount));
|
|
258
270
|
position.notifyChallengeStarted(_collateralAmount, liqPrice);
|
|
@@ -270,25 +282,36 @@ contract MintingHub is IMintingHub, ERC165 {
|
|
|
270
282
|
* @param size how much of the collateral the caller wants to bid for at most
|
|
271
283
|
* (automatically reduced to the available amount)
|
|
272
284
|
* @param postponeCollateralReturn To postpone the return of the collateral to the challenger. Usually false.
|
|
285
|
+
* @param returnCollateralAsNative If true, return collateral as native coin (only for WcBTC positions).
|
|
286
|
+
* In phase 1 (aversion): bidder receives native. In phase 2 (liquidation): both
|
|
287
|
+
* challenger refund and bidder acquisition are returned as native.
|
|
273
288
|
*/
|
|
274
|
-
function bid(uint32 _challengeNumber, uint256 size, bool postponeCollateralReturn)
|
|
289
|
+
function bid(uint32 _challengeNumber, uint256 size, bool postponeCollateralReturn, bool returnCollateralAsNative) public {
|
|
275
290
|
Challenge memory _challenge = challenges[_challengeNumber];
|
|
276
291
|
(uint256 liqPrice, uint40 phase) = _challenge.position.challengeData();
|
|
277
292
|
size = _challenge.size < size ? _challenge.size : size; // cannot bid for more than the size of the challenge
|
|
278
293
|
|
|
279
294
|
if (block.timestamp <= _challenge.start + phase) {
|
|
280
|
-
_avertChallenge(_challenge, _challengeNumber, liqPrice, size);
|
|
295
|
+
_avertChallenge(_challenge, _challengeNumber, liqPrice, size, returnCollateralAsNative);
|
|
281
296
|
emit ChallengeAverted(address(_challenge.position), _challengeNumber, size);
|
|
282
297
|
} else {
|
|
283
|
-
_returnChallengerCollateral(_challenge, _challengeNumber, size, postponeCollateralReturn);
|
|
284
|
-
(uint256 transferredCollateral, uint256 offer) = _finishChallenge(_challenge, size);
|
|
298
|
+
_returnChallengerCollateral(_challenge, _challengeNumber, size, postponeCollateralReturn, returnCollateralAsNative);
|
|
299
|
+
(uint256 transferredCollateral, uint256 offer) = _finishChallenge(_challenge, size, returnCollateralAsNative);
|
|
285
300
|
emit ChallengeSucceeded(address(_challenge.position), _challengeNumber, offer, transferredCollateral, size);
|
|
286
301
|
}
|
|
287
302
|
}
|
|
288
303
|
|
|
304
|
+
/**
|
|
305
|
+
* @notice Post a bid in JUSD given an open challenge (backward compatible version).
|
|
306
|
+
*/
|
|
307
|
+
function bid(uint32 _challengeNumber, uint256 size, bool postponeCollateralReturn) external {
|
|
308
|
+
bid(_challengeNumber, size, postponeCollateralReturn, false);
|
|
309
|
+
}
|
|
310
|
+
|
|
289
311
|
function _finishChallenge(
|
|
290
312
|
Challenge memory _challenge,
|
|
291
|
-
uint256 size
|
|
313
|
+
uint256 size,
|
|
314
|
+
bool asNative
|
|
292
315
|
) internal returns (uint256, uint256) {
|
|
293
316
|
// Repayments depend on what was actually minted, whereas bids depend on the available collateral
|
|
294
317
|
(address owner, uint256 collateral, uint256 repayment, uint256 interest, uint32 reservePPM) = _challenge
|
|
@@ -322,11 +345,21 @@ contract MintingHub is IMintingHub, ERC165 {
|
|
|
322
345
|
}
|
|
323
346
|
JUSD.burnWithoutReserve(repayment, reservePPM); // Repay the challenged part, example: 50 deur leading to 10 deur in implicit profits
|
|
324
347
|
JUSD.collectProfits(address(this), interest); // Collect interest as profits
|
|
325
|
-
|
|
348
|
+
|
|
349
|
+
// Transfer collateral to bidder (handles native coin if requested)
|
|
350
|
+
if (asNative && address(_challenge.position.collateral()) == WCBTC) {
|
|
351
|
+
_challenge.position.transferChallengedCollateral(address(this), collateral);
|
|
352
|
+
IWrappedNative(WCBTC).withdraw(collateral);
|
|
353
|
+
(bool success, ) = msg.sender.call{value: collateral}("");
|
|
354
|
+
if (!success) revert NativeTransferFailed();
|
|
355
|
+
} else {
|
|
356
|
+
_challenge.position.transferChallengedCollateral(msg.sender, collateral);
|
|
357
|
+
}
|
|
358
|
+
|
|
326
359
|
return (collateral, offer);
|
|
327
360
|
}
|
|
328
361
|
|
|
329
|
-
function _avertChallenge(Challenge memory _challenge, uint32 number, uint256 liqPrice, uint256 size) internal {
|
|
362
|
+
function _avertChallenge(Challenge memory _challenge, uint32 number, uint256 liqPrice, uint256 size, bool asNative) internal {
|
|
330
363
|
require(block.timestamp != _challenge.start); // do not allow to avert the challenge in the same transaction, see CS-ZCHF-037
|
|
331
364
|
if (msg.sender == _challenge.challenger) {
|
|
332
365
|
// allow challenger to cancel challenge without paying themselves
|
|
@@ -335,13 +368,22 @@ contract MintingHub is IMintingHub, ERC165 {
|
|
|
335
368
|
}
|
|
336
369
|
|
|
337
370
|
_challenge.position.notifyChallengeAverted(size);
|
|
338
|
-
|
|
371
|
+
|
|
339
372
|
if (size < _challenge.size) {
|
|
340
373
|
challenges[number].size = _challenge.size - size;
|
|
341
374
|
} else {
|
|
342
375
|
require(size == _challenge.size);
|
|
343
376
|
delete challenges[number];
|
|
344
377
|
}
|
|
378
|
+
|
|
379
|
+
// Transfer collateral to bidder (handles native coin if requested)
|
|
380
|
+
if (asNative && address(_challenge.position.collateral()) == WCBTC) {
|
|
381
|
+
IWrappedNative(WCBTC).withdraw(size);
|
|
382
|
+
(bool success, ) = msg.sender.call{value: size}("");
|
|
383
|
+
if (!success) revert NativeTransferFailed();
|
|
384
|
+
} else {
|
|
385
|
+
_challenge.position.collateral().transfer(msg.sender, size);
|
|
386
|
+
}
|
|
345
387
|
}
|
|
346
388
|
|
|
347
389
|
/**
|
|
@@ -351,9 +393,9 @@ contract MintingHub is IMintingHub, ERC165 {
|
|
|
351
393
|
Challenge memory _challenge,
|
|
352
394
|
uint32 number,
|
|
353
395
|
uint256 amount,
|
|
354
|
-
bool postpone
|
|
396
|
+
bool postpone,
|
|
397
|
+
bool asNative
|
|
355
398
|
) internal {
|
|
356
|
-
_returnCollateral(_challenge.position.collateral(), _challenge.challenger, amount, postpone);
|
|
357
399
|
if (_challenge.size == amount) {
|
|
358
400
|
// bid on full amount
|
|
359
401
|
delete challenges[number];
|
|
@@ -361,6 +403,7 @@ contract MintingHub is IMintingHub, ERC165 {
|
|
|
361
403
|
// bid on partial amount
|
|
362
404
|
challenges[number].size -= amount;
|
|
363
405
|
}
|
|
406
|
+
_returnCollateral(_challenge.position.collateral(), _challenge.challenger, amount, postpone, asNative);
|
|
364
407
|
}
|
|
365
408
|
|
|
366
409
|
/**
|
|
@@ -405,18 +448,39 @@ contract MintingHub is IMintingHub, ERC165 {
|
|
|
405
448
|
|
|
406
449
|
/**
|
|
407
450
|
* @notice Challengers can call this method to withdraw collateral whose return was postponed.
|
|
451
|
+
* @param collateral The collateral token address
|
|
452
|
+
* @param target The address to receive the collateral
|
|
453
|
+
* @param asNative If true and collateral is WcBTC, unwrap and send as native coin
|
|
408
454
|
*/
|
|
409
|
-
function returnPostponedCollateral(address collateral, address target)
|
|
455
|
+
function returnPostponedCollateral(address collateral, address target, bool asNative) public {
|
|
410
456
|
uint256 amount = pendingReturns[collateral][msg.sender];
|
|
411
457
|
delete pendingReturns[collateral][msg.sender];
|
|
412
|
-
|
|
458
|
+
if (asNative && collateral == WCBTC) {
|
|
459
|
+
IWrappedNative(WCBTC).withdraw(amount);
|
|
460
|
+
(bool success, ) = target.call{value: amount}("");
|
|
461
|
+
if (!success) revert NativeTransferFailed();
|
|
462
|
+
} else {
|
|
463
|
+
IERC20(collateral).transfer(target, amount);
|
|
464
|
+
}
|
|
413
465
|
}
|
|
414
466
|
|
|
415
|
-
|
|
467
|
+
/**
|
|
468
|
+
* @notice Challengers can call this method to withdraw collateral whose return was postponed (backward compatible).
|
|
469
|
+
*/
|
|
470
|
+
function returnPostponedCollateral(address collateral, address target) external {
|
|
471
|
+
returnPostponedCollateral(collateral, target, false);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
function _returnCollateral(IERC20 collateral, address recipient, uint256 amount, bool postpone, bool asNative) internal {
|
|
416
475
|
if (postpone) {
|
|
417
476
|
// Postponing helps in case the challenger was blacklisted or otherwise cannot receive at the moment.
|
|
418
477
|
pendingReturns[address(collateral)][recipient] += amount;
|
|
419
478
|
emit PostponedReturn(address(collateral), recipient, amount);
|
|
479
|
+
} else if (asNative && address(collateral) == WCBTC) {
|
|
480
|
+
// Unwrap and return as native coin
|
|
481
|
+
IWrappedNative(WCBTC).withdraw(amount);
|
|
482
|
+
(bool success, ) = recipient.call{value: amount}("");
|
|
483
|
+
if (!success) revert NativeTransferFailed();
|
|
420
484
|
} else {
|
|
421
485
|
collateral.transfer(recipient, amount); // return the challenger's collateral
|
|
422
486
|
}
|
|
@@ -458,8 +522,12 @@ contract MintingHub is IMintingHub, ERC165 {
|
|
|
458
522
|
*
|
|
459
523
|
* To prevent dust either the remaining collateral needs to be bought or collateral with a value
|
|
460
524
|
* of at least OPENING_FEE (1000 JUSD) needs to remain in the position for a different buyer
|
|
525
|
+
*
|
|
526
|
+
* @param pos The expired position to buy collateral from
|
|
527
|
+
* @param upToAmount Maximum amount of collateral to buy
|
|
528
|
+
* @param receiveAsNative If true and collateral is WcBTC, receive as native coin
|
|
461
529
|
*/
|
|
462
|
-
function buyExpiredCollateral(IPosition pos, uint256 upToAmount)
|
|
530
|
+
function buyExpiredCollateral(IPosition pos, uint256 upToAmount, bool receiveAsNative) public returns (uint256) {
|
|
463
531
|
uint256 max = pos.collateral().balanceOf(address(pos));
|
|
464
532
|
uint256 amount = upToAmount > max ? max : upToAmount;
|
|
465
533
|
uint256 forceSalePrice = expiredPurchasePrice(pos);
|
|
@@ -470,11 +538,31 @@ contract MintingHub is IMintingHub, ERC165 {
|
|
|
470
538
|
revert LeaveNoDust(max - amount);
|
|
471
539
|
}
|
|
472
540
|
|
|
473
|
-
pos.
|
|
541
|
+
address collateralAddr = address(pos.collateral());
|
|
542
|
+
if (receiveAsNative && collateralAddr == WCBTC) {
|
|
543
|
+
// Pull JUSD from user to Hub, then approve Position to spend it
|
|
544
|
+
JUSD.transferFrom(msg.sender, address(this), costs);
|
|
545
|
+
IERC20(address(JUSD)).approve(address(pos), costs);
|
|
546
|
+
// Route through hub to unwrap
|
|
547
|
+
pos.forceSale(address(this), amount, costs);
|
|
548
|
+
IWrappedNative(WCBTC).withdraw(amount);
|
|
549
|
+
(bool success, ) = msg.sender.call{value: amount}("");
|
|
550
|
+
if (!success) revert NativeTransferFailed();
|
|
551
|
+
} else {
|
|
552
|
+
pos.forceSale(msg.sender, amount, costs);
|
|
553
|
+
}
|
|
554
|
+
|
|
474
555
|
emit ForcedSale(address(pos), amount, forceSalePrice);
|
|
475
556
|
return amount;
|
|
476
557
|
}
|
|
477
558
|
|
|
559
|
+
/**
|
|
560
|
+
* Buys up to the desired amount of the collateral asset from the given expired position (backward compatible).
|
|
561
|
+
*/
|
|
562
|
+
function buyExpiredCollateral(IPosition pos, uint256 upToAmount) external returns (uint256) {
|
|
563
|
+
return buyExpiredCollateral(pos, upToAmount, false);
|
|
564
|
+
}
|
|
565
|
+
|
|
478
566
|
/**
|
|
479
567
|
* @dev See {IERC165-supportsInterface}.
|
|
480
568
|
*/
|
|
@@ -483,4 +571,9 @@ contract MintingHub is IMintingHub, ERC165 {
|
|
|
483
571
|
interfaceId == type(IMintingHub).interfaceId ||
|
|
484
572
|
super.supportsInterface(interfaceId);
|
|
485
573
|
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* @notice Required to receive native coin when unwrapping WcBTC.
|
|
577
|
+
*/
|
|
578
|
+
receive() external payable {}
|
|
486
579
|
}
|
|
@@ -16,13 +16,19 @@ interface IMintingHub {
|
|
|
16
16
|
address _positionAddr,
|
|
17
17
|
uint256 _collateralAmount,
|
|
18
18
|
uint256 minimumPrice
|
|
19
|
-
) external returns (uint256);
|
|
19
|
+
) external payable returns (uint256);
|
|
20
20
|
|
|
21
21
|
function bid(uint32 _challengeNumber, uint256 size, bool postponeCollateralReturn) external;
|
|
22
22
|
|
|
23
|
+
function bid(uint32 _challengeNumber, uint256 size, bool postponeCollateralReturn, bool returnCollateralAsNative) external;
|
|
24
|
+
|
|
23
25
|
function returnPostponedCollateral(address collateral, address target) external;
|
|
24
26
|
|
|
27
|
+
function returnPostponedCollateral(address collateral, address target, bool asNative) external;
|
|
28
|
+
|
|
25
29
|
function buyExpiredCollateral(IPosition pos, uint256 upToAmount) external returns (uint256);
|
|
26
30
|
|
|
31
|
+
function buyExpiredCollateral(IPosition pos, uint256 upToAmount, bool receiveAsNative) external returns (uint256);
|
|
32
|
+
|
|
27
33
|
function clone(address owner, address parent, uint256 _initialCollateral, uint256 _initialMint, uint40 expiration, uint256 _liqPrice) external payable returns (address);
|
|
28
34
|
}
|
|
@@ -14,7 +14,7 @@ contract PositionExpirationTest {
|
|
|
14
14
|
IJuiceDollar public jusd;
|
|
15
15
|
bytes32 public frontendCode;
|
|
16
16
|
|
|
17
|
-
constructor(address hub_) {
|
|
17
|
+
constructor(address payable hub_) {
|
|
18
18
|
hub = MintingHubGateway(hub_);
|
|
19
19
|
col = new TestToken("Some Collateral", "COL", uint8(0));
|
|
20
20
|
jusd = hub.JUSD();
|
|
@@ -20,7 +20,7 @@ contract PositionRollingTest {
|
|
|
20
20
|
IPosition public p1;
|
|
21
21
|
IPosition public p2;
|
|
22
22
|
|
|
23
|
-
constructor(address hub_) {
|
|
23
|
+
constructor(address payable hub_) {
|
|
24
24
|
hub = MintingHub(hub_);
|
|
25
25
|
col = new TestToken("Some Collateral", "COL", uint8(0));
|
|
26
26
|
jusd = hub.JUSD();
|
package/dist/index.d.mts
CHANGED
|
@@ -2827,6 +2827,10 @@ declare const MintingHubGatewayABI: readonly [{
|
|
|
2827
2827
|
readonly inputs: readonly [];
|
|
2828
2828
|
readonly name: "NativeOnlyForWCBTC";
|
|
2829
2829
|
readonly type: "error";
|
|
2830
|
+
}, {
|
|
2831
|
+
readonly inputs: readonly [];
|
|
2832
|
+
readonly name: "NativeTransferFailed";
|
|
2833
|
+
readonly type: "error";
|
|
2830
2834
|
}, {
|
|
2831
2835
|
readonly inputs: readonly [];
|
|
2832
2836
|
readonly name: "UnexpectedPrice";
|
|
@@ -3073,6 +3077,46 @@ declare const MintingHubGatewayABI: readonly [{
|
|
|
3073
3077
|
readonly outputs: readonly [];
|
|
3074
3078
|
readonly stateMutability: "nonpayable";
|
|
3075
3079
|
readonly type: "function";
|
|
3080
|
+
}, {
|
|
3081
|
+
readonly inputs: readonly [{
|
|
3082
|
+
readonly internalType: "uint32";
|
|
3083
|
+
readonly name: "_challengeNumber";
|
|
3084
|
+
readonly type: "uint32";
|
|
3085
|
+
}, {
|
|
3086
|
+
readonly internalType: "uint256";
|
|
3087
|
+
readonly name: "size";
|
|
3088
|
+
readonly type: "uint256";
|
|
3089
|
+
}, {
|
|
3090
|
+
readonly internalType: "bool";
|
|
3091
|
+
readonly name: "postponeCollateralReturn";
|
|
3092
|
+
readonly type: "bool";
|
|
3093
|
+
}, {
|
|
3094
|
+
readonly internalType: "bool";
|
|
3095
|
+
readonly name: "returnCollateralAsNative";
|
|
3096
|
+
readonly type: "bool";
|
|
3097
|
+
}];
|
|
3098
|
+
readonly name: "bid";
|
|
3099
|
+
readonly outputs: readonly [];
|
|
3100
|
+
readonly stateMutability: "nonpayable";
|
|
3101
|
+
readonly type: "function";
|
|
3102
|
+
}, {
|
|
3103
|
+
readonly inputs: readonly [{
|
|
3104
|
+
readonly internalType: "contract IPosition";
|
|
3105
|
+
readonly name: "pos";
|
|
3106
|
+
readonly type: "address";
|
|
3107
|
+
}, {
|
|
3108
|
+
readonly internalType: "uint256";
|
|
3109
|
+
readonly name: "upToAmount";
|
|
3110
|
+
readonly type: "uint256";
|
|
3111
|
+
}];
|
|
3112
|
+
readonly name: "buyExpiredCollateral";
|
|
3113
|
+
readonly outputs: readonly [{
|
|
3114
|
+
readonly internalType: "uint256";
|
|
3115
|
+
readonly name: "";
|
|
3116
|
+
readonly type: "uint256";
|
|
3117
|
+
}];
|
|
3118
|
+
readonly stateMutability: "nonpayable";
|
|
3119
|
+
readonly type: "function";
|
|
3076
3120
|
}, {
|
|
3077
3121
|
readonly inputs: readonly [{
|
|
3078
3122
|
readonly internalType: "contract IPosition";
|
|
@@ -3082,6 +3126,10 @@ declare const MintingHubGatewayABI: readonly [{
|
|
|
3082
3126
|
readonly internalType: "uint256";
|
|
3083
3127
|
readonly name: "upToAmount";
|
|
3084
3128
|
readonly type: "uint256";
|
|
3129
|
+
}, {
|
|
3130
|
+
readonly internalType: "bool";
|
|
3131
|
+
readonly name: "receiveAsNative";
|
|
3132
|
+
readonly type: "bool";
|
|
3085
3133
|
}];
|
|
3086
3134
|
readonly name: "buyExpiredCollateral";
|
|
3087
3135
|
readonly outputs: readonly [{
|
|
@@ -3111,7 +3159,7 @@ declare const MintingHubGatewayABI: readonly [{
|
|
|
3111
3159
|
readonly name: "";
|
|
3112
3160
|
readonly type: "uint256";
|
|
3113
3161
|
}];
|
|
3114
|
-
readonly stateMutability: "
|
|
3162
|
+
readonly stateMutability: "payable";
|
|
3115
3163
|
readonly type: "function";
|
|
3116
3164
|
}, {
|
|
3117
3165
|
readonly inputs: readonly [{
|
|
@@ -3371,6 +3419,24 @@ declare const MintingHubGatewayABI: readonly [{
|
|
|
3371
3419
|
}];
|
|
3372
3420
|
readonly stateMutability: "view";
|
|
3373
3421
|
readonly type: "function";
|
|
3422
|
+
}, {
|
|
3423
|
+
readonly inputs: readonly [{
|
|
3424
|
+
readonly internalType: "address";
|
|
3425
|
+
readonly name: "collateral";
|
|
3426
|
+
readonly type: "address";
|
|
3427
|
+
}, {
|
|
3428
|
+
readonly internalType: "address";
|
|
3429
|
+
readonly name: "target";
|
|
3430
|
+
readonly type: "address";
|
|
3431
|
+
}, {
|
|
3432
|
+
readonly internalType: "bool";
|
|
3433
|
+
readonly name: "asNative";
|
|
3434
|
+
readonly type: "bool";
|
|
3435
|
+
}];
|
|
3436
|
+
readonly name: "returnPostponedCollateral";
|
|
3437
|
+
readonly outputs: readonly [];
|
|
3438
|
+
readonly stateMutability: "nonpayable";
|
|
3439
|
+
readonly type: "function";
|
|
3374
3440
|
}, {
|
|
3375
3441
|
readonly inputs: readonly [{
|
|
3376
3442
|
readonly internalType: "address";
|
|
@@ -3399,6 +3465,9 @@ declare const MintingHubGatewayABI: readonly [{
|
|
|
3399
3465
|
}];
|
|
3400
3466
|
readonly stateMutability: "view";
|
|
3401
3467
|
readonly type: "function";
|
|
3468
|
+
}, {
|
|
3469
|
+
readonly stateMutability: "payable";
|
|
3470
|
+
readonly type: "receive";
|
|
3402
3471
|
}];
|
|
3403
3472
|
|
|
3404
3473
|
declare const SavingsGatewayABI: readonly [{
|
|
@@ -7734,6 +7803,10 @@ declare const MintingHubV2ABI: readonly [{
|
|
|
7734
7803
|
readonly inputs: readonly [];
|
|
7735
7804
|
readonly name: "NativeOnlyForWCBTC";
|
|
7736
7805
|
readonly type: "error";
|
|
7806
|
+
}, {
|
|
7807
|
+
readonly inputs: readonly [];
|
|
7808
|
+
readonly name: "NativeTransferFailed";
|
|
7809
|
+
readonly type: "error";
|
|
7737
7810
|
}, {
|
|
7738
7811
|
readonly inputs: readonly [];
|
|
7739
7812
|
readonly name: "UnexpectedPrice";
|
|
@@ -7970,6 +8043,46 @@ declare const MintingHubV2ABI: readonly [{
|
|
|
7970
8043
|
readonly outputs: readonly [];
|
|
7971
8044
|
readonly stateMutability: "nonpayable";
|
|
7972
8045
|
readonly type: "function";
|
|
8046
|
+
}, {
|
|
8047
|
+
readonly inputs: readonly [{
|
|
8048
|
+
readonly internalType: "uint32";
|
|
8049
|
+
readonly name: "_challengeNumber";
|
|
8050
|
+
readonly type: "uint32";
|
|
8051
|
+
}, {
|
|
8052
|
+
readonly internalType: "uint256";
|
|
8053
|
+
readonly name: "size";
|
|
8054
|
+
readonly type: "uint256";
|
|
8055
|
+
}, {
|
|
8056
|
+
readonly internalType: "bool";
|
|
8057
|
+
readonly name: "postponeCollateralReturn";
|
|
8058
|
+
readonly type: "bool";
|
|
8059
|
+
}, {
|
|
8060
|
+
readonly internalType: "bool";
|
|
8061
|
+
readonly name: "returnCollateralAsNative";
|
|
8062
|
+
readonly type: "bool";
|
|
8063
|
+
}];
|
|
8064
|
+
readonly name: "bid";
|
|
8065
|
+
readonly outputs: readonly [];
|
|
8066
|
+
readonly stateMutability: "nonpayable";
|
|
8067
|
+
readonly type: "function";
|
|
8068
|
+
}, {
|
|
8069
|
+
readonly inputs: readonly [{
|
|
8070
|
+
readonly internalType: "contract IPosition";
|
|
8071
|
+
readonly name: "pos";
|
|
8072
|
+
readonly type: "address";
|
|
8073
|
+
}, {
|
|
8074
|
+
readonly internalType: "uint256";
|
|
8075
|
+
readonly name: "upToAmount";
|
|
8076
|
+
readonly type: "uint256";
|
|
8077
|
+
}];
|
|
8078
|
+
readonly name: "buyExpiredCollateral";
|
|
8079
|
+
readonly outputs: readonly [{
|
|
8080
|
+
readonly internalType: "uint256";
|
|
8081
|
+
readonly name: "";
|
|
8082
|
+
readonly type: "uint256";
|
|
8083
|
+
}];
|
|
8084
|
+
readonly stateMutability: "nonpayable";
|
|
8085
|
+
readonly type: "function";
|
|
7973
8086
|
}, {
|
|
7974
8087
|
readonly inputs: readonly [{
|
|
7975
8088
|
readonly internalType: "contract IPosition";
|
|
@@ -7979,6 +8092,10 @@ declare const MintingHubV2ABI: readonly [{
|
|
|
7979
8092
|
readonly internalType: "uint256";
|
|
7980
8093
|
readonly name: "upToAmount";
|
|
7981
8094
|
readonly type: "uint256";
|
|
8095
|
+
}, {
|
|
8096
|
+
readonly internalType: "bool";
|
|
8097
|
+
readonly name: "receiveAsNative";
|
|
8098
|
+
readonly type: "bool";
|
|
7982
8099
|
}];
|
|
7983
8100
|
readonly name: "buyExpiredCollateral";
|
|
7984
8101
|
readonly outputs: readonly [{
|
|
@@ -8008,7 +8125,7 @@ declare const MintingHubV2ABI: readonly [{
|
|
|
8008
8125
|
readonly name: "";
|
|
8009
8126
|
readonly type: "uint256";
|
|
8010
8127
|
}];
|
|
8011
|
-
readonly stateMutability: "
|
|
8128
|
+
readonly stateMutability: "payable";
|
|
8012
8129
|
readonly type: "function";
|
|
8013
8130
|
}, {
|
|
8014
8131
|
readonly inputs: readonly [{
|
|
@@ -8166,6 +8283,24 @@ declare const MintingHubV2ABI: readonly [{
|
|
|
8166
8283
|
}];
|
|
8167
8284
|
readonly stateMutability: "view";
|
|
8168
8285
|
readonly type: "function";
|
|
8286
|
+
}, {
|
|
8287
|
+
readonly inputs: readonly [{
|
|
8288
|
+
readonly internalType: "address";
|
|
8289
|
+
readonly name: "collateral";
|
|
8290
|
+
readonly type: "address";
|
|
8291
|
+
}, {
|
|
8292
|
+
readonly internalType: "address";
|
|
8293
|
+
readonly name: "target";
|
|
8294
|
+
readonly type: "address";
|
|
8295
|
+
}, {
|
|
8296
|
+
readonly internalType: "bool";
|
|
8297
|
+
readonly name: "asNative";
|
|
8298
|
+
readonly type: "bool";
|
|
8299
|
+
}];
|
|
8300
|
+
readonly name: "returnPostponedCollateral";
|
|
8301
|
+
readonly outputs: readonly [];
|
|
8302
|
+
readonly stateMutability: "nonpayable";
|
|
8303
|
+
readonly type: "function";
|
|
8169
8304
|
}, {
|
|
8170
8305
|
readonly inputs: readonly [{
|
|
8171
8306
|
readonly internalType: "address";
|
|
@@ -8194,6 +8329,9 @@ declare const MintingHubV2ABI: readonly [{
|
|
|
8194
8329
|
}];
|
|
8195
8330
|
readonly stateMutability: "view";
|
|
8196
8331
|
readonly type: "function";
|
|
8332
|
+
}, {
|
|
8333
|
+
readonly stateMutability: "payable";
|
|
8334
|
+
readonly type: "receive";
|
|
8197
8335
|
}];
|
|
8198
8336
|
|
|
8199
8337
|
declare const SavingsABI: readonly [{
|