diff --git a/Assets/Tests/CustomReadTests.cs b/Assets/Tests/CustomReadTests.cs index ebf781f2..bb2be491 100644 --- a/Assets/Tests/CustomReadTests.cs +++ b/Assets/Tests/CustomReadTests.cs @@ -46,23 +46,21 @@ public IEnumerator GetContract_Success() } [UnityTest] - public IEnumerator Custom_WithoutAbi_FailNativeSucceedWebGL() + public IEnumerator Custom_WithoutAbi_Fetch() { - var contract = ThirdwebManager.Instance.SDK.GetContract(_dropErc20Address); + var abiTask = Contract.FetchAbi(_dropErc20Address, 421614); + yield return new WaitUntil(() => abiTask.IsCompleted); + if (abiTask.IsFaulted) + throw abiTask.Exception; + Assert.IsTrue(abiTask.IsCompletedSuccessfully); + Assert.NotNull(abiTask.Result); + var contract = ThirdwebManager.Instance.SDK.GetContract(_dropErc20Address, abiTask.Result); var readTask = contract.Read("balanceOf", _dropErc20Address); yield return new WaitUntil(() => readTask.IsCompleted); - if (Utils.IsWebGLBuild()) - { - if (readTask.IsFaulted) - throw readTask.Exception; - Assert.IsTrue(readTask.IsCompletedSuccessfully); - Assert.NotNull(readTask.Result); - } - else - { - Assert.IsTrue(readTask.IsFaulted); - Assert.AreEqual("You must pass an ABI for native platform custom calls", readTask.Exception.InnerException.Message); - } + if (readTask.IsFaulted) + throw readTask.Exception; + Assert.IsTrue(readTask.IsCompletedSuccessfully); + Assert.NotNull(readTask.Result); } [UnityTest] diff --git a/Assets/Tests/SmartWalletTests.cs b/Assets/Tests/SmartWalletTests.cs index c6ef1d99..5c2bf77d 100644 --- a/Assets/Tests/SmartWalletTests.cs +++ b/Assets/Tests/SmartWalletTests.cs @@ -66,7 +66,7 @@ public IEnumerator CreateSessionKey_WithValidSignerCheck_Success() yield return Connect_WithGaslessManagedAccountFactory_Success(); var task = ThirdwebManager.Instance.SDK.Wallet.CreateSessionKey( - signerAddress: "0x22b79AD6c6009525933ac2FF40bC9F30dF14Ecfb", + signerAddress: "0xA86F78b995a3899785FA1508eB1E62aEa501fc3c", approvedTargets: new List() { "0x450b943729Ddba196Ab58b589Cea545551DF71CC" }, nativeTokenLimitPerTransactionInWei: "0", permissionStartTimestamp: "0", @@ -88,7 +88,7 @@ public IEnumerator CreateSessionKey_WithValidSignerCheck_Success() bool exists = false; foreach (var signer in getAllActiveSignersTask.Result) { - if (signer.signer == "0x22b79AD6c6009525933ac2FF40bC9F30dF14Ecfb") + if (signer.signer == "0xA86F78b995a3899785FA1508eB1E62aEa501fc3c") { exists = true; break; @@ -120,7 +120,7 @@ public IEnumerator RevokeSessionKey_WithValidSignerCheck_Success() { yield return CreateSessionKey_WithValidSignerCheck_Success(); - var task = ThirdwebManager.Instance.SDK.Wallet.RevokeSessionKey(signerAddress: "0x22b79AD6c6009525933ac2FF40bC9F30dF14Ecfb"); + var task = ThirdwebManager.Instance.SDK.Wallet.RevokeSessionKey(signerAddress: "0xA86F78b995a3899785FA1508eB1E62aEa501fc3c"); yield return new WaitUntil(() => task.IsCompleted); Assert.IsTrue(task.IsCompletedSuccessfully); Assert.IsNotNull(task.Result); @@ -134,7 +134,7 @@ public IEnumerator RevokeSessionKey_WithValidSignerCheck_Success() bool exists = false; foreach (var signer in getAllActiveSignersTask.Result) { - if (signer.signer == "0x22b79AD6c6009525933ac2FF40bC9F30dF14Ecfb") + if (signer.signer == "0xA86F78b995a3899785FA1508eB1E62aEa501fc3c") { exists = true; break; diff --git a/Assets/Thirdweb/Core/Scripts/Contract.cs b/Assets/Thirdweb/Core/Scripts/Contract.cs index 389a74b6..f293d1b9 100644 --- a/Assets/Thirdweb/Core/Scripts/Contract.cs +++ b/Assets/Thirdweb/Core/Scripts/Contract.cs @@ -10,6 +10,8 @@ using Nethereum.Contracts; using Nethereum.RPC.Eth.DTOs; using Nethereum.ABI.FunctionEncoding.Attributes; +using UnityEngine.Networking; +using Thirdweb.Redcode.Awaiting; namespace Thirdweb { @@ -198,7 +200,7 @@ public async Task 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); @@ -256,7 +258,7 @@ public async Task Read(string functionName, params object[] args) } 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 = Utils.GetWeb3().Eth.GetContract(this.ABI, this.Address); var function = contract.GetFunction(functionName); @@ -392,13 +394,27 @@ public async Task ReadRaw(string functionName, params object[] args) } 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 = Utils.GetWeb3().Eth.GetContract(this.ABI, this.Address); var function = contract.GetFunction(functionName); return await function.CallDeserializingToObjectAsync(args); } + public static async Task FetchAbi(string contractAddress, BigInteger chainId) + { + var url = $"https://contract.thirdweb.com/abi/{chainId}/{contractAddress}"; + using (var request = UnityWebRequest.Get(url)) + { + await request.SendWebRequest(); + if (request.result != UnityWebRequest.Result.Success) + { + throw new UnityException($"Failed to fetch ABI! Error: {request.error}"); + } + return request.downloadHandler.text; + } + } + private T ConvertValue(object value) { if (value is T result) diff --git a/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_Miscellaneous.cs b/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_Miscellaneous.cs index 275567cd..c67e1ee5 100644 --- a/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_Miscellaneous.cs +++ b/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_Miscellaneous.cs @@ -21,7 +21,8 @@ public async void CustomCall() { try { - Contract contract = ThirdwebManager.Instance.SDK.GetContract("0xEBB8a39D865465F289fa349A67B3391d8f910da9", MY_CUSTOM_CONTRACT_ABI); + string abi = await Contract.FetchAbi("0xEBB8a39D865465F289fa349A67B3391d8f910da9", await ThirdwebManager.Instance.SDK.Wallet.GetChainId()); + Contract contract = ThirdwebManager.Instance.SDK.GetContract("0xEBB8a39D865465F289fa349A67B3391d8f910da9", abi); // Contract.Read string uri = await contract.Read("name"); @@ -120,8 +121,5 @@ public async void Sign() Debugger.Instance.Log("[Sign] Error", e.ToString()); } } - - string MY_CUSTOM_CONTRACT_ABI = - "[ { \"type\": \"constructor\", \"name\": \"\", \"inputs\": [], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"event\", \"name\": \"Approval\", \"inputs\": [ { \"type\": \"address\", \"name\": \"owner\", \"indexed\": true, \"internalType\": \"address\" }, { \"type\": \"address\", \"name\": \"spender\", \"indexed\": true, \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"value\", \"indexed\": false, \"internalType\": \"uint256\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"ClaimConditionsUpdated\", \"inputs\": [ { \"type\": \"tuple[]\", \"name\": \"claimConditions\", \"components\": [ { \"type\": \"uint256\", \"name\": \"startTimestamp\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"maxClaimableSupply\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"supplyClaimed\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"quantityLimitPerWallet\", \"internalType\": \"uint256\" }, { \"type\": \"bytes32\", \"name\": \"merkleRoot\", \"internalType\": \"bytes32\" }, { \"type\": \"uint256\", \"name\": \"pricePerToken\", \"internalType\": \"uint256\" }, { \"type\": \"address\", \"name\": \"currency\", \"internalType\": \"address\" }, { \"type\": \"string\", \"name\": \"metadata\", \"internalType\": \"string\" } ], \"indexed\": false, \"internalType\": \"struct IClaimCondition.ClaimCondition[]\" }, { \"type\": \"bool\", \"name\": \"resetEligibility\", \"indexed\": false, \"internalType\": \"bool\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"ContractURIUpdated\", \"inputs\": [ { \"type\": \"string\", \"name\": \"prevURI\", \"indexed\": false, \"internalType\": \"string\" }, { \"type\": \"string\", \"name\": \"newURI\", \"indexed\": false, \"internalType\": \"string\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"DelegateChanged\", \"inputs\": [ { \"type\": \"address\", \"name\": \"delegator\", \"indexed\": true, \"internalType\": \"address\" }, { \"type\": \"address\", \"name\": \"fromDelegate\", \"indexed\": true, \"internalType\": \"address\" }, { \"type\": \"address\", \"name\": \"toDelegate\", \"indexed\": true, \"internalType\": \"address\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"DelegateVotesChanged\", \"inputs\": [ { \"type\": \"address\", \"name\": \"delegate\", \"indexed\": true, \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"previousBalance\", \"indexed\": false, \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"newBalance\", \"indexed\": false, \"internalType\": \"uint256\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"EIP712DomainChanged\", \"inputs\": [], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"FlatPlatformFeeUpdated\", \"inputs\": [ { \"type\": \"address\", \"name\": \"platformFeeRecipient\", \"indexed\": false, \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"flatFee\", \"indexed\": false, \"internalType\": \"uint256\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"Initialized\", \"inputs\": [ { \"type\": \"uint8\", \"name\": \"version\", \"indexed\": false, \"internalType\": \"uint8\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"MaxTotalSupplyUpdated\", \"inputs\": [ { \"type\": \"uint256\", \"name\": \"maxTotalSupply\", \"indexed\": false, \"internalType\": \"uint256\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"PlatformFeeInfoUpdated\", \"inputs\": [ { \"type\": \"address\", \"name\": \"platformFeeRecipient\", \"indexed\": true, \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"platformFeeBps\", \"indexed\": false, \"internalType\": \"uint256\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"PlatformFeeTypeUpdated\", \"inputs\": [ { \"type\": \"uint8\", \"name\": \"feeType\", \"indexed\": false, \"internalType\": \"enum IPlatformFee.PlatformFeeType\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"PrimarySaleRecipientUpdated\", \"inputs\": [ { \"type\": \"address\", \"name\": \"recipient\", \"indexed\": true, \"internalType\": \"address\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"RoleAdminChanged\", \"inputs\": [ { \"type\": \"bytes32\", \"name\": \"role\", \"indexed\": true, \"internalType\": \"bytes32\" }, { \"type\": \"bytes32\", \"name\": \"previousAdminRole\", \"indexed\": true, \"internalType\": \"bytes32\" }, { \"type\": \"bytes32\", \"name\": \"newAdminRole\", \"indexed\": true, \"internalType\": \"bytes32\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"RoleGranted\", \"inputs\": [ { \"type\": \"bytes32\", \"name\": \"role\", \"indexed\": true, \"internalType\": \"bytes32\" }, { \"type\": \"address\", \"name\": \"account\", \"indexed\": true, \"internalType\": \"address\" }, { \"type\": \"address\", \"name\": \"sender\", \"indexed\": true, \"internalType\": \"address\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"RoleRevoked\", \"inputs\": [ { \"type\": \"bytes32\", \"name\": \"role\", \"indexed\": true, \"internalType\": \"bytes32\" }, { \"type\": \"address\", \"name\": \"account\", \"indexed\": true, \"internalType\": \"address\" }, { \"type\": \"address\", \"name\": \"sender\", \"indexed\": true, \"internalType\": \"address\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"TokensClaimed\", \"inputs\": [ { \"type\": \"uint256\", \"name\": \"claimConditionIndex\", \"indexed\": true, \"internalType\": \"uint256\" }, { \"type\": \"address\", \"name\": \"claimer\", \"indexed\": true, \"internalType\": \"address\" }, { \"type\": \"address\", \"name\": \"receiver\", \"indexed\": true, \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"startTokenId\", \"indexed\": false, \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"quantityClaimed\", \"indexed\": false, \"internalType\": \"uint256\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"event\", \"name\": \"Transfer\", \"inputs\": [ { \"type\": \"address\", \"name\": \"from\", \"indexed\": true, \"internalType\": \"address\" }, { \"type\": \"address\", \"name\": \"to\", \"indexed\": true, \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"value\", \"indexed\": false, \"internalType\": \"uint256\" } ], \"outputs\": [], \"anonymous\": false }, { \"type\": \"function\", \"name\": \"CLOCK_MODE\", \"inputs\": [], \"outputs\": [ { \"type\": \"string\", \"name\": \"\", \"internalType\": \"string\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"DEFAULT_ADMIN_ROLE\", \"inputs\": [], \"outputs\": [ { \"type\": \"bytes32\", \"name\": \"\", \"internalType\": \"bytes32\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"DOMAIN_SEPARATOR\", \"inputs\": [], \"outputs\": [ { \"type\": \"bytes32\", \"name\": \"\", \"internalType\": \"bytes32\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"allowance\", \"inputs\": [ { \"type\": \"address\", \"name\": \"owner\", \"internalType\": \"address\" }, { \"type\": \"address\", \"name\": \"spender\", \"internalType\": \"address\" } ], \"outputs\": [ { \"type\": \"uint256\", \"name\": \"\", \"internalType\": \"uint256\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"approve\", \"inputs\": [ { \"type\": \"address\", \"name\": \"spender\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"amount\", \"internalType\": \"uint256\" } ], \"outputs\": [ { \"type\": \"bool\", \"name\": \"\", \"internalType\": \"bool\" } ], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"balanceOf\", \"inputs\": [ { \"type\": \"address\", \"name\": \"account\", \"internalType\": \"address\" } ], \"outputs\": [ { \"type\": \"uint256\", \"name\": \"\", \"internalType\": \"uint256\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"burn\", \"inputs\": [ { \"type\": \"uint256\", \"name\": \"amount\", \"internalType\": \"uint256\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"burnFrom\", \"inputs\": [ { \"type\": \"address\", \"name\": \"account\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"amount\", \"internalType\": \"uint256\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"checkpoints\", \"inputs\": [ { \"type\": \"address\", \"name\": \"account\", \"internalType\": \"address\" }, { \"type\": \"uint32\", \"name\": \"pos\", \"internalType\": \"uint32\" } ], \"outputs\": [ { \"type\": \"tuple\", \"name\": \"\", \"components\": [ { \"type\": \"uint32\", \"name\": \"fromBlock\", \"internalType\": \"uint32\" }, { \"type\": \"uint224\", \"name\": \"votes\", \"internalType\": \"uint224\" } ], \"internalType\": \"struct ERC20VotesUpgradeable.Checkpoint\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"claim\", \"inputs\": [ { \"type\": \"address\", \"name\": \"_receiver\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"_quantity\", \"internalType\": \"uint256\" }, { \"type\": \"address\", \"name\": \"_currency\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"_pricePerToken\", \"internalType\": \"uint256\" }, { \"type\": \"tuple\", \"name\": \"_allowlistProof\", \"components\": [ { \"type\": \"bytes32[]\", \"name\": \"proof\", \"internalType\": \"bytes32[]\" }, { \"type\": \"uint256\", \"name\": \"quantityLimitPerWallet\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"pricePerToken\", \"internalType\": \"uint256\" }, { \"type\": \"address\", \"name\": \"currency\", \"internalType\": \"address\" } ], \"internalType\": \"struct IDrop.AllowlistProof\" }, { \"type\": \"bytes\", \"name\": \"_data\", \"internalType\": \"bytes\" } ], \"outputs\": [], \"stateMutability\": \"payable\" }, { \"type\": \"function\", \"name\": \"claimCondition\", \"inputs\": [], \"outputs\": [ { \"type\": \"uint256\", \"name\": \"currentStartId\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"count\", \"internalType\": \"uint256\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"clock\", \"inputs\": [], \"outputs\": [ { \"type\": \"uint48\", \"name\": \"\", \"internalType\": \"uint48\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"contractType\", \"inputs\": [], \"outputs\": [ { \"type\": \"bytes32\", \"name\": \"\", \"internalType\": \"bytes32\" } ], \"stateMutability\": \"pure\" }, { \"type\": \"function\", \"name\": \"contractURI\", \"inputs\": [], \"outputs\": [ { \"type\": \"string\", \"name\": \"\", \"internalType\": \"string\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"contractVersion\", \"inputs\": [], \"outputs\": [ { \"type\": \"uint8\", \"name\": \"\", \"internalType\": \"uint8\" } ], \"stateMutability\": \"pure\" }, { \"type\": \"function\", \"name\": \"decimals\", \"inputs\": [], \"outputs\": [ { \"type\": \"uint8\", \"name\": \"\", \"internalType\": \"uint8\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"decreaseAllowance\", \"inputs\": [ { \"type\": \"address\", \"name\": \"spender\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"subtractedValue\", \"internalType\": \"uint256\" } ], \"outputs\": [ { \"type\": \"bool\", \"name\": \"\", \"internalType\": \"bool\" } ], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"delegate\", \"inputs\": [ { \"type\": \"address\", \"name\": \"delegatee\", \"internalType\": \"address\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"delegateBySig\", \"inputs\": [ { \"type\": \"address\", \"name\": \"delegatee\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"nonce\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"expiry\", \"internalType\": \"uint256\" }, { \"type\": \"uint8\", \"name\": \"v\", \"internalType\": \"uint8\" }, { \"type\": \"bytes32\", \"name\": \"r\", \"internalType\": \"bytes32\" }, { \"type\": \"bytes32\", \"name\": \"s\", \"internalType\": \"bytes32\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"delegates\", \"inputs\": [ { \"type\": \"address\", \"name\": \"account\", \"internalType\": \"address\" } ], \"outputs\": [ { \"type\": \"address\", \"name\": \"\", \"internalType\": \"address\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"eip712Domain\", \"inputs\": [], \"outputs\": [ { \"type\": \"bytes1\", \"name\": \"fields\", \"internalType\": \"bytes1\" }, { \"type\": \"string\", \"name\": \"name\", \"internalType\": \"string\" }, { \"type\": \"string\", \"name\": \"version\", \"internalType\": \"string\" }, { \"type\": \"uint256\", \"name\": \"chainId\", \"internalType\": \"uint256\" }, { \"type\": \"address\", \"name\": \"verifyingContract\", \"internalType\": \"address\" }, { \"type\": \"bytes32\", \"name\": \"salt\", \"internalType\": \"bytes32\" }, { \"type\": \"uint256[]\", \"name\": \"extensions\", \"internalType\": \"uint256[]\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"getActiveClaimConditionId\", \"inputs\": [], \"outputs\": [ { \"type\": \"uint256\", \"name\": \"\", \"internalType\": \"uint256\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"getClaimConditionById\", \"inputs\": [ { \"type\": \"uint256\", \"name\": \"_conditionId\", \"internalType\": \"uint256\" } ], \"outputs\": [ { \"type\": \"tuple\", \"name\": \"condition\", \"components\": [ { \"type\": \"uint256\", \"name\": \"startTimestamp\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"maxClaimableSupply\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"supplyClaimed\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"quantityLimitPerWallet\", \"internalType\": \"uint256\" }, { \"type\": \"bytes32\", \"name\": \"merkleRoot\", \"internalType\": \"bytes32\" }, { \"type\": \"uint256\", \"name\": \"pricePerToken\", \"internalType\": \"uint256\" }, { \"type\": \"address\", \"name\": \"currency\", \"internalType\": \"address\" }, { \"type\": \"string\", \"name\": \"metadata\", \"internalType\": \"string\" } ], \"internalType\": \"struct IClaimCondition.ClaimCondition\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"getFlatPlatformFeeInfo\", \"inputs\": [], \"outputs\": [ { \"type\": \"address\", \"name\": \"\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"\", \"internalType\": \"uint256\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"getPastTotalSupply\", \"inputs\": [ { \"type\": \"uint256\", \"name\": \"timepoint\", \"internalType\": \"uint256\" } ], \"outputs\": [ { \"type\": \"uint256\", \"name\": \"\", \"internalType\": \"uint256\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"getPastVotes\", \"inputs\": [ { \"type\": \"address\", \"name\": \"account\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"timepoint\", \"internalType\": \"uint256\" } ], \"outputs\": [ { \"type\": \"uint256\", \"name\": \"\", \"internalType\": \"uint256\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"getPlatformFeeInfo\", \"inputs\": [], \"outputs\": [ { \"type\": \"address\", \"name\": \"\", \"internalType\": \"address\" }, { \"type\": \"uint16\", \"name\": \"\", \"internalType\": \"uint16\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"getPlatformFeeType\", \"inputs\": [], \"outputs\": [ { \"type\": \"uint8\", \"name\": \"\", \"internalType\": \"enum IPlatformFee.PlatformFeeType\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"getRoleAdmin\", \"inputs\": [ { \"type\": \"bytes32\", \"name\": \"role\", \"internalType\": \"bytes32\" } ], \"outputs\": [ { \"type\": \"bytes32\", \"name\": \"\", \"internalType\": \"bytes32\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"getRoleMember\", \"inputs\": [ { \"type\": \"bytes32\", \"name\": \"role\", \"internalType\": \"bytes32\" }, { \"type\": \"uint256\", \"name\": \"index\", \"internalType\": \"uint256\" } ], \"outputs\": [ { \"type\": \"address\", \"name\": \"member\", \"internalType\": \"address\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"getRoleMemberCount\", \"inputs\": [ { \"type\": \"bytes32\", \"name\": \"role\", \"internalType\": \"bytes32\" } ], \"outputs\": [ { \"type\": \"uint256\", \"name\": \"count\", \"internalType\": \"uint256\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"getSupplyClaimedByWallet\", \"inputs\": [ { \"type\": \"uint256\", \"name\": \"_conditionId\", \"internalType\": \"uint256\" }, { \"type\": \"address\", \"name\": \"_claimer\", \"internalType\": \"address\" } ], \"outputs\": [ { \"type\": \"uint256\", \"name\": \"supplyClaimedByWallet\", \"internalType\": \"uint256\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"getVotes\", \"inputs\": [ { \"type\": \"address\", \"name\": \"account\", \"internalType\": \"address\" } ], \"outputs\": [ { \"type\": \"uint256\", \"name\": \"\", \"internalType\": \"uint256\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"grantRole\", \"inputs\": [ { \"type\": \"bytes32\", \"name\": \"role\", \"internalType\": \"bytes32\" }, { \"type\": \"address\", \"name\": \"account\", \"internalType\": \"address\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"hasRole\", \"inputs\": [ { \"type\": \"bytes32\", \"name\": \"role\", \"internalType\": \"bytes32\" }, { \"type\": \"address\", \"name\": \"account\", \"internalType\": \"address\" } ], \"outputs\": [ { \"type\": \"bool\", \"name\": \"\", \"internalType\": \"bool\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"hasRoleWithSwitch\", \"inputs\": [ { \"type\": \"bytes32\", \"name\": \"role\", \"internalType\": \"bytes32\" }, { \"type\": \"address\", \"name\": \"account\", \"internalType\": \"address\" } ], \"outputs\": [ { \"type\": \"bool\", \"name\": \"\", \"internalType\": \"bool\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"increaseAllowance\", \"inputs\": [ { \"type\": \"address\", \"name\": \"spender\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"addedValue\", \"internalType\": \"uint256\" } ], \"outputs\": [ { \"type\": \"bool\", \"name\": \"\", \"internalType\": \"bool\" } ], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"initialize\", \"inputs\": [ { \"type\": \"address\", \"name\": \"_defaultAdmin\", \"internalType\": \"address\" }, { \"type\": \"string\", \"name\": \"_name\", \"internalType\": \"string\" }, { \"type\": \"string\", \"name\": \"_symbol\", \"internalType\": \"string\" }, { \"type\": \"string\", \"name\": \"_contractURI\", \"internalType\": \"string\" }, { \"type\": \"address[]\", \"name\": \"_trustedForwarders\", \"internalType\": \"address[]\" }, { \"type\": \"address\", \"name\": \"_saleRecipient\", \"internalType\": \"address\" }, { \"type\": \"address\", \"name\": \"_platformFeeRecipient\", \"internalType\": \"address\" }, { \"type\": \"uint128\", \"name\": \"_platformFeeBps\", \"internalType\": \"uint128\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"isTrustedForwarder\", \"inputs\": [ { \"type\": \"address\", \"name\": \"forwarder\", \"internalType\": \"address\" } ], \"outputs\": [ { \"type\": \"bool\", \"name\": \"\", \"internalType\": \"bool\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"maxTotalSupply\", \"inputs\": [], \"outputs\": [ { \"type\": \"uint256\", \"name\": \"\", \"internalType\": \"uint256\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"multicall\", \"inputs\": [ { \"type\": \"bytes[]\", \"name\": \"data\", \"internalType\": \"bytes[]\" } ], \"outputs\": [ { \"type\": \"bytes[]\", \"name\": \"results\", \"internalType\": \"bytes[]\" } ], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"name\", \"inputs\": [], \"outputs\": [ { \"type\": \"string\", \"name\": \"\", \"internalType\": \"string\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"nonces\", \"inputs\": [ { \"type\": \"address\", \"name\": \"owner\", \"internalType\": \"address\" } ], \"outputs\": [ { \"type\": \"uint256\", \"name\": \"\", \"internalType\": \"uint256\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"numCheckpoints\", \"inputs\": [ { \"type\": \"address\", \"name\": \"account\", \"internalType\": \"address\" } ], \"outputs\": [ { \"type\": \"uint32\", \"name\": \"\", \"internalType\": \"uint32\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"permit\", \"inputs\": [ { \"type\": \"address\", \"name\": \"owner\", \"internalType\": \"address\" }, { \"type\": \"address\", \"name\": \"spender\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"value\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"deadline\", \"internalType\": \"uint256\" }, { \"type\": \"uint8\", \"name\": \"v\", \"internalType\": \"uint8\" }, { \"type\": \"bytes32\", \"name\": \"r\", \"internalType\": \"bytes32\" }, { \"type\": \"bytes32\", \"name\": \"s\", \"internalType\": \"bytes32\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"primarySaleRecipient\", \"inputs\": [], \"outputs\": [ { \"type\": \"address\", \"name\": \"\", \"internalType\": \"address\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"renounceRole\", \"inputs\": [ { \"type\": \"bytes32\", \"name\": \"role\", \"internalType\": \"bytes32\" }, { \"type\": \"address\", \"name\": \"account\", \"internalType\": \"address\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"revokeRole\", \"inputs\": [ { \"type\": \"bytes32\", \"name\": \"role\", \"internalType\": \"bytes32\" }, { \"type\": \"address\", \"name\": \"account\", \"internalType\": \"address\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"setClaimConditions\", \"inputs\": [ { \"type\": \"tuple[]\", \"name\": \"_conditions\", \"components\": [ { \"type\": \"uint256\", \"name\": \"startTimestamp\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"maxClaimableSupply\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"supplyClaimed\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"quantityLimitPerWallet\", \"internalType\": \"uint256\" }, { \"type\": \"bytes32\", \"name\": \"merkleRoot\", \"internalType\": \"bytes32\" }, { \"type\": \"uint256\", \"name\": \"pricePerToken\", \"internalType\": \"uint256\" }, { \"type\": \"address\", \"name\": \"currency\", \"internalType\": \"address\" }, { \"type\": \"string\", \"name\": \"metadata\", \"internalType\": \"string\" } ], \"internalType\": \"struct IClaimCondition.ClaimCondition[]\" }, { \"type\": \"bool\", \"name\": \"_resetClaimEligibility\", \"internalType\": \"bool\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"setContractURI\", \"inputs\": [ { \"type\": \"string\", \"name\": \"_uri\", \"internalType\": \"string\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"setFlatPlatformFeeInfo\", \"inputs\": [ { \"type\": \"address\", \"name\": \"_platformFeeRecipient\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"_flatFee\", \"internalType\": \"uint256\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"setMaxTotalSupply\", \"inputs\": [ { \"type\": \"uint256\", \"name\": \"_maxTotalSupply\", \"internalType\": \"uint256\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"setPlatformFeeInfo\", \"inputs\": [ { \"type\": \"address\", \"name\": \"_platformFeeRecipient\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"_platformFeeBps\", \"internalType\": \"uint256\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"setPlatformFeeType\", \"inputs\": [ { \"type\": \"uint8\", \"name\": \"_feeType\", \"internalType\": \"enum IPlatformFee.PlatformFeeType\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"setPrimarySaleRecipient\", \"inputs\": [ { \"type\": \"address\", \"name\": \"_saleRecipient\", \"internalType\": \"address\" } ], \"outputs\": [], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"symbol\", \"inputs\": [], \"outputs\": [ { \"type\": \"string\", \"name\": \"\", \"internalType\": \"string\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"totalSupply\", \"inputs\": [], \"outputs\": [ { \"type\": \"uint256\", \"name\": \"\", \"internalType\": \"uint256\" } ], \"stateMutability\": \"view\" }, { \"type\": \"function\", \"name\": \"transfer\", \"inputs\": [ { \"type\": \"address\", \"name\": \"to\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"amount\", \"internalType\": \"uint256\" } ], \"outputs\": [ { \"type\": \"bool\", \"name\": \"\", \"internalType\": \"bool\" } ], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"transferFrom\", \"inputs\": [ { \"type\": \"address\", \"name\": \"from\", \"internalType\": \"address\" }, { \"type\": \"address\", \"name\": \"to\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"amount\", \"internalType\": \"uint256\" } ], \"outputs\": [ { \"type\": \"bool\", \"name\": \"\", \"internalType\": \"bool\" } ], \"stateMutability\": \"nonpayable\" }, { \"type\": \"function\", \"name\": \"verifyClaim\", \"inputs\": [ { \"type\": \"uint256\", \"name\": \"_conditionId\", \"internalType\": \"uint256\" }, { \"type\": \"address\", \"name\": \"_claimer\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"_quantity\", \"internalType\": \"uint256\" }, { \"type\": \"address\", \"name\": \"_currency\", \"internalType\": \"address\" }, { \"type\": \"uint256\", \"name\": \"_pricePerToken\", \"internalType\": \"uint256\" }, { \"type\": \"tuple\", \"name\": \"_allowlistProof\", \"components\": [ { \"type\": \"bytes32[]\", \"name\": \"proof\", \"internalType\": \"bytes32[]\" }, { \"type\": \"uint256\", \"name\": \"quantityLimitPerWallet\", \"internalType\": \"uint256\" }, { \"type\": \"uint256\", \"name\": \"pricePerToken\", \"internalType\": \"uint256\" }, { \"type\": \"address\", \"name\": \"currency\", \"internalType\": \"address\" } ], \"internalType\": \"struct IDrop.AllowlistProof\" } ], \"outputs\": [ { \"type\": \"bool\", \"name\": \"isOverride\", \"internalType\": \"bool\" } ], \"stateMutability\": \"view\" } ]"; } }