Skip to content

Commit

Permalink
fetch abi by default is custom call
Browse files Browse the repository at this point in the history
  • Loading branch information
0xFirekeeper committed Apr 10, 2024
1 parent 5f31fcc commit 080d475
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Assets/Thirdweb/Core/Scripts/Contract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public async Task<TransactionResult> Write(string functionName, TransactionReque
else
{
if (this.ABI == null)
throw new UnityException("You must pass an ABI for native platform custom calls");
this.ABI = await FetchAbi(this.Address, await ThirdwebManager.Instance.SDK.Wallet.GetChainId());

var contract = ThirdwebManager.Instance.SDK.Session.Web3.Eth.GetContract(this.ABI, this.Address);

Expand Down Expand Up @@ -258,7 +258,7 @@ public async Task<T> Read<T>(string functionName, params object[] args)
}

if (this.ABI == null)
throw new UnityException("You must pass an ABI for native platform custom calls - make use of the static Contract.FetchAbi method to fetch the ABI if you do not have it on hand.");
this.ABI = await FetchAbi(this.Address, await ThirdwebManager.Instance.SDK.Wallet.GetChainId());

var contract = Utils.GetWeb3().Eth.GetContract(this.ABI, this.Address);
var function = contract.GetFunction(functionName);
Expand Down Expand Up @@ -394,7 +394,7 @@ public async Task<T> ReadRaw<T>(string functionName, params object[] args)
}

if (this.ABI == null)
throw new UnityException("You must pass an ABI for native platform custom calls - make use of the static Contract.FetchAbi method to fetch the ABI if you do not have it on hand.");
this.ABI = await FetchAbi(this.Address, await ThirdwebManager.Instance.SDK.Wallet.GetChainId());

var contract = Utils.GetWeb3().Eth.GetContract(this.ABI, this.Address);
var function = contract.GetFunction(functionName);
Expand Down

0 comments on commit 080d475

Please sign in to comment.