Skip to content

Commit b1f9d4c

Browse files
committed
Fetch abi in Contract.Prepare if unavailable
1 parent 9e90d61 commit b1f9d4c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Assets/Thirdweb/Core/Scripts/Contract.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ public async Task<Transaction> Prepare(string functionName, string from = null,
120120
}
121121
else
122122
{
123+
if (this.ABI == null)
124+
this.ABI = await FetchAbi(this.Address, await ThirdwebManager.Instance.SDK.Wallet.GetChainId());
123125
var contract = Utils.GetWeb3().Eth.GetContract(this.ABI, this.Address);
124126
var function = contract.GetFunction(functionName);
125127
var fromAddress = from ?? await ThirdwebManager.Instance.SDK.Wallet.GetAddress();

0 commit comments

Comments
 (0)