deploying-contracts-on-gatelayer

Deploys smart contracts to GateLayer using Foundry. Covers forge create commands, contract verification, and GateScan API key configuration. Use when deploying Solidity contracts to GateLayer Mainnet or Testnet. Covers phrases like "deploy contract to GateLayer", "forge create on GateLayer", "verify contract on GateScan", "get testnet GT", "GateLayer faucet", "how do I deploy to GateLayer", or "publish my contract".

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "deploying-contracts-on-gatelayer" with this command: npx skills add gatechain/gatelayer_skills/gatechain-gatelayer-skills-deploying-contracts-on-gatelayer

Deploying Contracts on GateLayer

Prerequisites

  1. Configure RPC endpoint (testnet: https://gatelayer-testnet.gatenode.cc, mainnet: https://gatelayer-mainnet.gatenode.cc)
  2. Store private keys in Foundry's encrypted keystore — never commit keys
  3. Obtain testnet GT from faucet (testnet only)

Security

  • Never commit private keys to version control — use Foundry's encrypted keystore (cast wallet import)
  • Never hardcode API keys in source files — use environment variables or foundry.toml with ${ENV_VAR} references
  • Never expose .env files — add .env to .gitignore
  • Use production RPC providers (not public endpoints) for mainnet deployments to avoid rate limits and data leaks
  • Verify contracts on GateScan to enable public audit of deployed code

Input Validation

Before constructing shell commands, validate all user-provided values:

  • contract-path: Must match ^[a-zA-Z0-9_/.-]+\.sol:[a-zA-Z0-9_]+$. Reject paths with spaces, semicolons, pipes, or backticks.
  • rpc-url: Must be a valid HTTPS URL (^https://[^\s;|&]+$). Reject non-HTTPS or malformed URLs.
  • keystore-account: Must be alphanumeric with hyphens/underscores (^[a-zA-Z0-9_-]+$).

Do not pass unvalidated user input into shell commands.

Obtaining Testnet GT

Testnet GT is required to pay gas on GateLayer Testnet. Use the Gatelayer Faucet to claim it. Supported token :GT claims are capped at 0.1 GT per claim, 1 claims per 24 hours.

Gatelayer UI (recommended for quick setup)

Agent behavior: If you have browser access, navigate to the portal and claim directly. Otherwise, ask the user to complete these steps and provide the funded wallet address.

  1. Go to Gatelayer Faucets
  2. Select Gatelayer network
  3. Enter the wallet address and click Claim
  4. Verify on Gatelayer Testnet Scan that the funds arrived

Deployment and Verify Commands

Testnet

forge create src/MyContract.sol:MyContract \
  --rpc-url https://gatelayer-testnet.gatenode.cc \
  --account <keystore-account> \
  --verify \
  --verifier-url 'https://www.gatescan.org/gatelayer-testnet/api' \
  --verifier blockscout

Mainnet

forge create src/MyContract.sol:MyContract \
  --rpc-url https://gatelayer-mainnet.gatenode.cc \
  --account <keystore-account> \
  --verify \
  --verifier-url 'https://www.gatescan.org/gatelayer/api' \
  --verifier blockscout

Key Notes

Common Issues

ErrorCause
nonce has already been usedNode sync incomplete
Transaction failsInsufficient GT for gas — obtain from faucet
Verification failsWrong RPC endpoint for target network

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

skill-creator

No summary provided by upstream source.

Repository SourceNeeds Review
Web3

connecting-to-gatelayer-network

No summary provided by upstream source.

Repository SourceNeeds Review
Web3

running-a-gatelayer-node

No summary provided by upstream source.

Repository SourceNeeds Review
Web3

china-sportswear-outdoor-sourcing

Comprehensive sportswear and outdoor equipment sourcing guide for international buyers – provides detailed information about China's athletic apparel, footwear, outdoor gear, and accessories manufacturing clusters, supply chain structure, regional specializations, and industry trends (2026 updated).

Archived SourceRecently Updated