Contract Virtualization

Create virtual representations of HYCHAIN mainnet or testnet contracts to dramatically simplify reading & writing contract data.

Virtualization & Motive

HYPLAY was created to make interactions with users, wallets, transactions, on-chain data, and off-chain data as seamless as possible for developers. This seamless approach extends to contract interactions and management through a feature we call contract virtualization.

Contract virtualization involves importing an already deployed contract's address and ABI using the Create contract or a corresponding SDK function. Upon import, the contract is assigned a unique ID by the HYPLAY system - it's now virtualized within HYPLAY's systems.

To interact with a virtualized contract, simply specify its ID, the function you wish to invoke, and, if applicable, a tuple of arguments. HYPLAY handles the complexities behind the scenes—encoding arguments, validating the ABI, covering gas fees, and executing the read or write operation as the wallet associated with the used authorization method. Virtualized contracts are compatible with contract reads, and contract writes (transactions).

This streamlined process significantly simplifies reading from and writing to contracts on HYCHAIN mainnet or testnet, dramatically improving developer productivity and significantly reducing operational overhead and system complexities.

Importing Contracts (Virtualizing)

To begin using a contract with HYPLAY's systems, initiate the virtualization process by utilizing the create contract API endpoint or the corresponding function in the SDK. This action creates a new virtualized contract instance within HYPLAY's infrastructure. This virtual representation mimics the actual on-chain contract and handles all complexities related to contract interactions behind the scenes.

Once the virtualized contract is established, it is returned as an object. This object and it's id serves as the gateway for all subsequent interactions with the contract. Simply reference the virtualized contract's ID to access or modify its data through the read contract and write contract (transactions) API endpoints or equivalent SDK functions.