Skip to content

ryderhiew/hyperx-starter-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HyperX Smart Contract Starter Kit

Deploy and verify smart contracts on HyperX blockchain with ease.

🌐 Network Details

Parameter Value
Network Name HyperX
RPC URL https://rpc.hyperx.technology
Chain ID 88888
Currency Symbol HPX
Block Explorer https://scan.hyperx.technology

Add to MetaMask

Use these values to add HyperX network to MetaMask or any Web3 wallet.

🚀 Quick Start

1. Clone & Install

git clone https://github.com/ryderhiew/hyperx-starter-kit.git
cd hyperx-starter-kit
npm install

2. Configure Environment

cp .env.example .env

Edit .env with your private key:

PRIVATE_KEY=your_private_key_without_0x

3. Deploy

npm run deploy

4. Verify

npm run verify 0xYourContractAddress

📁 Project Structure

hyperx-starter-kit/
├── contracts/
│   └── MyToken.sol          # Example ERC20 token
├── scripts/
│   ├── deploy.js            # Deployment script
│   └── verify-api.js        # API verification (recommended)
├── .env.example
├── package.json
└── README.md

⚠️ Important: HyperX Compatibility

HyperX uses EVM version paris (pre-Shanghai). This means:

  • ✅ Solidity 0.8.x works fine
  • ✅ OpenZeppelin contracts work fine
  • PUSH0 opcode is NOT supported

The starter kit handles this automatically by setting evmVersion: "paris" in compiler settings.

📝 Creating Your Own Contract

  1. Add your .sol file to contracts/
  2. Update scripts/deploy.js:
    • Change CONTRACT_FILE and CONTRACT_NAME
    • Update CONSTRUCTOR_ARGS to match your constructor
  3. Update scripts/verify-api.js:
    • Change CONTRACT_FILE and CONTRACT_NAME
    • Update CONSTRUCTOR_ARGS to match your deployment
  4. Run npm run deploy
  5. Run npm run verify 0xYourAddress

🔍 Contract Verification

Recommended: API Verification

The verify-api.js script verifies directly via BlockScout API - faster and more reliable than the web UI.

npm run verify 0xYourContractAddress

Before running, edit scripts/verify-api.js and update:

// Your constructor argument types and values
const CONSTRUCTOR_ARGS = {
  types: ["string", "string", "uint8", "uint256", "address"],
  values: [
    "My Token",           // name
    "MTK",                // symbol
    18,                   // decimals
    1000000,              // initialSupply
    "0xYourAddress"       // owner
  ]
};

Alternative: BlockScout UI

If you prefer the web interface:

  1. Go to https://scan.hyperx.technology/contract-verification
  2. Select "Solidity (Standard JSON input)"
  3. Upload the verify.json generated after deployment
  4. Contract name: Your contract name (e.g., MyToken)
  5. Compiler version: Must match solc version in package.json
  6. Check "Try to fetch constructor arguments automatically"

🔧 Compiler Version

The compiler version for verification must exactly match what's in package.json:

"solc": "^0.8.28"

The verification script auto-detects this. If verifying manually, find your exact version:

node -e "console.log(require('solc').version())"

🛠 Troubleshooting

"invalid opcode: PUSH0"

Your compiler is targeting Shanghai EVM. This starter kit already sets evmVersion: "paris" - if you see this error with your own setup, add it to your compiler settings.

"Failed to verify" on BlockScout UI

Use the API verification instead: npm run verify 0xYourAddress

RPC Connection Issues

Check if https://rpc.hyperx.technology is accessible.

Constructor Arguments Mismatch

Make sure CONSTRUCTOR_ARGS in verify-api.js exactly matches what you passed during deployment. Order and types matter!

📚 Resources

📄 License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published