淺談Metaforce/Forsage/原力元宇宙佛薩奇2.0系統開發技術詳細及程式碼說明

搭建lovei130908發表於2023-04-26

智慧合約系統根據事件描述資訊中包含的觸發條件,當滿足觸發條件時,從智慧合約自動發出預設的資料資源,以及包括觸發條件的事件;整個智慧合約系統的核心就在於智慧合約以事務和事件的方式經過智慧合約模組的處理,輸出還是一組事務和事件;智慧合約只是一個事務處理模組和狀態機構成的系統,它不產生智慧合約,也不會修改智慧合約;它的存在只是為了讓一組複雜的、帶有觸發條件的數字化承諾能夠按照參與者的意志,正確執行。I80智慧合約3831系統開發9724

  

  #![cfg_attr(not(feature="std"),no_std)]

  

  //`construct_runtime!`does a lot of recursion and requires us to increase the limit to 256.

  

  #![recursion_limit="256"]

  

  //Make the WASM binary available.

  

  #[cfg(feature="std")]

  

  include!(concat!(env!("OUT_DIR"),"/wasm_binary.rs"));

  

  //--snip--

  

  #![cfg_attr(not(feature="std"),no_std)]

  

  pub use pallet::*;

  

  #[frame_support::pallet]

  

  pub mod pallet{

  

  use frame_support::{

  

  sp_runtime::traits::{Hash,Zero},

  

  dispatch::{DispatchResultWithPostInfo,DispatchResult},

  

  traits::{Currency,ExistenceRequirement,Randomness},

  

  pallet_prelude::*

  

  };

  

  use frame_system::pallet_prelude::*;

  

  use sp_io::hashing::blake2_128;

  

  //TODO Part II:Struct for holding Kitty information.

  

  //TODO Part II:Enum and implementation to handle Gender type in Kitty struct.

  

  #[pallet::pallet]

  

  #[pallet::generate_store(pub(super)trait Store)]

  

  pub struct Pallet<T>(_);

  

  ///Configure the pallet by specifying the parameters and types it depends on.

  

  #[pallet::config]

  

  pub trait Config:frame_system::Config{

  

  ///Because this pallet emits events,it depends on the runtime's definition of an event.

  

  type Event:From<Event<Self>>+IsType<<Self as frame_system::Config>::Event>;

  

  ///The Currency handler for the Kitties pallet.

  

  type Currency:Currency<Self::AccountId>;

  

  //TODO Part II:Specify the custom types for our runtime.

  

  }/speedseq.config file


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70028605/viewspace-2948971/,如需轉載,請註明出處,否則將追究法律責任。

相關文章