Skip to main content

Smart Contract Architecture

Smart Contract Architecture

WikiTruth uses modular smart contracts deployed on Oasis Sapphire (EVM-compatible privacy public chain). Confidential data is stored on-chain in encrypted form and permissions are verified via SIWE tokens.

In the testnet, core contracts support Proxy upgrades, allowing business logic upgrades without changing addresses and data. Mainnet contracts are immutable contracts.

Core Modules

  • AddressManager.sol: Unifies management of core contract addresses, DAO, supported tokens, and DEX whitelists.
  • SiweAuthWikiTruth.sol: SIWE identity authentication, supporting multi-domain verification, adapted for Sapphire zero-address scenarios.
  • UserId.sol: User ID/Blacklist management, used as contract event log parameters to protect on-chain identity privacy.
  • TruthBox.sol: Core asset contract, managing state machine, pricing, and deadlines, using Sapphire TEE to store confidential data encrypted.
  • TruthNFT.sol: ERC-721 standard NFT contract, a byproduct of creating a Truth Box, used to implement the display circulation and cross-chain capability of this project in the NFT market, enhancing the influence of the WikiTruth ecosystem.
  • Exchange.sol: Trading engine, handling the full flow of Sell/Auction/Buy/Bid/Refund/Complete.
  • FundManager.sol: Fund custody and allocation, responsible for multi-currency payment, automatic exchange (DEX interaction), and revenue distribution.

Network and Contract Deployment (Mainnet/Testnet)

ItemMainnetTestnet
Network NameOasis SapphireOasis Sapphire Testnet
Chain ID2329423295
Block ExplorerTBDOasis Sapphire Testnet explorer
AddressManagerTBD0x7609F2617c6e4A8757809dB67a7EAd55A5B33195
TruthBoxTBD0x1aec0197b0Ddc0412393813F863382748Da5C01e
ExchangeTBD0xFD4C4CFA8B1dF3aF3F7a07A630B2FbBa6b45b40d
FundManagerTBD0x28FE0c45e9730a89ABDdD4DC817b532F802Fe1E3
TruthNFTTBD0x4994C64ABC6A7BAE72C3b58133F8AAAB4dF1CbE7
UserIdTBD0xB1F04fB48490F3B37D5FEe3731c140dbF2224F5e
SiweAuthTBD0x6547F0a925BD522F029D0aFEC3A239aCDcE0122a