@juicedollar/jusd 1.0.4 → 1.0.6
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 +141 -2
- package/dist/index.d.ts +141 -2
- package/dist/index.js +193 -13
- package/dist/index.mjs +193 -13
- package/exports/abis/core/MintingHubGateway.ts +90 -1
- package/exports/abis/utils/MintingHubV2.ts +90 -1
- package/exports/address.config.ts +13 -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
|
@@ -11,6 +11,7 @@ interface ChainAddress {
|
|
|
11
11
|
startUSD: Address;
|
|
12
12
|
roller: Address;
|
|
13
13
|
positionFactoryV2: Address;
|
|
14
|
+
genesisPosition: Address;
|
|
14
15
|
}
|
|
15
16
|
declare const ADDRESS: Record<number, ChainAddress>;
|
|
16
17
|
|
|
@@ -2827,6 +2828,10 @@ declare const MintingHubGatewayABI: readonly [{
|
|
|
2827
2828
|
readonly inputs: readonly [];
|
|
2828
2829
|
readonly name: "NativeOnlyForWCBTC";
|
|
2829
2830
|
readonly type: "error";
|
|
2831
|
+
}, {
|
|
2832
|
+
readonly inputs: readonly [];
|
|
2833
|
+
readonly name: "NativeTransferFailed";
|
|
2834
|
+
readonly type: "error";
|
|
2830
2835
|
}, {
|
|
2831
2836
|
readonly inputs: readonly [];
|
|
2832
2837
|
readonly name: "UnexpectedPrice";
|
|
@@ -3073,6 +3078,46 @@ declare const MintingHubGatewayABI: readonly [{
|
|
|
3073
3078
|
readonly outputs: readonly [];
|
|
3074
3079
|
readonly stateMutability: "nonpayable";
|
|
3075
3080
|
readonly type: "function";
|
|
3081
|
+
}, {
|
|
3082
|
+
readonly inputs: readonly [{
|
|
3083
|
+
readonly internalType: "uint32";
|
|
3084
|
+
readonly name: "_challengeNumber";
|
|
3085
|
+
readonly type: "uint32";
|
|
3086
|
+
}, {
|
|
3087
|
+
readonly internalType: "uint256";
|
|
3088
|
+
readonly name: "size";
|
|
3089
|
+
readonly type: "uint256";
|
|
3090
|
+
}, {
|
|
3091
|
+
readonly internalType: "bool";
|
|
3092
|
+
readonly name: "postponeCollateralReturn";
|
|
3093
|
+
readonly type: "bool";
|
|
3094
|
+
}, {
|
|
3095
|
+
readonly internalType: "bool";
|
|
3096
|
+
readonly name: "returnCollateralAsNative";
|
|
3097
|
+
readonly type: "bool";
|
|
3098
|
+
}];
|
|
3099
|
+
readonly name: "bid";
|
|
3100
|
+
readonly outputs: readonly [];
|
|
3101
|
+
readonly stateMutability: "nonpayable";
|
|
3102
|
+
readonly type: "function";
|
|
3103
|
+
}, {
|
|
3104
|
+
readonly inputs: readonly [{
|
|
3105
|
+
readonly internalType: "contract IPosition";
|
|
3106
|
+
readonly name: "pos";
|
|
3107
|
+
readonly type: "address";
|
|
3108
|
+
}, {
|
|
3109
|
+
readonly internalType: "uint256";
|
|
3110
|
+
readonly name: "upToAmount";
|
|
3111
|
+
readonly type: "uint256";
|
|
3112
|
+
}];
|
|
3113
|
+
readonly name: "buyExpiredCollateral";
|
|
3114
|
+
readonly outputs: readonly [{
|
|
3115
|
+
readonly internalType: "uint256";
|
|
3116
|
+
readonly name: "";
|
|
3117
|
+
readonly type: "uint256";
|
|
3118
|
+
}];
|
|
3119
|
+
readonly stateMutability: "nonpayable";
|
|
3120
|
+
readonly type: "function";
|
|
3076
3121
|
}, {
|
|
3077
3122
|
readonly inputs: readonly [{
|
|
3078
3123
|
readonly internalType: "contract IPosition";
|
|
@@ -3082,6 +3127,10 @@ declare const MintingHubGatewayABI: readonly [{
|
|
|
3082
3127
|
readonly internalType: "uint256";
|
|
3083
3128
|
readonly name: "upToAmount";
|
|
3084
3129
|
readonly type: "uint256";
|
|
3130
|
+
}, {
|
|
3131
|
+
readonly internalType: "bool";
|
|
3132
|
+
readonly name: "receiveAsNative";
|
|
3133
|
+
readonly type: "bool";
|
|
3085
3134
|
}];
|
|
3086
3135
|
readonly name: "buyExpiredCollateral";
|
|
3087
3136
|
readonly outputs: readonly [{
|
|
@@ -3111,7 +3160,7 @@ declare const MintingHubGatewayABI: readonly [{
|
|
|
3111
3160
|
readonly name: "";
|
|
3112
3161
|
readonly type: "uint256";
|
|
3113
3162
|
}];
|
|
3114
|
-
readonly stateMutability: "
|
|
3163
|
+
readonly stateMutability: "payable";
|
|
3115
3164
|
readonly type: "function";
|
|
3116
3165
|
}, {
|
|
3117
3166
|
readonly inputs: readonly [{
|
|
@@ -3371,6 +3420,24 @@ declare const MintingHubGatewayABI: readonly [{
|
|
|
3371
3420
|
}];
|
|
3372
3421
|
readonly stateMutability: "view";
|
|
3373
3422
|
readonly type: "function";
|
|
3423
|
+
}, {
|
|
3424
|
+
readonly inputs: readonly [{
|
|
3425
|
+
readonly internalType: "address";
|
|
3426
|
+
readonly name: "collateral";
|
|
3427
|
+
readonly type: "address";
|
|
3428
|
+
}, {
|
|
3429
|
+
readonly internalType: "address";
|
|
3430
|
+
readonly name: "target";
|
|
3431
|
+
readonly type: "address";
|
|
3432
|
+
}, {
|
|
3433
|
+
readonly internalType: "bool";
|
|
3434
|
+
readonly name: "asNative";
|
|
3435
|
+
readonly type: "bool";
|
|
3436
|
+
}];
|
|
3437
|
+
readonly name: "returnPostponedCollateral";
|
|
3438
|
+
readonly outputs: readonly [];
|
|
3439
|
+
readonly stateMutability: "nonpayable";
|
|
3440
|
+
readonly type: "function";
|
|
3374
3441
|
}, {
|
|
3375
3442
|
readonly inputs: readonly [{
|
|
3376
3443
|
readonly internalType: "address";
|
|
@@ -3399,6 +3466,9 @@ declare const MintingHubGatewayABI: readonly [{
|
|
|
3399
3466
|
}];
|
|
3400
3467
|
readonly stateMutability: "view";
|
|
3401
3468
|
readonly type: "function";
|
|
3469
|
+
}, {
|
|
3470
|
+
readonly stateMutability: "payable";
|
|
3471
|
+
readonly type: "receive";
|
|
3402
3472
|
}];
|
|
3403
3473
|
|
|
3404
3474
|
declare const SavingsGatewayABI: readonly [{
|
|
@@ -7734,6 +7804,10 @@ declare const MintingHubV2ABI: readonly [{
|
|
|
7734
7804
|
readonly inputs: readonly [];
|
|
7735
7805
|
readonly name: "NativeOnlyForWCBTC";
|
|
7736
7806
|
readonly type: "error";
|
|
7807
|
+
}, {
|
|
7808
|
+
readonly inputs: readonly [];
|
|
7809
|
+
readonly name: "NativeTransferFailed";
|
|
7810
|
+
readonly type: "error";
|
|
7737
7811
|
}, {
|
|
7738
7812
|
readonly inputs: readonly [];
|
|
7739
7813
|
readonly name: "UnexpectedPrice";
|
|
@@ -7970,6 +8044,46 @@ declare const MintingHubV2ABI: readonly [{
|
|
|
7970
8044
|
readonly outputs: readonly [];
|
|
7971
8045
|
readonly stateMutability: "nonpayable";
|
|
7972
8046
|
readonly type: "function";
|
|
8047
|
+
}, {
|
|
8048
|
+
readonly inputs: readonly [{
|
|
8049
|
+
readonly internalType: "uint32";
|
|
8050
|
+
readonly name: "_challengeNumber";
|
|
8051
|
+
readonly type: "uint32";
|
|
8052
|
+
}, {
|
|
8053
|
+
readonly internalType: "uint256";
|
|
8054
|
+
readonly name: "size";
|
|
8055
|
+
readonly type: "uint256";
|
|
8056
|
+
}, {
|
|
8057
|
+
readonly internalType: "bool";
|
|
8058
|
+
readonly name: "postponeCollateralReturn";
|
|
8059
|
+
readonly type: "bool";
|
|
8060
|
+
}, {
|
|
8061
|
+
readonly internalType: "bool";
|
|
8062
|
+
readonly name: "returnCollateralAsNative";
|
|
8063
|
+
readonly type: "bool";
|
|
8064
|
+
}];
|
|
8065
|
+
readonly name: "bid";
|
|
8066
|
+
readonly outputs: readonly [];
|
|
8067
|
+
readonly stateMutability: "nonpayable";
|
|
8068
|
+
readonly type: "function";
|
|
8069
|
+
}, {
|
|
8070
|
+
readonly inputs: readonly [{
|
|
8071
|
+
readonly internalType: "contract IPosition";
|
|
8072
|
+
readonly name: "pos";
|
|
8073
|
+
readonly type: "address";
|
|
8074
|
+
}, {
|
|
8075
|
+
readonly internalType: "uint256";
|
|
8076
|
+
readonly name: "upToAmount";
|
|
8077
|
+
readonly type: "uint256";
|
|
8078
|
+
}];
|
|
8079
|
+
readonly name: "buyExpiredCollateral";
|
|
8080
|
+
readonly outputs: readonly [{
|
|
8081
|
+
readonly internalType: "uint256";
|
|
8082
|
+
readonly name: "";
|
|
8083
|
+
readonly type: "uint256";
|
|
8084
|
+
}];
|
|
8085
|
+
readonly stateMutability: "nonpayable";
|
|
8086
|
+
readonly type: "function";
|
|
7973
8087
|
}, {
|
|
7974
8088
|
readonly inputs: readonly [{
|
|
7975
8089
|
readonly internalType: "contract IPosition";
|
|
@@ -7979,6 +8093,10 @@ declare const MintingHubV2ABI: readonly [{
|
|
|
7979
8093
|
readonly internalType: "uint256";
|
|
7980
8094
|
readonly name: "upToAmount";
|
|
7981
8095
|
readonly type: "uint256";
|
|
8096
|
+
}, {
|
|
8097
|
+
readonly internalType: "bool";
|
|
8098
|
+
readonly name: "receiveAsNative";
|
|
8099
|
+
readonly type: "bool";
|
|
7982
8100
|
}];
|
|
7983
8101
|
readonly name: "buyExpiredCollateral";
|
|
7984
8102
|
readonly outputs: readonly [{
|
|
@@ -8008,7 +8126,7 @@ declare const MintingHubV2ABI: readonly [{
|
|
|
8008
8126
|
readonly name: "";
|
|
8009
8127
|
readonly type: "uint256";
|
|
8010
8128
|
}];
|
|
8011
|
-
readonly stateMutability: "
|
|
8129
|
+
readonly stateMutability: "payable";
|
|
8012
8130
|
readonly type: "function";
|
|
8013
8131
|
}, {
|
|
8014
8132
|
readonly inputs: readonly [{
|
|
@@ -8166,6 +8284,24 @@ declare const MintingHubV2ABI: readonly [{
|
|
|
8166
8284
|
}];
|
|
8167
8285
|
readonly stateMutability: "view";
|
|
8168
8286
|
readonly type: "function";
|
|
8287
|
+
}, {
|
|
8288
|
+
readonly inputs: readonly [{
|
|
8289
|
+
readonly internalType: "address";
|
|
8290
|
+
readonly name: "collateral";
|
|
8291
|
+
readonly type: "address";
|
|
8292
|
+
}, {
|
|
8293
|
+
readonly internalType: "address";
|
|
8294
|
+
readonly name: "target";
|
|
8295
|
+
readonly type: "address";
|
|
8296
|
+
}, {
|
|
8297
|
+
readonly internalType: "bool";
|
|
8298
|
+
readonly name: "asNative";
|
|
8299
|
+
readonly type: "bool";
|
|
8300
|
+
}];
|
|
8301
|
+
readonly name: "returnPostponedCollateral";
|
|
8302
|
+
readonly outputs: readonly [];
|
|
8303
|
+
readonly stateMutability: "nonpayable";
|
|
8304
|
+
readonly type: "function";
|
|
8169
8305
|
}, {
|
|
8170
8306
|
readonly inputs: readonly [{
|
|
8171
8307
|
readonly internalType: "address";
|
|
@@ -8194,6 +8330,9 @@ declare const MintingHubV2ABI: readonly [{
|
|
|
8194
8330
|
}];
|
|
8195
8331
|
readonly stateMutability: "view";
|
|
8196
8332
|
readonly type: "function";
|
|
8333
|
+
}, {
|
|
8334
|
+
readonly stateMutability: "payable";
|
|
8335
|
+
readonly type: "receive";
|
|
8197
8336
|
}];
|
|
8198
8337
|
|
|
8199
8338
|
declare const SavingsABI: readonly [{
|