Skip to content

Commit ba25441

Browse files
committed
refactor(examples): streamline AssetManager initialization in fassetsReserveCollateralWithExecutor.ts
1 parent bd8ff42 commit ba25441

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

examples/developer-hub-javascript/fassetsReserveCollateralWithExecutor.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import {
55
IAssetManagerContract,
66
} from "../../typechain-types";
77

8+
// Initialize the FAssets FXRP AssetManager contract
9+
const AssetManager = artifacts.require("IAssetManager");
10+
811
// 1. Define constants
912

1013
// AssetManager address on Flare Testnet Coston2 network
@@ -105,8 +108,6 @@ async function parseCollateralReservedEvent(transactionReceipt) {
105108
// 4. Main function
106109

107110
async function main() {
108-
// Initialize the FAssets FXRP AssetManager contract
109-
const AssetManager = artifacts.require("IAssetManager");
110111
const assetManager: IAssetManagerInstance = await AssetManager.at(
111112
ASSET_MANAGER_ADDRESS,
112113
);
@@ -130,9 +131,7 @@ async function main() {
130131
"Collateral reservation fee:",
131132
collateralReservationFee.toString(),
132133
);
133-
134-
const IAssetManager = artifacts.require("IAssetManager");
135-
const iAssetManager: IAssetManagerInstance = await IAssetManager.at(
134+
const iAssetManager: IAssetManagerInstance = await AssetManager.at(
136135
ASSET_MANAGER_ADDRESS,
137136
);
138137

0 commit comments

Comments
 (0)