Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cuddly-gorillas-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@thirdweb-dev/sdk": patch
---

Improve add/removeContract methods
24 changes: 8 additions & 16 deletions packages/sdk/src/evm/core/classes/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,11 @@ export class ContractRegistry extends ContractWrapper<TWRegistry> {
): Promise<Transaction<TransactionResult>> => {
const deployerAddress = await this.getSignerAddress();
const contractEncoder = new ContractEncoder(this);
const encoded: string[] = await Promise.all(
contractAddresses.map(async (address) =>
contractEncoder.encode("add", [
deployerAddress,
await resolveAddress(address),
]),
),
const encoded = (
await Promise.all(contractAddresses.map((addr) => resolveAddress(addr)))
).map((address) =>
contractEncoder.encode("add", [deployerAddress, address]),
);

return Transaction.fromContractWrapper({
contractWrapper: this,
method: "multicall",
Expand All @@ -79,15 +75,11 @@ export class ContractRegistry extends ContractWrapper<TWRegistry> {
): Promise<Transaction<TransactionResult>> => {
const deployerAddress = await this.getSignerAddress();
const contractEncoder = new ContractEncoder(this);
const encoded: string[] = await Promise.all(
contractAddresses.map(async (address) =>
contractEncoder.encode("remove", [
deployerAddress,
await resolveAddress(address),
]),
),
const encoded = (
await Promise.all(contractAddresses.map((addr) => resolveAddress(addr)))
).map((address) =>
contractEncoder.encode("remove", [deployerAddress, address]),
);

return Transaction.fromContractWrapper({
contractWrapper: this,
method: "multicall",
Expand Down