Please refer to the Resources section for more details on this topic.
Executing, or running a smart contract basically transmits the compiled
AVM bytecode to the engine to be processed and executed. Pre-executing a contract involves the exact same process, except for the following key differences:
Any transaction that updates the on-chain data will not be able to do so, i.e. the changes will not be reflected.
The transaction will not be transmitted to consensus nodes
Pre-execution can be used to determine whether or not the contract runs as intended, and can also be used a way to find out the gas fee to run a particular contract.
Contract protocols such as ONT and ONG, and other governing contracts are referred to as native contracts. All the methods that are available can found by following this link. For more information on smart contracts and a more detailed distinction, please refer to the Smart contract documentation.
Yes, the contract hash also corresponds to an account. The way this is implemented is by treating the contract hash as a big endian address of an account that is commonly used for funds management with
The private key to this particular account does exist, but remains unknown and cannot be used in any manner.
Every account that invokes a smart contract needs to pass its account address and the size of the asset that is being transferred parameters when invoking a smart contract.
Within the scope of the contract, the
CheckWitness method is used to carry out signature verification and to judge the valid asset limit.
No, there is no timing mechanism in the contract system. However, the
GetTime() method from
ontology.interop.System.Runtime API can be used to fetch the current timestamp. The value returned is in seconds. The timestamp may be needed considering external contract invocations.