Skip to content

Commit 6b816fb

Browse files
committed
Fix lint errors
1 parent 2253ce5 commit 6b816fb

37 files changed

+416
-422
lines changed

packages/thirdweb/biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.0.4/schema.json",
33
"extends": "//"
44
}

packages/thirdweb/src/assets/bootstrap.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ export async function deployRouter(options: ClientAndChainAndAccount) {
5959

6060
const routerImpl = await getOrDeployInfraContract({
6161
...options,
62-
contractId: "Router",
6362
constructorParams: {
64-
_marketSaleImplementation: marketSaleImpl.address,
6563
_feeManager: feeManager.address,
64+
_marketSaleImplementation: marketSaleImpl.address,
6665
},
66+
contractId: "Router",
6767
publisher: "0x6453a486d52e0EB6E79Ec4491038E2522a926936",
6868
});
6969

@@ -74,16 +74,16 @@ export async function deployRouter(options: ClientAndChainAndAccount) {
7474

7575
const routerProxyAddress = await deployInfraProxy({
7676
...options,
77-
initData,
77+
assetFactory,
7878
extraData: "0x",
7979
implementationAddress: routerImpl.address,
80-
assetFactory,
80+
initData,
8181
});
8282

8383
return getContract({
84-
client: options.client,
85-
chain: options.chain,
8684
address: routerProxyAddress,
85+
chain: options.chain,
86+
client: options.client,
8787
});
8888
}
8989

@@ -106,12 +106,12 @@ export async function deployRewardLocker(options: ClientAndChainAndAccount) {
106106

107107
return await getOrDeployInfraContract({
108108
...options,
109-
contractId: "RewardLocker",
110109
constructorParams: {
111110
_feeManager: feeManager.address,
112111
_v3PositionManager: v3PositionManager,
113112
_v4PositionManager: v4PositionManager,
114113
},
114+
contractId: "RewardLocker",
115115
publisher: "0x6453a486d52e0EB6E79Ec4491038E2522a926936",
116116
});
117117
}
@@ -132,23 +132,23 @@ export async function deployFeeManager(options: ClientAndChainAndAccount) {
132132

133133
// encode init data
134134
const initData = encodeFeeManagerInit({
135-
owner: DEFAULT_INFRA_ADMIN,
136-
feeRecipient: DEFAULT_FEE_RECIPIENT,
137135
defaultFee: DEFAULT_FEE_BPS,
136+
feeRecipient: DEFAULT_FEE_RECIPIENT,
137+
owner: DEFAULT_INFRA_ADMIN,
138138
});
139139

140140
// fee manager proxy deployment
141141
const transaction = deployInfraProxyDeterministic({
142142
contract: assetFactory,
143-
implementation: feeManagerImpl.address,
144143
data: initData,
145144
extraData: "0x",
145+
implementation: feeManagerImpl.address,
146146
salt: keccakId(DEFAULT_SALT),
147147
});
148148

149149
const receipt = await sendAndConfirmTransaction({
150-
transaction,
151150
account: options.account,
151+
transaction,
152152
});
153153
const proxyEvent = assetInfraDeployedEvent();
154154
const decodedEvent = parseEventLogs({
@@ -165,9 +165,9 @@ export async function deployFeeManager(options: ClientAndChainAndAccount) {
165165
const feeManagerProxyAddress = decodedEvent[0]?.args.proxy;
166166

167167
return getContract({
168-
client: options.client,
169-
chain: options.chain,
170168
address: feeManagerProxyAddress,
169+
chain: options.chain,
170+
client: options.client,
171171
});
172172
}
173173

@@ -203,11 +203,11 @@ export async function getDeployedRouter(options: ClientAndChain) {
203203

204204
const routerImpl = await getDeployedInfraContract({
205205
...options,
206-
contractId: "Router",
207206
constructorParams: {
208-
_marketSaleImplementation: marketSaleImpl.address,
209207
_feeManager: feeManager.address,
208+
_marketSaleImplementation: marketSaleImpl.address,
210209
},
210+
contractId: "Router",
211211
publisher: "0x6453a486d52e0EB6E79Ec4491038E2522a926936",
212212
});
213213

@@ -233,9 +233,9 @@ export async function getDeployedRouter(options: ClientAndChain) {
233233

234234
const routerProxyAddress = `0x${hashedDeployInfo.slice(26)}`;
235235
const routerProxy = getContract({
236-
client: options.client,
237-
chain: options.chain,
238236
address: routerProxyAddress,
237+
chain: options.chain,
238+
client: options.client,
239239
});
240240

241241
if (!(await isContractDeployed(routerProxy))) {
@@ -264,12 +264,12 @@ export async function getDeployedRewardLocker(options: ClientAndChain) {
264264

265265
return await getDeployedInfraContract({
266266
...options,
267-
contractId: "RewardLocker",
268267
constructorParams: {
269268
_feeManager: feeManager.address,
270269
_v3PositionManager: v3PositionManager,
271270
_v4PositionManager: v4PositionManager,
272271
},
272+
contractId: "RewardLocker",
273273
publisher: "0x6453a486d52e0EB6E79Ec4491038E2522a926936",
274274
});
275275
}
@@ -306,9 +306,9 @@ export async function getDeployedFeeManager(options: ClientAndChain) {
306306

307307
const feeManagerProxyAddress = `0x${hashedDeployInfo.slice(26)}`;
308308
const feeManagerProxy = getContract({
309-
client: options.client,
310-
chain: options.chain,
311309
address: feeManagerProxyAddress,
310+
chain: options.chain,
311+
client: options.client,
312312
});
313313

314314
if (!(await isContractDeployed(feeManagerProxy))) {

packages/thirdweb/src/assets/bootstrapinfra.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { deployFeeManager, getDeployedFeeManager } from "./bootstrap.js";
77
describe.runIf(process.env.TW_SECRET_KEY)("bootstrap asset infra", () => {
88
it("should bootstrap fee manager", async () => {
99
const feeManager = await deployFeeManager({
10+
account: TEST_ACCOUNT_A,
1011
chain: ANVIL_CHAIN,
1112
client: TEST_CLIENT,
12-
account: TEST_ACCOUNT_A,
1313
});
1414

1515
const expectedFeeManager = await getDeployedFeeManager({

packages/thirdweb/src/assets/constants.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,21 @@ export const DEFAULT_FEE_BPS = 50n;
88
export const DEFAULT_SALT = "thirdweb";
99

1010
export const IMPLEMENTATIONS: Record<number, Record<string, string>> = {
11-
[84532]: {
11+
84532: {
1212
AssetEntrypointERC20: "0x79C1236cFe59f1f088A15Da08b0D8667387d9703",
1313
ERC20AssetImpl: "",
1414
V3PositionManager: "",
1515
V4PositionManager: "",
1616
},
1717
};
1818

19-
// biome-ignore lint/nursery/noEnum: FIXME
2019
export enum ImplementationType {
2120
CLONE = 0,
2221
CLONE_WITH_IMMUTABLE_ARGS = 1,
2322
ERC1967 = 2,
2423
ERC1967_WITH_IMMUTABLE_ARGS = 3,
2524
}
2625

27-
// biome-ignore lint/nursery/noEnum: FIXME
2826
export enum CreateHook {
2927
NONE = 0, // do nothing
3028
CREATE_POOL = 1, // create a DEX pool via Router

packages/thirdweb/src/assets/create-token-by-impl-config.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ export async function createTokenByImplConfig(options: CreateTokenOptions) {
3232

3333
const encodedInitData = await encodeInitParams({
3434
client,
35-
params,
3635
creator,
36+
params,
3737
});
3838

3939
const rpcRequest = getRpcClient({
@@ -68,9 +68,9 @@ export async function createTokenByImplConfig(options: CreateTokenOptions) {
6868
launchConfig.config.tokenOut &&
6969
launchConfig.config.tokenOut !== NATIVE_TOKEN_ADDRESS
7070
? getContract({
71-
client,
72-
chain,
7371
address: launchConfig.config.tokenOut,
72+
chain,
73+
client,
7474
})
7575
: null;
7676
const currencyDecimals = launchConfig.config.priceDenominator
@@ -88,12 +88,8 @@ export async function createTokenByImplConfig(options: CreateTokenOptions) {
8888
}
8989

9090
const transaction = createAssetByImplementationConfig({
91-
contract: entrypoint,
92-
creator,
9391
config: {
9492
contractId: keccakId("ERC20Asset"),
95-
implementation: tokenImpl.address,
96-
implementationType: ImplementationType.ERC1967,
9793
createHook:
9894
launchConfig?.kind === "pool"
9995
? CreateHook.CREATE_POOL
@@ -103,13 +99,17 @@ export async function createTokenByImplConfig(options: CreateTokenOptions) {
10399
? CreateHook.DISTRIBUTE
104100
: CreateHook.NONE,
105101
createHookData: hookData,
102+
implementation: tokenImpl.address,
103+
implementationType: ImplementationType.ERC1967,
106104
},
105+
contract: entrypoint,
106+
creator,
107107
params: {
108108
amount,
109-
referrer: ZERO_ADDRESS,
110-
salt,
111109
data: encodedInitData,
112110
hookData,
111+
referrer: ZERO_ADDRESS,
112+
salt,
113113
},
114114
});
115115

packages/thirdweb/src/assets/create-token.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { totalSupply } from "src/extensions/erc20/__generated__/IERC20/read/totalSupply.js";
21
import { describe, expect, it } from "vitest";
32
import { ANVIL_CHAIN } from "../../test/src/chains.js";
43
import { TEST_CLIENT } from "../../test/src/test-clients.js";
@@ -11,12 +10,12 @@ import { createTokenByImplConfig } from "./create-token-by-impl-config.js";
1110
describe.runIf(process.env.TW_SECRET_KEY)("create token by impl config", () => {
1211
it("should create token without pool", async () => {
1312
const token = await createTokenByImplConfig({
13+
account: TEST_ACCOUNT_A,
1414
chain: ANVIL_CHAIN,
1515
client: TEST_CLIENT,
16-
account: TEST_ACCOUNT_A,
1716
params: {
18-
name: "Test",
1917
maxSupply: 10_00n,
18+
name: "Test",
2019
},
2120
salt: "salt123",
2221
});
@@ -25,9 +24,9 @@ describe.runIf(process.env.TW_SECRET_KEY)("create token by impl config", () => {
2524

2625
const tokenName = await name({
2726
contract: getContract({
28-
client: TEST_CLIENT,
29-
chain: ANVIL_CHAIN,
3027
address: token,
28+
chain: ANVIL_CHAIN,
29+
client: TEST_CLIENT,
3130
}),
3231
});
3332
expect(tokenName).to.eq("Test");

packages/thirdweb/src/assets/create-token.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export async function createToken(options: CreateTokenOptions) {
2727

2828
const encodedInitData = await encodeInitParams({
2929
client,
30-
params,
3130
creator,
31+
params,
3232
});
3333

3434
const rpcRequest = getRpcClient({
@@ -62,9 +62,9 @@ export async function createToken(options: CreateTokenOptions) {
6262
launchConfig.config.tokenOut &&
6363
launchConfig.config.tokenOut !== NATIVE_TOKEN_ADDRESS
6464
? getContract({
65-
client,
66-
chain,
6765
address: launchConfig.config.tokenOut,
66+
chain,
67+
client,
6868
})
6969
: null;
7070
const currencyDecimals = launchConfig.config.priceDenominator
@@ -83,14 +83,14 @@ export async function createToken(options: CreateTokenOptions) {
8383

8484
const transaction = createAsset({
8585
contract: entrypoint,
86-
creator,
8786
createParams: {
8887
amount,
89-
referrer: ZERO_ADDRESS,
90-
salt,
9188
data: encodedInitData,
9289
hookData,
90+
referrer: ZERO_ADDRESS,
91+
salt,
9392
},
93+
creator,
9494
});
9595

9696
const receipt = await sendAndConfirmTransaction({ account, transaction });

packages/thirdweb/src/assets/deploy-infra-proxy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ export async function deployInfraProxy(
1818
) {
1919
const transaction = deployInfraProxyDeterministic({
2020
contract: options.assetFactory,
21-
implementation: options.implementationAddress,
2221
data: options.initData,
2322
extraData: options.extraData,
23+
implementation: options.implementationAddress,
2424
salt: keccakId(DEFAULT_SALT),
2525
});
2626

2727
const receipt = await sendAndConfirmTransaction({
28-
transaction,
2928
account: options.account,
29+
transaction,
3030
});
3131
const proxyEvent = assetInfraDeployedEvent();
3232
const decodedEvent = parseEventLogs({

0 commit comments

Comments
 (0)