From 5a08abb67f7d5d607b8e9d605a5211c777de190d Mon Sep 17 00:00:00 2001 From: Elias Tazartes <66871571+Eikix@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:48:47 +0200 Subject: [PATCH] fix: fix kakarot abi in indexer provider (#1335) --- indexer/src/provider.ts | 705 +++++++++++++++++++++++++--------------- 1 file changed, 441 insertions(+), 264 deletions(-) diff --git a/indexer/src/provider.ts b/indexer/src/provider.ts index bd51f7f70..84f9479b8 100644 --- a/indexer/src/provider.ts +++ b/indexer/src/provider.ts @@ -15,499 +15,676 @@ export const PROVIDER = new RpcProvider({ const abi = [ { - members: [ + "members": [ { - name: "low", - offset: 0, - type: "felt", + "name": "low", + "offset": 0, + "type": "felt", }, { - name: "high", - offset: 1, - type: "felt", + "name": "high", + "offset": 1, + "type": "felt", }, ], - name: "Uint256", - size: 2, - type: "struct", + "name": "Uint256", + "size": 2, + "type": "struct", }, { - members: [ + "members": [ { - name: "is_some", - offset: 0, - type: "felt", + "name": "is_some", + "offset": 0, + "type": "felt", }, { - name: "value", - offset: 1, - type: "felt", + "name": "value", + "offset": 1, + "type": "felt", }, ], - name: "Option", - size: 2, - type: "struct", + "name": "Option", + "size": 2, + "type": "struct", }, { - data: [ + "data": [ { - name: "previousOwner", - type: "felt", + "name": "previousOwner", + "type": "felt", }, { - name: "newOwner", - type: "felt", + "name": "newOwner", + "type": "felt", }, ], - keys: [], - name: "OwnershipTransferred", - type: "event", + "keys": [], + "name": "OwnershipTransferred", + "type": "event", }, { - data: [ + "data": [ { - name: "evm_contract_address", - type: "felt", + "name": "evm_contract_address", + "type": "felt", }, { - name: "starknet_contract_address", - type: "felt", + "name": "starknet_contract_address", + "type": "felt", }, ], - keys: [], - name: "evm_contract_deployed", - type: "event", + "keys": [], + "name": "evm_contract_deployed", + "type": "event", }, { - data: [ + "data": [ { - name: "new_class_hash", - type: "felt", + "name": "new_class_hash", + "type": "felt", }, ], - keys: [], - name: "kakarot_upgraded", - type: "event", + "keys": [], + "name": "kakarot_upgraded", + "type": "event", }, { - inputs: [ + "inputs": [ { - name: "owner", - type: "felt", + "name": "owner", + "type": "felt", }, { - name: "native_token_address", - type: "felt", + "name": "native_token_address", + "type": "felt", }, { - name: "account_contract_class_hash", - type: "felt", + "name": "account_contract_class_hash", + "type": "felt", }, { - name: "uninitialized_account_class_hash", - type: "felt", + "name": "uninitialized_account_class_hash", + "type": "felt", }, { - name: "precompiles_class_hash", - type: "felt", + "name": "cairo1_helpers_class_hash", + "type": "felt", }, { - name: "coinbase", - type: "felt", + "name": "coinbase", + "type": "felt", }, { - name: "block_gas_limit", - type: "felt", + "name": "block_gas_limit", + "type": "felt", }, ], - name: "constructor", - outputs: [], - type: "constructor", + "name": "constructor", + "outputs": [], + "type": "constructor", }, { - inputs: [ + "inputs": [ { - name: "new_class_hash", - type: "felt", + "name": "new_class_hash", + "type": "felt", }, ], - name: "upgrade", - outputs: [], - type: "function", + "name": "upgrade", + "outputs": [], + "type": "function", }, { - inputs: [ + "inputs": [], + "name": "get_owner", + "outputs": [ { - name: "native_token_address", - type: "felt", + "name": "owner", + "type": "felt", }, ], - name: "set_native_token", - outputs: [], - type: "function", + "type": "function", }, { - inputs: [], - name: "get_native_token", - outputs: [ + "inputs": [ { - name: "native_token_address", - type: "felt", + "name": "new_owner", + "type": "felt", }, ], - stateMutability: "view", - type: "function", + "name": "transfer_ownership", + "outputs": [], + "type": "function", }, { - inputs: [ + "inputs": [ { - name: "base_fee", - type: "felt", + "name": "native_token_address", + "type": "felt", }, ], - name: "set_base_fee", - outputs: [], - type: "function", + "name": "set_native_token", + "outputs": [], + "type": "function", }, { - inputs: [], - name: "get_base_fee", - outputs: [ + "inputs": [], + "name": "get_native_token", + "outputs": [ { - name: "base_fee", - type: "felt", + "name": "native_token_address", + "type": "felt", }, ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function", }, { - inputs: [ + "inputs": [ { - name: "coinbase", - type: "felt", + "name": "base_fee", + "type": "felt", }, ], - name: "set_coinbase", - outputs: [], - type: "function", + "name": "set_base_fee", + "outputs": [], + "type": "function", }, { - inputs: [], - name: "get_coinbase", - outputs: [ + "inputs": [], + "name": "get_base_fee", + "outputs": [ { - name: "coinbase", - type: "felt", + "name": "base_fee", + "type": "felt", }, ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function", }, { - inputs: [ + "inputs": [ { - name: "prev_randao", - type: "Uint256", + "name": "coinbase", + "type": "felt", }, ], - name: "set_prev_randao", - outputs: [], - type: "function", + "name": "set_coinbase", + "outputs": [], + "type": "function", }, { - inputs: [], - name: "get_prev_randao", - outputs: [ + "inputs": [], + "name": "get_coinbase", + "outputs": [ { - name: "prev_randao", - type: "Uint256", + "name": "coinbase", + "type": "felt", }, ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function", }, { - inputs: [ + "inputs": [ { - name: "gas_limit_", - type: "felt", + "name": "prev_randao", + "type": "Uint256", }, ], - name: "set_block_gas_limit", - outputs: [], - type: "function", + "name": "set_prev_randao", + "outputs": [], + "type": "function", }, { - inputs: [], - name: "get_block_gas_limit", - outputs: [ + "inputs": [], + "name": "get_prev_randao", + "outputs": [ { - name: "block_gas_limit", - type: "felt", + "name": "prev_randao", + "type": "Uint256", }, ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function", }, { - inputs: [ + "inputs": [ { - name: "evm_address", - type: "felt", + "name": "gas_limit_", + "type": "felt", }, ], - name: "compute_starknet_address", - outputs: [ + "name": "set_block_gas_limit", + "outputs": [], + "type": "function", + }, + { + "inputs": [], + "name": "get_block_gas_limit", + "outputs": [ + { + "name": "block_gas_limit", + "type": "felt", + }, + ], + "stateMutability": "view", + "type": "function", + }, + { + "inputs": [ + { + "name": "evm_address", + "type": "felt", + }, + ], + "name": "compute_starknet_address", + "outputs": [ + { + "name": "contract_address", + "type": "felt", + }, + ], + "stateMutability": "view", + "type": "function", + }, + { + "inputs": [], + "name": "get_account_contract_class_hash", + "outputs": [ + { + "name": "account_contract_class_hash", + "type": "felt", + }, + ], + "stateMutability": "view", + "type": "function", + }, + { + "inputs": [ + { + "name": "account_contract_class_hash", + "type": "felt", + }, + ], + "name": "set_account_contract_class_hash", + "outputs": [], + "type": "function", + }, + { + "inputs": [ + { + "name": "evm_address", + "type": "felt", + }, + { + "name": "authorized", + "type": "felt", + }, + ], + "name": "set_authorized_cairo_precompile_caller", + "outputs": [], + "type": "function", + }, + { + "inputs": [ + { + "name": "cairo1_helpers_class_hash", + "type": "felt", + }, + ], + "name": "set_cairo1_helpers_class_hash", + "outputs": [], + "type": "function", + }, + { + "inputs": [], + "name": "get_cairo1_helpers_class_hash", + "outputs": [ + { + "name": "cairo1_helpers_class_hash", + "type": "felt", + }, + ], + "stateMutability": "view", + "type": "function", + }, + { + "inputs": [ + { + "name": "evm_address", + "type": "felt", + }, + ], + "name": "get_starknet_address", + "outputs": [ { - name: "contract_address", - type: "felt", + "name": "starknet_address", + "type": "felt", }, ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function", }, { - inputs: [], - name: "get_account_contract_class_hash", - outputs: [ + "inputs": [ { - name: "account_contract_class_hash", - type: "felt", + "name": "evm_address", + "type": "felt", }, ], - stateMutability: "view", - type: "function", + "name": "deploy_externally_owned_account", + "outputs": [ + { + "name": "starknet_contract_address", + "type": "felt", + }, + ], + "type": "function", }, { - inputs: [ + "inputs": [ { - name: "evm_address", - type: "felt", + "name": "evm_address", + "type": "felt", }, ], - name: "get_starknet_address", - outputs: [ + "name": "register_account", + "outputs": [], + "type": "function", + }, + { + "inputs": [ + { + "name": "evm_address", + "type": "felt", + }, { - name: "starknet_address", - type: "felt", + "name": "bytecode_len", + "type": "felt", + }, + { + "name": "bytecode", + "type": "felt*", }, ], - stateMutability: "view", - type: "function", + "name": "write_account_bytecode", + "outputs": [], + "type": "function", }, { - inputs: [ + "inputs": [ { - name: "evm_address", - type: "felt", + "name": "evm_address", + "type": "felt", }, ], - name: "deploy_externally_owned_account", - outputs: [ + "name": "upgrade_account", + "outputs": [], + "type": "function", + }, + { + "inputs": [ + { + "name": "evm_address", + "type": "felt", + }, { - name: "starknet_contract_address", - type: "felt", + "name": "nonce", + "type": "felt", }, ], - type: "function", + "name": "write_account_nonce", + "outputs": [], + "type": "function", }, { - inputs: [ + "inputs": [ + { + "name": "sender", + "type": "felt", + }, { - name: "evm_address", - type: "felt", + "name": "authorized", + "type": "felt", }, ], - name: "register_account", - outputs: [], - type: "function", + "name": "set_authorized_message_sender", + "outputs": [], + "type": "function", }, { - inputs: [ + "inputs": [ { - name: "nonce", - type: "felt", + "name": "sender_address", + "type": "felt", }, { - name: "origin", - type: "felt", + "name": "msg_hash", + "type": "Uint256", + }, + ], + "name": "set_authorized_pre_eip155_tx", + "outputs": [], + "type": "function", + }, + { + "inputs": [ + { + "name": "nonce", + "type": "felt", + }, + { + "name": "origin", + "type": "felt", }, { - name: "to", - type: "Option", + "name": "to", + "type": "Option", }, { - name: "gas_limit", - type: "felt", + "name": "gas_limit", + "type": "felt", }, { - name: "gas_price", - type: "felt", + "name": "gas_price", + "type": "felt", }, { - name: "value", - type: "Uint256", + "name": "value", + "type": "Uint256", }, { - name: "data_len", - type: "felt", + "name": "data_len", + "type": "felt", }, { - name: "data", - type: "felt*", + "name": "data", + "type": "felt*", }, { - name: "access_list_len", - type: "felt", + "name": "access_list_len", + "type": "felt", }, { - name: "access_list", - type: "felt*", + "name": "access_list", + "type": "felt*", }, ], - name: "eth_call", - outputs: [ + "name": "eth_call", + "outputs": [ { - name: "return_data_len", - type: "felt", + "name": "return_data_len", + "type": "felt", }, { - name: "return_data", - type: "felt*", + "name": "return_data", + "type": "felt*", }, { - name: "success", - type: "felt", + "name": "success", + "type": "felt", }, { - name: "gas_used", - type: "felt", + "name": "gas_used", + "type": "felt", }, ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function", }, { - inputs: [ + "inputs": [ { - name: "nonce", - type: "felt", + "name": "nonce", + "type": "felt", }, { - name: "origin", - type: "felt", + "name": "origin", + "type": "felt", }, { - name: "to", - type: "Option", + "name": "to", + "type": "Option", }, { - name: "gas_limit", - type: "felt", + "name": "gas_limit", + "type": "felt", }, { - name: "gas_price", - type: "felt", + "name": "gas_price", + "type": "felt", }, { - name: "value", - type: "Uint256", + "name": "value", + "type": "Uint256", }, { - name: "data_len", - type: "felt", + "name": "data_len", + "type": "felt", }, { - name: "data", - type: "felt*", + "name": "data", + "type": "felt*", }, { - name: "access_list_len", - type: "felt", + "name": "access_list_len", + "type": "felt", }, { - name: "access_list", - type: "felt*", + "name": "access_list", + "type": "felt*", }, ], - name: "eth_estimate_gas", - outputs: [ + "name": "eth_estimate_gas", + "outputs": [ { - name: "return_data_len", - type: "felt", + "name": "return_data_len", + "type": "felt", }, { - name: "return_data", - type: "felt*", + "name": "return_data", + "type": "felt*", }, { - name: "success", - type: "felt", + "name": "success", + "type": "felt", }, { - name: "required_gas", - type: "felt", + "name": "required_gas", + "type": "felt", }, ], - stateMutability: "view", - type: "function", + "stateMutability": "view", + "type": "function", }, { - inputs: [ + "inputs": [ + { + "name": "to", + "type": "Option", + }, + { + "name": "gas_limit", + "type": "felt", + }, + { + "name": "gas_price", + "type": "felt", + }, { - name: "to", - type: "Option", + "name": "value", + "type": "Uint256", }, { - name: "gas_limit", - type: "felt", + "name": "data_len", + "type": "felt", }, { - name: "gas_price", - type: "felt", + "name": "data", + "type": "felt*", }, { - name: "value", - type: "Uint256", + "name": "access_list_len", + "type": "felt", }, { - name: "data_len", - type: "felt", + "name": "access_list", + "type": "felt*", }, + ], + "name": "eth_send_transaction", + "outputs": [ { - name: "data", - type: "felt*", + "name": "return_data_len", + "type": "felt", }, { - name: "access_list_len", - type: "felt", + "name": "return_data", + "type": "felt*", }, { - name: "access_list", - type: "felt*", + "name": "success", + "type": "felt", + }, + { + "name": "gas_used", + "type": "felt", }, ], - name: "eth_send_transaction", - outputs: [ + "type": "function", + }, + { + "inputs": [ + { + "name": "from_address", + "type": "felt", + }, + { + "name": "l1_sender", + "type": "felt", + }, { - name: "return_data_len", - type: "felt", + "name": "to_address", + "type": "felt", }, { - name: "return_data", - type: "felt*", + "name": "value", + "type": "felt", }, { - name: "success", - type: "felt", + "name": "data_len", + "type": "felt", }, { - name: "gas_used", - type: "felt", + "name": "data", + "type": "felt*", }, ], - type: "function", + "name": "handle_l1_message", + "outputs": [], + "type": "l1_handler", }, ];