Best JavaScript code snippet using fast-check-monorepo
CToken.ts
Source:CToken.ts
...18 constructor(event: AccrueInterest) {19 this._event = event;20 }21 get cashPrior(): BigInt {22 return this._event.parameters[0].value.toBigInt();23 }24 get interestAccumulated(): BigInt {25 return this._event.parameters[1].value.toBigInt();26 }27 get borrowIndex(): BigInt {28 return this._event.parameters[2].value.toBigInt();29 }30 get totalBorrows(): BigInt {31 return this._event.parameters[3].value.toBigInt();32 }33}34export class Mint extends ethereum.Event {35 get params(): Mint__Params {36 return new Mint__Params(this);37 }38}39export class Mint__Params {40 _event: Mint;41 constructor(event: Mint) {42 this._event = event;43 }44 get minter(): Address {45 return this._event.parameters[0].value.toAddress();46 }47 get mintAmount(): BigInt {48 return this._event.parameters[1].value.toBigInt();49 }50 get mintTokens(): BigInt {51 return this._event.parameters[2].value.toBigInt();52 }53}54export class Redeem extends ethereum.Event {55 get params(): Redeem__Params {56 return new Redeem__Params(this);57 }58}59export class Redeem__Params {60 _event: Redeem;61 constructor(event: Redeem) {62 this._event = event;63 }64 get redeemer(): Address {65 return this._event.parameters[0].value.toAddress();66 }67 get redeemAmount(): BigInt {68 return this._event.parameters[1].value.toBigInt();69 }70 get redeemTokens(): BigInt {71 return this._event.parameters[2].value.toBigInt();72 }73}74export class Borrow extends ethereum.Event {75 get params(): Borrow__Params {76 return new Borrow__Params(this);77 }78}79export class Borrow__Params {80 _event: Borrow;81 constructor(event: Borrow) {82 this._event = event;83 }84 get borrower(): Address {85 return this._event.parameters[0].value.toAddress();86 }87 get borrowAmount(): BigInt {88 return this._event.parameters[1].value.toBigInt();89 }90 get accountBorrows(): BigInt {91 return this._event.parameters[2].value.toBigInt();92 }93 get totalBorrows(): BigInt {94 return this._event.parameters[3].value.toBigInt();95 }96}97export class RepayBorrow extends ethereum.Event {98 get params(): RepayBorrow__Params {99 return new RepayBorrow__Params(this);100 }101}102export class RepayBorrow__Params {103 _event: RepayBorrow;104 constructor(event: RepayBorrow) {105 this._event = event;106 }107 get payer(): Address {108 return this._event.parameters[0].value.toAddress();109 }110 get borrower(): Address {111 return this._event.parameters[1].value.toAddress();112 }113 get repayAmount(): BigInt {114 return this._event.parameters[2].value.toBigInt();115 }116 get accountBorrows(): BigInt {117 return this._event.parameters[3].value.toBigInt();118 }119 get totalBorrows(): BigInt {120 return this._event.parameters[4].value.toBigInt();121 }122}123export class LiquidateBorrow extends ethereum.Event {124 get params(): LiquidateBorrow__Params {125 return new LiquidateBorrow__Params(this);126 }127}128export class LiquidateBorrow__Params {129 _event: LiquidateBorrow;130 constructor(event: LiquidateBorrow) {131 this._event = event;132 }133 get liquidator(): Address {134 return this._event.parameters[0].value.toAddress();135 }136 get borrower(): Address {137 return this._event.parameters[1].value.toAddress();138 }139 get repayAmount(): BigInt {140 return this._event.parameters[2].value.toBigInt();141 }142 get cTokenCollateral(): Address {143 return this._event.parameters[3].value.toAddress();144 }145 get seizeTokens(): BigInt {146 return this._event.parameters[4].value.toBigInt();147 }148}149export class NewPendingAdmin extends ethereum.Event {150 get params(): NewPendingAdmin__Params {151 return new NewPendingAdmin__Params(this);152 }153}154export class NewPendingAdmin__Params {155 _event: NewPendingAdmin;156 constructor(event: NewPendingAdmin) {157 this._event = event;158 }159 get oldPendingAdmin(): Address {160 return this._event.parameters[0].value.toAddress();161 }162 get newPendingAdmin(): Address {163 return this._event.parameters[1].value.toAddress();164 }165}166export class NewAdmin extends ethereum.Event {167 get params(): NewAdmin__Params {168 return new NewAdmin__Params(this);169 }170}171export class NewAdmin__Params {172 _event: NewAdmin;173 constructor(event: NewAdmin) {174 this._event = event;175 }176 get oldAdmin(): Address {177 return this._event.parameters[0].value.toAddress();178 }179 get newAdmin(): Address {180 return this._event.parameters[1].value.toAddress();181 }182}183export class NewComptroller extends ethereum.Event {184 get params(): NewComptroller__Params {185 return new NewComptroller__Params(this);186 }187}188export class NewComptroller__Params {189 _event: NewComptroller;190 constructor(event: NewComptroller) {191 this._event = event;192 }193 get oldComptroller(): Address {194 return this._event.parameters[0].value.toAddress();195 }196 get newComptroller(): Address {197 return this._event.parameters[1].value.toAddress();198 }199}200export class NewMarketInterestRateModel extends ethereum.Event {201 get params(): NewMarketInterestRateModel__Params {202 return new NewMarketInterestRateModel__Params(this);203 }204}205export class NewMarketInterestRateModel__Params {206 _event: NewMarketInterestRateModel;207 constructor(event: NewMarketInterestRateModel) {208 this._event = event;209 }210 get oldInterestRateModel(): Address {211 return this._event.parameters[0].value.toAddress();212 }213 get newInterestRateModel(): Address {214 return this._event.parameters[1].value.toAddress();215 }216}217export class NewReserveFactor extends ethereum.Event {218 get params(): NewReserveFactor__Params {219 return new NewReserveFactor__Params(this);220 }221}222export class NewReserveFactor__Params {223 _event: NewReserveFactor;224 constructor(event: NewReserveFactor) {225 this._event = event;226 }227 get oldReserveFactorMantissa(): BigInt {228 return this._event.parameters[0].value.toBigInt();229 }230 get newReserveFactorMantissa(): BigInt {231 return this._event.parameters[1].value.toBigInt();232 }233}234export class ReservesReduced extends ethereum.Event {235 get params(): ReservesReduced__Params {236 return new ReservesReduced__Params(this);237 }238}239export class ReservesReduced__Params {240 _event: ReservesReduced;241 constructor(event: ReservesReduced) {242 this._event = event;243 }244 get admin(): Address {245 return this._event.parameters[0].value.toAddress();246 }247 get reduceAmount(): BigInt {248 return this._event.parameters[1].value.toBigInt();249 }250 get newTotalReserves(): BigInt {251 return this._event.parameters[2].value.toBigInt();252 }253}254export class Failure extends ethereum.Event {255 get params(): Failure__Params {256 return new Failure__Params(this);257 }258}259export class Failure__Params {260 _event: Failure;261 constructor(event: Failure) {262 this._event = event;263 }264 get error(): BigInt {265 return this._event.parameters[0].value.toBigInt();266 }267 get info(): BigInt {268 return this._event.parameters[1].value.toBigInt();269 }270 get detail(): BigInt {271 return this._event.parameters[2].value.toBigInt();272 }273}274export class Transfer extends ethereum.Event {275 get params(): Transfer__Params {276 return new Transfer__Params(this);277 }278}279export class Transfer__Params {280 _event: Transfer;281 constructor(event: Transfer) {282 this._event = event;283 }284 get from(): Address {285 return this._event.parameters[0].value.toAddress();286 }287 get to(): Address {288 return this._event.parameters[1].value.toAddress();289 }290 get amount(): BigInt {291 return this._event.parameters[2].value.toBigInt();292 }293}294export class Approval extends ethereum.Event {295 get params(): Approval__Params {296 return new Approval__Params(this);297 }298}299export class Approval__Params {300 _event: Approval;301 constructor(event: Approval) {302 this._event = event;303 }304 get owner(): Address {305 return this._event.parameters[0].value.toAddress();306 }307 get spender(): Address {308 return this._event.parameters[1].value.toAddress();309 }310 get amount(): BigInt {311 return this._event.parameters[2].value.toBigInt();312 }313}314export class NewReserveFactor1 extends ethereum.Event {315 get params(): NewReserveFactor1__Params {316 return new NewReserveFactor1__Params(this);317 }318}319export class NewReserveFactor1__Params {320 _event: NewReserveFactor1;321 constructor(event: NewReserveFactor1) {322 this._event = event;323 }324 get oldReserveFactorMantissa(): BigInt {325 return this._event.parameters[0].value.toBigInt();326 }327 get newReserveFactorMantissa(): BigInt {328 return this._event.parameters[1].value.toBigInt();329 }330}331export class CToken__getAccountSnapshotResult {332 value0: BigInt;333 value1: BigInt;334 value2: BigInt;335 value3: BigInt;336 constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) {337 this.value0 = value0;338 this.value1 = value1;339 this.value2 = value2;340 this.value3 = value3;341 }342 toMap(): TypedMap<string, ethereum.Value> {343 let map = new TypedMap<string, ethereum.Value>();344 map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0));345 map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1));346 map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2));347 map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3));348 return map;349 }350}351export class CToken extends ethereum.SmartContract {352 static bind(address: Address): CToken {353 return new CToken("CToken", address);354 }355 name(): string {356 let result = super.call("name", "name():(string)", []);357 return result[0].toString();358 }359 try_name(): ethereum.CallResult<string> {360 let result = super.tryCall("name", "name():(string)", []);361 if (result.reverted) {362 return new ethereum.CallResult();363 }364 let value = result.value;365 return ethereum.CallResult.fromValue(value[0].toString());366 }367 totalSupply(): BigInt {368 let result = super.call("totalSupply", "totalSupply():(uint256)", []);369 return result[0].toBigInt();370 }371 try_totalSupply(): ethereum.CallResult<BigInt> {372 let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []);373 if (result.reverted) {374 return new ethereum.CallResult();375 }376 let value = result.value;377 return ethereum.CallResult.fromValue(value[0].toBigInt());378 }379 exchangeRateStored(): BigInt {380 let result = super.call(381 "exchangeRateStored",382 "exchangeRateStored():(uint256)",383 []384 );385 return result[0].toBigInt();386 }387 try_exchangeRateStored(): ethereum.CallResult<BigInt> {388 let result = super.tryCall(389 "exchangeRateStored",390 "exchangeRateStored():(uint256)",391 []392 );393 if (result.reverted) {394 return new ethereum.CallResult();395 }396 let value = result.value;397 return ethereum.CallResult.fromValue(value[0].toBigInt());398 }399 decimals(): BigInt {400 let result = super.call("decimals", "decimals():(uint256)", []);401 return result[0].toBigInt();402 }403 try_decimals(): ethereum.CallResult<BigInt> {404 let result = super.tryCall("decimals", "decimals():(uint256)", []);405 if (result.reverted) {406 return new ethereum.CallResult();407 }408 let value = result.value;409 return ethereum.CallResult.fromValue(value[0].toBigInt());410 }411 balanceOfUnderlying(owner: Address): BigInt {412 let result = super.call(413 "balanceOfUnderlying",414 "balanceOfUnderlying(address):(uint256)",415 [ethereum.Value.fromAddress(owner)]416 );417 return result[0].toBigInt();418 }419 try_balanceOfUnderlying(owner: Address): ethereum.CallResult<BigInt> {420 let result = super.tryCall(421 "balanceOfUnderlying",422 "balanceOfUnderlying(address):(uint256)",423 [ethereum.Value.fromAddress(owner)]424 );425 if (result.reverted) {426 return new ethereum.CallResult();427 }428 let value = result.value;429 return ethereum.CallResult.fromValue(value[0].toBigInt());430 }431 getCash(): BigInt {432 let result = super.call("getCash", "getCash():(uint256)", []);433 return result[0].toBigInt();434 }435 try_getCash(): ethereum.CallResult<BigInt> {436 let result = super.tryCall("getCash", "getCash():(uint256)", []);437 if (result.reverted) {438 return new ethereum.CallResult();439 }440 let value = result.value;441 return ethereum.CallResult.fromValue(value[0].toBigInt());442 }443 totalBorrows(): BigInt {444 let result = super.call("totalBorrows", "totalBorrows():(uint256)", []);445 return result[0].toBigInt();446 }447 try_totalBorrows(): ethereum.CallResult<BigInt> {448 let result = super.tryCall("totalBorrows", "totalBorrows():(uint256)", []);449 if (result.reverted) {450 return new ethereum.CallResult();451 }452 let value = result.value;453 return ethereum.CallResult.fromValue(value[0].toBigInt());454 }455 accrualBlockNumber(): BigInt {456 let result = super.call(457 "accrualBlockNumber",458 "accrualBlockNumber():(uint256)",459 []460 );461 return result[0].toBigInt();462 }463 try_accrualBlockNumber(): ethereum.CallResult<BigInt> {464 let result = super.tryCall(465 "accrualBlockNumber",466 "accrualBlockNumber():(uint256)",467 []468 );469 if (result.reverted) {470 return new ethereum.CallResult();471 }472 let value = result.value;473 return ethereum.CallResult.fromValue(value[0].toBigInt());474 }475 underlying(): Address {476 let result = super.call("underlying", "underlying():(address)", []);477 return result[0].toAddress();478 }479 try_underlying(): ethereum.CallResult<Address> {480 let result = super.tryCall("underlying", "underlying():(address)", []);481 if (result.reverted) {482 return new ethereum.CallResult();483 }484 let value = result.value;485 return ethereum.CallResult.fromValue(value[0].toAddress());486 }487 balanceOf(owner: Address): BigInt {488 let result = super.call("balanceOf", "balanceOf(address):(uint256)", [489 ethereum.Value.fromAddress(owner)490 ]);491 return result[0].toBigInt();492 }493 try_balanceOf(owner: Address): ethereum.CallResult<BigInt> {494 let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [495 ethereum.Value.fromAddress(owner)496 ]);497 if (result.reverted) {498 return new ethereum.CallResult();499 }500 let value = result.value;501 return ethereum.CallResult.fromValue(value[0].toBigInt());502 }503 totalReserves(): BigInt {504 let result = super.call("totalReserves", "totalReserves():(uint256)", []);505 return result[0].toBigInt();506 }507 try_totalReserves(): ethereum.CallResult<BigInt> {508 let result = super.tryCall(509 "totalReserves",510 "totalReserves():(uint256)",511 []512 );513 if (result.reverted) {514 return new ethereum.CallResult();515 }516 let value = result.value;517 return ethereum.CallResult.fromValue(value[0].toBigInt());518 }519 symbol(): string {520 let result = super.call("symbol", "symbol():(string)", []);521 return result[0].toString();522 }523 try_symbol(): ethereum.CallResult<string> {524 let result = super.tryCall("symbol", "symbol():(string)", []);525 if (result.reverted) {526 return new ethereum.CallResult();527 }528 let value = result.value;529 return ethereum.CallResult.fromValue(value[0].toString());530 }531 accrueInterest(): BigInt {532 let result = super.call("accrueInterest", "accrueInterest():(uint256)", []);533 return result[0].toBigInt();534 }535 try_accrueInterest(): ethereum.CallResult<BigInt> {536 let result = super.tryCall(537 "accrueInterest",538 "accrueInterest():(uint256)",539 []540 );541 if (result.reverted) {542 return new ethereum.CallResult();543 }544 let value = result.value;545 return ethereum.CallResult.fromValue(value[0].toBigInt());546 }547 borrowIndex(): BigInt {548 let result = super.call("borrowIndex", "borrowIndex():(uint256)", []);549 return result[0].toBigInt();550 }551 try_borrowIndex(): ethereum.CallResult<BigInt> {552 let result = super.tryCall("borrowIndex", "borrowIndex():(uint256)", []);553 if (result.reverted) {554 return new ethereum.CallResult();555 }556 let value = result.value;557 return ethereum.CallResult.fromValue(value[0].toBigInt());558 }559 supplyRatePerBlock(): BigInt {560 let result = super.call(561 "supplyRatePerBlock",562 "supplyRatePerBlock():(uint256)",563 []564 );565 return result[0].toBigInt();566 }567 try_supplyRatePerBlock(): ethereum.CallResult<BigInt> {568 let result = super.tryCall(569 "supplyRatePerBlock",570 "supplyRatePerBlock():(uint256)",571 []572 );573 if (result.reverted) {574 return new ethereum.CallResult();575 }576 let value = result.value;577 return ethereum.CallResult.fromValue(value[0].toBigInt());578 }579 getAccountSnapshot(account: Address): CToken__getAccountSnapshotResult {580 let result = super.call(581 "getAccountSnapshot",582 "getAccountSnapshot(address):(uint256,uint256,uint256,uint256)",583 [ethereum.Value.fromAddress(account)]584 );585 return new CToken__getAccountSnapshotResult(586 result[0].toBigInt(),587 result[1].toBigInt(),588 result[2].toBigInt(),589 result[3].toBigInt()590 );591 }592 try_getAccountSnapshot(593 account: Address594 ): ethereum.CallResult<CToken__getAccountSnapshotResult> {595 let result = super.tryCall(596 "getAccountSnapshot",597 "getAccountSnapshot(address):(uint256,uint256,uint256,uint256)",598 [ethereum.Value.fromAddress(account)]599 );600 if (result.reverted) {601 return new ethereum.CallResult();602 }603 let value = result.value;604 return ethereum.CallResult.fromValue(605 new CToken__getAccountSnapshotResult(606 value[0].toBigInt(),607 value[1].toBigInt(),608 value[2].toBigInt(),609 value[3].toBigInt()610 )611 );612 }613 borrowRatePerBlock(): BigInt {614 let result = super.call(615 "borrowRatePerBlock",616 "borrowRatePerBlock():(uint256)",617 []618 );619 return result[0].toBigInt();620 }621 try_borrowRatePerBlock(): ethereum.CallResult<BigInt> {622 let result = super.tryCall(623 "borrowRatePerBlock",624 "borrowRatePerBlock():(uint256)",625 []626 );627 if (result.reverted) {628 return new ethereum.CallResult();629 }630 let value = result.value;631 return ethereum.CallResult.fromValue(value[0].toBigInt());632 }633 reserveFactorMantissa(): BigInt {634 let result = super.call(635 "reserveFactorMantissa",636 "reserveFactorMantissa():(uint256)",637 []638 );639 return result[0].toBigInt();640 }641 try_reserveFactorMantissa(): ethereum.CallResult<BigInt> {642 let result = super.tryCall(643 "reserveFactorMantissa",644 "reserveFactorMantissa():(uint256)",645 []646 );647 if (result.reverted) {648 return new ethereum.CallResult();649 }650 let value = result.value;651 return ethereum.CallResult.fromValue(value[0].toBigInt());652 }653 interestRateModel(): Address {654 let result = super.call(655 "interestRateModel",656 "interestRateModel():(address)",657 []658 );659 return result[0].toAddress();660 }661 try_interestRateModel(): ethereum.CallResult<Address> {662 let result = super.tryCall(663 "interestRateModel",664 "interestRateModel():(address)",665 []666 );667 if (result.reverted) {668 return new ethereum.CallResult();669 }670 let value = result.value;671 return ethereum.CallResult.fromValue(value[0].toAddress());672 }673}674export class BalanceOfUnderlyingCall extends ethereum.Call {675 get inputs(): BalanceOfUnderlyingCall__Inputs {676 return new BalanceOfUnderlyingCall__Inputs(this);677 }678 get outputs(): BalanceOfUnderlyingCall__Outputs {679 return new BalanceOfUnderlyingCall__Outputs(this);680 }681}682export class BalanceOfUnderlyingCall__Inputs {683 _call: BalanceOfUnderlyingCall;684 constructor(call: BalanceOfUnderlyingCall) {685 this._call = call;686 }687 get owner(): Address {688 return this._call.inputValues[0].value.toAddress();689 }690}691export class BalanceOfUnderlyingCall__Outputs {692 _call: BalanceOfUnderlyingCall;693 constructor(call: BalanceOfUnderlyingCall) {694 this._call = call;695 }696 get value0(): BigInt {697 return this._call.outputValues[0].value.toBigInt();698 }699}700export class AccrueInterestCall extends ethereum.Call {701 get inputs(): AccrueInterestCall__Inputs {702 return new AccrueInterestCall__Inputs(this);703 }704 get outputs(): AccrueInterestCall__Outputs {705 return new AccrueInterestCall__Outputs(this);706 }707}708export class AccrueInterestCall__Inputs {709 _call: AccrueInterestCall;710 constructor(call: AccrueInterestCall) {711 this._call = call;712 }713}714export class AccrueInterestCall__Outputs {715 _call: AccrueInterestCall;716 constructor(call: AccrueInterestCall) {717 this._call = call;718 }719 get value0(): BigInt {720 return this._call.outputValues[0].value.toBigInt();721 }...
DivaFactoryFacet.ts
Source:DivaFactoryFacet.ts
...18 constructor(event: LiquidityAdded) {19 this._event = event;20 }21 get optionSetId(): BigInt {22 return this._event.parameters[0].value.toBigInt();23 }24 get from(): Address {25 return this._event.parameters[1].value.toAddress();26 }27 get collateralAmount(): BigInt {28 return this._event.parameters[2].value.toBigInt();29 }30}31export class LiquidityRemoved extends ethereum.Event {32 get params(): LiquidityRemoved__Params {33 return new LiquidityRemoved__Params(this);34 }35}36export class LiquidityRemoved__Params {37 _event: LiquidityRemoved;38 constructor(event: LiquidityRemoved) {39 this._event = event;40 }41 get optionSetId(): BigInt {42 return this._event.parameters[0].value.toBigInt();43 }44 get from(): Address {45 return this._event.parameters[1].value.toAddress();46 }47 get collateralAmount(): BigInt {48 return this._event.parameters[2].value.toBigInt();49 }50}51export class OptionSetIssued extends ethereum.Event {52 get params(): OptionSetIssued__Params {53 return new OptionSetIssued__Params(this);54 }55}56export class OptionSetIssued__Params {57 _event: OptionSetIssued;58 constructor(event: OptionSetIssued) {59 this._event = event;60 }61 get optionSetId(): BigInt {62 return this._event.parameters[0].value.toBigInt();63 }64 get shortToken(): Address {65 return this._event.parameters[1].value.toAddress();66 }67 get longToken(): Address {68 return this._event.parameters[2].value.toAddress();69 }70}71export class DivaFactoryFacet__issueOptionSetInput_optionSetParamsStruct extends ethereum.Tuple {72 get inflection(): BigInt {73 return this[0].toBigInt();74 }75 get cap(): BigInt {76 return this[1].toBigInt();77 }78 get floor(): BigInt {79 return this[2].toBigInt();80 }81 get collateralBalanceShort(): BigInt {82 return this[3].toBigInt();83 }84 get collateralBalanceLong(): BigInt {85 return this[4].toBigInt();86 }87 get expiryDate(): BigInt {88 return this[5].toBigInt();89 }90 get supplyShort(): BigInt {91 return this[6].toBigInt();92 }93 get supplyLong(): BigInt {94 return this[7].toBigInt();95 }96 get referenceAsset(): string {97 return this[8].toString();98 }99 get collateralToken(): Address {100 return this[9].toAddress();101 }102 get dataFeedProvider(): Address {103 return this[10].toAddress();104 }105}106export class DivaFactoryFacet extends ethereum.SmartContract {107 static bind(address: Address): DivaFactoryFacet {108 return new DivaFactoryFacet("DivaFactoryFacet", address);109 }110 addLiquidity(111 _optionSetId: BigInt,112 _supplyCollateralAmountIncr: BigInt113 ): boolean {114 let result = super.call(115 "addLiquidity",116 "addLiquidity(uint256,uint256):(bool)",117 [118 ethereum.Value.fromUnsignedBigInt(_optionSetId),119 ethereum.Value.fromUnsignedBigInt(_supplyCollateralAmountIncr)120 ]121 );122 return result[0].toBoolean();123 }124 try_addLiquidity(125 _optionSetId: BigInt,126 _supplyCollateralAmountIncr: BigInt127 ): ethereum.CallResult<boolean> {128 let result = super.tryCall(129 "addLiquidity",130 "addLiquidity(uint256,uint256):(bool)",131 [132 ethereum.Value.fromUnsignedBigInt(_optionSetId),133 ethereum.Value.fromUnsignedBigInt(_supplyCollateralAmountIncr)134 ]135 );136 if (result.reverted) {137 return new ethereum.CallResult();138 }139 let value = result.value;140 return ethereum.CallResult.fromValue(value[0].toBoolean());141 }142 issueOptionSet(143 _optionSetParams: DivaFactoryFacet__issueOptionSetInput_optionSetParamsStruct144 ): boolean {145 let result = super.call(146 "issueOptionSet",147 "issueOptionSet((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,string,address,address)):(bool)",148 [ethereum.Value.fromTuple(_optionSetParams)]149 );150 return result[0].toBoolean();151 }152 try_issueOptionSet(153 _optionSetParams: DivaFactoryFacet__issueOptionSetInput_optionSetParamsStruct154 ): ethereum.CallResult<boolean> {155 let result = super.tryCall(156 "issueOptionSet",157 "issueOptionSet((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,string,address,address)):(bool)",158 [ethereum.Value.fromTuple(_optionSetParams)]159 );160 if (result.reverted) {161 return new ethereum.CallResult();162 }163 let value = result.value;164 return ethereum.CallResult.fromValue(value[0].toBoolean());165 }166 removeLiquidity(_optionSetId: BigInt, _amountLongTokens: BigInt): boolean {167 let result = super.call(168 "removeLiquidity",169 "removeLiquidity(uint256,uint256):(bool)",170 [171 ethereum.Value.fromUnsignedBigInt(_optionSetId),172 ethereum.Value.fromUnsignedBigInt(_amountLongTokens)173 ]174 );175 return result[0].toBoolean();176 }177 try_removeLiquidity(178 _optionSetId: BigInt,179 _amountLongTokens: BigInt180 ): ethereum.CallResult<boolean> {181 let result = super.tryCall(182 "removeLiquidity",183 "removeLiquidity(uint256,uint256):(bool)",184 [185 ethereum.Value.fromUnsignedBigInt(_optionSetId),186 ethereum.Value.fromUnsignedBigInt(_amountLongTokens)187 ]188 );189 if (result.reverted) {190 return new ethereum.CallResult();191 }192 let value = result.value;193 return ethereum.CallResult.fromValue(value[0].toBoolean());194 }195}196export class AddLiquidityCall extends ethereum.Call {197 get inputs(): AddLiquidityCall__Inputs {198 return new AddLiquidityCall__Inputs(this);199 }200 get outputs(): AddLiquidityCall__Outputs {201 return new AddLiquidityCall__Outputs(this);202 }203}204export class AddLiquidityCall__Inputs {205 _call: AddLiquidityCall;206 constructor(call: AddLiquidityCall) {207 this._call = call;208 }209 get _optionSetId(): BigInt {210 return this._call.inputValues[0].value.toBigInt();211 }212 get _supplyCollateralAmountIncr(): BigInt {213 return this._call.inputValues[1].value.toBigInt();214 }215}216export class AddLiquidityCall__Outputs {217 _call: AddLiquidityCall;218 constructor(call: AddLiquidityCall) {219 this._call = call;220 }221 get value0(): boolean {222 return this._call.outputValues[0].value.toBoolean();223 }224}225export class IssueOptionSetCall extends ethereum.Call {226 get inputs(): IssueOptionSetCall__Inputs {227 return new IssueOptionSetCall__Inputs(this);228 }229 get outputs(): IssueOptionSetCall__Outputs {230 return new IssueOptionSetCall__Outputs(this);231 }232}233export class IssueOptionSetCall__Inputs {234 _call: IssueOptionSetCall;235 constructor(call: IssueOptionSetCall) {236 this._call = call;237 }238 get _optionSetParams(): IssueOptionSetCall_optionSetParamsStruct {239 return changetype<IssueOptionSetCall_optionSetParamsStruct>(240 this._call.inputValues[0].value.toTuple()241 );242 }243}244export class IssueOptionSetCall__Outputs {245 _call: IssueOptionSetCall;246 constructor(call: IssueOptionSetCall) {247 this._call = call;248 }249 get value0(): boolean {250 return this._call.outputValues[0].value.toBoolean();251 }252}253export class IssueOptionSetCall_optionSetParamsStruct extends ethereum.Tuple {254 get inflection(): BigInt {255 return this[0].toBigInt();256 }257 get cap(): BigInt {258 return this[1].toBigInt();259 }260 get floor(): BigInt {261 return this[2].toBigInt();262 }263 get collateralBalanceShort(): BigInt {264 return this[3].toBigInt();265 }266 get collateralBalanceLong(): BigInt {267 return this[4].toBigInt();268 }269 get expiryDate(): BigInt {270 return this[5].toBigInt();271 }272 get supplyShort(): BigInt {273 return this[6].toBigInt();274 }275 get supplyLong(): BigInt {276 return this[7].toBigInt();277 }278 get referenceAsset(): string {279 return this[8].toString();280 }281 get collateralToken(): Address {282 return this[9].toAddress();283 }284 get dataFeedProvider(): Address {285 return this[10].toAddress();286 }287}288export class RemoveLiquidityCall extends ethereum.Call {289 get inputs(): RemoveLiquidityCall__Inputs {290 return new RemoveLiquidityCall__Inputs(this);291 }292 get outputs(): RemoveLiquidityCall__Outputs {293 return new RemoveLiquidityCall__Outputs(this);294 }295}296export class RemoveLiquidityCall__Inputs {297 _call: RemoveLiquidityCall;298 constructor(call: RemoveLiquidityCall) {299 this._call = call;300 }301 get _optionSetId(): BigInt {302 return this._call.inputValues[0].value.toBigInt();303 }304 get _amountLongTokens(): BigInt {305 return this._call.inputValues[1].value.toBigInt();306 }307}308export class RemoveLiquidityCall__Outputs {309 _call: RemoveLiquidityCall;310 constructor(call: RemoveLiquidityCall) {311 this._call = call;312 }313 get value0(): boolean {314 return this._call.outputValues[0].value.toBoolean();315 }...
Using AI Code Generation
1const { toBigInt } = require('fast-check');2const { toBigInt64Array } = require('fast-check');3const { toBigUint64Array } = require('fast-check');4const { toBigInt } = require('fast-check');5const { toBigInt64Array } = require('fast-check');6const { toBigUint64Array } = require('fast-check');7const { toBigInt } = require('fast-check');8const { toBigInt64Array } = require('fast-check');9const { toBigUint64Array } = require('fast-check');10const { toBigInt } = require('fast-check');11const { toBigInt64Array } = require('fast-check');12const { toBigUint64Array } = require('fast-check');13const { toBigInt } = require('fast-check');14const { toBigInt64Array } = require('fast-check');15const { toBigUint64Array } = require('fast-check');16const { toBigInt } = require('fast-check');17const { toBigInt64Array } = require('fast-check');18const { toBigUint64Array } = require('fast-check');19const { toBigInt } = require('fast-check');20const { toBigInt64Array } = require('fast-check');21const { toBigUint64Array } = require('fast-check');22const { toBigInt } = require('fast-check');23const { toBigInt64Array } = require('fast-check');24const { toBigUint64Array } = require('fast-check');25const { toBigInt } = require('fast-check');26const { toBigInt64Array } = require('fast-check');27const { toBigUint64Array } = require('fast-check');28const { toBigInt } = require('fast-check');29const { toBigInt64Array } = require('fast-check');30const { toBigUint64
Using AI Code Generation
1const fc = require("fast-check");2const { toBigInt } = require("fast-check/lib/types/BigIntArbitrary");3const { toBigIntN } = require("fast-check/lib/types/BigIntNArbitrary");4const arbBigInt = toBigInt(fc.integer());5const arbBigIntN = toBigIntN(64, fc.integer());6console.log(arbBigInt.generate());7console.log(arbBigIntN.generate());8* [fast-check](
Using AI Code Generation
1import fc from 'fast-check';2import { BigIntArbitrary } from 'fast-check';3const arb = BigIntArbitrary();4const arb2 = BigIntArbitrary();5fc.assert(6 fc.property(arb, arb2, (a, b) => {7 const c = a + b;8 return c > a && c > b;9 })10);
Using AI Code Generation
1const fc = require('fast-check');2const { toBigInt } = require('fast-check-monorepo');3fc.assert(4 fc.property(fc.integer(), (n) => {5 console.log('n: ', n);6 const nBigInt = toBigInt(n);7 console.log('nBigInt: ', nBigInt);8 return typeof nBigInt === 'bigint';9 })10);
Using AI Code Generation
1const fc = require('fast-check');2const { toBigInt } = require('fast-check-monorepo');3const arb = fc.bigInt();4const arb2 = fc.bigInt({min: -100, max: 100});5fc.assert(6 fc.property(arb, (n) => {7 return toBigInt(n) === BigInt(n);8 })9);10fc.assert(11 fc.property(arb2, (n) => {12 return toBigInt(n, {min: -100, max: 100}) === BigInt(n);13 })14);15fc.assert(16 fc.property(arb2, (n) => {17 return toBigInt(n, {min: -100, max: 100}) === BigInt(n);18 })19);20fc.assert(21 fc.property(arb2, (n) => {22 return toBigInt(n, {min: -100, max: 100}) === BigInt(n);23 })24);25fc.assert(26 fc.property(arb2, (n) => {27 return toBigInt(n, {min: -100, max: 100}) === BigInt(n);28 })29);30fc.assert(31 fc.property(arb2, (n) => {32 return toBigInt(n, {min: -100, max: 100}) === BigInt(n);33 })34);35fc.assert(36 fc.property(arb2, (n) => {37 return toBigInt(n, {min: -100, max: 100}) === BigInt(n);38 })39);40fc.assert(41 fc.property(arb2, (n) => {42 return toBigInt(n, {min: -100, max: 100}) === BigInt(n);43 })44);45fc.assert(46 fc.property(arb2, (n) => {47 return toBigInt(n, {min: -100, max: 100}) === BigInt(n);48 })49);50fc.assert(51 fc.property(arb2, (n) => {52 return toBigInt(n, {min: -100, max: 100}) === BigInt
Using AI Code Generation
1const { toBigInt } = require('fast-check');2const { expect } = require('chai');3const fc = require('fast-check');4describe('toBigInt', () => {5 it('should convert an integer to a BigInt', () => {6 fc.assert(7 fc.property(fc.integer(), (value) => {8 expect(toBigInt(value)).to.equal(BigInt(value));9 }),10 );11 });12});13const { toBigInt } = require('fast-check');14const { expect } = require('chai');15const fc = require('fast-check');16describe('toBigInt', () => {17 it('should convert an integer to a BigInt', () => {18 fc.assert(19 fc.property(fc.integer(), (value) => {20 expect(toBigInt(value)).to.equal(BigInt(value));21 }),22 );23 });24});25const { toBigInt } = require('fast-check');26const { expect } = require('chai');27const fc = require('fast-check');28describe('toBigInt', () => {29 it('should convert an integer to a BigInt', () => {30 fc.assert(31 fc.property(fc.integer(), (value) => {32 expect(toBigInt(value)).to.equal(BigInt(value));33 }),34 );35 });36});37const { toBigInt } = require('fast-check');38const { expect } = require('chai');39const fc = require('fast-check');40describe('toBigInt', () => {41 it('should convert an integer to a BigInt', () => {42 fc.assert(43 fc.property(fc.integer(), (value) => {44 expect(toBigInt(value)).to.equal(BigInt(value));45 }),46 );47 });48});49const { toBigInt } = require('fast-check');50const { expect } = require('chai');51const fc = require('fast-check');52describe('toBigInt', () => {53 it('should convert an integer to
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!