Deploying a smart contract
AssigneeAdvanced New Technologies Co., Ltd.
InventorZhongxiao Yao
Life of this patent
Estimating the term…
Abstract
Implementations of the present specification provide a method for deploying a smart contract. According to one implementation the method includes: receiving a transaction request for invoking a first contract; obtaining a first instruction code and a function index table, wherein the function index table is used to indicate a memory address of an instruction code corresponding to each of import and export functions in the first contract; determining a first memory address corresponding to the invocation function based on the function index table; and executing the first instruction code in the first memory address based on the determined first memory address.
Claims20
A computer-implemented method for executing a smart contract comprising:
- receiving, by a node in a blockchain network, a transaction request for invoking a first contract, wherein the transaction request comprises a contract address and a function of the first contract;
- obtaining, from a cache memory, a function index table that corresponds to the first contract and is stored in the cache memory after preprocessing the first contract during a phase of deploying the first contract, wherein the function index table is used to indicate at least a memory address of an instruction code corresponding to the function of the first contract;
- identifying the memory address corresponding to the function based on the function index table;
- and
- executing the function of the first contract based on the instruction code stored at the memory address.
A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations for executing a smart contract comprising:
- receiving, by a node in a blockchain network, a transaction request for invoking a first contract, wherein the transaction request comprises a contract address and a function of the first contract;
- obtaining, from a cache memory, a function index table that corresponds to the first contract and is stored in the cache memory after preprocessing the first contract during a phase of deploying the first contract, wherein the function index table is used to indicate at least a memory address of an instruction code corresponding to the function of the first contract;
- identifying the memory address corresponding to the function based on the function index table;
- and
- executing the function of the first contract based on the instruction code stored at the memory address.
A computer-implemented system, comprising:
- one or more computers;
- and
- one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations for executing a smart contract, wherein the operations comprise:
- receiving, by a node in a blockchain network, a transaction request for invoking a first contract, wherein the transaction request comprises a contract address and a function of the first contract;
- obtaining, from a cache memory, a function index table that corresponds to the first contract and is stored in the cache memory after preprocessing the first contract during a phase of deploying the first contract, wherein the function index table is used to indicate at least a memory address of an instruction code corresponding to the function of the first contract;
- identifying the memory address corresponding to the function based on the function index table;
- and
- executing the function of the first contract based on the instruction code stored at the memory address.
Dependencies are inferred from the claim text.