diff --git a/contracts/vendingFactory/contract.ts b/contracts/vendingFactory/contract.ts index d50f054..35e87e0 100644 --- a/contracts/vendingFactory/contract.ts +++ b/contracts/vendingFactory/contract.ts @@ -63,8 +63,10 @@ export const vendingFactory = (client: SigningCosmWasmClient, txSigner: string): const result = await client.execute(senderAddress, contractAddress, msg, 'auto', '', funds) return { - vendingMinterAddress: result.logs[0].events[16].attributes[0].value, - sg721Address: result.logs[0].events[18].attributes[0].value, + vendingMinterAddress: result.logs[0].events.filter((e) => e.type === 'instantiate')[0].attributes[0].value, + sg721Address: result.logs[0].events + .filter((e) => e.type === 'wasm') + .filter((e) => e.attributes[2]?.key === 'sg721_address')[0].attributes[2].value, transactionHash: result.transactionHash, logs: result.logs, }