From ca45aa6da6101f15fe9ef4c485e5d61a64f66f84 Mon Sep 17 00:00:00 2001 From: ricecodekhmer <151774852+ricecodekhmer@users.noreply.github.com> Date: Tue, 9 Apr 2024 01:50:10 +0100 Subject: [PATCH 1/4] fix(bridge-ui): fix ERC721 and ERC1155 detection in NFT bridge (#16680) --- .../src/libs/token/detectContractType.test.ts | 23 ++++--------------- .../src/libs/token/detectContractType.ts | 20 ++++++++-------- 2 files changed, 14 insertions(+), 29 deletions(-) diff --git a/packages/bridge-ui/src/libs/token/detectContractType.test.ts b/packages/bridge-ui/src/libs/token/detectContractType.test.ts index 7655a7d6c4..46d50e000c 100644 --- a/packages/bridge-ui/src/libs/token/detectContractType.test.ts +++ b/packages/bridge-ui/src/libs/token/detectContractType.test.ts @@ -13,20 +13,7 @@ describe('detectContractType', () => { // Given const contractAddress = zeroAddress; const chainId = 1; - vi.mocked(readContract).mockImplementationOnce(() => Promise.resolve()); - - // When - const result = await detectContractType(contractAddress, chainId); - - // Then - expect(result).toBe(TokenType.ERC721); - }); - - it('should return ERC721 for a valid ERC721 contract with invalid Token ID', async () => { - // Given - const contractAddress = zeroAddress; - const chainId = 1; - vi.mocked(readContract).mockImplementationOnce(() => Promise.reject(new Error('ERC721: invalid token ID'))); + vi.mocked(readContract).mockImplementationOnce(() => Promise.resolve(true)); // When const result = await detectContractType(contractAddress, chainId); @@ -40,8 +27,8 @@ describe('detectContractType', () => { const contractAddress = zeroAddress; const chainId = 1; vi.mocked(readContract) - .mockImplementationOnce(() => Promise.reject()) - .mockImplementationOnce(() => Promise.resolve()); + .mockImplementationOnce(() => Promise.reject(false)) + .mockImplementationOnce(() => Promise.resolve(true)); // When const result = await detectContractType(contractAddress, chainId); @@ -55,8 +42,8 @@ describe('detectContractType', () => { const contractAddress = zeroAddress; const chainId = 1; vi.mocked(readContract) - .mockImplementationOnce(() => Promise.reject()) - .mockImplementationOnce(() => Promise.reject()) + .mockImplementationOnce(() => Promise.reject(new Error())) + .mockImplementationOnce(() => Promise.reject(new Error())) .mockImplementationOnce(() => Promise.resolve()); // When diff --git a/packages/bridge-ui/src/libs/token/detectContractType.ts b/packages/bridge-ui/src/libs/token/detectContractType.ts index 99c96962e4..9a4cf06b86 100644 --- a/packages/bridge-ui/src/libs/token/detectContractType.ts +++ b/packages/bridge-ui/src/libs/token/detectContractType.ts @@ -13,31 +13,28 @@ const log = getLogger('detectContractType'); async function isERC721(address: Address, chainId: number): Promise { try { - await readContract(config, { + return await readContract(config, { address, abi: erc721Abi, - functionName: 'ownerOf', - args: [0n], + functionName: 'supportsInterface', + args: ['0x80ac58cd'], // Identifier for ERC-721 chainId, }); - return true; - } catch (err) { - // we expect this error to be thrown if the token is a ERC721 and the tokenId is invalid - return (err as Error)?.message?.includes('ERC721: invalid token ID') ?? false; + } catch { + return false; } } // return err instanceof ContractFunctionExecutionError && // err.cause.message.includes('ERC721: invalid token ID'); async function isERC1155(address: Address, chainId: number): Promise { try { - await readContract(config, { + return await readContract(config, { address, abi: erc1155Abi, - functionName: 'isApprovedForAll', - args: ['0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000'], + functionName: 'supportsInterface', + args: ['0xd9b67a26'], // Identifier for ERC-1155 chainId, }); - return true; } catch { return false; } @@ -52,6 +49,7 @@ async function isERC20(address: Address, chainId: number): Promise { args: ['0x0000000000000000000000000000000000000000'], chainId, }); + return true; } catch { return false; From 977b5cbc2eaff986c0a7a7c94e323a91ea1e3ecd Mon Sep 17 00:00:00 2001 From: jeff <113397187+cyberhorsey@users.noreply.github.com> Date: Tue, 9 Apr 2024 00:22:01 -0700 Subject: [PATCH 2/4] feat(eventindexer): introduce disperser (#16694) --- packages/eventindexer/SgxVerifier.json | 932 +++++ packages/eventindexer/TaikoToken.json | 1155 ++++++ packages/eventindexer/abigen.sh | 4 +- packages/eventindexer/cmd/flags/common.go | 2 +- packages/eventindexer/cmd/flags/disperser.go | 41 + packages/eventindexer/cmd/flags/indexer.go | 8 + packages/eventindexer/cmd/main.go | 8 + .../contracts/sgxverifier/SgxVerifier.go | 2371 +++++++++++ .../contracts/taikotoken/TaikoToken.go | 3455 +++++++++++++++++ packages/eventindexer/disperser/config.go | 98 + packages/eventindexer/disperser/disperser.go | 120 + packages/eventindexer/encoding/types.go | 18 + packages/eventindexer/event.go | 1 + packages/eventindexer/indexer/config.go | 2 + packages/eventindexer/indexer/filter.go | 16 + packages/eventindexer/indexer/indexer.go | 16 +- .../indexer/save_instance_added_event.go | 89 + 17 files changed, 8331 insertions(+), 5 deletions(-) create mode 100644 packages/eventindexer/SgxVerifier.json create mode 100644 packages/eventindexer/TaikoToken.json create mode 100644 packages/eventindexer/cmd/flags/disperser.go create mode 100644 packages/eventindexer/contracts/sgxverifier/SgxVerifier.go create mode 100644 packages/eventindexer/contracts/taikotoken/TaikoToken.go create mode 100644 packages/eventindexer/disperser/config.go create mode 100644 packages/eventindexer/disperser/disperser.go create mode 100644 packages/eventindexer/encoding/types.go create mode 100644 packages/eventindexer/indexer/save_instance_added_event.go diff --git a/packages/eventindexer/SgxVerifier.json b/packages/eventindexer/SgxVerifier.json new file mode 100644 index 0000000000..4b1bbc6830 --- /dev/null +++ b/packages/eventindexer/SgxVerifier.json @@ -0,0 +1,932 @@ +[ + { + "type": "function", + "name": "INSTANCE_EXPIRY", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint64", + "internalType": "uint64" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "INSTANCE_VALIDITY_DELAY", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint64", + "internalType": "uint64" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "acceptOwnership", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "addInstances", + "inputs": [ + { + "name": "_instances", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "addressManager", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "addressRegistered", + "inputs": [ + { + "name": "instanceAddress", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "alreadyAttested", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "deleteInstances", + "inputs": [ + { + "name": "_ids", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "init", + "inputs": [ + { + "name": "_owner", + "type": "address", + "internalType": "address" + }, + { + "name": "_addressManager", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "instances", + "inputs": [ + { + "name": "instanceId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "validSince", + "type": "uint64", + "internalType": "uint64" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "lastUnpausedAt", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint64", + "internalType": "uint64" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "nextInstanceId", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "owner", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "pause", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "paused", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "pendingOwner", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "proxiableUUID", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "registerInstance", + "inputs": [ + { + "name": "_attestation", + "type": "tuple", + "internalType": "struct V3Struct.ParsedV3QuoteStruct", + "components": [ + { + "name": "header", + "type": "tuple", + "internalType": "struct V3Struct.Header", + "components": [ + { + "name": "version", + "type": "bytes2", + "internalType": "bytes2" + }, + { + "name": "attestationKeyType", + "type": "bytes2", + "internalType": "bytes2" + }, + { + "name": "teeType", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "qeSvn", + "type": "bytes2", + "internalType": "bytes2" + }, + { + "name": "pceSvn", + "type": "bytes2", + "internalType": "bytes2" + }, + { + "name": "qeVendorId", + "type": "bytes16", + "internalType": "bytes16" + }, + { + "name": "userData", + "type": "bytes20", + "internalType": "bytes20" + } + ] + }, + { + "name": "localEnclaveReport", + "type": "tuple", + "internalType": "struct V3Struct.EnclaveReport", + "components": [ + { + "name": "cpuSvn", + "type": "bytes16", + "internalType": "bytes16" + }, + { + "name": "miscSelect", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "reserved1", + "type": "bytes28", + "internalType": "bytes28" + }, + { + "name": "attributes", + "type": "bytes16", + "internalType": "bytes16" + }, + { + "name": "mrEnclave", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "reserved2", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "mrSigner", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "reserved3", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "isvProdId", + "type": "uint16", + "internalType": "uint16" + }, + { + "name": "isvSvn", + "type": "uint16", + "internalType": "uint16" + }, + { + "name": "reserved4", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "reportData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "v3AuthData", + "type": "tuple", + "internalType": "struct V3Struct.ECDSAQuoteV3AuthData", + "components": [ + { + "name": "ecdsa256BitSignature", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "ecdsaAttestationKey", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "pckSignedQeReport", + "type": "tuple", + "internalType": "struct V3Struct.EnclaveReport", + "components": [ + { + "name": "cpuSvn", + "type": "bytes16", + "internalType": "bytes16" + }, + { + "name": "miscSelect", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "reserved1", + "type": "bytes28", + "internalType": "bytes28" + }, + { + "name": "attributes", + "type": "bytes16", + "internalType": "bytes16" + }, + { + "name": "mrEnclave", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "reserved2", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "mrSigner", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "reserved3", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "isvProdId", + "type": "uint16", + "internalType": "uint16" + }, + { + "name": "isvSvn", + "type": "uint16", + "internalType": "uint16" + }, + { + "name": "reserved4", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "reportData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "qeReportSignature", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "qeAuthData", + "type": "tuple", + "internalType": "struct V3Struct.QEAuthData", + "components": [ + { + "name": "parsedDataSize", + "type": "uint16", + "internalType": "uint16" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "certification", + "type": "tuple", + "internalType": "struct V3Struct.CertificationData", + "components": [ + { + "name": "certType", + "type": "uint16", + "internalType": "uint16" + }, + { + "name": "certDataSize", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "decodedCertDataArray", + "type": "bytes[3]", + "internalType": "bytes[3]" + } + ] + } + ] + } + ] + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "renounceOwnership", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "resolve", + "inputs": [ + { + "name": "_chainId", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "_name", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_allowZeroAddress", + "type": "bool", + "internalType": "bool" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address payable" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "resolve", + "inputs": [ + { + "name": "_name", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_allowZeroAddress", + "type": "bool", + "internalType": "bool" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address payable" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "transferOwnership", + "inputs": [ + { + "name": "newOwner", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "unpause", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "upgradeTo", + "inputs": [ + { + "name": "newImplementation", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "upgradeToAndCall", + "inputs": [ + { + "name": "newImplementation", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "verifyProof", + "inputs": [ + { + "name": "_ctx", + "type": "tuple", + "internalType": "struct IVerifier.Context", + "components": [ + { + "name": "metaHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "blobHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "prover", + "type": "address", + "internalType": "address" + }, + { + "name": "blockId", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "isContesting", + "type": "bool", + "internalType": "bool" + }, + { + "name": "blobUsed", + "type": "bool", + "internalType": "bool" + }, + { + "name": "msgSender", + "type": "address", + "internalType": "address" + } + ] + }, + { + "name": "_tran", + "type": "tuple", + "internalType": "struct TaikoData.Transition", + "components": [ + { + "name": "parentHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "blockHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "stateRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "graffiti", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "_proof", + "type": "tuple", + "internalType": "struct TaikoData.TierProof", + "components": [ + { + "name": "tier", + "type": "uint16", + "internalType": "uint16" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "AdminChanged", + "inputs": [ + { + "name": "previousAdmin", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "newAdmin", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BeaconUpgraded", + "inputs": [ + { + "name": "beacon", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "InstanceAdded", + "inputs": [ + { + "name": "id", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "instance", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "replaced", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "validSince", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "InstanceDeleted", + "inputs": [ + { + "name": "id", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "instance", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferStarted", + "inputs": [ + { + "name": "previousOwner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "newOwner", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferred", + "inputs": [ + { + "name": "previousOwner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "newOwner", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Paused", + "inputs": [ + { + "name": "account", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Unpaused", + "inputs": [ + { + "name": "account", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Upgraded", + "inputs": [ + { + "name": "implementation", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "INVALID_PAUSE_STATUS", + "inputs": [] + }, + { + "type": "error", + "name": "REENTRANT_CALL", + "inputs": [] + }, + { + "type": "error", + "name": "RESOLVER_DENIED", + "inputs": [] + }, + { + "type": "error", + "name": "RESOLVER_INVALID_MANAGER", + "inputs": [] + }, + { + "type": "error", + "name": "RESOLVER_UNEXPECTED_CHAINID", + "inputs": [] + }, + { + "type": "error", + "name": "RESOLVER_ZERO_ADDR", + "inputs": [ + { + "name": "chainId", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "name", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "SGX_ALREADY_ATTESTED", + "inputs": [] + }, + { + "type": "error", + "name": "SGX_INVALID_ATTESTATION", + "inputs": [] + }, + { + "type": "error", + "name": "SGX_INVALID_INSTANCE", + "inputs": [] + }, + { + "type": "error", + "name": "SGX_INVALID_PROOF", + "inputs": [] + }, + { + "type": "error", + "name": "SGX_RA_NOT_SUPPORTED", + "inputs": [] + }, + { + "type": "error", + "name": "ZERO_ADDR_MANAGER", + "inputs": [] + } +] diff --git a/packages/eventindexer/TaikoToken.json b/packages/eventindexer/TaikoToken.json new file mode 100644 index 0000000000..fc986a5e1b --- /dev/null +++ b/packages/eventindexer/TaikoToken.json @@ -0,0 +1,1155 @@ +[ + { + "type": "function", + "name": "CLOCK_MODE", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "DOMAIN_SEPARATOR", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "acceptOwnership", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "addressManager", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "allowance", + "inputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "spender", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "approve", + "inputs": [ + { + "name": "spender", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "balanceOf", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "balanceOfAt", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + }, + { + "name": "snapshotId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "burn", + "inputs": [ + { + "name": "_from", + "type": "address", + "internalType": "address" + }, + { + "name": "_amount", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "checkpoints", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + }, + { + "name": "pos", + "type": "uint32", + "internalType": "uint32" + } + ], + "outputs": [ + { + "name": "", + "type": "tuple", + "internalType": "struct ERC20VotesUpgradeable.Checkpoint", + "components": [ + { + "name": "fromBlock", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "votes", + "type": "uint224", + "internalType": "uint224" + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "clock", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint48", + "internalType": "uint48" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "decimals", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "decreaseAllowance", + "inputs": [ + { + "name": "spender", + "type": "address", + "internalType": "address" + }, + { + "name": "subtractedValue", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "delegate", + "inputs": [ + { + "name": "delegatee", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "delegateBySig", + "inputs": [ + { + "name": "delegatee", + "type": "address", + "internalType": "address" + }, + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiry", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "delegates", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "eip712Domain", + "inputs": [], + "outputs": [ + { + "name": "fields", + "type": "bytes1", + "internalType": "bytes1" + }, + { + "name": "name", + "type": "string", + "internalType": "string" + }, + { + "name": "version", + "type": "string", + "internalType": "string" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "verifyingContract", + "type": "address", + "internalType": "address" + }, + { + "name": "salt", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "extensions", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getPastTotalSupply", + "inputs": [ + { + "name": "timepoint", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getPastVotes", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + }, + { + "name": "timepoint", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getVotes", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "increaseAllowance", + "inputs": [ + { + "name": "spender", + "type": "address", + "internalType": "address" + }, + { + "name": "addedValue", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "init", + "inputs": [ + { + "name": "_owner", + "type": "address", + "internalType": "address" + }, + { + "name": "_name", + "type": "string", + "internalType": "string" + }, + { + "name": "_symbol", + "type": "string", + "internalType": "string" + }, + { + "name": "_recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "_addressManager", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "lastUnpausedAt", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint64", + "internalType": "uint64" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "nonces", + "inputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "numCheckpoints", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint32", + "internalType": "uint32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "owner", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "pause", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "paused", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "pendingOwner", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "permit", + "inputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "spender", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "deadline", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "proxiableUUID", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "renounceOwnership", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "resolve", + "inputs": [ + { + "name": "_chainId", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "_name", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_allowZeroAddress", + "type": "bool", + "internalType": "bool" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address payable" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "resolve", + "inputs": [ + { + "name": "_name", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_allowZeroAddress", + "type": "bool", + "internalType": "bool" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address payable" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "snapshot", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "symbol", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "totalSupply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "totalSupplyAt", + "inputs": [ + { + "name": "snapshotId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "transfer", + "inputs": [ + { + "name": "_to", + "type": "address", + "internalType": "address" + }, + { + "name": "_amount", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "transferFrom", + "inputs": [ + { + "name": "_from", + "type": "address", + "internalType": "address" + }, + { + "name": "_to", + "type": "address", + "internalType": "address" + }, + { + "name": "_amount", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "transferOwnership", + "inputs": [ + { + "name": "newOwner", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "unpause", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "upgradeTo", + "inputs": [ + { + "name": "newImplementation", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "upgradeToAndCall", + "inputs": [ + { + "name": "newImplementation", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "event", + "name": "AdminChanged", + "inputs": [ + { + "name": "previousAdmin", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "newAdmin", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Approval", + "inputs": [ + { + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "spender", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BeaconUpgraded", + "inputs": [ + { + "name": "beacon", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DelegateChanged", + "inputs": [ + { + "name": "delegator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "fromDelegate", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "toDelegate", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DelegateVotesChanged", + "inputs": [ + { + "name": "delegate", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "previousBalance", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "newBalance", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "EIP712DomainChanged", + "inputs": [], + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferStarted", + "inputs": [ + { + "name": "previousOwner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "newOwner", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferred", + "inputs": [ + { + "name": "previousOwner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "newOwner", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Paused", + "inputs": [ + { + "name": "account", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Snapshot", + "inputs": [ + { + "name": "id", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Transfer", + "inputs": [ + { + "name": "from", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Unpaused", + "inputs": [ + { + "name": "account", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Upgraded", + "inputs": [ + { + "name": "implementation", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "INVALID_PAUSE_STATUS", + "inputs": [] + }, + { + "type": "error", + "name": "REENTRANT_CALL", + "inputs": [] + }, + { + "type": "error", + "name": "RESOLVER_DENIED", + "inputs": [] + }, + { + "type": "error", + "name": "RESOLVER_INVALID_MANAGER", + "inputs": [] + }, + { + "type": "error", + "name": "RESOLVER_UNEXPECTED_CHAINID", + "inputs": [] + }, + { + "type": "error", + "name": "RESOLVER_ZERO_ADDR", + "inputs": [ + { + "name": "chainId", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "name", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "TKO_INVALID_ADDR", + "inputs": [] + }, + { + "type": "error", + "name": "ZERO_ADDR_MANAGER", + "inputs": [] + } +] diff --git a/packages/eventindexer/abigen.sh b/packages/eventindexer/abigen.sh index e61ebde29f..0f83c65c1e 100755 --- a/packages/eventindexer/abigen.sh +++ b/packages/eventindexer/abigen.sh @@ -5,9 +5,9 @@ if [ ! -d "../protocol/out" ]; then exit 1 fi -paths=("TaikoL1.sol" "Bridge.sol" "AssignmentHook.sol") +paths=("TaikoL1.sol" "Bridge.sol" "AssignmentHook.sol" "SgxVerifier.sol" "TaikoToken.sol") -names=("TaikoL1" "Bridge" "AssignmentHook") +names=("TaikoL1" "Bridge" "AssignmentHook" "SgxVerifier" "TaikoToken") for (( i = 0; i < ${#paths[@]}; ++i )); diff --git a/packages/eventindexer/cmd/flags/common.go b/packages/eventindexer/cmd/flags/common.go index 0e91aed5b5..794eb82126 100644 --- a/packages/eventindexer/cmd/flags/common.go +++ b/packages/eventindexer/cmd/flags/common.go @@ -8,6 +8,7 @@ var ( commonCategory = "COMMON" indexerCategory = "INDEXER" generatorCategory = "GENERATOR" + disperserCategory = "DISPERSER" ) var ( @@ -71,7 +72,6 @@ var ( Value: 6061, EnvVars: []string{"METRICS_HTTP_PORT"}, } - Layer = &cli.StringFlag{ Name: "layer", Usage: "Which layer indexing is occurring on", diff --git a/packages/eventindexer/cmd/flags/disperser.go b/packages/eventindexer/cmd/flags/disperser.go new file mode 100644 index 0000000000..fbf653c627 --- /dev/null +++ b/packages/eventindexer/cmd/flags/disperser.go @@ -0,0 +1,41 @@ +package flags + +import "github.com/urfave/cli/v2" + +var ( + DisperserPrivateKey = &cli.StringFlag{ + Name: "disperserPrivateKey", + Usage: "Disperser private key which contains TTKO", + Required: true, + Category: disperserCategory, + EnvVars: []string{"DISPERSER_PRIVATE_KEY"}, + } + TaikoTokenAddress = &cli.StringFlag{ + Name: "taikoTokenAddress", + Usage: "Address of the TaikoToken contract", + Required: true, + Category: disperserCategory, + EnvVars: []string{"TAIKO_TOKEN_ADDRESS"}, + } + DispersalAmount = &cli.StringFlag{ + Name: "taikoTokenAddress", + Usage: "Dispersal amount in wei", + Required: true, + Category: disperserCategory, + EnvVars: []string{"DISPERSAL_AMOUNT"}, + } + RPCUrl = &cli.StringFlag{ + Name: "rpcUrl", + Usage: "RPC URL for the source chain", + Required: true, + Category: commonCategory, + EnvVars: []string{"RPC_URL"}, + } +) + +var DisperserFlags = MergeFlags(CommonFlags, []cli.Flag{ + DisperserPrivateKey, + TaikoTokenAddress, + DispersalAmount, + RPCUrl, +}) diff --git a/packages/eventindexer/cmd/flags/indexer.go b/packages/eventindexer/cmd/flags/indexer.go index dfe8952cf7..0fb28bec73 100644 --- a/packages/eventindexer/cmd/flags/indexer.go +++ b/packages/eventindexer/cmd/flags/indexer.go @@ -51,6 +51,13 @@ var ( Category: indexerCategory, EnvVars: []string{"ASSIGNMENT_HOOK_ADDRESS"}, } + SgxVerifierAddress = &cli.StringFlag{ + Name: "sgxVerifierAddress", + Usage: "Address of the SGXVerifier contract", + Required: false, + Category: indexerCategory, + EnvVars: []string{"SGX_VERIFIER_ADDRESS"}, + } BlockBatchSize = &cli.Uint64Flag{ Name: "blockBatchSize", Usage: "Block batch size when iterating through blocks", @@ -90,6 +97,7 @@ var IndexerFlags = MergeFlags(CommonFlags, []cli.Flag{ L1TaikoAddress, BridgeAddress, SwapAddresses, + SgxVerifierAddress, AssignmentHookAddress, BlockBatchSize, SubscriptionBackoff, diff --git a/packages/eventindexer/cmd/main.go b/packages/eventindexer/cmd/main.go index fac9c63679..a5ce330e48 100644 --- a/packages/eventindexer/cmd/main.go +++ b/packages/eventindexer/cmd/main.go @@ -9,6 +9,7 @@ import ( "github.com/taikoxyz/taiko-mono/packages/eventindexer/api" "github.com/taikoxyz/taiko-mono/packages/eventindexer/cmd/flags" "github.com/taikoxyz/taiko-mono/packages/eventindexer/cmd/utils" + "github.com/taikoxyz/taiko-mono/packages/eventindexer/disperser" "github.com/taikoxyz/taiko-mono/packages/eventindexer/generator" "github.com/taikoxyz/taiko-mono/packages/eventindexer/indexer" "github.com/urfave/cli/v2" @@ -58,6 +59,13 @@ func main() { Description: "Taiko time-series data generator", Action: utils.SubcommandAction(new(generator.Generator)), }, + { + Name: "disperser", + Flags: flags.DisperserFlags, + Usage: "Starts the disperser software", + Description: "Taiko TTKO disperser", + Action: utils.SubcommandAction(new(disperser.Disperser)), + }, } if err := app.Run(os.Args); err != nil { diff --git a/packages/eventindexer/contracts/sgxverifier/SgxVerifier.go b/packages/eventindexer/contracts/sgxverifier/SgxVerifier.go new file mode 100644 index 0000000000..e6f077c6a1 --- /dev/null +++ b/packages/eventindexer/contracts/sgxverifier/SgxVerifier.go @@ -0,0 +1,2371 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package sgxverifier + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// IVerifierContext is an auto generated low-level Go binding around an user-defined struct. +type IVerifierContext struct { + MetaHash [32]byte + BlobHash [32]byte + Prover common.Address + BlockId uint64 + IsContesting bool + BlobUsed bool + MsgSender common.Address +} + +// TaikoDataTierProof is an auto generated low-level Go binding around an user-defined struct. +type TaikoDataTierProof struct { + Tier uint16 + Data []byte +} + +// TaikoDataTransition is an auto generated low-level Go binding around an user-defined struct. +type TaikoDataTransition struct { + ParentHash [32]byte + BlockHash [32]byte + StateRoot [32]byte + Graffiti [32]byte +} + +// V3StructCertificationData is an auto generated low-level Go binding around an user-defined struct. +type V3StructCertificationData struct { + CertType uint16 + CertDataSize uint32 + DecodedCertDataArray [3][]byte +} + +// V3StructECDSAQuoteV3AuthData is an auto generated low-level Go binding around an user-defined struct. +type V3StructECDSAQuoteV3AuthData struct { + Ecdsa256BitSignature []byte + EcdsaAttestationKey []byte + PckSignedQeReport V3StructEnclaveReport + QeReportSignature []byte + QeAuthData V3StructQEAuthData + Certification V3StructCertificationData +} + +// V3StructEnclaveReport is an auto generated low-level Go binding around an user-defined struct. +type V3StructEnclaveReport struct { + CpuSvn [16]byte + MiscSelect [4]byte + Reserved1 [28]byte + Attributes [16]byte + MrEnclave [32]byte + Reserved2 [32]byte + MrSigner [32]byte + Reserved3 []byte + IsvProdId uint16 + IsvSvn uint16 + Reserved4 []byte + ReportData []byte +} + +// V3StructHeader is an auto generated low-level Go binding around an user-defined struct. +type V3StructHeader struct { + Version [2]byte + AttestationKeyType [2]byte + TeeType [4]byte + QeSvn [2]byte + PceSvn [2]byte + QeVendorId [16]byte + UserData [20]byte +} + +// V3StructParsedV3QuoteStruct is an auto generated low-level Go binding around an user-defined struct. +type V3StructParsedV3QuoteStruct struct { + Header V3StructHeader + LocalEnclaveReport V3StructEnclaveReport + V3AuthData V3StructECDSAQuoteV3AuthData +} + +// V3StructQEAuthData is an auto generated low-level Go binding around an user-defined struct. +type V3StructQEAuthData struct { + ParsedDataSize uint16 + Data []byte +} + +// SgxVerifierMetaData contains all meta data concerning the SgxVerifier contract. +var SgxVerifierMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"INSTANCE_EXPIRY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"INSTANCE_VALIDITY_DELAY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"addInstances\",\"inputs\":[{\"name\":\"_instances\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"addressManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"addressRegistered\",\"inputs\":[{\"name\":\"instanceAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"alreadyAttested\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deleteInstances\",\"inputs\":[{\"name\":\"_ids\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"init\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_addressManager\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"instances\",\"inputs\":[{\"name\":\"instanceId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"validSince\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"lastUnpausedAt\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nextInstanceId\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pendingOwner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerInstance\",\"inputs\":[{\"name\":\"_attestation\",\"type\":\"tuple\",\"internalType\":\"structV3Struct.ParsedV3QuoteStruct\",\"components\":[{\"name\":\"header\",\"type\":\"tuple\",\"internalType\":\"structV3Struct.Header\",\"components\":[{\"name\":\"version\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"attestationKeyType\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"teeType\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"qeSvn\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"pceSvn\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"qeVendorId\",\"type\":\"bytes16\",\"internalType\":\"bytes16\"},{\"name\":\"userData\",\"type\":\"bytes20\",\"internalType\":\"bytes20\"}]},{\"name\":\"localEnclaveReport\",\"type\":\"tuple\",\"internalType\":\"structV3Struct.EnclaveReport\",\"components\":[{\"name\":\"cpuSvn\",\"type\":\"bytes16\",\"internalType\":\"bytes16\"},{\"name\":\"miscSelect\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"reserved1\",\"type\":\"bytes28\",\"internalType\":\"bytes28\"},{\"name\":\"attributes\",\"type\":\"bytes16\",\"internalType\":\"bytes16\"},{\"name\":\"mrEnclave\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"reserved2\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"mrSigner\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"reserved3\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"isvProdId\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"isvSvn\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"reserved4\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"reportData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"v3AuthData\",\"type\":\"tuple\",\"internalType\":\"structV3Struct.ECDSAQuoteV3AuthData\",\"components\":[{\"name\":\"ecdsa256BitSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"ecdsaAttestationKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"pckSignedQeReport\",\"type\":\"tuple\",\"internalType\":\"structV3Struct.EnclaveReport\",\"components\":[{\"name\":\"cpuSvn\",\"type\":\"bytes16\",\"internalType\":\"bytes16\"},{\"name\":\"miscSelect\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"reserved1\",\"type\":\"bytes28\",\"internalType\":\"bytes28\"},{\"name\":\"attributes\",\"type\":\"bytes16\",\"internalType\":\"bytes16\"},{\"name\":\"mrEnclave\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"reserved2\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"mrSigner\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"reserved3\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"isvProdId\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"isvSvn\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"reserved4\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"reportData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"qeReportSignature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"qeAuthData\",\"type\":\"tuple\",\"internalType\":\"structV3Struct.QEAuthData\",\"components\":[{\"name\":\"parsedDataSize\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"certification\",\"type\":\"tuple\",\"internalType\":\"structV3Struct.CertificationData\",\"components\":[{\"name\":\"certType\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"certDataSize\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"decodedCertDataArray\",\"type\":\"bytes[3]\",\"internalType\":\"bytes[3]\"}]}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resolve\",\"inputs\":[{\"name\":\"_chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_name\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_allowZeroAddress\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"resolve\",\"inputs\":[{\"name\":\"_name\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_allowZeroAddress\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeTo\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"verifyProof\",\"inputs\":[{\"name\":\"_ctx\",\"type\":\"tuple\",\"internalType\":\"structIVerifier.Context\",\"components\":[{\"name\":\"metaHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"blobHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"prover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"blockId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"isContesting\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"blobUsed\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"msgSender\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"_tran\",\"type\":\"tuple\",\"internalType\":\"structTaikoData.Transition\",\"components\":[{\"name\":\"parentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"blockHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"stateRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"graffiti\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"_proof\",\"type\":\"tuple\",\"internalType\":\"structTaikoData.TierProof\",\"components\":[{\"name\":\"tier\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AdminChanged\",\"inputs\":[{\"name\":\"previousAdmin\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"newAdmin\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BeaconUpgraded\",\"inputs\":[{\"name\":\"beacon\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InstanceAdded\",\"inputs\":[{\"name\":\"id\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"instance\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"replaced\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"validSince\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InstanceDeleted\",\"inputs\":[{\"name\":\"id\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"instance\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferStarted\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"INVALID_PAUSE_STATUS\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"REENTRANT_CALL\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RESOLVER_DENIED\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RESOLVER_INVALID_MANAGER\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RESOLVER_UNEXPECTED_CHAINID\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RESOLVER_ZERO_ADDR\",\"inputs\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"name\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"SGX_ALREADY_ATTESTED\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SGX_INVALID_ATTESTATION\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SGX_INVALID_INSTANCE\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SGX_INVALID_PROOF\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SGX_RA_NOT_SUPPORTED\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ZERO_ADDR_MANAGER\",\"inputs\":[]}]", +} + +// SgxVerifierABI is the input ABI used to generate the binding from. +// Deprecated: Use SgxVerifierMetaData.ABI instead. +var SgxVerifierABI = SgxVerifierMetaData.ABI + +// SgxVerifier is an auto generated Go binding around an Ethereum contract. +type SgxVerifier struct { + SgxVerifierCaller // Read-only binding to the contract + SgxVerifierTransactor // Write-only binding to the contract + SgxVerifierFilterer // Log filterer for contract events +} + +// SgxVerifierCaller is an auto generated read-only Go binding around an Ethereum contract. +type SgxVerifierCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SgxVerifierTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SgxVerifierTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SgxVerifierFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SgxVerifierFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SgxVerifierSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SgxVerifierSession struct { + Contract *SgxVerifier // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SgxVerifierCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SgxVerifierCallerSession struct { + Contract *SgxVerifierCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SgxVerifierTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SgxVerifierTransactorSession struct { + Contract *SgxVerifierTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SgxVerifierRaw is an auto generated low-level Go binding around an Ethereum contract. +type SgxVerifierRaw struct { + Contract *SgxVerifier // Generic contract binding to access the raw methods on +} + +// SgxVerifierCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SgxVerifierCallerRaw struct { + Contract *SgxVerifierCaller // Generic read-only contract binding to access the raw methods on +} + +// SgxVerifierTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SgxVerifierTransactorRaw struct { + Contract *SgxVerifierTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSgxVerifier creates a new instance of SgxVerifier, bound to a specific deployed contract. +func NewSgxVerifier(address common.Address, backend bind.ContractBackend) (*SgxVerifier, error) { + contract, err := bindSgxVerifier(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SgxVerifier{SgxVerifierCaller: SgxVerifierCaller{contract: contract}, SgxVerifierTransactor: SgxVerifierTransactor{contract: contract}, SgxVerifierFilterer: SgxVerifierFilterer{contract: contract}}, nil +} + +// NewSgxVerifierCaller creates a new read-only instance of SgxVerifier, bound to a specific deployed contract. +func NewSgxVerifierCaller(address common.Address, caller bind.ContractCaller) (*SgxVerifierCaller, error) { + contract, err := bindSgxVerifier(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SgxVerifierCaller{contract: contract}, nil +} + +// NewSgxVerifierTransactor creates a new write-only instance of SgxVerifier, bound to a specific deployed contract. +func NewSgxVerifierTransactor(address common.Address, transactor bind.ContractTransactor) (*SgxVerifierTransactor, error) { + contract, err := bindSgxVerifier(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SgxVerifierTransactor{contract: contract}, nil +} + +// NewSgxVerifierFilterer creates a new log filterer instance of SgxVerifier, bound to a specific deployed contract. +func NewSgxVerifierFilterer(address common.Address, filterer bind.ContractFilterer) (*SgxVerifierFilterer, error) { + contract, err := bindSgxVerifier(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SgxVerifierFilterer{contract: contract}, nil +} + +// bindSgxVerifier binds a generic wrapper to an already deployed contract. +func bindSgxVerifier(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := SgxVerifierMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SgxVerifier *SgxVerifierRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SgxVerifier.Contract.SgxVerifierCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SgxVerifier *SgxVerifierRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SgxVerifier.Contract.SgxVerifierTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SgxVerifier *SgxVerifierRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SgxVerifier.Contract.SgxVerifierTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SgxVerifier *SgxVerifierCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SgxVerifier.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SgxVerifier *SgxVerifierTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SgxVerifier.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SgxVerifier *SgxVerifierTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SgxVerifier.Contract.contract.Transact(opts, method, params...) +} + +// INSTANCEEXPIRY is a free data retrieval call binding the contract method 0xd632cf35. +// +// Solidity: function INSTANCE_EXPIRY() view returns(uint64) +func (_SgxVerifier *SgxVerifierCaller) INSTANCEEXPIRY(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _SgxVerifier.contract.Call(opts, &out, "INSTANCE_EXPIRY") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// INSTANCEEXPIRY is a free data retrieval call binding the contract method 0xd632cf35. +// +// Solidity: function INSTANCE_EXPIRY() view returns(uint64) +func (_SgxVerifier *SgxVerifierSession) INSTANCEEXPIRY() (uint64, error) { + return _SgxVerifier.Contract.INSTANCEEXPIRY(&_SgxVerifier.CallOpts) +} + +// INSTANCEEXPIRY is a free data retrieval call binding the contract method 0xd632cf35. +// +// Solidity: function INSTANCE_EXPIRY() view returns(uint64) +func (_SgxVerifier *SgxVerifierCallerSession) INSTANCEEXPIRY() (uint64, error) { + return _SgxVerifier.Contract.INSTANCEEXPIRY(&_SgxVerifier.CallOpts) +} + +// INSTANCEVALIDITYDELAY is a free data retrieval call binding the contract method 0xb51ec328. +// +// Solidity: function INSTANCE_VALIDITY_DELAY() view returns(uint64) +func (_SgxVerifier *SgxVerifierCaller) INSTANCEVALIDITYDELAY(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _SgxVerifier.contract.Call(opts, &out, "INSTANCE_VALIDITY_DELAY") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// INSTANCEVALIDITYDELAY is a free data retrieval call binding the contract method 0xb51ec328. +// +// Solidity: function INSTANCE_VALIDITY_DELAY() view returns(uint64) +func (_SgxVerifier *SgxVerifierSession) INSTANCEVALIDITYDELAY() (uint64, error) { + return _SgxVerifier.Contract.INSTANCEVALIDITYDELAY(&_SgxVerifier.CallOpts) +} + +// INSTANCEVALIDITYDELAY is a free data retrieval call binding the contract method 0xb51ec328. +// +// Solidity: function INSTANCE_VALIDITY_DELAY() view returns(uint64) +func (_SgxVerifier *SgxVerifierCallerSession) INSTANCEVALIDITYDELAY() (uint64, error) { + return _SgxVerifier.Contract.INSTANCEVALIDITYDELAY(&_SgxVerifier.CallOpts) +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_SgxVerifier *SgxVerifierCaller) AddressManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SgxVerifier.contract.Call(opts, &out, "addressManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_SgxVerifier *SgxVerifierSession) AddressManager() (common.Address, error) { + return _SgxVerifier.Contract.AddressManager(&_SgxVerifier.CallOpts) +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_SgxVerifier *SgxVerifierCallerSession) AddressManager() (common.Address, error) { + return _SgxVerifier.Contract.AddressManager(&_SgxVerifier.CallOpts) +} + +// AddressRegistered is a free data retrieval call binding the contract method 0x9d7809b5. +// +// Solidity: function addressRegistered(address instanceAddress) view returns(bool alreadyAttested) +func (_SgxVerifier *SgxVerifierCaller) AddressRegistered(opts *bind.CallOpts, instanceAddress common.Address) (bool, error) { + var out []interface{} + err := _SgxVerifier.contract.Call(opts, &out, "addressRegistered", instanceAddress) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// AddressRegistered is a free data retrieval call binding the contract method 0x9d7809b5. +// +// Solidity: function addressRegistered(address instanceAddress) view returns(bool alreadyAttested) +func (_SgxVerifier *SgxVerifierSession) AddressRegistered(instanceAddress common.Address) (bool, error) { + return _SgxVerifier.Contract.AddressRegistered(&_SgxVerifier.CallOpts, instanceAddress) +} + +// AddressRegistered is a free data retrieval call binding the contract method 0x9d7809b5. +// +// Solidity: function addressRegistered(address instanceAddress) view returns(bool alreadyAttested) +func (_SgxVerifier *SgxVerifierCallerSession) AddressRegistered(instanceAddress common.Address) (bool, error) { + return _SgxVerifier.Contract.AddressRegistered(&_SgxVerifier.CallOpts, instanceAddress) +} + +// Instances is a free data retrieval call binding the contract method 0xa2f7b3a5. +// +// Solidity: function instances(uint256 instanceId) view returns(address addr, uint64 validSince) +func (_SgxVerifier *SgxVerifierCaller) Instances(opts *bind.CallOpts, instanceId *big.Int) (struct { + Addr common.Address + ValidSince uint64 +}, error) { + var out []interface{} + err := _SgxVerifier.contract.Call(opts, &out, "instances", instanceId) + + outstruct := new(struct { + Addr common.Address + ValidSince uint64 + }) + if err != nil { + return *outstruct, err + } + + outstruct.Addr = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.ValidSince = *abi.ConvertType(out[1], new(uint64)).(*uint64) + + return *outstruct, err + +} + +// Instances is a free data retrieval call binding the contract method 0xa2f7b3a5. +// +// Solidity: function instances(uint256 instanceId) view returns(address addr, uint64 validSince) +func (_SgxVerifier *SgxVerifierSession) Instances(instanceId *big.Int) (struct { + Addr common.Address + ValidSince uint64 +}, error) { + return _SgxVerifier.Contract.Instances(&_SgxVerifier.CallOpts, instanceId) +} + +// Instances is a free data retrieval call binding the contract method 0xa2f7b3a5. +// +// Solidity: function instances(uint256 instanceId) view returns(address addr, uint64 validSince) +func (_SgxVerifier *SgxVerifierCallerSession) Instances(instanceId *big.Int) (struct { + Addr common.Address + ValidSince uint64 +}, error) { + return _SgxVerifier.Contract.Instances(&_SgxVerifier.CallOpts, instanceId) +} + +// LastUnpausedAt is a free data retrieval call binding the contract method 0xe07baba6. +// +// Solidity: function lastUnpausedAt() view returns(uint64) +func (_SgxVerifier *SgxVerifierCaller) LastUnpausedAt(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _SgxVerifier.contract.Call(opts, &out, "lastUnpausedAt") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// LastUnpausedAt is a free data retrieval call binding the contract method 0xe07baba6. +// +// Solidity: function lastUnpausedAt() view returns(uint64) +func (_SgxVerifier *SgxVerifierSession) LastUnpausedAt() (uint64, error) { + return _SgxVerifier.Contract.LastUnpausedAt(&_SgxVerifier.CallOpts) +} + +// LastUnpausedAt is a free data retrieval call binding the contract method 0xe07baba6. +// +// Solidity: function lastUnpausedAt() view returns(uint64) +func (_SgxVerifier *SgxVerifierCallerSession) LastUnpausedAt() (uint64, error) { + return _SgxVerifier.Contract.LastUnpausedAt(&_SgxVerifier.CallOpts) +} + +// NextInstanceId is a free data retrieval call binding the contract method 0xee45abb0. +// +// Solidity: function nextInstanceId() view returns(uint256) +func (_SgxVerifier *SgxVerifierCaller) NextInstanceId(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SgxVerifier.contract.Call(opts, &out, "nextInstanceId") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// NextInstanceId is a free data retrieval call binding the contract method 0xee45abb0. +// +// Solidity: function nextInstanceId() view returns(uint256) +func (_SgxVerifier *SgxVerifierSession) NextInstanceId() (*big.Int, error) { + return _SgxVerifier.Contract.NextInstanceId(&_SgxVerifier.CallOpts) +} + +// NextInstanceId is a free data retrieval call binding the contract method 0xee45abb0. +// +// Solidity: function nextInstanceId() view returns(uint256) +func (_SgxVerifier *SgxVerifierCallerSession) NextInstanceId() (*big.Int, error) { + return _SgxVerifier.Contract.NextInstanceId(&_SgxVerifier.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_SgxVerifier *SgxVerifierCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SgxVerifier.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_SgxVerifier *SgxVerifierSession) Owner() (common.Address, error) { + return _SgxVerifier.Contract.Owner(&_SgxVerifier.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_SgxVerifier *SgxVerifierCallerSession) Owner() (common.Address, error) { + return _SgxVerifier.Contract.Owner(&_SgxVerifier.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_SgxVerifier *SgxVerifierCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _SgxVerifier.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_SgxVerifier *SgxVerifierSession) Paused() (bool, error) { + return _SgxVerifier.Contract.Paused(&_SgxVerifier.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_SgxVerifier *SgxVerifierCallerSession) Paused() (bool, error) { + return _SgxVerifier.Contract.Paused(&_SgxVerifier.CallOpts) +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_SgxVerifier *SgxVerifierCaller) PendingOwner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SgxVerifier.contract.Call(opts, &out, "pendingOwner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_SgxVerifier *SgxVerifierSession) PendingOwner() (common.Address, error) { + return _SgxVerifier.Contract.PendingOwner(&_SgxVerifier.CallOpts) +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_SgxVerifier *SgxVerifierCallerSession) PendingOwner() (common.Address, error) { + return _SgxVerifier.Contract.PendingOwner(&_SgxVerifier.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_SgxVerifier *SgxVerifierCaller) ProxiableUUID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SgxVerifier.contract.Call(opts, &out, "proxiableUUID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_SgxVerifier *SgxVerifierSession) ProxiableUUID() ([32]byte, error) { + return _SgxVerifier.Contract.ProxiableUUID(&_SgxVerifier.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_SgxVerifier *SgxVerifierCallerSession) ProxiableUUID() ([32]byte, error) { + return _SgxVerifier.Contract.ProxiableUUID(&_SgxVerifier.CallOpts) +} + +// Resolve is a free data retrieval call binding the contract method 0x3eb6b8cf. +// +// Solidity: function resolve(uint64 _chainId, bytes32 _name, bool _allowZeroAddress) view returns(address) +func (_SgxVerifier *SgxVerifierCaller) Resolve(opts *bind.CallOpts, _chainId uint64, _name [32]byte, _allowZeroAddress bool) (common.Address, error) { + var out []interface{} + err := _SgxVerifier.contract.Call(opts, &out, "resolve", _chainId, _name, _allowZeroAddress) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Resolve is a free data retrieval call binding the contract method 0x3eb6b8cf. +// +// Solidity: function resolve(uint64 _chainId, bytes32 _name, bool _allowZeroAddress) view returns(address) +func (_SgxVerifier *SgxVerifierSession) Resolve(_chainId uint64, _name [32]byte, _allowZeroAddress bool) (common.Address, error) { + return _SgxVerifier.Contract.Resolve(&_SgxVerifier.CallOpts, _chainId, _name, _allowZeroAddress) +} + +// Resolve is a free data retrieval call binding the contract method 0x3eb6b8cf. +// +// Solidity: function resolve(uint64 _chainId, bytes32 _name, bool _allowZeroAddress) view returns(address) +func (_SgxVerifier *SgxVerifierCallerSession) Resolve(_chainId uint64, _name [32]byte, _allowZeroAddress bool) (common.Address, error) { + return _SgxVerifier.Contract.Resolve(&_SgxVerifier.CallOpts, _chainId, _name, _allowZeroAddress) +} + +// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. +// +// Solidity: function resolve(bytes32 _name, bool _allowZeroAddress) view returns(address) +func (_SgxVerifier *SgxVerifierCaller) Resolve0(opts *bind.CallOpts, _name [32]byte, _allowZeroAddress bool) (common.Address, error) { + var out []interface{} + err := _SgxVerifier.contract.Call(opts, &out, "resolve0", _name, _allowZeroAddress) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. +// +// Solidity: function resolve(bytes32 _name, bool _allowZeroAddress) view returns(address) +func (_SgxVerifier *SgxVerifierSession) Resolve0(_name [32]byte, _allowZeroAddress bool) (common.Address, error) { + return _SgxVerifier.Contract.Resolve0(&_SgxVerifier.CallOpts, _name, _allowZeroAddress) +} + +// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. +// +// Solidity: function resolve(bytes32 _name, bool _allowZeroAddress) view returns(address) +func (_SgxVerifier *SgxVerifierCallerSession) Resolve0(_name [32]byte, _allowZeroAddress bool) (common.Address, error) { + return _SgxVerifier.Contract.Resolve0(&_SgxVerifier.CallOpts, _name, _allowZeroAddress) +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_SgxVerifier *SgxVerifierTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SgxVerifier.contract.Transact(opts, "acceptOwnership") +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_SgxVerifier *SgxVerifierSession) AcceptOwnership() (*types.Transaction, error) { + return _SgxVerifier.Contract.AcceptOwnership(&_SgxVerifier.TransactOpts) +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_SgxVerifier *SgxVerifierTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _SgxVerifier.Contract.AcceptOwnership(&_SgxVerifier.TransactOpts) +} + +// AddInstances is a paid mutator transaction binding the contract method 0x16107290. +// +// Solidity: function addInstances(address[] _instances) returns(uint256[]) +func (_SgxVerifier *SgxVerifierTransactor) AddInstances(opts *bind.TransactOpts, _instances []common.Address) (*types.Transaction, error) { + return _SgxVerifier.contract.Transact(opts, "addInstances", _instances) +} + +// AddInstances is a paid mutator transaction binding the contract method 0x16107290. +// +// Solidity: function addInstances(address[] _instances) returns(uint256[]) +func (_SgxVerifier *SgxVerifierSession) AddInstances(_instances []common.Address) (*types.Transaction, error) { + return _SgxVerifier.Contract.AddInstances(&_SgxVerifier.TransactOpts, _instances) +} + +// AddInstances is a paid mutator transaction binding the contract method 0x16107290. +// +// Solidity: function addInstances(address[] _instances) returns(uint256[]) +func (_SgxVerifier *SgxVerifierTransactorSession) AddInstances(_instances []common.Address) (*types.Transaction, error) { + return _SgxVerifier.Contract.AddInstances(&_SgxVerifier.TransactOpts, _instances) +} + +// DeleteInstances is a paid mutator transaction binding the contract method 0x4ef36a56. +// +// Solidity: function deleteInstances(uint256[] _ids) returns() +func (_SgxVerifier *SgxVerifierTransactor) DeleteInstances(opts *bind.TransactOpts, _ids []*big.Int) (*types.Transaction, error) { + return _SgxVerifier.contract.Transact(opts, "deleteInstances", _ids) +} + +// DeleteInstances is a paid mutator transaction binding the contract method 0x4ef36a56. +// +// Solidity: function deleteInstances(uint256[] _ids) returns() +func (_SgxVerifier *SgxVerifierSession) DeleteInstances(_ids []*big.Int) (*types.Transaction, error) { + return _SgxVerifier.Contract.DeleteInstances(&_SgxVerifier.TransactOpts, _ids) +} + +// DeleteInstances is a paid mutator transaction binding the contract method 0x4ef36a56. +// +// Solidity: function deleteInstances(uint256[] _ids) returns() +func (_SgxVerifier *SgxVerifierTransactorSession) DeleteInstances(_ids []*big.Int) (*types.Transaction, error) { + return _SgxVerifier.Contract.DeleteInstances(&_SgxVerifier.TransactOpts, _ids) +} + +// Init is a paid mutator transaction binding the contract method 0xf09a4016. +// +// Solidity: function init(address _owner, address _addressManager) returns() +func (_SgxVerifier *SgxVerifierTransactor) Init(opts *bind.TransactOpts, _owner common.Address, _addressManager common.Address) (*types.Transaction, error) { + return _SgxVerifier.contract.Transact(opts, "init", _owner, _addressManager) +} + +// Init is a paid mutator transaction binding the contract method 0xf09a4016. +// +// Solidity: function init(address _owner, address _addressManager) returns() +func (_SgxVerifier *SgxVerifierSession) Init(_owner common.Address, _addressManager common.Address) (*types.Transaction, error) { + return _SgxVerifier.Contract.Init(&_SgxVerifier.TransactOpts, _owner, _addressManager) +} + +// Init is a paid mutator transaction binding the contract method 0xf09a4016. +// +// Solidity: function init(address _owner, address _addressManager) returns() +func (_SgxVerifier *SgxVerifierTransactorSession) Init(_owner common.Address, _addressManager common.Address) (*types.Transaction, error) { + return _SgxVerifier.Contract.Init(&_SgxVerifier.TransactOpts, _owner, _addressManager) +} + +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_SgxVerifier *SgxVerifierTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SgxVerifier.contract.Transact(opts, "pause") +} + +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_SgxVerifier *SgxVerifierSession) Pause() (*types.Transaction, error) { + return _SgxVerifier.Contract.Pause(&_SgxVerifier.TransactOpts) +} + +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_SgxVerifier *SgxVerifierTransactorSession) Pause() (*types.Transaction, error) { + return _SgxVerifier.Contract.Pause(&_SgxVerifier.TransactOpts) +} + +// RegisterInstance is a paid mutator transaction binding the contract method 0xa91951a2. +// +// Solidity: function registerInstance(((bytes2,bytes2,bytes4,bytes2,bytes2,bytes16,bytes20),(bytes16,bytes4,bytes28,bytes16,bytes32,bytes32,bytes32,bytes,uint16,uint16,bytes,bytes),(bytes,bytes,(bytes16,bytes4,bytes28,bytes16,bytes32,bytes32,bytes32,bytes,uint16,uint16,bytes,bytes),bytes,(uint16,bytes),(uint16,uint32,bytes[3]))) _attestation) returns(uint256) +func (_SgxVerifier *SgxVerifierTransactor) RegisterInstance(opts *bind.TransactOpts, _attestation V3StructParsedV3QuoteStruct) (*types.Transaction, error) { + return _SgxVerifier.contract.Transact(opts, "registerInstance", _attestation) +} + +// RegisterInstance is a paid mutator transaction binding the contract method 0xa91951a2. +// +// Solidity: function registerInstance(((bytes2,bytes2,bytes4,bytes2,bytes2,bytes16,bytes20),(bytes16,bytes4,bytes28,bytes16,bytes32,bytes32,bytes32,bytes,uint16,uint16,bytes,bytes),(bytes,bytes,(bytes16,bytes4,bytes28,bytes16,bytes32,bytes32,bytes32,bytes,uint16,uint16,bytes,bytes),bytes,(uint16,bytes),(uint16,uint32,bytes[3]))) _attestation) returns(uint256) +func (_SgxVerifier *SgxVerifierSession) RegisterInstance(_attestation V3StructParsedV3QuoteStruct) (*types.Transaction, error) { + return _SgxVerifier.Contract.RegisterInstance(&_SgxVerifier.TransactOpts, _attestation) +} + +// RegisterInstance is a paid mutator transaction binding the contract method 0xa91951a2. +// +// Solidity: function registerInstance(((bytes2,bytes2,bytes4,bytes2,bytes2,bytes16,bytes20),(bytes16,bytes4,bytes28,bytes16,bytes32,bytes32,bytes32,bytes,uint16,uint16,bytes,bytes),(bytes,bytes,(bytes16,bytes4,bytes28,bytes16,bytes32,bytes32,bytes32,bytes,uint16,uint16,bytes,bytes),bytes,(uint16,bytes),(uint16,uint32,bytes[3]))) _attestation) returns(uint256) +func (_SgxVerifier *SgxVerifierTransactorSession) RegisterInstance(_attestation V3StructParsedV3QuoteStruct) (*types.Transaction, error) { + return _SgxVerifier.Contract.RegisterInstance(&_SgxVerifier.TransactOpts, _attestation) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_SgxVerifier *SgxVerifierTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SgxVerifier.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_SgxVerifier *SgxVerifierSession) RenounceOwnership() (*types.Transaction, error) { + return _SgxVerifier.Contract.RenounceOwnership(&_SgxVerifier.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_SgxVerifier *SgxVerifierTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _SgxVerifier.Contract.RenounceOwnership(&_SgxVerifier.TransactOpts) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_SgxVerifier *SgxVerifierTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _SgxVerifier.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_SgxVerifier *SgxVerifierSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _SgxVerifier.Contract.TransferOwnership(&_SgxVerifier.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_SgxVerifier *SgxVerifierTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _SgxVerifier.Contract.TransferOwnership(&_SgxVerifier.TransactOpts, newOwner) +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_SgxVerifier *SgxVerifierTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SgxVerifier.contract.Transact(opts, "unpause") +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_SgxVerifier *SgxVerifierSession) Unpause() (*types.Transaction, error) { + return _SgxVerifier.Contract.Unpause(&_SgxVerifier.TransactOpts) +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_SgxVerifier *SgxVerifierTransactorSession) Unpause() (*types.Transaction, error) { + return _SgxVerifier.Contract.Unpause(&_SgxVerifier.TransactOpts) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_SgxVerifier *SgxVerifierTransactor) UpgradeTo(opts *bind.TransactOpts, newImplementation common.Address) (*types.Transaction, error) { + return _SgxVerifier.contract.Transact(opts, "upgradeTo", newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_SgxVerifier *SgxVerifierSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _SgxVerifier.Contract.UpgradeTo(&_SgxVerifier.TransactOpts, newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_SgxVerifier *SgxVerifierTransactorSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _SgxVerifier.Contract.UpgradeTo(&_SgxVerifier.TransactOpts, newImplementation) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_SgxVerifier *SgxVerifierTransactor) UpgradeToAndCall(opts *bind.TransactOpts, newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _SgxVerifier.contract.Transact(opts, "upgradeToAndCall", newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_SgxVerifier *SgxVerifierSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _SgxVerifier.Contract.UpgradeToAndCall(&_SgxVerifier.TransactOpts, newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_SgxVerifier *SgxVerifierTransactorSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _SgxVerifier.Contract.UpgradeToAndCall(&_SgxVerifier.TransactOpts, newImplementation, data) +} + +// VerifyProof is a paid mutator transaction binding the contract method 0x21e89968. +// +// Solidity: function verifyProof((bytes32,bytes32,address,uint64,bool,bool,address) _ctx, (bytes32,bytes32,bytes32,bytes32) _tran, (uint16,bytes) _proof) returns() +func (_SgxVerifier *SgxVerifierTransactor) VerifyProof(opts *bind.TransactOpts, _ctx IVerifierContext, _tran TaikoDataTransition, _proof TaikoDataTierProof) (*types.Transaction, error) { + return _SgxVerifier.contract.Transact(opts, "verifyProof", _ctx, _tran, _proof) +} + +// VerifyProof is a paid mutator transaction binding the contract method 0x21e89968. +// +// Solidity: function verifyProof((bytes32,bytes32,address,uint64,bool,bool,address) _ctx, (bytes32,bytes32,bytes32,bytes32) _tran, (uint16,bytes) _proof) returns() +func (_SgxVerifier *SgxVerifierSession) VerifyProof(_ctx IVerifierContext, _tran TaikoDataTransition, _proof TaikoDataTierProof) (*types.Transaction, error) { + return _SgxVerifier.Contract.VerifyProof(&_SgxVerifier.TransactOpts, _ctx, _tran, _proof) +} + +// VerifyProof is a paid mutator transaction binding the contract method 0x21e89968. +// +// Solidity: function verifyProof((bytes32,bytes32,address,uint64,bool,bool,address) _ctx, (bytes32,bytes32,bytes32,bytes32) _tran, (uint16,bytes) _proof) returns() +func (_SgxVerifier *SgxVerifierTransactorSession) VerifyProof(_ctx IVerifierContext, _tran TaikoDataTransition, _proof TaikoDataTierProof) (*types.Transaction, error) { + return _SgxVerifier.Contract.VerifyProof(&_SgxVerifier.TransactOpts, _ctx, _tran, _proof) +} + +// SgxVerifierAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the SgxVerifier contract. +type SgxVerifierAdminChangedIterator struct { + Event *SgxVerifierAdminChanged // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SgxVerifierAdminChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SgxVerifierAdminChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SgxVerifierAdminChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SgxVerifierAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SgxVerifierAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SgxVerifierAdminChanged represents a AdminChanged event raised by the SgxVerifier contract. +type SgxVerifierAdminChanged struct { + PreviousAdmin common.Address + NewAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_SgxVerifier *SgxVerifierFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*SgxVerifierAdminChangedIterator, error) { + + logs, sub, err := _SgxVerifier.contract.FilterLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return &SgxVerifierAdminChangedIterator{contract: _SgxVerifier.contract, event: "AdminChanged", logs: logs, sub: sub}, nil +} + +// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_SgxVerifier *SgxVerifierFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *SgxVerifierAdminChanged) (event.Subscription, error) { + + logs, sub, err := _SgxVerifier.contract.WatchLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SgxVerifierAdminChanged) + if err := _SgxVerifier.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_SgxVerifier *SgxVerifierFilterer) ParseAdminChanged(log types.Log) (*SgxVerifierAdminChanged, error) { + event := new(SgxVerifierAdminChanged) + if err := _SgxVerifier.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SgxVerifierBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the SgxVerifier contract. +type SgxVerifierBeaconUpgradedIterator struct { + Event *SgxVerifierBeaconUpgraded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SgxVerifierBeaconUpgradedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SgxVerifierBeaconUpgraded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SgxVerifierBeaconUpgraded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SgxVerifierBeaconUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SgxVerifierBeaconUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SgxVerifierBeaconUpgraded represents a BeaconUpgraded event raised by the SgxVerifier contract. +type SgxVerifierBeaconUpgraded struct { + Beacon common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_SgxVerifier *SgxVerifierFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*SgxVerifierBeaconUpgradedIterator, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _SgxVerifier.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return &SgxVerifierBeaconUpgradedIterator{contract: _SgxVerifier.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil +} + +// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_SgxVerifier *SgxVerifierFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *SgxVerifierBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _SgxVerifier.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SgxVerifierBeaconUpgraded) + if err := _SgxVerifier.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_SgxVerifier *SgxVerifierFilterer) ParseBeaconUpgraded(log types.Log) (*SgxVerifierBeaconUpgraded, error) { + event := new(SgxVerifierBeaconUpgraded) + if err := _SgxVerifier.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SgxVerifierInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the SgxVerifier contract. +type SgxVerifierInitializedIterator struct { + Event *SgxVerifierInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SgxVerifierInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SgxVerifierInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SgxVerifierInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SgxVerifierInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SgxVerifierInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SgxVerifierInitialized represents a Initialized event raised by the SgxVerifier contract. +type SgxVerifierInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_SgxVerifier *SgxVerifierFilterer) FilterInitialized(opts *bind.FilterOpts) (*SgxVerifierInitializedIterator, error) { + + logs, sub, err := _SgxVerifier.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &SgxVerifierInitializedIterator{contract: _SgxVerifier.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_SgxVerifier *SgxVerifierFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *SgxVerifierInitialized) (event.Subscription, error) { + + logs, sub, err := _SgxVerifier.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SgxVerifierInitialized) + if err := _SgxVerifier.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_SgxVerifier *SgxVerifierFilterer) ParseInitialized(log types.Log) (*SgxVerifierInitialized, error) { + event := new(SgxVerifierInitialized) + if err := _SgxVerifier.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SgxVerifierInstanceAddedIterator is returned from FilterInstanceAdded and is used to iterate over the raw logs and unpacked data for InstanceAdded events raised by the SgxVerifier contract. +type SgxVerifierInstanceAddedIterator struct { + Event *SgxVerifierInstanceAdded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SgxVerifierInstanceAddedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SgxVerifierInstanceAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SgxVerifierInstanceAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SgxVerifierInstanceAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SgxVerifierInstanceAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SgxVerifierInstanceAdded represents a InstanceAdded event raised by the SgxVerifier contract. +type SgxVerifierInstanceAdded struct { + Id *big.Int + Instance common.Address + Replaced common.Address + ValidSince *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInstanceAdded is a free log retrieval operation binding the contract event 0xbbe529d240965181270c1e2e32a80761e8807dda1ee9765e326178bd6804a9cb. +// +// Solidity: event InstanceAdded(uint256 indexed id, address indexed instance, address replaced, uint256 validSince) +func (_SgxVerifier *SgxVerifierFilterer) FilterInstanceAdded(opts *bind.FilterOpts, id []*big.Int, instance []common.Address) (*SgxVerifierInstanceAddedIterator, error) { + + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) + } + var instanceRule []interface{} + for _, instanceItem := range instance { + instanceRule = append(instanceRule, instanceItem) + } + + logs, sub, err := _SgxVerifier.contract.FilterLogs(opts, "InstanceAdded", idRule, instanceRule) + if err != nil { + return nil, err + } + return &SgxVerifierInstanceAddedIterator{contract: _SgxVerifier.contract, event: "InstanceAdded", logs: logs, sub: sub}, nil +} + +// WatchInstanceAdded is a free log subscription operation binding the contract event 0xbbe529d240965181270c1e2e32a80761e8807dda1ee9765e326178bd6804a9cb. +// +// Solidity: event InstanceAdded(uint256 indexed id, address indexed instance, address replaced, uint256 validSince) +func (_SgxVerifier *SgxVerifierFilterer) WatchInstanceAdded(opts *bind.WatchOpts, sink chan<- *SgxVerifierInstanceAdded, id []*big.Int, instance []common.Address) (event.Subscription, error) { + + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) + } + var instanceRule []interface{} + for _, instanceItem := range instance { + instanceRule = append(instanceRule, instanceItem) + } + + logs, sub, err := _SgxVerifier.contract.WatchLogs(opts, "InstanceAdded", idRule, instanceRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SgxVerifierInstanceAdded) + if err := _SgxVerifier.contract.UnpackLog(event, "InstanceAdded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInstanceAdded is a log parse operation binding the contract event 0xbbe529d240965181270c1e2e32a80761e8807dda1ee9765e326178bd6804a9cb. +// +// Solidity: event InstanceAdded(uint256 indexed id, address indexed instance, address replaced, uint256 validSince) +func (_SgxVerifier *SgxVerifierFilterer) ParseInstanceAdded(log types.Log) (*SgxVerifierInstanceAdded, error) { + event := new(SgxVerifierInstanceAdded) + if err := _SgxVerifier.contract.UnpackLog(event, "InstanceAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SgxVerifierInstanceDeletedIterator is returned from FilterInstanceDeleted and is used to iterate over the raw logs and unpacked data for InstanceDeleted events raised by the SgxVerifier contract. +type SgxVerifierInstanceDeletedIterator struct { + Event *SgxVerifierInstanceDeleted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SgxVerifierInstanceDeletedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SgxVerifierInstanceDeleted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SgxVerifierInstanceDeleted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SgxVerifierInstanceDeletedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SgxVerifierInstanceDeletedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SgxVerifierInstanceDeleted represents a InstanceDeleted event raised by the SgxVerifier contract. +type SgxVerifierInstanceDeleted struct { + Id *big.Int + Instance common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInstanceDeleted is a free log retrieval operation binding the contract event 0x89d0dca869ffe08b709ca9ff5adfd5ee8d9de2750d0561e15df614c7a2596d8e. +// +// Solidity: event InstanceDeleted(uint256 indexed id, address indexed instance) +func (_SgxVerifier *SgxVerifierFilterer) FilterInstanceDeleted(opts *bind.FilterOpts, id []*big.Int, instance []common.Address) (*SgxVerifierInstanceDeletedIterator, error) { + + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) + } + var instanceRule []interface{} + for _, instanceItem := range instance { + instanceRule = append(instanceRule, instanceItem) + } + + logs, sub, err := _SgxVerifier.contract.FilterLogs(opts, "InstanceDeleted", idRule, instanceRule) + if err != nil { + return nil, err + } + return &SgxVerifierInstanceDeletedIterator{contract: _SgxVerifier.contract, event: "InstanceDeleted", logs: logs, sub: sub}, nil +} + +// WatchInstanceDeleted is a free log subscription operation binding the contract event 0x89d0dca869ffe08b709ca9ff5adfd5ee8d9de2750d0561e15df614c7a2596d8e. +// +// Solidity: event InstanceDeleted(uint256 indexed id, address indexed instance) +func (_SgxVerifier *SgxVerifierFilterer) WatchInstanceDeleted(opts *bind.WatchOpts, sink chan<- *SgxVerifierInstanceDeleted, id []*big.Int, instance []common.Address) (event.Subscription, error) { + + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) + } + var instanceRule []interface{} + for _, instanceItem := range instance { + instanceRule = append(instanceRule, instanceItem) + } + + logs, sub, err := _SgxVerifier.contract.WatchLogs(opts, "InstanceDeleted", idRule, instanceRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SgxVerifierInstanceDeleted) + if err := _SgxVerifier.contract.UnpackLog(event, "InstanceDeleted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInstanceDeleted is a log parse operation binding the contract event 0x89d0dca869ffe08b709ca9ff5adfd5ee8d9de2750d0561e15df614c7a2596d8e. +// +// Solidity: event InstanceDeleted(uint256 indexed id, address indexed instance) +func (_SgxVerifier *SgxVerifierFilterer) ParseInstanceDeleted(log types.Log) (*SgxVerifierInstanceDeleted, error) { + event := new(SgxVerifierInstanceDeleted) + if err := _SgxVerifier.contract.UnpackLog(event, "InstanceDeleted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SgxVerifierOwnershipTransferStartedIterator is returned from FilterOwnershipTransferStarted and is used to iterate over the raw logs and unpacked data for OwnershipTransferStarted events raised by the SgxVerifier contract. +type SgxVerifierOwnershipTransferStartedIterator struct { + Event *SgxVerifierOwnershipTransferStarted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SgxVerifierOwnershipTransferStartedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SgxVerifierOwnershipTransferStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SgxVerifierOwnershipTransferStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SgxVerifierOwnershipTransferStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SgxVerifierOwnershipTransferStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SgxVerifierOwnershipTransferStarted represents a OwnershipTransferStarted event raised by the SgxVerifier contract. +type SgxVerifierOwnershipTransferStarted struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferStarted is a free log retrieval operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_SgxVerifier *SgxVerifierFilterer) FilterOwnershipTransferStarted(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*SgxVerifierOwnershipTransferStartedIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _SgxVerifier.contract.FilterLogs(opts, "OwnershipTransferStarted", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &SgxVerifierOwnershipTransferStartedIterator{contract: _SgxVerifier.contract, event: "OwnershipTransferStarted", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferStarted is a free log subscription operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_SgxVerifier *SgxVerifierFilterer) WatchOwnershipTransferStarted(opts *bind.WatchOpts, sink chan<- *SgxVerifierOwnershipTransferStarted, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _SgxVerifier.contract.WatchLogs(opts, "OwnershipTransferStarted", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SgxVerifierOwnershipTransferStarted) + if err := _SgxVerifier.contract.UnpackLog(event, "OwnershipTransferStarted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferStarted is a log parse operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_SgxVerifier *SgxVerifierFilterer) ParseOwnershipTransferStarted(log types.Log) (*SgxVerifierOwnershipTransferStarted, error) { + event := new(SgxVerifierOwnershipTransferStarted) + if err := _SgxVerifier.contract.UnpackLog(event, "OwnershipTransferStarted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SgxVerifierOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the SgxVerifier contract. +type SgxVerifierOwnershipTransferredIterator struct { + Event *SgxVerifierOwnershipTransferred // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SgxVerifierOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SgxVerifierOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SgxVerifierOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SgxVerifierOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SgxVerifierOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SgxVerifierOwnershipTransferred represents a OwnershipTransferred event raised by the SgxVerifier contract. +type SgxVerifierOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_SgxVerifier *SgxVerifierFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*SgxVerifierOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _SgxVerifier.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &SgxVerifierOwnershipTransferredIterator{contract: _SgxVerifier.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_SgxVerifier *SgxVerifierFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *SgxVerifierOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _SgxVerifier.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SgxVerifierOwnershipTransferred) + if err := _SgxVerifier.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_SgxVerifier *SgxVerifierFilterer) ParseOwnershipTransferred(log types.Log) (*SgxVerifierOwnershipTransferred, error) { + event := new(SgxVerifierOwnershipTransferred) + if err := _SgxVerifier.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SgxVerifierPausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the SgxVerifier contract. +type SgxVerifierPausedIterator struct { + Event *SgxVerifierPaused // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SgxVerifierPausedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SgxVerifierPaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SgxVerifierPaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SgxVerifierPausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SgxVerifierPausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SgxVerifierPaused represents a Paused event raised by the SgxVerifier contract. +type SgxVerifierPaused struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPaused is a free log retrieval operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. +// +// Solidity: event Paused(address account) +func (_SgxVerifier *SgxVerifierFilterer) FilterPaused(opts *bind.FilterOpts) (*SgxVerifierPausedIterator, error) { + + logs, sub, err := _SgxVerifier.contract.FilterLogs(opts, "Paused") + if err != nil { + return nil, err + } + return &SgxVerifierPausedIterator{contract: _SgxVerifier.contract, event: "Paused", logs: logs, sub: sub}, nil +} + +// WatchPaused is a free log subscription operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. +// +// Solidity: event Paused(address account) +func (_SgxVerifier *SgxVerifierFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *SgxVerifierPaused) (event.Subscription, error) { + + logs, sub, err := _SgxVerifier.contract.WatchLogs(opts, "Paused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SgxVerifierPaused) + if err := _SgxVerifier.contract.UnpackLog(event, "Paused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParsePaused is a log parse operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. +// +// Solidity: event Paused(address account) +func (_SgxVerifier *SgxVerifierFilterer) ParsePaused(log types.Log) (*SgxVerifierPaused, error) { + event := new(SgxVerifierPaused) + if err := _SgxVerifier.contract.UnpackLog(event, "Paused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SgxVerifierUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the SgxVerifier contract. +type SgxVerifierUnpausedIterator struct { + Event *SgxVerifierUnpaused // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SgxVerifierUnpausedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SgxVerifierUnpaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SgxVerifierUnpaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SgxVerifierUnpausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SgxVerifierUnpausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SgxVerifierUnpaused represents a Unpaused event raised by the SgxVerifier contract. +type SgxVerifierUnpaused struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnpaused is a free log retrieval operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. +// +// Solidity: event Unpaused(address account) +func (_SgxVerifier *SgxVerifierFilterer) FilterUnpaused(opts *bind.FilterOpts) (*SgxVerifierUnpausedIterator, error) { + + logs, sub, err := _SgxVerifier.contract.FilterLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return &SgxVerifierUnpausedIterator{contract: _SgxVerifier.contract, event: "Unpaused", logs: logs, sub: sub}, nil +} + +// WatchUnpaused is a free log subscription operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. +// +// Solidity: event Unpaused(address account) +func (_SgxVerifier *SgxVerifierFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *SgxVerifierUnpaused) (event.Subscription, error) { + + logs, sub, err := _SgxVerifier.contract.WatchLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SgxVerifierUnpaused) + if err := _SgxVerifier.contract.UnpackLog(event, "Unpaused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUnpaused is a log parse operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. +// +// Solidity: event Unpaused(address account) +func (_SgxVerifier *SgxVerifierFilterer) ParseUnpaused(log types.Log) (*SgxVerifierUnpaused, error) { + event := new(SgxVerifierUnpaused) + if err := _SgxVerifier.contract.UnpackLog(event, "Unpaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SgxVerifierUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the SgxVerifier contract. +type SgxVerifierUpgradedIterator struct { + Event *SgxVerifierUpgraded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SgxVerifierUpgradedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SgxVerifierUpgraded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SgxVerifierUpgraded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SgxVerifierUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SgxVerifierUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SgxVerifierUpgraded represents a Upgraded event raised by the SgxVerifier contract. +type SgxVerifierUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_SgxVerifier *SgxVerifierFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*SgxVerifierUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _SgxVerifier.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &SgxVerifierUpgradedIterator{contract: _SgxVerifier.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_SgxVerifier *SgxVerifierFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *SgxVerifierUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _SgxVerifier.contract.WatchLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SgxVerifierUpgraded) + if err := _SgxVerifier.contract.UnpackLog(event, "Upgraded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_SgxVerifier *SgxVerifierFilterer) ParseUpgraded(log types.Log) (*SgxVerifierUpgraded, error) { + event := new(SgxVerifierUpgraded) + if err := _SgxVerifier.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/packages/eventindexer/contracts/taikotoken/TaikoToken.go b/packages/eventindexer/contracts/taikotoken/TaikoToken.go new file mode 100644 index 0000000000..c1869d58f0 --- /dev/null +++ b/packages/eventindexer/contracts/taikotoken/TaikoToken.go @@ -0,0 +1,3455 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package taikotoken + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// ERC20VotesUpgradeableCheckpoint is an auto generated low-level Go binding around an user-defined struct. +type ERC20VotesUpgradeableCheckpoint struct { + FromBlock uint32 + Votes *big.Int +} + +// TaikoTokenMetaData contains all meta data concerning the TaikoToken contract. +var TaikoTokenMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"CLOCK_MODE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"addressManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"allowance\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"approve\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"balanceOf\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"balanceOfAt\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"snapshotId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"burn\",\"inputs\":[{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"checkpoints\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"pos\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structERC20VotesUpgradeable.Checkpoint\",\"components\":[{\"name\":\"fromBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"votes\",\"type\":\"uint224\",\"internalType\":\"uint224\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"clock\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decreaseAllowance\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"subtractedValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegate\",\"inputs\":[{\"name\":\"delegatee\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegateBySig\",\"inputs\":[{\"name\":\"delegatee\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"v\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegates\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eip712Domain\",\"inputs\":[],\"outputs\":[{\"name\":\"fields\",\"type\":\"bytes1\",\"internalType\":\"bytes1\"},{\"name\":\"name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"extensions\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPastTotalSupply\",\"inputs\":[{\"name\":\"timepoint\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPastVotes\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"timepoint\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getVotes\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"increaseAllowance\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"addedValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"init\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_symbol\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_addressManager\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lastUnpausedAt\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"name\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonces\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"numCheckpoints\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pendingOwner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"permit\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"deadline\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"v\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resolve\",\"inputs\":[{\"name\":\"_chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_name\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_allowZeroAddress\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"resolve\",\"inputs\":[{\"name\":\"_name\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_allowZeroAddress\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"snapshot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"symbol\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalSupply\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalSupplyAt\",\"inputs\":[{\"name\":\"snapshotId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFrom\",\"inputs\":[{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeTo\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"AdminChanged\",\"inputs\":[{\"name\":\"previousAdmin\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"newAdmin\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Approval\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BeaconUpgraded\",\"inputs\":[{\"name\":\"beacon\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegateChanged\",\"inputs\":[{\"name\":\"delegator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"fromDelegate\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"toDelegate\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegateVotesChanged\",\"inputs\":[{\"name\":\"delegate\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"previousBalance\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newBalance\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EIP712DomainChanged\",\"inputs\":[],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferStarted\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Snapshot\",\"inputs\":[{\"name\":\"id\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transfer\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"INVALID_PAUSE_STATUS\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"REENTRANT_CALL\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RESOLVER_DENIED\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RESOLVER_INVALID_MANAGER\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RESOLVER_UNEXPECTED_CHAINID\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RESOLVER_ZERO_ADDR\",\"inputs\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"name\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"TKO_INVALID_ADDR\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ZERO_ADDR_MANAGER\",\"inputs\":[]}]", +} + +// TaikoTokenABI is the input ABI used to generate the binding from. +// Deprecated: Use TaikoTokenMetaData.ABI instead. +var TaikoTokenABI = TaikoTokenMetaData.ABI + +// TaikoToken is an auto generated Go binding around an Ethereum contract. +type TaikoToken struct { + TaikoTokenCaller // Read-only binding to the contract + TaikoTokenTransactor // Write-only binding to the contract + TaikoTokenFilterer // Log filterer for contract events +} + +// TaikoTokenCaller is an auto generated read-only Go binding around an Ethereum contract. +type TaikoTokenCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TaikoTokenTransactor is an auto generated write-only Go binding around an Ethereum contract. +type TaikoTokenTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TaikoTokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type TaikoTokenFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TaikoTokenSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type TaikoTokenSession struct { + Contract *TaikoToken // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TaikoTokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type TaikoTokenCallerSession struct { + Contract *TaikoTokenCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// TaikoTokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type TaikoTokenTransactorSession struct { + Contract *TaikoTokenTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TaikoTokenRaw is an auto generated low-level Go binding around an Ethereum contract. +type TaikoTokenRaw struct { + Contract *TaikoToken // Generic contract binding to access the raw methods on +} + +// TaikoTokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type TaikoTokenCallerRaw struct { + Contract *TaikoTokenCaller // Generic read-only contract binding to access the raw methods on +} + +// TaikoTokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type TaikoTokenTransactorRaw struct { + Contract *TaikoTokenTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewTaikoToken creates a new instance of TaikoToken, bound to a specific deployed contract. +func NewTaikoToken(address common.Address, backend bind.ContractBackend) (*TaikoToken, error) { + contract, err := bindTaikoToken(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &TaikoToken{TaikoTokenCaller: TaikoTokenCaller{contract: contract}, TaikoTokenTransactor: TaikoTokenTransactor{contract: contract}, TaikoTokenFilterer: TaikoTokenFilterer{contract: contract}}, nil +} + +// NewTaikoTokenCaller creates a new read-only instance of TaikoToken, bound to a specific deployed contract. +func NewTaikoTokenCaller(address common.Address, caller bind.ContractCaller) (*TaikoTokenCaller, error) { + contract, err := bindTaikoToken(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TaikoTokenCaller{contract: contract}, nil +} + +// NewTaikoTokenTransactor creates a new write-only instance of TaikoToken, bound to a specific deployed contract. +func NewTaikoTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*TaikoTokenTransactor, error) { + contract, err := bindTaikoToken(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TaikoTokenTransactor{contract: contract}, nil +} + +// NewTaikoTokenFilterer creates a new log filterer instance of TaikoToken, bound to a specific deployed contract. +func NewTaikoTokenFilterer(address common.Address, filterer bind.ContractFilterer) (*TaikoTokenFilterer, error) { + contract, err := bindTaikoToken(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TaikoTokenFilterer{contract: contract}, nil +} + +// bindTaikoToken binds a generic wrapper to an already deployed contract. +func bindTaikoToken(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := TaikoTokenMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_TaikoToken *TaikoTokenRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TaikoToken.Contract.TaikoTokenCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_TaikoToken *TaikoTokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoToken.Contract.TaikoTokenTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TaikoToken *TaikoTokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TaikoToken.Contract.TaikoTokenTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_TaikoToken *TaikoTokenCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TaikoToken.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_TaikoToken *TaikoTokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoToken.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TaikoToken *TaikoTokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TaikoToken.Contract.contract.Transact(opts, method, params...) +} + +// CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. +// +// Solidity: function CLOCK_MODE() view returns(string) +func (_TaikoToken *TaikoTokenCaller) CLOCKMODE(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "CLOCK_MODE") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. +// +// Solidity: function CLOCK_MODE() view returns(string) +func (_TaikoToken *TaikoTokenSession) CLOCKMODE() (string, error) { + return _TaikoToken.Contract.CLOCKMODE(&_TaikoToken.CallOpts) +} + +// CLOCKMODE is a free data retrieval call binding the contract method 0x4bf5d7e9. +// +// Solidity: function CLOCK_MODE() view returns(string) +func (_TaikoToken *TaikoTokenCallerSession) CLOCKMODE() (string, error) { + return _TaikoToken.Contract.CLOCKMODE(&_TaikoToken.CallOpts) +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_TaikoToken *TaikoTokenCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "DOMAIN_SEPARATOR") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_TaikoToken *TaikoTokenSession) DOMAINSEPARATOR() ([32]byte, error) { + return _TaikoToken.Contract.DOMAINSEPARATOR(&_TaikoToken.CallOpts) +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_TaikoToken *TaikoTokenCallerSession) DOMAINSEPARATOR() ([32]byte, error) { + return _TaikoToken.Contract.DOMAINSEPARATOR(&_TaikoToken.CallOpts) +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_TaikoToken *TaikoTokenCaller) AddressManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "addressManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_TaikoToken *TaikoTokenSession) AddressManager() (common.Address, error) { + return _TaikoToken.Contract.AddressManager(&_TaikoToken.CallOpts) +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_TaikoToken *TaikoTokenCallerSession) AddressManager() (common.Address, error) { + return _TaikoToken.Contract.AddressManager(&_TaikoToken.CallOpts) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "allowance", owner, spender) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _TaikoToken.Contract.Allowance(&_TaikoToken.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _TaikoToken.Contract.Allowance(&_TaikoToken.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "balanceOf", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) BalanceOf(account common.Address) (*big.Int, error) { + return _TaikoToken.Contract.BalanceOf(&_TaikoToken.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _TaikoToken.Contract.BalanceOf(&_TaikoToken.CallOpts, account) +} + +// BalanceOfAt is a free data retrieval call binding the contract method 0x4ee2cd7e. +// +// Solidity: function balanceOfAt(address account, uint256 snapshotId) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) BalanceOfAt(opts *bind.CallOpts, account common.Address, snapshotId *big.Int) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "balanceOfAt", account, snapshotId) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOfAt is a free data retrieval call binding the contract method 0x4ee2cd7e. +// +// Solidity: function balanceOfAt(address account, uint256 snapshotId) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) BalanceOfAt(account common.Address, snapshotId *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.BalanceOfAt(&_TaikoToken.CallOpts, account, snapshotId) +} + +// BalanceOfAt is a free data retrieval call binding the contract method 0x4ee2cd7e. +// +// Solidity: function balanceOfAt(address account, uint256 snapshotId) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) BalanceOfAt(account common.Address, snapshotId *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.BalanceOfAt(&_TaikoToken.CallOpts, account, snapshotId) +} + +// Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. +// +// Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) +func (_TaikoToken *TaikoTokenCaller) Checkpoints(opts *bind.CallOpts, account common.Address, pos uint32) (ERC20VotesUpgradeableCheckpoint, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "checkpoints", account, pos) + + if err != nil { + return *new(ERC20VotesUpgradeableCheckpoint), err + } + + out0 := *abi.ConvertType(out[0], new(ERC20VotesUpgradeableCheckpoint)).(*ERC20VotesUpgradeableCheckpoint) + + return out0, err + +} + +// Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. +// +// Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) +func (_TaikoToken *TaikoTokenSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesUpgradeableCheckpoint, error) { + return _TaikoToken.Contract.Checkpoints(&_TaikoToken.CallOpts, account, pos) +} + +// Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. +// +// Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) +func (_TaikoToken *TaikoTokenCallerSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesUpgradeableCheckpoint, error) { + return _TaikoToken.Contract.Checkpoints(&_TaikoToken.CallOpts, account, pos) +} + +// Clock is a free data retrieval call binding the contract method 0x91ddadf4. +// +// Solidity: function clock() view returns(uint48) +func (_TaikoToken *TaikoTokenCaller) Clock(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "clock") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Clock is a free data retrieval call binding the contract method 0x91ddadf4. +// +// Solidity: function clock() view returns(uint48) +func (_TaikoToken *TaikoTokenSession) Clock() (*big.Int, error) { + return _TaikoToken.Contract.Clock(&_TaikoToken.CallOpts) +} + +// Clock is a free data retrieval call binding the contract method 0x91ddadf4. +// +// Solidity: function clock() view returns(uint48) +func (_TaikoToken *TaikoTokenCallerSession) Clock() (*big.Int, error) { + return _TaikoToken.Contract.Clock(&_TaikoToken.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_TaikoToken *TaikoTokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_TaikoToken *TaikoTokenSession) Decimals() (uint8, error) { + return _TaikoToken.Contract.Decimals(&_TaikoToken.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_TaikoToken *TaikoTokenCallerSession) Decimals() (uint8, error) { + return _TaikoToken.Contract.Decimals(&_TaikoToken.CallOpts) +} + +// Delegates is a free data retrieval call binding the contract method 0x587cde1e. +// +// Solidity: function delegates(address account) view returns(address) +func (_TaikoToken *TaikoTokenCaller) Delegates(opts *bind.CallOpts, account common.Address) (common.Address, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "delegates", account) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Delegates is a free data retrieval call binding the contract method 0x587cde1e. +// +// Solidity: function delegates(address account) view returns(address) +func (_TaikoToken *TaikoTokenSession) Delegates(account common.Address) (common.Address, error) { + return _TaikoToken.Contract.Delegates(&_TaikoToken.CallOpts, account) +} + +// Delegates is a free data retrieval call binding the contract method 0x587cde1e. +// +// Solidity: function delegates(address account) view returns(address) +func (_TaikoToken *TaikoTokenCallerSession) Delegates(account common.Address) (common.Address, error) { + return _TaikoToken.Contract.Delegates(&_TaikoToken.CallOpts, account) +} + +// Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. +// +// Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) +func (_TaikoToken *TaikoTokenCaller) Eip712Domain(opts *bind.CallOpts) (struct { + Fields [1]byte + Name string + Version string + ChainId *big.Int + VerifyingContract common.Address + Salt [32]byte + Extensions []*big.Int +}, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "eip712Domain") + + outstruct := new(struct { + Fields [1]byte + Name string + Version string + ChainId *big.Int + VerifyingContract common.Address + Salt [32]byte + Extensions []*big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Fields = *abi.ConvertType(out[0], new([1]byte)).(*[1]byte) + outstruct.Name = *abi.ConvertType(out[1], new(string)).(*string) + outstruct.Version = *abi.ConvertType(out[2], new(string)).(*string) + outstruct.ChainId = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.VerifyingContract = *abi.ConvertType(out[4], new(common.Address)).(*common.Address) + outstruct.Salt = *abi.ConvertType(out[5], new([32]byte)).(*[32]byte) + outstruct.Extensions = *abi.ConvertType(out[6], new([]*big.Int)).(*[]*big.Int) + + return *outstruct, err + +} + +// Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. +// +// Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) +func (_TaikoToken *TaikoTokenSession) Eip712Domain() (struct { + Fields [1]byte + Name string + Version string + ChainId *big.Int + VerifyingContract common.Address + Salt [32]byte + Extensions []*big.Int +}, error) { + return _TaikoToken.Contract.Eip712Domain(&_TaikoToken.CallOpts) +} + +// Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. +// +// Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) +func (_TaikoToken *TaikoTokenCallerSession) Eip712Domain() (struct { + Fields [1]byte + Name string + Version string + ChainId *big.Int + VerifyingContract common.Address + Salt [32]byte + Extensions []*big.Int +}, error) { + return _TaikoToken.Contract.Eip712Domain(&_TaikoToken.CallOpts) +} + +// GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. +// +// Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) GetPastTotalSupply(opts *bind.CallOpts, timepoint *big.Int) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "getPastTotalSupply", timepoint) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. +// +// Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) GetPastTotalSupply(timepoint *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.GetPastTotalSupply(&_TaikoToken.CallOpts, timepoint) +} + +// GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. +// +// Solidity: function getPastTotalSupply(uint256 timepoint) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) GetPastTotalSupply(timepoint *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.GetPastTotalSupply(&_TaikoToken.CallOpts, timepoint) +} + +// GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. +// +// Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) GetPastVotes(opts *bind.CallOpts, account common.Address, timepoint *big.Int) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "getPastVotes", account, timepoint) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. +// +// Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) GetPastVotes(account common.Address, timepoint *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.GetPastVotes(&_TaikoToken.CallOpts, account, timepoint) +} + +// GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. +// +// Solidity: function getPastVotes(address account, uint256 timepoint) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) GetPastVotes(account common.Address, timepoint *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.GetPastVotes(&_TaikoToken.CallOpts, account, timepoint) +} + +// GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. +// +// Solidity: function getVotes(address account) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) GetVotes(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "getVotes", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. +// +// Solidity: function getVotes(address account) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) GetVotes(account common.Address) (*big.Int, error) { + return _TaikoToken.Contract.GetVotes(&_TaikoToken.CallOpts, account) +} + +// GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. +// +// Solidity: function getVotes(address account) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) GetVotes(account common.Address) (*big.Int, error) { + return _TaikoToken.Contract.GetVotes(&_TaikoToken.CallOpts, account) +} + +// LastUnpausedAt is a free data retrieval call binding the contract method 0xe07baba6. +// +// Solidity: function lastUnpausedAt() view returns(uint64) +func (_TaikoToken *TaikoTokenCaller) LastUnpausedAt(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "lastUnpausedAt") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// LastUnpausedAt is a free data retrieval call binding the contract method 0xe07baba6. +// +// Solidity: function lastUnpausedAt() view returns(uint64) +func (_TaikoToken *TaikoTokenSession) LastUnpausedAt() (uint64, error) { + return _TaikoToken.Contract.LastUnpausedAt(&_TaikoToken.CallOpts) +} + +// LastUnpausedAt is a free data retrieval call binding the contract method 0xe07baba6. +// +// Solidity: function lastUnpausedAt() view returns(uint64) +func (_TaikoToken *TaikoTokenCallerSession) LastUnpausedAt() (uint64, error) { + return _TaikoToken.Contract.LastUnpausedAt(&_TaikoToken.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_TaikoToken *TaikoTokenCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_TaikoToken *TaikoTokenSession) Name() (string, error) { + return _TaikoToken.Contract.Name(&_TaikoToken.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_TaikoToken *TaikoTokenCallerSession) Name() (string, error) { + return _TaikoToken.Contract.Name(&_TaikoToken.CallOpts) +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address owner) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) Nonces(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "nonces", owner) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address owner) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) Nonces(owner common.Address) (*big.Int, error) { + return _TaikoToken.Contract.Nonces(&_TaikoToken.CallOpts, owner) +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address owner) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) Nonces(owner common.Address) (*big.Int, error) { + return _TaikoToken.Contract.Nonces(&_TaikoToken.CallOpts, owner) +} + +// NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. +// +// Solidity: function numCheckpoints(address account) view returns(uint32) +func (_TaikoToken *TaikoTokenCaller) NumCheckpoints(opts *bind.CallOpts, account common.Address) (uint32, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "numCheckpoints", account) + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. +// +// Solidity: function numCheckpoints(address account) view returns(uint32) +func (_TaikoToken *TaikoTokenSession) NumCheckpoints(account common.Address) (uint32, error) { + return _TaikoToken.Contract.NumCheckpoints(&_TaikoToken.CallOpts, account) +} + +// NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. +// +// Solidity: function numCheckpoints(address account) view returns(uint32) +func (_TaikoToken *TaikoTokenCallerSession) NumCheckpoints(account common.Address) (uint32, error) { + return _TaikoToken.Contract.NumCheckpoints(&_TaikoToken.CallOpts, account) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_TaikoToken *TaikoTokenCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_TaikoToken *TaikoTokenSession) Owner() (common.Address, error) { + return _TaikoToken.Contract.Owner(&_TaikoToken.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_TaikoToken *TaikoTokenCallerSession) Owner() (common.Address, error) { + return _TaikoToken.Contract.Owner(&_TaikoToken.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_TaikoToken *TaikoTokenCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_TaikoToken *TaikoTokenSession) Paused() (bool, error) { + return _TaikoToken.Contract.Paused(&_TaikoToken.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_TaikoToken *TaikoTokenCallerSession) Paused() (bool, error) { + return _TaikoToken.Contract.Paused(&_TaikoToken.CallOpts) +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_TaikoToken *TaikoTokenCaller) PendingOwner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "pendingOwner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_TaikoToken *TaikoTokenSession) PendingOwner() (common.Address, error) { + return _TaikoToken.Contract.PendingOwner(&_TaikoToken.CallOpts) +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_TaikoToken *TaikoTokenCallerSession) PendingOwner() (common.Address, error) { + return _TaikoToken.Contract.PendingOwner(&_TaikoToken.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_TaikoToken *TaikoTokenCaller) ProxiableUUID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "proxiableUUID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_TaikoToken *TaikoTokenSession) ProxiableUUID() ([32]byte, error) { + return _TaikoToken.Contract.ProxiableUUID(&_TaikoToken.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_TaikoToken *TaikoTokenCallerSession) ProxiableUUID() ([32]byte, error) { + return _TaikoToken.Contract.ProxiableUUID(&_TaikoToken.CallOpts) +} + +// Resolve is a free data retrieval call binding the contract method 0x3eb6b8cf. +// +// Solidity: function resolve(uint64 _chainId, bytes32 _name, bool _allowZeroAddress) view returns(address) +func (_TaikoToken *TaikoTokenCaller) Resolve(opts *bind.CallOpts, _chainId uint64, _name [32]byte, _allowZeroAddress bool) (common.Address, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "resolve", _chainId, _name, _allowZeroAddress) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Resolve is a free data retrieval call binding the contract method 0x3eb6b8cf. +// +// Solidity: function resolve(uint64 _chainId, bytes32 _name, bool _allowZeroAddress) view returns(address) +func (_TaikoToken *TaikoTokenSession) Resolve(_chainId uint64, _name [32]byte, _allowZeroAddress bool) (common.Address, error) { + return _TaikoToken.Contract.Resolve(&_TaikoToken.CallOpts, _chainId, _name, _allowZeroAddress) +} + +// Resolve is a free data retrieval call binding the contract method 0x3eb6b8cf. +// +// Solidity: function resolve(uint64 _chainId, bytes32 _name, bool _allowZeroAddress) view returns(address) +func (_TaikoToken *TaikoTokenCallerSession) Resolve(_chainId uint64, _name [32]byte, _allowZeroAddress bool) (common.Address, error) { + return _TaikoToken.Contract.Resolve(&_TaikoToken.CallOpts, _chainId, _name, _allowZeroAddress) +} + +// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. +// +// Solidity: function resolve(bytes32 _name, bool _allowZeroAddress) view returns(address) +func (_TaikoToken *TaikoTokenCaller) Resolve0(opts *bind.CallOpts, _name [32]byte, _allowZeroAddress bool) (common.Address, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "resolve0", _name, _allowZeroAddress) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. +// +// Solidity: function resolve(bytes32 _name, bool _allowZeroAddress) view returns(address) +func (_TaikoToken *TaikoTokenSession) Resolve0(_name [32]byte, _allowZeroAddress bool) (common.Address, error) { + return _TaikoToken.Contract.Resolve0(&_TaikoToken.CallOpts, _name, _allowZeroAddress) +} + +// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. +// +// Solidity: function resolve(bytes32 _name, bool _allowZeroAddress) view returns(address) +func (_TaikoToken *TaikoTokenCallerSession) Resolve0(_name [32]byte, _allowZeroAddress bool) (common.Address, error) { + return _TaikoToken.Contract.Resolve0(&_TaikoToken.CallOpts, _name, _allowZeroAddress) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_TaikoToken *TaikoTokenCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_TaikoToken *TaikoTokenSession) Symbol() (string, error) { + return _TaikoToken.Contract.Symbol(&_TaikoToken.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_TaikoToken *TaikoTokenCallerSession) Symbol() (string, error) { + return _TaikoToken.Contract.Symbol(&_TaikoToken.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_TaikoToken *TaikoTokenSession) TotalSupply() (*big.Int, error) { + return _TaikoToken.Contract.TotalSupply(&_TaikoToken.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) TotalSupply() (*big.Int, error) { + return _TaikoToken.Contract.TotalSupply(&_TaikoToken.CallOpts) +} + +// TotalSupplyAt is a free data retrieval call binding the contract method 0x981b24d0. +// +// Solidity: function totalSupplyAt(uint256 snapshotId) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) TotalSupplyAt(opts *bind.CallOpts, snapshotId *big.Int) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "totalSupplyAt", snapshotId) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupplyAt is a free data retrieval call binding the contract method 0x981b24d0. +// +// Solidity: function totalSupplyAt(uint256 snapshotId) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) TotalSupplyAt(snapshotId *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.TotalSupplyAt(&_TaikoToken.CallOpts, snapshotId) +} + +// TotalSupplyAt is a free data retrieval call binding the contract method 0x981b24d0. +// +// Solidity: function totalSupplyAt(uint256 snapshotId) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) TotalSupplyAt(snapshotId *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.TotalSupplyAt(&_TaikoToken.CallOpts, snapshotId) +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_TaikoToken *TaikoTokenTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "acceptOwnership") +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_TaikoToken *TaikoTokenSession) AcceptOwnership() (*types.Transaction, error) { + return _TaikoToken.Contract.AcceptOwnership(&_TaikoToken.TransactOpts) +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_TaikoToken *TaikoTokenTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _TaikoToken.Contract.AcceptOwnership(&_TaikoToken.TransactOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_TaikoToken *TaikoTokenTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_TaikoToken *TaikoTokenSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Approve(&_TaikoToken.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_TaikoToken *TaikoTokenTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Approve(&_TaikoToken.TransactOpts, spender, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address _from, uint256 _amount) returns() +func (_TaikoToken *TaikoTokenTransactor) Burn(opts *bind.TransactOpts, _from common.Address, _amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "burn", _from, _amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address _from, uint256 _amount) returns() +func (_TaikoToken *TaikoTokenSession) Burn(_from common.Address, _amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Burn(&_TaikoToken.TransactOpts, _from, _amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address _from, uint256 _amount) returns() +func (_TaikoToken *TaikoTokenTransactorSession) Burn(_from common.Address, _amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Burn(&_TaikoToken.TransactOpts, _from, _amount) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_TaikoToken *TaikoTokenTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_TaikoToken *TaikoTokenSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.DecreaseAllowance(&_TaikoToken.TransactOpts, spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_TaikoToken *TaikoTokenTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.DecreaseAllowance(&_TaikoToken.TransactOpts, spender, subtractedValue) +} + +// Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. +// +// Solidity: function delegate(address delegatee) returns() +func (_TaikoToken *TaikoTokenTransactor) Delegate(opts *bind.TransactOpts, delegatee common.Address) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "delegate", delegatee) +} + +// Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. +// +// Solidity: function delegate(address delegatee) returns() +func (_TaikoToken *TaikoTokenSession) Delegate(delegatee common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.Delegate(&_TaikoToken.TransactOpts, delegatee) +} + +// Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. +// +// Solidity: function delegate(address delegatee) returns() +func (_TaikoToken *TaikoTokenTransactorSession) Delegate(delegatee common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.Delegate(&_TaikoToken.TransactOpts, delegatee) +} + +// DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. +// +// Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() +func (_TaikoToken *TaikoTokenTransactor) DelegateBySig(opts *bind.TransactOpts, delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "delegateBySig", delegatee, nonce, expiry, v, r, s) +} + +// DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. +// +// Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() +func (_TaikoToken *TaikoTokenSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _TaikoToken.Contract.DelegateBySig(&_TaikoToken.TransactOpts, delegatee, nonce, expiry, v, r, s) +} + +// DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. +// +// Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() +func (_TaikoToken *TaikoTokenTransactorSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _TaikoToken.Contract.DelegateBySig(&_TaikoToken.TransactOpts, delegatee, nonce, expiry, v, r, s) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_TaikoToken *TaikoTokenTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_TaikoToken *TaikoTokenSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.IncreaseAllowance(&_TaikoToken.TransactOpts, spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_TaikoToken *TaikoTokenTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.IncreaseAllowance(&_TaikoToken.TransactOpts, spender, addedValue) +} + +// Init is a paid mutator transaction binding the contract method 0x5332da6d. +// +// Solidity: function init(address _owner, string _name, string _symbol, address _recipient, address _addressManager) returns() +func (_TaikoToken *TaikoTokenTransactor) Init(opts *bind.TransactOpts, _owner common.Address, _name string, _symbol string, _recipient common.Address, _addressManager common.Address) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "init", _owner, _name, _symbol, _recipient, _addressManager) +} + +// Init is a paid mutator transaction binding the contract method 0x5332da6d. +// +// Solidity: function init(address _owner, string _name, string _symbol, address _recipient, address _addressManager) returns() +func (_TaikoToken *TaikoTokenSession) Init(_owner common.Address, _name string, _symbol string, _recipient common.Address, _addressManager common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.Init(&_TaikoToken.TransactOpts, _owner, _name, _symbol, _recipient, _addressManager) +} + +// Init is a paid mutator transaction binding the contract method 0x5332da6d. +// +// Solidity: function init(address _owner, string _name, string _symbol, address _recipient, address _addressManager) returns() +func (_TaikoToken *TaikoTokenTransactorSession) Init(_owner common.Address, _name string, _symbol string, _recipient common.Address, _addressManager common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.Init(&_TaikoToken.TransactOpts, _owner, _name, _symbol, _recipient, _addressManager) +} + +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_TaikoToken *TaikoTokenTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "pause") +} + +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_TaikoToken *TaikoTokenSession) Pause() (*types.Transaction, error) { + return _TaikoToken.Contract.Pause(&_TaikoToken.TransactOpts) +} + +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_TaikoToken *TaikoTokenTransactorSession) Pause() (*types.Transaction, error) { + return _TaikoToken.Contract.Pause(&_TaikoToken.TransactOpts) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_TaikoToken *TaikoTokenTransactor) Permit(opts *bind.TransactOpts, owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "permit", owner, spender, value, deadline, v, r, s) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_TaikoToken *TaikoTokenSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _TaikoToken.Contract.Permit(&_TaikoToken.TransactOpts, owner, spender, value, deadline, v, r, s) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_TaikoToken *TaikoTokenTransactorSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _TaikoToken.Contract.Permit(&_TaikoToken.TransactOpts, owner, spender, value, deadline, v, r, s) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TaikoToken *TaikoTokenTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TaikoToken *TaikoTokenSession) RenounceOwnership() (*types.Transaction, error) { + return _TaikoToken.Contract.RenounceOwnership(&_TaikoToken.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TaikoToken *TaikoTokenTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _TaikoToken.Contract.RenounceOwnership(&_TaikoToken.TransactOpts) +} + +// Snapshot is a paid mutator transaction binding the contract method 0x9711715a. +// +// Solidity: function snapshot() returns(uint256) +func (_TaikoToken *TaikoTokenTransactor) Snapshot(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "snapshot") +} + +// Snapshot is a paid mutator transaction binding the contract method 0x9711715a. +// +// Solidity: function snapshot() returns(uint256) +func (_TaikoToken *TaikoTokenSession) Snapshot() (*types.Transaction, error) { + return _TaikoToken.Contract.Snapshot(&_TaikoToken.TransactOpts) +} + +// Snapshot is a paid mutator transaction binding the contract method 0x9711715a. +// +// Solidity: function snapshot() returns(uint256) +func (_TaikoToken *TaikoTokenTransactorSession) Snapshot() (*types.Transaction, error) { + return _TaikoToken.Contract.Snapshot(&_TaikoToken.TransactOpts) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address _to, uint256 _amount) returns(bool) +func (_TaikoToken *TaikoTokenTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "transfer", _to, _amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address _to, uint256 _amount) returns(bool) +func (_TaikoToken *TaikoTokenSession) Transfer(_to common.Address, _amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Transfer(&_TaikoToken.TransactOpts, _to, _amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address _to, uint256 _amount) returns(bool) +func (_TaikoToken *TaikoTokenTransactorSession) Transfer(_to common.Address, _amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Transfer(&_TaikoToken.TransactOpts, _to, _amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address _from, address _to, uint256 _amount) returns(bool) +func (_TaikoToken *TaikoTokenTransactor) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "transferFrom", _from, _to, _amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address _from, address _to, uint256 _amount) returns(bool) +func (_TaikoToken *TaikoTokenSession) TransferFrom(_from common.Address, _to common.Address, _amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.TransferFrom(&_TaikoToken.TransactOpts, _from, _to, _amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address _from, address _to, uint256 _amount) returns(bool) +func (_TaikoToken *TaikoTokenTransactorSession) TransferFrom(_from common.Address, _to common.Address, _amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.TransferFrom(&_TaikoToken.TransactOpts, _from, _to, _amount) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TaikoToken *TaikoTokenTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TaikoToken *TaikoTokenSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.TransferOwnership(&_TaikoToken.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TaikoToken *TaikoTokenTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.TransferOwnership(&_TaikoToken.TransactOpts, newOwner) +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_TaikoToken *TaikoTokenTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "unpause") +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_TaikoToken *TaikoTokenSession) Unpause() (*types.Transaction, error) { + return _TaikoToken.Contract.Unpause(&_TaikoToken.TransactOpts) +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_TaikoToken *TaikoTokenTransactorSession) Unpause() (*types.Transaction, error) { + return _TaikoToken.Contract.Unpause(&_TaikoToken.TransactOpts) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_TaikoToken *TaikoTokenTransactor) UpgradeTo(opts *bind.TransactOpts, newImplementation common.Address) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "upgradeTo", newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_TaikoToken *TaikoTokenSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.UpgradeTo(&_TaikoToken.TransactOpts, newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_TaikoToken *TaikoTokenTransactorSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.UpgradeTo(&_TaikoToken.TransactOpts, newImplementation) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_TaikoToken *TaikoTokenTransactor) UpgradeToAndCall(opts *bind.TransactOpts, newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "upgradeToAndCall", newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_TaikoToken *TaikoTokenSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _TaikoToken.Contract.UpgradeToAndCall(&_TaikoToken.TransactOpts, newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_TaikoToken *TaikoTokenTransactorSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _TaikoToken.Contract.UpgradeToAndCall(&_TaikoToken.TransactOpts, newImplementation, data) +} + +// TaikoTokenAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the TaikoToken contract. +type TaikoTokenAdminChangedIterator struct { + Event *TaikoTokenAdminChanged // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenAdminChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenAdminChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenAdminChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenAdminChanged represents a AdminChanged event raised by the TaikoToken contract. +type TaikoTokenAdminChanged struct { + PreviousAdmin common.Address + NewAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_TaikoToken *TaikoTokenFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*TaikoTokenAdminChangedIterator, error) { + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return &TaikoTokenAdminChangedIterator{contract: _TaikoToken.contract, event: "AdminChanged", logs: logs, sub: sub}, nil +} + +// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_TaikoToken *TaikoTokenFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *TaikoTokenAdminChanged) (event.Subscription, error) { + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenAdminChanged) + if err := _TaikoToken.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_TaikoToken *TaikoTokenFilterer) ParseAdminChanged(log types.Log) (*TaikoTokenAdminChanged, error) { + event := new(TaikoTokenAdminChanged) + if err := _TaikoToken.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the TaikoToken contract. +type TaikoTokenApprovalIterator struct { + Event *TaikoTokenApproval // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenApproval represents a Approval event raised by the TaikoToken contract. +type TaikoTokenApproval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_TaikoToken *TaikoTokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*TaikoTokenApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &TaikoTokenApprovalIterator{contract: _TaikoToken.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_TaikoToken *TaikoTokenFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *TaikoTokenApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenApproval) + if err := _TaikoToken.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_TaikoToken *TaikoTokenFilterer) ParseApproval(log types.Log) (*TaikoTokenApproval, error) { + event := new(TaikoTokenApproval) + if err := _TaikoToken.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the TaikoToken contract. +type TaikoTokenBeaconUpgradedIterator struct { + Event *TaikoTokenBeaconUpgraded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenBeaconUpgradedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenBeaconUpgraded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenBeaconUpgraded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenBeaconUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenBeaconUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenBeaconUpgraded represents a BeaconUpgraded event raised by the TaikoToken contract. +type TaikoTokenBeaconUpgraded struct { + Beacon common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_TaikoToken *TaikoTokenFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*TaikoTokenBeaconUpgradedIterator, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return &TaikoTokenBeaconUpgradedIterator{contract: _TaikoToken.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil +} + +// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_TaikoToken *TaikoTokenFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *TaikoTokenBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenBeaconUpgraded) + if err := _TaikoToken.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_TaikoToken *TaikoTokenFilterer) ParseBeaconUpgraded(log types.Log) (*TaikoTokenBeaconUpgraded, error) { + event := new(TaikoTokenBeaconUpgraded) + if err := _TaikoToken.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenDelegateChangedIterator is returned from FilterDelegateChanged and is used to iterate over the raw logs and unpacked data for DelegateChanged events raised by the TaikoToken contract. +type TaikoTokenDelegateChangedIterator struct { + Event *TaikoTokenDelegateChanged // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenDelegateChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenDelegateChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenDelegateChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenDelegateChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenDelegateChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenDelegateChanged represents a DelegateChanged event raised by the TaikoToken contract. +type TaikoTokenDelegateChanged struct { + Delegator common.Address + FromDelegate common.Address + ToDelegate common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDelegateChanged is a free log retrieval operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. +// +// Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) +func (_TaikoToken *TaikoTokenFilterer) FilterDelegateChanged(opts *bind.FilterOpts, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (*TaikoTokenDelegateChangedIterator, error) { + + var delegatorRule []interface{} + for _, delegatorItem := range delegator { + delegatorRule = append(delegatorRule, delegatorItem) + } + var fromDelegateRule []interface{} + for _, fromDelegateItem := range fromDelegate { + fromDelegateRule = append(fromDelegateRule, fromDelegateItem) + } + var toDelegateRule []interface{} + for _, toDelegateItem := range toDelegate { + toDelegateRule = append(toDelegateRule, toDelegateItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) + if err != nil { + return nil, err + } + return &TaikoTokenDelegateChangedIterator{contract: _TaikoToken.contract, event: "DelegateChanged", logs: logs, sub: sub}, nil +} + +// WatchDelegateChanged is a free log subscription operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. +// +// Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) +func (_TaikoToken *TaikoTokenFilterer) WatchDelegateChanged(opts *bind.WatchOpts, sink chan<- *TaikoTokenDelegateChanged, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (event.Subscription, error) { + + var delegatorRule []interface{} + for _, delegatorItem := range delegator { + delegatorRule = append(delegatorRule, delegatorItem) + } + var fromDelegateRule []interface{} + for _, fromDelegateItem := range fromDelegate { + fromDelegateRule = append(fromDelegateRule, fromDelegateItem) + } + var toDelegateRule []interface{} + for _, toDelegateItem := range toDelegate { + toDelegateRule = append(toDelegateRule, toDelegateItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenDelegateChanged) + if err := _TaikoToken.contract.UnpackLog(event, "DelegateChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDelegateChanged is a log parse operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. +// +// Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) +func (_TaikoToken *TaikoTokenFilterer) ParseDelegateChanged(log types.Log) (*TaikoTokenDelegateChanged, error) { + event := new(TaikoTokenDelegateChanged) + if err := _TaikoToken.contract.UnpackLog(event, "DelegateChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenDelegateVotesChangedIterator is returned from FilterDelegateVotesChanged and is used to iterate over the raw logs and unpacked data for DelegateVotesChanged events raised by the TaikoToken contract. +type TaikoTokenDelegateVotesChangedIterator struct { + Event *TaikoTokenDelegateVotesChanged // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenDelegateVotesChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenDelegateVotesChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenDelegateVotesChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenDelegateVotesChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenDelegateVotesChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenDelegateVotesChanged represents a DelegateVotesChanged event raised by the TaikoToken contract. +type TaikoTokenDelegateVotesChanged struct { + Delegate common.Address + PreviousBalance *big.Int + NewBalance *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDelegateVotesChanged is a free log retrieval operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. +// +// Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) +func (_TaikoToken *TaikoTokenFilterer) FilterDelegateVotesChanged(opts *bind.FilterOpts, delegate []common.Address) (*TaikoTokenDelegateVotesChangedIterator, error) { + + var delegateRule []interface{} + for _, delegateItem := range delegate { + delegateRule = append(delegateRule, delegateItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "DelegateVotesChanged", delegateRule) + if err != nil { + return nil, err + } + return &TaikoTokenDelegateVotesChangedIterator{contract: _TaikoToken.contract, event: "DelegateVotesChanged", logs: logs, sub: sub}, nil +} + +// WatchDelegateVotesChanged is a free log subscription operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. +// +// Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) +func (_TaikoToken *TaikoTokenFilterer) WatchDelegateVotesChanged(opts *bind.WatchOpts, sink chan<- *TaikoTokenDelegateVotesChanged, delegate []common.Address) (event.Subscription, error) { + + var delegateRule []interface{} + for _, delegateItem := range delegate { + delegateRule = append(delegateRule, delegateItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "DelegateVotesChanged", delegateRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenDelegateVotesChanged) + if err := _TaikoToken.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDelegateVotesChanged is a log parse operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. +// +// Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) +func (_TaikoToken *TaikoTokenFilterer) ParseDelegateVotesChanged(log types.Log) (*TaikoTokenDelegateVotesChanged, error) { + event := new(TaikoTokenDelegateVotesChanged) + if err := _TaikoToken.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenEIP712DomainChangedIterator is returned from FilterEIP712DomainChanged and is used to iterate over the raw logs and unpacked data for EIP712DomainChanged events raised by the TaikoToken contract. +type TaikoTokenEIP712DomainChangedIterator struct { + Event *TaikoTokenEIP712DomainChanged // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenEIP712DomainChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenEIP712DomainChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenEIP712DomainChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenEIP712DomainChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenEIP712DomainChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenEIP712DomainChanged represents a EIP712DomainChanged event raised by the TaikoToken contract. +type TaikoTokenEIP712DomainChanged struct { + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEIP712DomainChanged is a free log retrieval operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. +// +// Solidity: event EIP712DomainChanged() +func (_TaikoToken *TaikoTokenFilterer) FilterEIP712DomainChanged(opts *bind.FilterOpts) (*TaikoTokenEIP712DomainChangedIterator, error) { + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "EIP712DomainChanged") + if err != nil { + return nil, err + } + return &TaikoTokenEIP712DomainChangedIterator{contract: _TaikoToken.contract, event: "EIP712DomainChanged", logs: logs, sub: sub}, nil +} + +// WatchEIP712DomainChanged is a free log subscription operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. +// +// Solidity: event EIP712DomainChanged() +func (_TaikoToken *TaikoTokenFilterer) WatchEIP712DomainChanged(opts *bind.WatchOpts, sink chan<- *TaikoTokenEIP712DomainChanged) (event.Subscription, error) { + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "EIP712DomainChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenEIP712DomainChanged) + if err := _TaikoToken.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseEIP712DomainChanged is a log parse operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. +// +// Solidity: event EIP712DomainChanged() +func (_TaikoToken *TaikoTokenFilterer) ParseEIP712DomainChanged(log types.Log) (*TaikoTokenEIP712DomainChanged, error) { + event := new(TaikoTokenEIP712DomainChanged) + if err := _TaikoToken.contract.UnpackLog(event, "EIP712DomainChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the TaikoToken contract. +type TaikoTokenInitializedIterator struct { + Event *TaikoTokenInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenInitialized represents a Initialized event raised by the TaikoToken contract. +type TaikoTokenInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_TaikoToken *TaikoTokenFilterer) FilterInitialized(opts *bind.FilterOpts) (*TaikoTokenInitializedIterator, error) { + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &TaikoTokenInitializedIterator{contract: _TaikoToken.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_TaikoToken *TaikoTokenFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *TaikoTokenInitialized) (event.Subscription, error) { + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenInitialized) + if err := _TaikoToken.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_TaikoToken *TaikoTokenFilterer) ParseInitialized(log types.Log) (*TaikoTokenInitialized, error) { + event := new(TaikoTokenInitialized) + if err := _TaikoToken.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenOwnershipTransferStartedIterator is returned from FilterOwnershipTransferStarted and is used to iterate over the raw logs and unpacked data for OwnershipTransferStarted events raised by the TaikoToken contract. +type TaikoTokenOwnershipTransferStartedIterator struct { + Event *TaikoTokenOwnershipTransferStarted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenOwnershipTransferStartedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenOwnershipTransferStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenOwnershipTransferStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenOwnershipTransferStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenOwnershipTransferStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenOwnershipTransferStarted represents a OwnershipTransferStarted event raised by the TaikoToken contract. +type TaikoTokenOwnershipTransferStarted struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferStarted is a free log retrieval operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_TaikoToken *TaikoTokenFilterer) FilterOwnershipTransferStarted(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TaikoTokenOwnershipTransferStartedIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "OwnershipTransferStarted", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &TaikoTokenOwnershipTransferStartedIterator{contract: _TaikoToken.contract, event: "OwnershipTransferStarted", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferStarted is a free log subscription operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_TaikoToken *TaikoTokenFilterer) WatchOwnershipTransferStarted(opts *bind.WatchOpts, sink chan<- *TaikoTokenOwnershipTransferStarted, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "OwnershipTransferStarted", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenOwnershipTransferStarted) + if err := _TaikoToken.contract.UnpackLog(event, "OwnershipTransferStarted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferStarted is a log parse operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_TaikoToken *TaikoTokenFilterer) ParseOwnershipTransferStarted(log types.Log) (*TaikoTokenOwnershipTransferStarted, error) { + event := new(TaikoTokenOwnershipTransferStarted) + if err := _TaikoToken.contract.UnpackLog(event, "OwnershipTransferStarted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the TaikoToken contract. +type TaikoTokenOwnershipTransferredIterator struct { + Event *TaikoTokenOwnershipTransferred // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenOwnershipTransferred represents a OwnershipTransferred event raised by the TaikoToken contract. +type TaikoTokenOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_TaikoToken *TaikoTokenFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TaikoTokenOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &TaikoTokenOwnershipTransferredIterator{contract: _TaikoToken.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_TaikoToken *TaikoTokenFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TaikoTokenOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenOwnershipTransferred) + if err := _TaikoToken.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_TaikoToken *TaikoTokenFilterer) ParseOwnershipTransferred(log types.Log) (*TaikoTokenOwnershipTransferred, error) { + event := new(TaikoTokenOwnershipTransferred) + if err := _TaikoToken.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenPausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the TaikoToken contract. +type TaikoTokenPausedIterator struct { + Event *TaikoTokenPaused // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenPausedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenPaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenPaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenPausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenPausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenPaused represents a Paused event raised by the TaikoToken contract. +type TaikoTokenPaused struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPaused is a free log retrieval operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. +// +// Solidity: event Paused(address account) +func (_TaikoToken *TaikoTokenFilterer) FilterPaused(opts *bind.FilterOpts) (*TaikoTokenPausedIterator, error) { + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "Paused") + if err != nil { + return nil, err + } + return &TaikoTokenPausedIterator{contract: _TaikoToken.contract, event: "Paused", logs: logs, sub: sub}, nil +} + +// WatchPaused is a free log subscription operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. +// +// Solidity: event Paused(address account) +func (_TaikoToken *TaikoTokenFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *TaikoTokenPaused) (event.Subscription, error) { + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "Paused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenPaused) + if err := _TaikoToken.contract.UnpackLog(event, "Paused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParsePaused is a log parse operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. +// +// Solidity: event Paused(address account) +func (_TaikoToken *TaikoTokenFilterer) ParsePaused(log types.Log) (*TaikoTokenPaused, error) { + event := new(TaikoTokenPaused) + if err := _TaikoToken.contract.UnpackLog(event, "Paused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenSnapshotIterator is returned from FilterSnapshot and is used to iterate over the raw logs and unpacked data for Snapshot events raised by the TaikoToken contract. +type TaikoTokenSnapshotIterator struct { + Event *TaikoTokenSnapshot // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenSnapshotIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenSnapshot) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenSnapshot) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenSnapshotIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenSnapshotIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenSnapshot represents a Snapshot event raised by the TaikoToken contract. +type TaikoTokenSnapshot struct { + Id *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSnapshot is a free log retrieval operation binding the contract event 0x8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67. +// +// Solidity: event Snapshot(uint256 id) +func (_TaikoToken *TaikoTokenFilterer) FilterSnapshot(opts *bind.FilterOpts) (*TaikoTokenSnapshotIterator, error) { + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "Snapshot") + if err != nil { + return nil, err + } + return &TaikoTokenSnapshotIterator{contract: _TaikoToken.contract, event: "Snapshot", logs: logs, sub: sub}, nil +} + +// WatchSnapshot is a free log subscription operation binding the contract event 0x8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67. +// +// Solidity: event Snapshot(uint256 id) +func (_TaikoToken *TaikoTokenFilterer) WatchSnapshot(opts *bind.WatchOpts, sink chan<- *TaikoTokenSnapshot) (event.Subscription, error) { + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "Snapshot") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenSnapshot) + if err := _TaikoToken.contract.UnpackLog(event, "Snapshot", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSnapshot is a log parse operation binding the contract event 0x8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67. +// +// Solidity: event Snapshot(uint256 id) +func (_TaikoToken *TaikoTokenFilterer) ParseSnapshot(log types.Log) (*TaikoTokenSnapshot, error) { + event := new(TaikoTokenSnapshot) + if err := _TaikoToken.contract.UnpackLog(event, "Snapshot", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the TaikoToken contract. +type TaikoTokenTransferIterator struct { + Event *TaikoTokenTransfer // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenTransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenTransfer represents a Transfer event raised by the TaikoToken contract. +type TaikoTokenTransfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_TaikoToken *TaikoTokenFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TaikoTokenTransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &TaikoTokenTransferIterator{contract: _TaikoToken.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_TaikoToken *TaikoTokenFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *TaikoTokenTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenTransfer) + if err := _TaikoToken.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_TaikoToken *TaikoTokenFilterer) ParseTransfer(log types.Log) (*TaikoTokenTransfer, error) { + event := new(TaikoTokenTransfer) + if err := _TaikoToken.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the TaikoToken contract. +type TaikoTokenUnpausedIterator struct { + Event *TaikoTokenUnpaused // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenUnpausedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenUnpaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenUnpaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenUnpausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenUnpausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenUnpaused represents a Unpaused event raised by the TaikoToken contract. +type TaikoTokenUnpaused struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnpaused is a free log retrieval operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. +// +// Solidity: event Unpaused(address account) +func (_TaikoToken *TaikoTokenFilterer) FilterUnpaused(opts *bind.FilterOpts) (*TaikoTokenUnpausedIterator, error) { + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return &TaikoTokenUnpausedIterator{contract: _TaikoToken.contract, event: "Unpaused", logs: logs, sub: sub}, nil +} + +// WatchUnpaused is a free log subscription operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. +// +// Solidity: event Unpaused(address account) +func (_TaikoToken *TaikoTokenFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *TaikoTokenUnpaused) (event.Subscription, error) { + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenUnpaused) + if err := _TaikoToken.contract.UnpackLog(event, "Unpaused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUnpaused is a log parse operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. +// +// Solidity: event Unpaused(address account) +func (_TaikoToken *TaikoTokenFilterer) ParseUnpaused(log types.Log) (*TaikoTokenUnpaused, error) { + event := new(TaikoTokenUnpaused) + if err := _TaikoToken.contract.UnpackLog(event, "Unpaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the TaikoToken contract. +type TaikoTokenUpgradedIterator struct { + Event *TaikoTokenUpgraded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenUpgradedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenUpgraded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenUpgraded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenUpgraded represents a Upgraded event raised by the TaikoToken contract. +type TaikoTokenUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_TaikoToken *TaikoTokenFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*TaikoTokenUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &TaikoTokenUpgradedIterator{contract: _TaikoToken.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_TaikoToken *TaikoTokenFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *TaikoTokenUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenUpgraded) + if err := _TaikoToken.contract.UnpackLog(event, "Upgraded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_TaikoToken *TaikoTokenFilterer) ParseUpgraded(log types.Log) (*TaikoTokenUpgraded, error) { + event := new(TaikoTokenUpgraded) + if err := _TaikoToken.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/packages/eventindexer/disperser/config.go b/packages/eventindexer/disperser/config.go new file mode 100644 index 0000000000..c53323f458 --- /dev/null +++ b/packages/eventindexer/disperser/config.go @@ -0,0 +1,98 @@ +package disperser + +import ( + "crypto/ecdsa" + "database/sql" + "fmt" + "math/big" + + "github.com/ethereum-optimism/optimism/op-service/txmgr" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/taikoxyz/taiko-mono/packages/eventindexer/cmd/flags" + "github.com/taikoxyz/taiko-mono/packages/eventindexer/pkg/db" + pkgFlags "github.com/taikoxyz/taiko-mono/packages/relayer/pkg/flags" + "github.com/urfave/cli/v2" + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +type DB interface { + DB() (*sql.DB, error) + GormDB() *gorm.DB +} + +type Config struct { + // db configs + DatabaseUsername string + DatabasePassword string + DatabaseName string + DatabaseHost string + DatabaseMaxIdleConns uint64 + DatabaseMaxOpenConns uint64 + DatabaseMaxConnLifetime uint64 + MetricsHTTPPort uint64 + DisperserPrivateKey *ecdsa.PrivateKey + DispersalAmount *big.Int + TaikoTokenAddress common.Address + TxmgrConfigs *txmgr.CLIConfig + RPCURL string + OpenDBFunc func() (DB, error) +} + +// NewConfigFromCliContext creates a new config instance from command line flags. +func NewConfigFromCliContext(c *cli.Context) (*Config, error) { + disperserPrivateKey, err := crypto.ToECDSA( + common.Hex2Bytes(c.String(flags.DisperserPrivateKey.Name)), + ) + if err != nil { + return nil, fmt.Errorf("invalid disperserPrivateKey: %w", err) + } + + dispersalAmount, ok := new(big.Int).SetString(c.String(flags.DispersalAmount.Name), 10) + if !ok { + return nil, fmt.Errorf("Invalid dispersal amount") + } + + return &Config{ + DatabaseUsername: c.String(flags.DatabaseUsername.Name), + DatabasePassword: c.String(flags.DatabasePassword.Name), + DatabaseName: c.String(flags.DatabaseName.Name), + DatabaseHost: c.String(flags.DatabaseHost.Name), + DatabaseMaxIdleConns: c.Uint64(flags.DatabaseMaxIdleConns.Name), + DatabaseMaxOpenConns: c.Uint64(flags.DatabaseMaxOpenConns.Name), + DatabaseMaxConnLifetime: c.Uint64(flags.DatabaseConnMaxLifetime.Name), + MetricsHTTPPort: c.Uint64(flags.MetricsHTTPPort.Name), + DisperserPrivateKey: disperserPrivateKey, + RPCURL: c.String(flags.RPCUrl.Name), + DispersalAmount: dispersalAmount, + TaikoTokenAddress: common.HexToAddress(c.String(flags.TaikoTokenAddress.Name)), + TxmgrConfigs: pkgFlags.InitTxmgrConfigsFromCli( + c.String(flags.RPCUrl.Name), + disperserPrivateKey, + c, + ), + OpenDBFunc: func() (DB, error) { + return db.OpenDBConnection(db.DBConnectionOpts{ + Name: c.String(flags.DatabaseUsername.Name), + Password: c.String(flags.DatabasePassword.Name), + Database: c.String(flags.DatabaseName.Name), + Host: c.String(flags.DatabaseHost.Name), + MaxIdleConns: c.Uint64(flags.DatabaseMaxIdleConns.Name), + MaxOpenConns: c.Uint64(flags.DatabaseMaxOpenConns.Name), + MaxConnLifetime: c.Uint64(flags.DatabaseConnMaxLifetime.Name), + OpenFunc: func(dsn string) (*db.DB, error) { + gormDB, err := gorm.Open(mysql.Open(dsn), &gorm.Config{ + Logger: logger.Default.LogMode(logger.Silent), + }) + if err != nil { + return nil, err + } + + return db.New(gormDB), nil + }, + }) + }, + }, nil +} diff --git a/packages/eventindexer/disperser/disperser.go b/packages/eventindexer/disperser/disperser.go new file mode 100644 index 0000000000..b8dae27ed2 --- /dev/null +++ b/packages/eventindexer/disperser/disperser.go @@ -0,0 +1,120 @@ +package disperser + +import ( + "context" + "log/slog" + "math/big" + + txmgrMetrics "github.com/ethereum-optimism/optimism/op-service/txmgr/metrics" + "github.com/taikoxyz/taiko-mono/packages/eventindexer/encoding" + + "github.com/ethereum-optimism/optimism/op-service/txmgr" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" + "github.com/urfave/cli/v2" +) + +var ( + ZeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000") +) + +// Disperser is a subcommand which is intended to be run on an interval, like +// a cronjob, to parse the indexed data from the database, and generate +// time series data that can easily be displayed via charting libraries. +type Disperser struct { + db DB + dispersalAmount *big.Int + taikoTokenAddress common.Address + txmgr txmgr.TxManager +} + +func (d *Disperser) InitFromCli(ctx context.Context, c *cli.Context) error { + config, err := NewConfigFromCliContext(c) + if err != nil { + return err + } + + return InitFromConfig(ctx, d, config) +} + +func InitFromConfig(ctx context.Context, d *Disperser, cfg *Config) error { + db, err := cfg.OpenDBFunc() + if err != nil { + return err + } + + if d.txmgr, err = txmgr.NewSimpleTxManager( + "disperser", + log.Root(), + new(txmgrMetrics.NoopTxMetrics), + *cfg.TxmgrConfigs, + ); err != nil { + return err + } + + d.db = db + + d.dispersalAmount = cfg.DispersalAmount + d.taikoTokenAddress = cfg.TaikoTokenAddress + + return nil +} + +func (d *Disperser) Name() string { + return "disperser" +} + +func (d *Disperser) Start() error { + addresses, err := d.findAllAddresses() + if err != nil { + return err + } + + for _, address := range addresses { + slog.Info("dispersing to", "address", address) + + data, err := encoding.TaikoTokenABI.Pack("transfer", common.HexToAddress(address), d.dispersalAmount) + if err != nil { + return err + } + + candidate := txmgr.TxCandidate{ + TxData: data, + Blobs: nil, + To: &d.taikoTokenAddress, + } + + receipt, err := d.txmgr.Send(context.Background(), candidate) + if err != nil { + slog.Warn("Failed to send transfer transaction", "error", err.Error()) + return err + } + + slog.Info("sent tx", "tx", receipt.TxHash.Hex()) + } + + return nil +} + +func (d *Disperser) findAllAddresses() ([]string, error) { + var addresses []string + // Execute raw SQL query to find distinct addresses where event is 'InstanceAdded' + err := d.db.GormDB().Raw("SELECT DISTINCT address FROM events WHERE event = ?", "InstanceAdded").Scan(&addresses).Error + + if err != nil { + return nil, err + } + + return addresses, nil +} + +func (d *Disperser) Close(ctx context.Context) { + sqlDB, err := d.db.DB() + if err != nil { + slog.Error("error getting sqldb when closing Disperser", "err", err.Error()) + } + + if err := sqlDB.Close(); err != nil { + slog.Error("error closing sqlbd connection", "err", err.Error()) + } +} diff --git a/packages/eventindexer/encoding/types.go b/packages/eventindexer/encoding/types.go new file mode 100644 index 0000000000..e3616f37d1 --- /dev/null +++ b/packages/eventindexer/encoding/types.go @@ -0,0 +1,18 @@ +package encoding + +import ( + "github.com/ethereum/go-ethereum/accounts/abi" + + "github.com/ethereum/go-ethereum/log" + "github.com/taikoxyz/taiko-mono/packages/eventindexer/contracts/taikotoken" +) + +var TaikoTokenABI *abi.ABI + +var err error + +func init() { + if TaikoTokenABI, err = taikotoken.TaikoTokenMetaData.GetAbi(); err != nil { + log.Crit("Get TaikoTokenABI ABI error", "error", err) + } +} diff --git a/packages/eventindexer/event.go b/packages/eventindexer/event.go index 7d8560ef25..27e95b7804 100644 --- a/packages/eventindexer/event.go +++ b/packages/eventindexer/event.go @@ -22,6 +22,7 @@ var ( EventNameSwap = "Swap" EventNameMint = "Mint" EventNameNFTTransfer = "Transfer" + EventNameInstanceAdded = "InstanceAdded" ) // Event represents a stored EVM event. The fields will be serialized diff --git a/packages/eventindexer/indexer/config.go b/packages/eventindexer/indexer/config.go index 940376559c..cb39786cfe 100644 --- a/packages/eventindexer/indexer/config.go +++ b/packages/eventindexer/indexer/config.go @@ -33,6 +33,7 @@ type Config struct { L1TaikoAddress common.Address BridgeAddress common.Address AssignmentHookAddress common.Address + SgxVerifierAddress common.Address SwapAddresses []common.Address BlockBatchSize uint64 SubscriptionBackoff uint64 @@ -67,6 +68,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { L1TaikoAddress: common.HexToAddress(c.String(flags.L1TaikoAddress.Name)), BridgeAddress: common.HexToAddress(c.String(flags.BridgeAddress.Name)), AssignmentHookAddress: common.HexToAddress(c.String(flags.AssignmentHookAddress.Name)), + SgxVerifierAddress: common.HexToAddress(flags.SgxVerifierAddress.Name), SwapAddresses: swaps, BlockBatchSize: c.Uint64(flags.BlockBatchSize.Name), SubscriptionBackoff: c.Uint64(flags.SubscriptionBackoff.Name), diff --git a/packages/eventindexer/indexer/filter.go b/packages/eventindexer/indexer/filter.go index a06f9641bb..8be27761f2 100644 --- a/packages/eventindexer/indexer/filter.go +++ b/packages/eventindexer/indexer/filter.go @@ -156,6 +156,22 @@ func filterFunc( } } + if i.sgxVerifier != nil { + wg.Go(func() error { + instancesAdded, err := i.sgxVerifier.FilterInstanceAdded(filterOpts, nil, nil) + if err != nil { + return errors.Wrap(err, "i.sgxVerifier.FilterInstanceAdded") + } + + err = i.saveInstanceAddedEvents(ctx, chainID, instancesAdded) + if err != nil { + return errors.Wrap(err, "i.saveInstanceAddedEvents") + } + + return nil + }) + } + wg.Go(func() error { if err := i.indexRawBlockData(ctx, chainID, filterOpts.Start, *filterOpts.End); err != nil { return errors.Wrap(err, "i.indexRawBlockData") diff --git a/packages/eventindexer/indexer/indexer.go b/packages/eventindexer/indexer/indexer.go index ba2f740afe..e0fc194c24 100644 --- a/packages/eventindexer/indexer/indexer.go +++ b/packages/eventindexer/indexer/indexer.go @@ -12,6 +12,7 @@ import ( "github.com/taikoxyz/taiko-mono/packages/eventindexer" "github.com/taikoxyz/taiko-mono/packages/eventindexer/contracts/assignmenthook" "github.com/taikoxyz/taiko-mono/packages/eventindexer/contracts/bridge" + "github.com/taikoxyz/taiko-mono/packages/eventindexer/contracts/sgxverifier" "github.com/taikoxyz/taiko-mono/packages/eventindexer/contracts/swap" "github.com/taikoxyz/taiko-mono/packages/eventindexer/contracts/taikol1" "github.com/taikoxyz/taiko-mono/packages/eventindexer/pkg/repo" @@ -53,6 +54,7 @@ type Indexer struct { taikol1 *taikol1.TaikoL1 bridge *bridge.Bridge assignmentHook *assignmenthook.AssignmentHook + sgxVerifier *sgxverifier.SgxVerifier swaps []*swap.Swap indexNfts bool @@ -178,7 +180,7 @@ func InitFromConfig(ctx context.Context, i *Indexer, cfg *Config) error { if cfg.AssignmentHookAddress.Hex() != ZeroAddress.Hex() { assignmentHookContract, err = assignmenthook.NewAssignmentHook(cfg.AssignmentHookAddress, ethClient) if err != nil { - return errors.Wrap(err, "contracts.NewBridge") + return errors.Wrap(err, "contracts.NewAssignmentHook") } } @@ -188,13 +190,22 @@ func InitFromConfig(ctx context.Context, i *Indexer, cfg *Config) error { for _, v := range cfg.SwapAddresses { swapContract, err := swap.NewSwap(v, ethClient) if err != nil { - return errors.Wrap(err, "contracts.NewBridge") + return errors.Wrap(err, "contracts.NewSwap") } swapContracts = append(swapContracts, swapContract) } } + var sgxVerifierContract *sgxverifier.SgxVerifier + + if cfg.SgxVerifierAddress.Hex() != ZeroAddress.Hex() { + sgxVerifierContract, err = sgxverifier.NewSgxVerifier(cfg.SgxVerifierAddress, ethClient) + if err != nil { + return errors.Wrap(err, "contracts.NewSgxVerifier") + } + } + i.blockSaveMutex = &sync.Mutex{} i.accountRepo = accountRepository i.eventRepo = eventRepository @@ -208,6 +219,7 @@ func InitFromConfig(ctx context.Context, i *Indexer, cfg *Config) error { i.taikol1 = taikoL1 i.bridge = bridgeContract i.assignmentHook = assignmentHookContract + i.sgxVerifier = sgxVerifierContract i.swaps = swapContracts i.blockBatchSize = cfg.BlockBatchSize i.subscriptionBackoff = time.Duration(cfg.SubscriptionBackoff) * time.Second diff --git a/packages/eventindexer/indexer/save_instance_added_event.go b/packages/eventindexer/indexer/save_instance_added_event.go new file mode 100644 index 0000000000..68293def2e --- /dev/null +++ b/packages/eventindexer/indexer/save_instance_added_event.go @@ -0,0 +1,89 @@ +package indexer + +import ( + "context" + "encoding/json" + "math/big" + "time" + + "log/slog" + + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + "github.com/taikoxyz/taiko-mono/packages/eventindexer" + "github.com/taikoxyz/taiko-mono/packages/eventindexer/contracts/sgxverifier" +) + +func (i *Indexer) saveInstanceAddedEvents( + ctx context.Context, + chainID *big.Int, + events *sgxverifier.SgxVerifierInstanceAddedIterator, +) error { + if !events.Next() || events.Event == nil { + slog.Info("no InstanceAdded events") + return nil + } + + for { + event := events.Event + + slog.Info("new instanceAdded event") + + // Getting the transaction + tx, _, err := i.ethClient.TransactionByHash(context.Background(), event.Raw.TxHash) + if err != nil { + return err + } + + receipt, err := i.ethClient.TransactionReceipt(ctx, tx.Hash()) + + if err != nil { + return err + } + + sender, err := i.ethClient.TransactionSender(ctx, tx, event.Raw.BlockHash, receipt.TransactionIndex) + if err != nil { + return err + } + + if err := i.saveInstanceAddedEvent(ctx, chainID, event, sender); err != nil { + return errors.Wrap(err, "i.saveInstanceAddedEvent") + } + + if !events.Next() { + return nil + } + } +} + +func (i *Indexer) saveInstanceAddedEvent( + ctx context.Context, + chainID *big.Int, + event *sgxverifier.SgxVerifierInstanceAdded, + sender common.Address, +) error { + marshaled, err := json.Marshal(event) + if err != nil { + return errors.Wrap(err, "json.Marshal(event)") + } + + block, err := i.ethClient.BlockByNumber(ctx, new(big.Int).SetUint64(event.Raw.BlockNumber)) + if err != nil { + return errors.Wrap(err, "i.ethClient.BlockByNumber") + } + + _, err = i.eventRepo.Save(ctx, eventindexer.SaveEventOpts{ + Name: eventindexer.EventNameInstanceAdded, + Data: string(marshaled), + ChainID: chainID, + Event: eventindexer.EventNameInstanceAdded, + Address: sender.Hex(), + TransactedAt: time.Unix(int64(block.Time()), 0), + EmittedBlockID: event.Raw.BlockNumber, + }) + if err != nil { + return errors.Wrap(err, "i.eventRepo.Save") + } + + return nil +} From b3b32b5b5451b4924b639d57d19cbe18cfbeda22 Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Tue, 9 Apr 2024 15:23:58 +0800 Subject: [PATCH 3/4] chore(protocol): avoid transfer to self in assignment hook (#16696) --- packages/protocol/contracts/L1/TaikoData.sol | 2 +- packages/protocol/contracts/L1/hooks/AssignmentHook.sol | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/protocol/contracts/L1/TaikoData.sol b/packages/protocol/contracts/L1/TaikoData.sol index cca1a568a9..5280e278a2 100644 --- a/packages/protocol/contracts/L1/TaikoData.sol +++ b/packages/protocol/contracts/L1/TaikoData.sol @@ -110,7 +110,7 @@ library TaikoData { } /// @dev Struct containing data required for verifying a block. - /// 10 slots reserved for upgradability, 3 slots used. + /// 3 slots used. struct Block { bytes32 metaHash; // slot 1 address assignedProver; // slot 2 diff --git a/packages/protocol/contracts/L1/hooks/AssignmentHook.sol b/packages/protocol/contracts/L1/hooks/AssignmentHook.sol index 6c66c5e3c3..3af2ed578a 100644 --- a/packages/protocol/contracts/L1/hooks/AssignmentHook.sol +++ b/packages/protocol/contracts/L1/hooks/AssignmentHook.sol @@ -118,11 +118,11 @@ contract AssignmentHook is EssentialContract, IHook { // The proposer irrevocably pays a fee to the assigned prover, either in // Ether or ERC20 tokens. if (assignment.feeToken == address(0)) { - // Paying Ether + // Paying Ether even when proverFee is 0 to trigger a potential receive() function call. // Note that this payment may fail if it cost more gas bool success = _blk.assignedProver.sendEther(proverFee, MAX_GAS_PAYING_PROVER, ""); if (!success) emit EtherPaymentFailed(_blk.assignedProver, MAX_GAS_PAYING_PROVER); - } else if (proverFee != 0) { + } else if (proverFee != 0 && _meta.sender != _blk.assignedProver) { // Paying ERC20 tokens IERC20(assignment.feeToken).safeTransferFrom( _meta.sender, _blk.assignedProver, proverFee From 84f06f34199db2fdf49dcb0fd3e055827c29a15a Mon Sep 17 00:00:00 2001 From: D <51912515+adaki2004@users.noreply.github.com> Date: Tue, 9 Apr 2024 15:50:11 +0200 Subject: [PATCH 4/4] chore(protocol): apply some optimization recommendations from OpenZeppelin (#16691) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Keszey Dániel --- packages/protocol/contracts/L1/TaikoL1.sol | 2 +- packages/protocol/contracts/L1/TaikoToken.sol | 3 +- .../contracts/L1/hooks/AssignmentHook.sol | 7 +- .../contracts/L1/libs/LibProposing.sol | 12 +-- .../protocol/contracts/L1/libs/LibProving.sol | 21 ++--- .../contracts/L1/libs/LibVerifying.sol | 14 +-- .../contracts/L1/provers/GuardianProver.sol | 5 +- .../protocol/contracts/L2/DelegateOwner.sol | 11 ++- packages/protocol/contracts/L2/TaikoL2.sol | 8 +- packages/protocol/contracts/bridge/Bridge.sol | 31 ++++--- .../contracts/common/EssentialContract.sol | 2 - .../protocol/contracts/common/LibStrings.sol | 86 +++++++++++++++++++ .../contracts/signal/ISignalService.sol | 2 +- .../protocol/contracts/signal/LibSignals.sol | 12 --- .../contracts/signal/SignalService.sol | 12 +-- .../contracts/tokenvault/BaseVault.sol | 3 +- .../contracts/tokenvault/BridgedERC1155.sol | 7 +- .../contracts/tokenvault/BridgedERC20Base.sol | 7 +- .../contracts/tokenvault/BridgedERC721.sol | 5 +- .../contracts/tokenvault/ERC1155Vault.sol | 4 +- .../contracts/tokenvault/ERC20Vault.sol | 4 +- .../contracts/tokenvault/ERC721Vault.sol | 4 +- .../contracts/verifiers/GuardianVerifier.sol | 3 +- .../contracts/verifiers/RiscZeroVerifier.sol | 3 +- .../contracts/verifiers/SgxVerifier.sol | 9 +- packages/protocol/script/DeployOnL1.s.sol | 11 ++- packages/protocol/test/L1/TaikoL1TestBase.sol | 2 +- .../protocol/test/signal/SignalService.t.sol | 20 ++--- 28 files changed, 205 insertions(+), 105 deletions(-) create mode 100644 packages/protocol/contracts/common/LibStrings.sol delete mode 100644 packages/protocol/contracts/signal/LibSignals.sol diff --git a/packages/protocol/contracts/L1/TaikoL1.sol b/packages/protocol/contracts/L1/TaikoL1.sol index 32817ffb46..ac450b627c 100644 --- a/packages/protocol/contracts/L1/TaikoL1.sol +++ b/packages/protocol/contracts/L1/TaikoL1.sol @@ -228,7 +228,7 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents, TaikoErrors { view virtual override - onlyFromOwnerOrNamed("chain_pauser") + onlyFromOwnerOrNamed(LibStrings.B_CHAIN_PAUSER) { } function _checkEOAForCalldataDA() internal pure virtual returns (bool) { diff --git a/packages/protocol/contracts/L1/TaikoToken.sol b/packages/protocol/contracts/L1/TaikoToken.sol index ee9bb15e73..c02a102351 100644 --- a/packages/protocol/contracts/L1/TaikoToken.sol +++ b/packages/protocol/contracts/L1/TaikoToken.sol @@ -5,6 +5,7 @@ import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20VotesUpgradeable.sol"; import "../common/EssentialContract.sol"; +import "../common/LibStrings.sol"; /// @title TaikoToken /// @notice The TaikoToken (TKO), in the protocol is used for prover collateral @@ -52,7 +53,7 @@ contract TaikoToken is EssentialContract, ERC20SnapshotUpgradeable, ERC20VotesUp } /// @notice Creates a new token snapshot. - function snapshot() public onlyFromOwnerOrNamed("snapshooter") returns (uint256) { + function snapshot() public onlyFromOwnerOrNamed(LibStrings.B_SNAPSHOOTER) returns (uint256) { return _snapshot(); } diff --git a/packages/protocol/contracts/L1/hooks/AssignmentHook.sol b/packages/protocol/contracts/L1/hooks/AssignmentHook.sol index 3af2ed578a..d5176e86bd 100644 --- a/packages/protocol/contracts/L1/hooks/AssignmentHook.sol +++ b/packages/protocol/contracts/L1/hooks/AssignmentHook.sol @@ -5,6 +5,7 @@ import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; import "../../common/EssentialContract.sol"; +import "../../common/LibStrings.sol"; import "../../libs/LibAddress.sol"; import "../ITaikoL1.sol"; import "./IHook.sol"; @@ -70,7 +71,7 @@ contract AssignmentHook is EssentialContract, IHook { ) external payable - onlyFromNamed("taiko") + onlyFromNamed(LibStrings.B_TAIKO) nonReentrant { // Note that @@ -105,7 +106,7 @@ contract AssignmentHook is EssentialContract, IHook { } // Send the liveness bond to the Taiko contract - IERC20 tko = IERC20(resolve("taiko_token", false)); + IERC20 tko = IERC20(resolve(LibStrings.B_TAIKO_TOKEN, false)); // Note that we don't have to worry about // https://github.com/crytic/slither/wiki/Detector-Documentation#arbitrary-from-in-transferfrom @@ -175,7 +176,7 @@ contract AssignmentHook is EssentialContract, IHook { return keccak256( abi.encodePacked( - "PROVER_ASSIGNMENT", + LibStrings.B_PROVER_ASSIGNMENT, ITaikoL1(_taikoL1Address).getConfig().chainId, _taikoL1Address, _blockProposer, diff --git a/packages/protocol/contracts/L1/libs/LibProposing.sol b/packages/protocol/contracts/L1/libs/LibProposing.sol index c4b3000908..61ad57d699 100644 --- a/packages/protocol/contracts/L1/libs/LibProposing.sol +++ b/packages/protocol/contracts/L1/libs/LibProposing.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.24; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../../common/IAddressResolver.sol"; +import "../../common/LibStrings.sol"; import "../../libs/LibAddress.sol"; import "../../libs/LibNetwork.sol"; import "../hooks/IHook.sol"; @@ -154,9 +155,8 @@ library LibProposing { meta_.difficulty = keccak256(abi.encodePacked(block.prevrandao, b.numBlocks, block.number)); // Use the difficulty as a random number - meta_.minTier = ITierProvider(_resolver.resolve("tier_provider", false)).getMinTier( - uint256(meta_.difficulty) - ); + meta_.minTier = ITierProvider(_resolver.resolve(LibStrings.B_TIER_PROVIDER, false)) + .getMinTier(uint256(meta_.difficulty)); // Create the block that will be stored onchain TaikoData.Block memory blk = TaikoData.Block({ @@ -184,7 +184,7 @@ library LibProposing { } { - IERC20 tko = IERC20(_resolver.resolve("taiko_token", false)); + IERC20 tko = IERC20(_resolver.resolve(LibStrings.B_TAIKO_TOKEN, false)); uint256 tkoBalance = tko.balanceOf(address(this)); // Run all hooks. @@ -240,13 +240,13 @@ library LibProposing { { if (_slotB.numBlocks == 1) { // Only proposer_one can propose the first block after genesis - address proposerOne = _resolver.resolve("proposer_one", true); + address proposerOne = _resolver.resolve(LibStrings.B_PROPOSER_ONE, true); if (proposerOne != address(0)) { return msg.sender == proposerOne; } } - address proposer = _resolver.resolve("proposer", true); + address proposer = _resolver.resolve(LibStrings.B_PROPOSER, true); return proposer == address(0) || msg.sender == proposer; } } diff --git a/packages/protocol/contracts/L1/libs/LibProving.sol b/packages/protocol/contracts/L1/libs/LibProving.sol index e29d24f735..eb91680de4 100644 --- a/packages/protocol/contracts/L1/libs/LibProving.sol +++ b/packages/protocol/contracts/L1/libs/LibProving.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../../common/IAddressResolver.sol"; +import "../../common/LibStrings.sol"; import "../../verifiers/IVerifier.sol"; import "../tiers/ITierProvider.sol"; import "./LibUtils.sol"; @@ -32,14 +33,6 @@ library LibProving { bool sameTransition; } - /// @notice Keccak hash of the string "RETURN_LIVENESS_BOND". - bytes32 public constant RETURN_LIVENESS_BOND = keccak256("RETURN_LIVENESS_BOND"); - - /// @notice The tier name for optimistic proofs - expected to only be used for testnets. For - /// production we do not plan to have optimistic type of proving first, but future will tell if - /// L3s, app-chains or other 3rd parties would be willing to do so. - bytes32 private constant TIER_OP = bytes32("tier_optimistic"); - // Warning: Any events defined here must also be defined in TaikoEvents.sol. /// @notice Emitted when a transition is proved. /// @param blockId The block ID. @@ -161,7 +154,8 @@ library LibProving { // Retrieve the tier configurations. If the tier is not supported, the // subsequent action will result in a revert. - local.tier = ITierProvider(_resolver.resolve("tier_provider", false)).getTier(_proof.tier); + local.tier = + ITierProvider(_resolver.resolve(LibStrings.B_TIER_PROVIDER, false)).getTier(_proof.tier); local.inProvingWindow = !LibUtils.isPostDeadline(ts.timestamp, local.b.lastUnpausedAt, local.tier.provingWindow); @@ -207,7 +201,7 @@ library LibProving { }); IVerifier(verifier).verifyProof(ctx, _tran, _proof); - } else if (local.tier.verifierName != TIER_OP) { + } else if (local.tier.verifierName != LibStrings.B_TIER_OP) { // The verifier can be address-zero, signifying that there are no // proof checks for the tier. In practice, this only applies to // optimistic proofs. @@ -216,14 +210,17 @@ library LibProving { } local.isTopTier = local.tier.contestBond == 0; - IERC20 tko = IERC20(_resolver.resolve("taiko_token", false)); + IERC20 tko = IERC20(_resolver.resolve(LibStrings.B_TAIKO_TOKEN, false)); local.livenessBond = blk.livenessBond; if (local.isTopTier) { if (local.livenessBond != 0) { if ( local.inProvingWindow - || (_proof.data.length == 32 && bytes32(_proof.data) == RETURN_LIVENESS_BOND) + || ( + _proof.data.length == 32 + && bytes32(_proof.data) == LibStrings.H_RETURN_LIVENESS_BOND + ) ) { tko.safeTransfer(local.assignedProver, local.livenessBond); } diff --git a/packages/protocol/contracts/L1/libs/LibVerifying.sol b/packages/protocol/contracts/L1/libs/LibVerifying.sol index 52f654a464..160b064abf 100644 --- a/packages/protocol/contracts/L1/libs/LibVerifying.sol +++ b/packages/protocol/contracts/L1/libs/LibVerifying.sol @@ -4,8 +4,8 @@ pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../../common/IAddressResolver.sol"; +import "../../common/LibStrings.sol"; import "../../signal/ISignalService.sol"; -import "../../signal/LibSignals.sol"; import "../tiers/ITierProvider.sol"; import "./LibUtils.sol"; @@ -119,6 +119,8 @@ library LibVerifying { uint64 numBlocksVerified; address tierProvider; + IERC20 tko = IERC20(_resolver.resolve(LibStrings.B_TAIKO_TOKEN, false)); + // Unchecked is safe: // - assignment is within ranges // - blockId and numBlocksVerified values incremented will still be OK in the @@ -148,7 +150,7 @@ library LibVerifying { break; } else { if (tierProvider == address(0)) { - tierProvider = _resolver.resolve("tier_provider", false); + tierProvider = _resolver.resolve(LibStrings.B_TIER_PROVIDER, false); } if ( @@ -171,7 +173,6 @@ library LibVerifying { blockHash = ts.blockHash; stateRoot = ts.stateRoot; - IERC20 tko = IERC20(_resolver.resolve("taiko_token", false)); tko.safeTransfer(ts.prover, ts.validityBond); // Note: We exclusively address the bonds linked to the @@ -219,10 +220,11 @@ library LibVerifying { ) private { - ISignalService signalService = ISignalService(_resolver.resolve("signal_service", false)); + ISignalService signalService = + ISignalService(_resolver.resolve(LibStrings.B_SIGNAL_SERVICE, false)); (uint64 lastSyncedBlock,) = signalService.getSyncedChainData( - _config.chainId, LibSignals.STATE_ROOT, 0 /* latest block Id*/ + _config.chainId, LibStrings.H_STATE_ROOT, 0 /* latest block Id*/ ); if (_lastVerifiedBlockId > lastSyncedBlock + _config.blockSyncThreshold) { @@ -230,7 +232,7 @@ library LibVerifying { _state.slotA.lastSynecdAt = uint64(block.timestamp); signalService.syncChainData( - _config.chainId, LibSignals.STATE_ROOT, _lastVerifiedBlockId, _stateRoot + _config.chainId, LibStrings.H_STATE_ROOT, _lastVerifiedBlockId, _stateRoot ); } } diff --git a/packages/protocol/contracts/L1/provers/GuardianProver.sol b/packages/protocol/contracts/L1/provers/GuardianProver.sol index 4b997364b7..16c0b86d2c 100644 --- a/packages/protocol/contracts/L1/provers/GuardianProver.sol +++ b/packages/protocol/contracts/L1/provers/GuardianProver.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.24; import "../tiers/ITierProvider.sol"; import "../ITaikoL1.sol"; import "./Guardians.sol"; +import "../../common/LibStrings.sol"; /// @title GuardianProver /// @custom:security-contact security@taiko.xyz @@ -57,7 +58,9 @@ contract GuardianProver is Guardians { if (approved_) { deleteApproval(hash); - ITaikoL1(resolve("taiko", false)).proveBlock(_meta.id, abi.encode(_meta, _tran, _proof)); + ITaikoL1(resolve(LibStrings.B_TAIKO, false)).proveBlock( + _meta.id, abi.encode(_meta, _tran, _proof) + ); } } } diff --git a/packages/protocol/contracts/L2/DelegateOwner.sol b/packages/protocol/contracts/L2/DelegateOwner.sol index 730affadea..5b79d7dc9a 100644 --- a/packages/protocol/contracts/L2/DelegateOwner.sol +++ b/packages/protocol/contracts/L2/DelegateOwner.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.24; import "../common/EssentialContract.sol"; +import "../common/LibStrings.sol"; import "../bridge/IBridge.sol"; /// @title DelegateOwner @@ -64,7 +65,11 @@ contract DelegateOwner is EssentialContract, IMessageInvocable { /// @inheritdoc IMessageInvocable /// @dev Do not guard with nonReentrant as this function may re-enter the contract as _data /// represents calls to address(this). - function onMessageInvocation(bytes calldata _data) external payable onlyFromNamed("bridge") { + function onMessageInvocation(bytes calldata _data) + external + payable + onlyFromNamed(LibStrings.B_BRIDGE) + { (uint64 txId, address target, bytes memory txdata) = abi.decode(_data, (uint64, address, bytes)); @@ -74,13 +79,13 @@ contract DelegateOwner is EssentialContract, IMessageInvocable { if (ctx.srcChainId != l1ChainId || ctx.from != realOwner) { revert DO_PERMISSION_DENIED(); } - + nextTxId++; // Sending ether along with the function call. Although this is sending Ether from this // contract back to itself, txData's function can now be payable. (bool success,) = target.call{ value: msg.value }(txdata); if (!success) revert DO_TX_REVERTED(); - emit TransactionExecuted(nextTxId++, target, bytes4(txdata)); + emit TransactionExecuted(txId, target, bytes4(txdata)); } function acceptOwnership(address target) external { diff --git a/packages/protocol/contracts/L2/TaikoL2.sol b/packages/protocol/contracts/L2/TaikoL2.sol index 04199f0f65..e0d36a4f97 100644 --- a/packages/protocol/contracts/L2/TaikoL2.sol +++ b/packages/protocol/contracts/L2/TaikoL2.sol @@ -5,9 +5,9 @@ import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../common/EssentialContract.sol"; +import "../common/LibStrings.sol"; import "../libs/LibAddress.sol"; import "../signal/ISignalService.sol"; -import "../signal/LibSignals.sol"; import "./Lib1559Math.sol"; import "./LibL2Config.sol"; @@ -152,8 +152,8 @@ contract TaikoL2 is EssentialContract { if (_l1BlockId > lastSyncedBlock) { // Store the L1's state root as a signal to the local signal service to // allow for multi-hop bridging. - ISignalService(resolve("signal_service", false)).syncChainData( - l1ChainId, LibSignals.STATE_ROOT, _l1BlockId, _l1StateRoot + ISignalService(resolve(LibStrings.B_SIGNAL_SERVICE, false)).syncChainData( + l1ChainId, LibStrings.H_STATE_ROOT, _l1BlockId, _l1StateRoot ); lastSyncedBlock = _l1BlockId; @@ -180,7 +180,7 @@ contract TaikoL2 is EssentialContract { ) external whenNotPaused - onlyFromOwnerOrNamed("withdrawer") + onlyFromOwnerOrNamed(LibStrings.B_WITHDRAWER) nonReentrant { if (_to == address(0)) revert L2_INVALID_PARAM(); diff --git a/packages/protocol/contracts/bridge/Bridge.sol b/packages/protocol/contracts/bridge/Bridge.sol index 05ec40a50a..3cf85d6cbf 100644 --- a/packages/protocol/contracts/bridge/Bridge.sol +++ b/packages/protocol/contracts/bridge/Bridge.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.24; import "../common/EssentialContract.sol"; +import "../common/LibStrings.sol"; import "../libs/LibAddress.sol"; import "../libs/LibMath.sol"; import "../signal/ISignalService.sol"; @@ -96,7 +97,7 @@ contract Bridge is EssentialContract, IBridge { bool _suspend ) external - onlyFromOwnerOrNamed("bridge_watchdog") + onlyFromOwnerOrNamed(LibStrings.B_BRIDGE_WATCHDOG) { for (uint256 i; i < _msgHashes.length; ++i) { bytes32 msgHash = _msgHashes[i]; @@ -157,7 +158,7 @@ contract Bridge is EssentialContract, IBridge { msgHash_ = hashMessage(message_); emit MessageSent(msgHash_, message_); - ISignalService(resolve("signal_service", false)).sendSignal(msgHash_); + ISignalService(resolve(LibStrings.B_SIGNAL_SERVICE, false)).sendSignal(msgHash_); } /// @inheritdoc IBridge @@ -181,7 +182,7 @@ contract Bridge is EssentialContract, IBridge { bool isNewlyProven; if (receivedAt == 0) { - address signalService = resolve("signal_service", false); + address signalService = resolve(LibStrings.B_SIGNAL_SERVICE, false); if (!ISignalService(signalService).isSignalSent(address(this), msgHash)) { revert B_MESSAGE_NOT_SENT(); @@ -240,7 +241,7 @@ contract Bridge is EssentialContract, IBridge { bytes32 msgHash = hashMessage(_message); if (messageStatus[msgHash] != Status.NEW) revert B_STATUS_MISMATCH(); - address signalService = resolve("signal_service", false); + address signalService = resolve(LibStrings.B_SIGNAL_SERVICE, false); uint64 receivedAt = proofReceipt[msgHash].receivedAt; if (receivedAt == type(uint64).max) revert B_MESSAGE_SUSPENDED(); @@ -400,7 +401,7 @@ contract Bridge is EssentialContract, IBridge { /// @inheritdoc IBridge function isMessageSent(Message calldata _message) external view returns (bool) { if (_message.srcChainId != block.chainid) return false; - return ISignalService(resolve("signal_service", false)).isSignalSent({ + return ISignalService(resolve(LibStrings.B_SIGNAL_SERVICE, false)).isSignalSent({ _app: address(this), _signal: hashMessage(_message) }); @@ -421,7 +422,7 @@ contract Bridge is EssentialContract, IBridge { if (_message.srcChainId != block.chainid) return false; return _proveSignalReceived( - resolve("signal_service", false), + resolve(LibStrings.B_SIGNAL_SERVICE, false), signalForFailedMessage(hashMessage(_message)), _message.destChainId, _proof @@ -442,7 +443,10 @@ contract Bridge is EssentialContract, IBridge { { if (_message.destChainId != block.chainid) return false; return _proveSignalReceived( - resolve("signal_service", false), hashMessage(_message), _message.srcChainId, _proof + resolve(LibStrings.B_SIGNAL_SERVICE, false), + hashMessage(_message), + _message.srcChainId, + _proof ); } @@ -462,7 +466,7 @@ contract Bridge is EssentialContract, IBridge { if (_message.srcChainId != block.chainid) return false; return _isSignalReceived( - resolve("signal_service", false), + resolve(LibStrings.B_SIGNAL_SERVICE, false), signalForFailedMessage(hashMessage(_message)), _message.destChainId, _proof @@ -484,7 +488,10 @@ contract Bridge is EssentialContract, IBridge { { if (_message.destChainId != block.chainid) return false; return _isSignalReceived( - resolve("signal_service", false), hashMessage(_message), _message.srcChainId, _proof + resolve(LibStrings.B_SIGNAL_SERVICE, false), + hashMessage(_message), + _message.srcChainId, + _proof ); } @@ -546,10 +553,10 @@ contract Bridge is EssentialContract, IBridge { /// only allow watchdog to pause the bridge, but does not allow it to unpause the bridge. function _authorizePause(address addr, bool toPause) internal view override { // Owenr and chain_pauser can pause/unpause the bridge. - if (addr == owner() || addr == resolve("chain_pauser", true)) return; + if (addr == owner() || addr == resolve(LibStrings.B_CHAIN_PAUSER, true)) return; // bridge_watchdog can pause the bridge, but cannot unpause it. - if (toPause && addr == resolve("bridge_watchdog", true)) return; + if (toPause && addr == resolve(LibStrings.B_BRIDGE_WATCHDOG, true)) return; revert RESOLVER_DENIED(); } @@ -601,7 +608,7 @@ contract Bridge is EssentialContract, IBridge { emit MessageStatusChanged(_msgHash, _status); if (_status == Status.FAILED) { - ISignalService(resolve("signal_service", false)).sendSignal( + ISignalService(resolve(LibStrings.B_SIGNAL_SERVICE, false)).sendSignal( signalForFailedMessage(_msgHash) ); } diff --git a/packages/protocol/contracts/common/EssentialContract.sol b/packages/protocol/contracts/common/EssentialContract.sol index 0cfed1baf2..a4758fd391 100644 --- a/packages/protocol/contracts/common/EssentialContract.sol +++ b/packages/protocol/contracts/common/EssentialContract.sol @@ -23,9 +23,7 @@ abstract contract EssentialContract is UUPSUpgradeable, Ownable2StepUpgradeable, /// @dev Slot 1. uint8 private __reentry; - uint8 private __paused; - uint64 public lastUnpausedAt; uint256[49] private __gap; diff --git a/packages/protocol/contracts/common/LibStrings.sol b/packages/protocol/contracts/common/LibStrings.sol new file mode 100644 index 0000000000..2467e8f217 --- /dev/null +++ b/packages/protocol/contracts/common/LibStrings.sol @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +/// @title LibStrings +/// @custom:security-contact security@taiko.xyz +library LibStrings { + /// @notice bytes32 representation of the string "chain_pauser". + bytes32 internal constant B_CHAIN_PAUSER = bytes32("chain_pauser"); + + /// @notice bytes32 representation of the string "snapshooter". + bytes32 internal constant B_SNAPSHOOTER = bytes32("snapshooter"); + + /// @notice bytes32 representation of the string "withdrawer". + bytes32 internal constant B_WITHDRAWER = bytes32("withdrawer"); + + /// @notice bytes32 representation of the string "proposer". + bytes32 internal constant B_PROPOSER = bytes32("proposer"); + + /// @notice bytes32 representation of the string "proposer_one". + bytes32 internal constant B_PROPOSER_ONE = bytes32("proposer_one"); + + /// @notice bytes32 representation of the string "signal_service". + bytes32 internal constant B_SIGNAL_SERVICE = bytes32("signal_service"); + + /// @notice bytes32 representation of the string "taiko_token". + bytes32 internal constant B_TAIKO_TOKEN = bytes32("taiko_token"); + + /// @notice bytes32 representation of the string "taiko". + bytes32 internal constant B_TAIKO = bytes32("taiko"); + + /// @notice bytes32 representation of the string "bridge". + bytes32 internal constant B_BRIDGE = bytes32("bridge"); + + /// @notice bytes32 representation of the string "erc20_vault". + bytes32 internal constant B_ERC20_VAULT = bytes32("erc20_vault"); + + /// @notice bytes32 representation of the string "bridged_erc20". + bytes32 internal constant B_BRIDGED_ERC20 = bytes32("bridged_erc20"); + + /// @notice bytes32 representation of the string "erc1155_vault". + bytes32 internal constant B_ERC1155_VAULT = bytes32("erc1155_vault"); + + /// @notice bytes32 representation of the string "bridged_erc1155". + bytes32 internal constant B_BRIDGED_ERC1155 = bytes32("bridged_erc1155"); + + /// @notice bytes32 representation of the string "erc721_vault". + bytes32 internal constant B_ERC721_VAULT = bytes32("erc721_vault"); + + /// @notice bytes32 representation of the string "bridged_erc721". + bytes32 internal constant B_BRIDGED_ERC721 = bytes32("bridged_erc721"); + + /// @notice bytes32 representation of the string "bridge_watchdog". + bytes32 internal constant B_BRIDGE_WATCHDOG = bytes32("bridge_watchdog"); + + /// @notice bytes32 representation of the string "rollup_watchdog". + bytes32 internal constant B_ROLLUP_WATCHDOG = bytes32("rollup_watchdog"); + + /// @notice bytes32 representation of the string "tier_provider". + bytes32 internal constant B_TIER_PROVIDER = bytes32("tier_provider"); + + /// @notice The tier name for optimistic proofs - expected to only be used for testnets. For + /// production we do not plan to have optimistic type of proving first, but future will tell if + /// L3s, app-chains or other 3rd parties would be willing to do so. + bytes32 internal constant B_TIER_OP = bytes32("tier_optimistic"); + + /// @notice bytes32 representation of the string "guardian_prover". + bytes32 internal constant B_GUARDIAN_PROVER = bytes32("guardian_prover"); + + /// @notice bytes32 representation of the string "automata_dcap_attestation". + bytes32 internal constant B_AUTOMATA_DCAP_ATTESTATION = bytes32("automata_dcap_attestation"); + + /// @notice bytes32 representation of the string "PROVER_ASSIGNMENT". + bytes32 public constant B_PROVER_ASSIGNMENT = bytes32("PROVER_ASSIGNMENT"); + + /// @notice Keccak hash of the string "RETURN_LIVENESS_BOND". + bytes32 internal constant H_RETURN_LIVENESS_BOND = keccak256("RETURN_LIVENESS_BOND"); + + /// @notice Keccak hash of the string "STATE_ROOT". + bytes32 internal constant H_STATE_ROOT = keccak256("STATE_ROOT"); + + /// @notice Keccak hash of the string "SIGNAL_ROOT". + bytes32 internal constant H_SIGNAL_ROOT = keccak256("SIGNAL_ROOT"); + + /// @notice Constant string "SIGNAL". + string internal constant S_SIGNAL = "SIGNAL"; +} diff --git a/packages/protocol/contracts/signal/ISignalService.sol b/packages/protocol/contracts/signal/ISignalService.sol index 2db157aeb2..15687f85a4 100644 --- a/packages/protocol/contracts/signal/ISignalService.sol +++ b/packages/protocol/contracts/signal/ISignalService.sol @@ -30,7 +30,7 @@ interface ISignalService { /// value has been synced to the destination chain. /// @dev To get both the blockId and the rootHash, apps should subscribe to the /// ChainDataSynced event or query `topBlockId` first using the source chain's ID and - /// LibSignals.STATE_ROOT to get the most recent block ID synced, then call + /// LibStrings.H_STATE_ROOT to get the most recent block ID synced, then call /// `getSyncedChainData` to read the synchronized data. bytes32 rootHash; /// @notice Options to cache either the state roots or signal roots of middle-hops to the diff --git a/packages/protocol/contracts/signal/LibSignals.sol b/packages/protocol/contracts/signal/LibSignals.sol deleted file mode 100644 index 6f503332f5..0000000000 --- a/packages/protocol/contracts/signal/LibSignals.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.24; - -/// @title LibSignals -/// @custom:security-contact security@taiko.xyz -library LibSignals { - /// @notice Keccak hash of the string "STATE_ROOT". - bytes32 public constant STATE_ROOT = keccak256("STATE_ROOT"); - - /// @notice Keccak hash of the string "SIGNAL_ROOT". - bytes32 public constant SIGNAL_ROOT = keccak256("SIGNAL_ROOT"); -} diff --git a/packages/protocol/contracts/signal/SignalService.sol b/packages/protocol/contracts/signal/SignalService.sol index 46bd86f2c6..50888a6d2c 100644 --- a/packages/protocol/contracts/signal/SignalService.sol +++ b/packages/protocol/contracts/signal/SignalService.sol @@ -2,9 +2,9 @@ pragma solidity 0.8.24; import "../common/EssentialContract.sol"; +import "../common/LibStrings.sol"; import "../libs/LibTrieProof.sol"; import "./ISignalService.sol"; -import "./LibSignals.sol"; /// @title SignalService /// @notice See the documentation in {ISignalService} for more details. @@ -190,7 +190,7 @@ contract SignalService is EssentialContract, ISignalService { pure returns (bytes32) { - return keccak256(abi.encodePacked("SIGNAL", _chainId, _app, _signal)); + return keccak256(abi.encodePacked(LibStrings.S_SIGNAL, _chainId, _app, _signal)); } function _verifyHopProof( @@ -266,7 +266,7 @@ contract SignalService is EssentialContract, ISignalService { if (cacheStateRoot && _action.isFullProof && !_action.isLastHop) { _syncChainData( - _action.chainId, LibSignals.STATE_ROOT, _action.blockId, _action.rootHash + _action.chainId, LibStrings.H_STATE_ROOT, _action.blockId, _action.rootHash ); } @@ -276,7 +276,7 @@ contract SignalService is EssentialContract, ISignalService { if (cacheSignalRoot && (_action.isFullProof || !_action.isLastHop)) { _syncChainData( - _action.chainId, LibSignals.SIGNAL_ROOT, _action.blockId, _action.signalRoot + _action.chainId, LibStrings.H_SIGNAL_ROOT, _action.blockId, _action.signalRoot ); } } @@ -366,7 +366,9 @@ contract SignalService is EssentialContract, ISignalService { } signal = signalForChainData( - chainId, isFullProof ? LibSignals.STATE_ROOT : LibSignals.SIGNAL_ROOT, hop.blockId + chainId, + isFullProof ? LibStrings.H_STATE_ROOT : LibStrings.H_SIGNAL_ROOT, + hop.blockId ); value = hop.rootHash; chainId = hop.chainId; diff --git a/packages/protocol/contracts/tokenvault/BaseVault.sol b/packages/protocol/contracts/tokenvault/BaseVault.sol index 838a736906..924bb6139a 100644 --- a/packages/protocol/contracts/tokenvault/BaseVault.sol +++ b/packages/protocol/contracts/tokenvault/BaseVault.sol @@ -5,6 +5,7 @@ import "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeab import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import "../bridge/IBridge.sol"; import "../common/EssentialContract.sol"; +import "../common/LibStrings.sol"; /// @title BaseVault /// @notice This abstract contract provides a base implementation for vaults. @@ -20,7 +21,7 @@ abstract contract BaseVault is error VAULT_PERMISSION_DENIED(); modifier onlyFromBridge() { - if (msg.sender != resolve("bridge", false)) { + if (msg.sender != resolve(LibStrings.B_BRIDGE, false)) { revert VAULT_PERMISSION_DENIED(); } _; diff --git a/packages/protocol/contracts/tokenvault/BridgedERC1155.sol b/packages/protocol/contracts/tokenvault/BridgedERC1155.sol index 4fefb8162e..70e70689d3 100644 --- a/packages/protocol/contracts/tokenvault/BridgedERC1155.sol +++ b/packages/protocol/contracts/tokenvault/BridgedERC1155.sol @@ -3,6 +3,7 @@ pragma solidity 0.8.24; import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol"; import "../common/EssentialContract.sol"; +import "../common/LibStrings.sol"; import "./LibBridgedToken.sol"; /// @title BridgedERC1155 @@ -70,7 +71,7 @@ contract BridgedERC1155 is EssentialContract, ERC1155Upgradeable { ) public whenNotPaused - onlyFromNamed("erc1155_vault") + onlyFromNamed(LibStrings.B_ERC1155_VAULT) nonReentrant { _mint(_to, _tokenId, _amount, ""); @@ -87,7 +88,7 @@ contract BridgedERC1155 is EssentialContract, ERC1155Upgradeable { ) public whenNotPaused - onlyFromNamed("erc1155_vault") + onlyFromNamed(LibStrings.B_ERC1155_VAULT) nonReentrant { _mintBatch(_to, _tokenIds, _amounts, ""); @@ -104,7 +105,7 @@ contract BridgedERC1155 is EssentialContract, ERC1155Upgradeable { ) public whenNotPaused - onlyFromNamed("erc1155_vault") + onlyFromNamed(LibStrings.B_ERC1155_VAULT) nonReentrant { _burn(_account, _tokenId, _amount); diff --git a/packages/protocol/contracts/tokenvault/BridgedERC20Base.sol b/packages/protocol/contracts/tokenvault/BridgedERC20Base.sol index 88e2bab98a..df7b834dfd 100644 --- a/packages/protocol/contracts/tokenvault/BridgedERC20Base.sol +++ b/packages/protocol/contracts/tokenvault/BridgedERC20Base.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.24; import "../common/EssentialContract.sol"; +import "../common/LibStrings.sol"; import "./IBridgedERC20.sol"; /// @title BridgedERC20Base @@ -39,7 +40,7 @@ abstract contract BridgedERC20Base is EssentialContract, IBridgedERC20 { ) external whenNotPaused - onlyFromOwnerOrNamed("erc20_vault") + onlyFromOwnerOrNamed(LibStrings.B_ERC20_VAULT) nonReentrant { if (_migratingAddress == migratingAddress && _migratingInbound == migratingInbound) { @@ -62,7 +63,7 @@ abstract contract BridgedERC20Base is EssentialContract, IBridgedERC20 { if (msg.sender == _migratingAddress) { // Inbound migration emit MigratedTo(_migratingAddress, _account, _amount); - } else if (msg.sender != resolve("erc20_vault", true)) { + } else if (msg.sender != resolve(LibStrings.B_ERC20_VAULT, true)) { // Bridging from vault revert BB_PERMISSION_DENIED(); } @@ -81,7 +82,7 @@ abstract contract BridgedERC20Base is EssentialContract, IBridgedERC20 { emit MigratedTo(migratingAddress, _account, _amount); // Ask the new bridged token to mint token for the user. IBridgedERC20(migratingAddress).mint(_account, _amount); - } else if (msg.sender != resolve("erc20_vault", true)) { + } else if (msg.sender != resolve(LibStrings.B_ERC20_VAULT, true)) { // Only the vault can burn tokens when not migrating out revert RESOLVER_DENIED(); } diff --git a/packages/protocol/contracts/tokenvault/BridgedERC721.sol b/packages/protocol/contracts/tokenvault/BridgedERC721.sol index d189ae6fc6..57ed0aacf9 100644 --- a/packages/protocol/contracts/tokenvault/BridgedERC721.sol +++ b/packages/protocol/contracts/tokenvault/BridgedERC721.sol @@ -3,6 +3,7 @@ pragma solidity 0.8.24; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "../common/EssentialContract.sol"; +import "../common/LibStrings.sol"; import "./LibBridgedToken.sol"; /// @title BridgedERC721 @@ -56,7 +57,7 @@ contract BridgedERC721 is EssentialContract, ERC721Upgradeable { ) external whenNotPaused - onlyFromNamed("erc721_vault") + onlyFromNamed(LibStrings.B_ERC721_VAULT) nonReentrant { _safeMint(_account, _tokenId); @@ -71,7 +72,7 @@ contract BridgedERC721 is EssentialContract, ERC721Upgradeable { ) external whenNotPaused - onlyFromNamed("erc721_vault") + onlyFromNamed(LibStrings.B_ERC721_VAULT) nonReentrant { // Check if the caller is the owner of the token. diff --git a/packages/protocol/contracts/tokenvault/ERC1155Vault.sol b/packages/protocol/contracts/tokenvault/ERC1155Vault.sol index 5d863641c7..372b8fc4a6 100644 --- a/packages/protocol/contracts/tokenvault/ERC1155Vault.sol +++ b/packages/protocol/contracts/tokenvault/ERC1155Vault.sol @@ -81,7 +81,7 @@ contract ERC1155Vault is BaseNFTVault, ERC1155ReceiverUpgradeable { // Send the message and obtain the message hash bytes32 msgHash; (msgHash, message_) = - IBridge(resolve("bridge", false)).sendMessage{ value: msg.value }(message); + IBridge(resolve(LibStrings.B_BRIDGE, false)).sendMessage{ value: msg.value }(message); // Emit TokenSent event emit TokenSent({ @@ -312,7 +312,7 @@ contract ERC1155Vault is BaseNFTVault, ERC1155ReceiverUpgradeable { (owner(), addressManager, _ctoken.addr, _ctoken.chainId, _ctoken.symbol, _ctoken.name) ); - btoken_ = address(new ERC1967Proxy(resolve("bridged_erc1155", false), data)); + btoken_ = address(new ERC1967Proxy(resolve(LibStrings.B_BRIDGED_ERC1155, false), data)); bridgedToCanonical[btoken_] = _ctoken; canonicalToBridged[_ctoken.chainId][_ctoken.addr] = btoken_; diff --git a/packages/protocol/contracts/tokenvault/ERC20Vault.sol b/packages/protocol/contracts/tokenvault/ERC20Vault.sol index 22d2d169fe..b0156eab8c 100644 --- a/packages/protocol/contracts/tokenvault/ERC20Vault.sol +++ b/packages/protocol/contracts/tokenvault/ERC20Vault.sol @@ -242,7 +242,7 @@ contract ERC20Vault is BaseVault { bytes32 msgHash; (msgHash, message_) = - IBridge(resolve("bridge", false)).sendMessage{ value: msg.value }(message); + IBridge(resolve(LibStrings.B_BRIDGE, false)).sendMessage{ value: msg.value }(message); emit TokenSent({ msgHash: msgHash, @@ -419,7 +419,7 @@ contract ERC20Vault is BaseVault { ) ); - btoken = address(new ERC1967Proxy(resolve("bridged_erc20", false), data)); + btoken = address(new ERC1967Proxy(resolve(LibStrings.B_BRIDGED_ERC20, false), data)); bridgedToCanonical[btoken] = ctoken; canonicalToBridged[ctoken.chainId][ctoken.addr] = btoken; diff --git a/packages/protocol/contracts/tokenvault/ERC721Vault.sol b/packages/protocol/contracts/tokenvault/ERC721Vault.sol index 7e86e797c1..93d7b96a23 100644 --- a/packages/protocol/contracts/tokenvault/ERC721Vault.sol +++ b/packages/protocol/contracts/tokenvault/ERC721Vault.sol @@ -65,7 +65,7 @@ contract ERC721Vault is BaseNFTVault, IERC721Receiver { bytes32 msgHash; (msgHash, message_) = - IBridge(resolve("bridge", false)).sendMessage{ value: msg.value }(message); + IBridge(resolve(LibStrings.B_BRIDGE, false)).sendMessage{ value: msg.value }(message); emit TokenSent({ msgHash: msgHash, @@ -249,7 +249,7 @@ contract ERC721Vault is BaseNFTVault, IERC721Receiver { (owner(), addressManager, _ctoken.addr, _ctoken.chainId, _ctoken.symbol, _ctoken.name) ); - btoken_ = address(new ERC1967Proxy(resolve("bridged_erc721", false), data)); + btoken_ = address(new ERC1967Proxy(resolve(LibStrings.B_BRIDGED_ERC721, false), data)); bridgedToCanonical[btoken_] = _ctoken; canonicalToBridged[_ctoken.chainId][_ctoken.addr] = btoken_; diff --git a/packages/protocol/contracts/verifiers/GuardianVerifier.sol b/packages/protocol/contracts/verifiers/GuardianVerifier.sol index 6153d59c9b..719b81bed1 100644 --- a/packages/protocol/contracts/verifiers/GuardianVerifier.sol +++ b/packages/protocol/contracts/verifiers/GuardianVerifier.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.24; import "../common/EssentialContract.sol"; +import "../common/LibStrings.sol"; import "../L1/tiers/ITierProvider.sol"; import "./IVerifier.sol"; @@ -33,7 +34,7 @@ contract GuardianVerifier is EssentialContract, IVerifier { revert GV_INVALID_PROOF(); } - if (_ctx.msgSender != resolve("guardian_prover", false)) { + if (_ctx.msgSender != resolve(LibStrings.B_GUARDIAN_PROVER, false)) { revert GV_PERMISSION_DENIED(); } } diff --git a/packages/protocol/contracts/verifiers/RiscZeroVerifier.sol b/packages/protocol/contracts/verifiers/RiscZeroVerifier.sol index 1876120813..cce5432b89 100644 --- a/packages/protocol/contracts/verifiers/RiscZeroVerifier.sol +++ b/packages/protocol/contracts/verifiers/RiscZeroVerifier.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.24; import "../common/EssentialContract.sol"; +import "../common/LibStrings.sol"; import "../thirdparty/risczero/IRiscZeroReceiptVerifier.sol"; import "../L1/ITaikoL1.sol"; import "./IVerifier.sol"; @@ -71,7 +72,7 @@ contract RiscZeroVerifier is EssentialContract, IVerifier { revert RISC_ZERO_INVALID_IMAGE_ID(); } - uint64 chainId = ITaikoL1(resolve("taiko", false)).getConfig().chainId; + uint64 chainId = ITaikoL1(resolve(LibStrings.B_TAIKO, false)).getConfig().chainId; bytes32 hash = LibPublicInput.hashPublicInputs( _tran, address(this), address(0), _ctx.prover, _ctx.metaHash, chainId ); diff --git a/packages/protocol/contracts/verifiers/SgxVerifier.sol b/packages/protocol/contracts/verifiers/SgxVerifier.sol index 3cf2c23fa4..04e1d0bb48 100644 --- a/packages/protocol/contracts/verifiers/SgxVerifier.sol +++ b/packages/protocol/contracts/verifiers/SgxVerifier.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.24; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "../L1/ITaikoL1.sol"; import "../common/EssentialContract.sol"; +import "../common/LibStrings.sol"; import "../automata-attestation/interfaces/IAttestation.sol"; import "../automata-attestation/lib/QuoteV3Auth/V3Struct.sol"; import "./libs/LibPublicInput.sol"; @@ -99,7 +100,7 @@ contract SgxVerifier is EssentialContract, IVerifier { /// @param _ids The ids array of SGX instances. function deleteInstances(uint256[] calldata _ids) external - onlyFromOwnerOrNamed("rollup_watchdog") + onlyFromOwnerOrNamed(LibStrings.B_ROLLUP_WATCHDOG) { for (uint256 i; i < _ids.length; ++i) { uint256 idx = _ids[i]; @@ -119,7 +120,7 @@ contract SgxVerifier is EssentialContract, IVerifier { external returns (uint256) { - address automataDcapAttestation = (resolve("automata_dcap_attestation", true)); + address automataDcapAttestation = (resolve(LibStrings.B_AUTOMATA_DCAP_ATTESTATION, true)); if (automataDcapAttestation == address(0)) { revert SGX_RA_NOT_SUPPORTED(); @@ -142,7 +143,7 @@ contract SgxVerifier is EssentialContract, IVerifier { TaikoData.TierProof calldata _proof ) external - onlyFromNamed("taiko") + onlyFromNamed(LibStrings.B_TAIKO) { // Do not run proof verification to contest an existing proof if (_ctx.isContesting) return; @@ -154,7 +155,7 @@ contract SgxVerifier is EssentialContract, IVerifier { uint32 id = uint32(bytes4(_proof.data[:4])); address newInstance = address(bytes20(_proof.data[4:24])); - uint64 chainId = ITaikoL1(resolve("taiko", false)).getConfig().chainId; + uint64 chainId = ITaikoL1(resolve(LibStrings.B_TAIKO, false)).getConfig().chainId; address oldInstance = ECDSA.recover( LibPublicInput.hashPublicInputs( diff --git a/packages/protocol/script/DeployOnL1.s.sol b/packages/protocol/script/DeployOnL1.s.sol index 0a61c3d8f4..37c77d66fd 100644 --- a/packages/protocol/script/DeployOnL1.s.sol +++ b/packages/protocol/script/DeployOnL1.s.sol @@ -3,6 +3,7 @@ pragma solidity 0.8.24; import "@openzeppelin/contracts/utils/Strings.sol"; +import "../contracts/common/LibStrings.sol"; import "../contracts/L1/TaikoToken.sol"; import "../contracts/L1/TaikoL1.sol"; import "../contracts/L1/provers/GuardianProver.sol"; @@ -67,13 +68,15 @@ contract DeployOnL1 is DeployCapability { // --------------------------------------------------------------- // Signal service need to authorize the new rollup - address signalServiceAddr = - AddressManager(sharedAddressManager).getAddress(uint64(block.chainid), "signal_service"); + address signalServiceAddr = AddressManager(sharedAddressManager).getAddress( + uint64(block.chainid), LibStrings.B_SIGNAL_SERVICE + ); addressNotNull(signalServiceAddr, "signalServiceAddr"); SignalService signalService = SignalService(signalServiceAddr); - address taikoL1Addr = - AddressManager(rollupAddressManager).getAddress(uint64(block.chainid), "taiko"); + address taikoL1Addr = AddressManager(rollupAddressManager).getAddress( + uint64(block.chainid), LibStrings.B_TAIKO + ); addressNotNull(taikoL1Addr, "taikoL1Addr"); TaikoL1 taikoL1 = TaikoL1(payable(taikoL1Addr)); diff --git a/packages/protocol/test/L1/TaikoL1TestBase.sol b/packages/protocol/test/L1/TaikoL1TestBase.sol index ab17da50aa..bbdda0bad4 100644 --- a/packages/protocol/test/L1/TaikoL1TestBase.sol +++ b/packages/protocol/test/L1/TaikoL1TestBase.sol @@ -29,7 +29,7 @@ abstract contract TaikoL1TestBase is TaikoTest { function deployTaikoL1() internal virtual returns (TaikoL1 taikoL1); function tierProvider() internal view returns (ITierProvider) { - return ITierProvider(L1.resolve("tier_provider", false)); + return ITierProvider(L1.resolve(LibStrings.B_TIER_PROVIDER, false)); } function setUp() public virtual { diff --git a/packages/protocol/test/signal/SignalService.t.sol b/packages/protocol/test/signal/SignalService.t.sol index 10fc85e7ea..a00d2f9e91 100644 --- a/packages/protocol/test/signal/SignalService.t.sol +++ b/packages/protocol/test/signal/SignalService.t.sol @@ -82,7 +82,7 @@ contract TestSignalService is TaikoTest { bytes32 stateRoot = hex"7a889e6436fc1cde7827f75217adf5371afb14cc56860e6d9032ba5e28214819"; uint64 blockId = 5570; vm.prank(Alice); - realSignalService.syncChainData(32_382, LibSignals.STATE_ROOT, blockId, stateRoot); + realSignalService.syncChainData(32_382, LibStrings.H_STATE_ROOT, blockId, stateRoot); realSignalService.proveSignalReceived(32_382, srcBridge, msgHash, proof); } @@ -319,7 +319,7 @@ contract TestSignalService is TaikoTest { // relay the signal root vm.prank(taiko); signalService.syncChainData( - srcChainId, LibSignals.SIGNAL_ROOT, proofs[0].blockId, proofs[0].rootHash + srcChainId, LibStrings.H_SIGNAL_ROOT, proofs[0].blockId, proofs[0].rootHash ); signalService.proveSignalReceived({ _chainId: srcChainId, @@ -334,7 +334,7 @@ contract TestSignalService is TaikoTest { vm.expectRevert(SignalService.SS_UNAUTHORIZED.selector); vm.prank(taiko); signalService.syncChainData( - srcChainId, LibSignals.SIGNAL_ROOT, proofs[0].blockId, proofs[0].rootHash + srcChainId, LibStrings.H_SIGNAL_ROOT, proofs[0].blockId, proofs[0].rootHash ); } @@ -365,7 +365,7 @@ contract TestSignalService is TaikoTest { // relay the state root vm.prank(taiko); signalService.syncChainData( - srcChainId, LibSignals.STATE_ROOT, proofs[0].blockId, proofs[0].rootHash + srcChainId, LibStrings.H_STATE_ROOT, proofs[0].blockId, proofs[0].rootHash ); // Should not revert @@ -378,7 +378,7 @@ contract TestSignalService is TaikoTest { assertEq( signalService.isChainDataSynced( - srcChainId, LibSignals.SIGNAL_ROOT, proofs[0].blockId, bytes32(uint256(789)) + srcChainId, LibStrings.H_SIGNAL_ROOT, proofs[0].blockId, bytes32(uint256(789)) ), false ); @@ -444,7 +444,7 @@ contract TestSignalService is TaikoTest { vm.prank(taiko); signalService.syncChainData( - proofs[1].chainId, LibSignals.STATE_ROOT, proofs[2].blockId, proofs[2].rootHash + proofs[1].chainId, LibStrings.H_STATE_ROOT, proofs[2].blockId, proofs[2].rootHash ); signalService.proveSignalReceived({ @@ -492,7 +492,7 @@ contract TestSignalService is TaikoTest { vm.prank(taiko); signalService.syncChainData( - proofs[1].chainId, LibSignals.STATE_ROOT, proofs[2].blockId, proofs[2].rootHash + proofs[1].chainId, LibStrings.H_STATE_ROOT, proofs[2].blockId, proofs[2].rootHash ); vm.expectRevert(SignalService.SS_INVALID_HOPS_WITH_LOOP.selector); @@ -594,7 +594,7 @@ contract TestSignalService is TaikoTest { vm.prank(taiko); signalService.syncChainData( - proofs[7].chainId, LibSignals.STATE_ROOT, proofs[8].blockId, proofs[8].rootHash + proofs[7].chainId, LibStrings.H_STATE_ROOT, proofs[8].blockId, proofs[8].rootHash ); signalService.proveSignalReceived({ @@ -635,13 +635,13 @@ contract TestSignalService is TaikoTest { private { assertEq( - signalService.isChainDataSynced(chainId, LibSignals.STATE_ROOT, blockId, stateRoot), + signalService.isChainDataSynced(chainId, LibStrings.H_STATE_ROOT, blockId, stateRoot), stateRootCached ); assertEq( signalService.isChainDataSynced( - chainId, LibSignals.SIGNAL_ROOT, blockId, bytes32(uint256(789)) + chainId, LibStrings.H_SIGNAL_ROOT, blockId, bytes32(uint256(789)) ), signalRootCached );