Caduceus Basics

Smart Contracts

3min

A a smart contract is a piece of computer programming code, usually written in a high level language, that instructs a blockchain on how to receive, process, store and distribute funds. Smart contracts are therefore the building blocks of financial applications that live on distributed and decentralized networks that process cryptocurrency.

Smart contracts instruct Caduceus to create on-chain functionality that will ultimately result in state changes to the DAG-driven state machine, a more advanced form of a blockchain that provides much needed efficiency to Metaverse and multimedia applications.

Smart Contract Development

Smart contracts on Caduceus are usually written in the Solidity language targetting EVM, and are often organized into decentralized applications called D'Apps.

To get started with building smart contracts, we recommend the Caduceus IDE

On the other hand, WASM smart contracts may be written in RUST.

The Caduceus Metaverse Protocol can run smart contracts based on WASM and EVM, in addition to multiple built-in system contracts. Smart contracts support user-oriented programming capabilities on the blockchain, while system contracts provide the necessary conditions for the management and configuration of the Caduceus Metaverse Protocol's blockchain.

Smart Contract Execution

After smart contracts have been created by a D'app developer, the system will execute the contracts when the requirement arises. Before the smart contract is handed over to the smart contract engine for execution, it will go through a series of parameter verifications. These verifications include bytecode, version, contract calling method name, contract calling parameters, and contract engine type. When the smart contract execution engine is started, the bytecode, version, contract call method name, contract call parameters will be parsed and serialised into the data required by the smart contract execution engine and the data will be copied to the smart contract engine. During the execution of the smart contract execution engine, it will execute according to the above information and return the contract execution result. Finally, the contract execution result is handed over to the storage module for persistence in the transaction record.

Updated 25 Mar 2024
Doc contributor
Did this page help you?