Sysethereum – NEVM Contracts for the Syscoin <=> NEVM Bridge
- Introduction
- Architecture & Core Components
- Prerequisites & Installation
- Running the Tests
- Deployment
Sysethereum is a set of smart contracts on the NEVM (Syscoin’s EVM layer) that implements a decentralized bridge between the Syscoin UTXO blockchain and the NEVM. It allows assets (Syscoin Platform Tokens or plain SYS) to move seamlessly between the two worlds.
SyscoinRelay.sol
is responsible for:- Verifying Syscoin blocks, transactions, and Merkle proofs on the NEVM side.
- Informing the Vault Manager (
SyscoinVaultManager.sol
) when a Syscoin transaction has locked or unlocked funds on the UTXO chain.
SyscoinVaultManager.sol
is responsible for:- Holding deposits or transferring tokens on the NEVM side.
- Minting or transferring tokens when coins are locked on Syscoin UTXO side (UTXO -> NEVM).
- Burning or locking tokens on NEVM when coins move back to Syscoin (NEVM -> UTXO).
- Potential bridging for ERC20, ERC721, ERC1155, or native SYS.
- A library used to parse and handle Syscoin transaction bytes, block headers, merkle proofs, etc.
- Provides functions like
parseVarInt
,parseCompactSize
, and big-endian / little-endian conversions.
- Test Mocks (e.g.,
MockERC20.sol
,MockERC721.sol
,MockERC1155.sol
) – used to test bridging flows in local test environments. - MaliciousReentrant – a test contract that verifies the bridge’s
nonReentrant
safety.
- Node.js v16 or later
- NPM or Yarn – for installing JavaScript dependencies
- Hardhat - for development, testing, and deployment
git clone https://github.com/syscoin/sysethereum-contracts.git
cd sysethereum-contracts
npm install
npx hardhat clean
npx hardhat compile
# Start a local Hardhat node
npx hardhat node
# Run all tests
npx hardhat test
# Deploy to local Hardhat network
npx hardhat run scripts/deploy.ts --network localhost
# Set your seed in .env file first
# MNEMONIC=your_seed_phrase_here
# Deploy and verify Syscoin mainnet
npx hardhat run scripts/deploy.ts --network syscoin
npx hardhat verify scripts/verify.ts --network syscoin