This directory contains examples demonstrating the usage of SealEVM. Below are instructions on how to compile and run the examples, as well as a description of each file's purpose.
Disclaimer: These example codes are for demonstration purposes only to show the usage of SealEVM. They are not intended for any commercial use. Use at your own risk.
To compile the examples, simply run:
./compile.sh
compile.sh
: Script for compiling Solidity contracts and generating executable filesevm.go
: Core EVM initialization and configurationstorage.go
: Storage implementation examplebasicExample.go
: Basic example demonstrating simple contract deployment and interactionprecompiledWithStorageExample.go
: Example showing precompiled contract usage with storagedeployHelper.go
: Helper functions for contract deploymentprinter.go
: Utility functions for output formatting
basicExample.sol
: Simple Solidity contract for basic functionality demonstrationbasicExampleCodes.go
: Bytecodes for basicExample.solcrossTxDataShareExample.sol
: Solidity contract demonstrating cross-transaction data sharingcrossTxDataShareExampleCodes.go
: Bytecodes for crossTxDataShareExample.sol
crossTxDataShare.go
: Implementing an example of a precompiled contract with storage functionality
-
Basic Example (
basicExample.go
):- Demonstrates basic contract deployment and interaction
- Uses the contract defined in
contracts/basicExample.sol
-
Precompiled With Storage Example (
precompiledWithStorageExample.go
):- Shows how to use precompiled contracts with storage functionality
- Implements cross-transaction data sharing
- Uses contracts from both
contracts/crossTxDataShareExample.sol
andprecompiledWithStorage/crossTxDataShare.go
Each example can be run independently after compilation. For detailed implementation and usage examples, please refer to the respective Go files.