VYRE Docs Mainnet

Deploy and verify

VYRE runs the EVM, so contracts deploy exactly as on Ethereum. You need a little test USDC for gas: the faucet's 2 USDC covers hundreds of deployments.

The examples below use the testnet. For VYRE mainnet, use --rpc-url https://rpc.vyrechain.com, chain ID 3045, and publish the source on https://explorer.vyrechain.com/contract-verification. Gas is real USDC there.

Keep keys out of your code and your repo. The examples sign with a Foundry keystore (cast wallet import deployer --interactive asks for the key once and stores it encrypted), or read a key from an environment variable you don't commit.

Foundry

# deploy
forge create src/Counter.sol:Counter \
  --rpc-url https://testnet-rpc.vyrechain.com \
  --account deployer \
  --broadcast

# the exact compiler input the explorer's form takes, to publish the source
# (build first: the next command reads Foundry's build cache, and without it prints an error line ahead of the JSON)
forge build
forge verify-contract 0xYourContractAddress src/Counter.sol:Counter \
  --show-standard-json-input > standard-input.json

# the compiler version the form asks for
jq -r .metadata.compiler.version out/Counter.sol/Counter.json

Then open the contract's page on the explorer, choose Contract → Verify & publish, pick Standard JSON input, and upload standard-input.json with the compiler version printed above (for example 0.8.28+commit.7893614a). The explorer compiles it, compares the result with the code on chain, and shows the source on the contract's page when they match.

forge verify-contract --verifier blockscout does not work here. It sends the source through the explorer's old Etherscan-style API, which answers reads only (the form above uses the explorer's newer route, which takes writes).

Use --skip-simulation with forge script. Without it, Foundry takes each transaction's gas from its own local simulation, which leaves out the data part of the gas (see "Things to know"), and the node refuses the send with intrinsic gas too low. With the flag it asks the node for the estimate, as forge create and cast send always do.

In foundry.toml, you can name the network and then use --rpc-url vyre_testnet:

[rpc_endpoints]
vyre_testnet = "https://testnet-rpc.vyrechain.com"

Hardhat

// hardhat.config.js
require('@nomicfoundation/hardhat-toolbox')

module.exports = {
  solidity: '0.8.28',
  networks: {
    vyreTestnet: {
      url: 'https://testnet-rpc.vyrechain.com',
      chainId: 7357,
      accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
    },
  },
  sourcify: { enabled: false },
}
npx hardhat run scripts/deploy.js --network vyreTestnet

# the exact compiler input the explorer's form takes: Hardhat 2 keeps it in the build-info file that the contract's own artifact points to
# (not the newest file: a compile that only touched another contract writes a newer one without this one in it)
jq .input "artifacts/contracts/Counter.sol/$(jq -r .buildInfo artifacts/contracts/Counter.sol/Counter.dbg.json)" > standard-input.json

(Without jq, Node does the same: node -e "const d='artifacts/contracts/Counter.sol/', f=require('path').resolve(d, require('./'+d+'Counter.dbg.json').buildInfo); require('fs').writeFileSync('standard-input.json', JSON.stringify(require(f).input))".)

Then publish it as above: Contract → Verify & publish → Standard JSON input, with the compiler version that build-info file names (jq -r .solcLongVersion on it, for example 0.8.28+commit.7893614a). (npx hardhat verify does not work here: it uses the same old API, which answers reads only.) This is Hardhat 2's config (Hardhat 3 formats it differently).

Remix and browser wallets

Add VYRE Testnet to your wallet (one click), pick Injected Provider as Remix's environment, and deploy. To verify, use the explorer's page for the contract: Contract → Verify & publish.

Things to know

  • Gas estimates include a data fee, so deployments estimate higher than their execution gas. Take the gas from eth_estimateGas on VYRE itself: not from a fixed limit from another chain, and not from a local simulation (such as forge script without --skip-simulation), which leaves the data part out and is refused as intrinsic gas too low.
  • Contract size: the usual 24 KB limit applies.
  • block.number is not VYRE's block number; use ArbSys(0x64).arbBlockNumber() for VYRE's. block.timestamp works as usual.
  • Public RPC limits: 20 points a second per IP, one request at a time; a deployment script with many transactions may need a pause between them (see Network and RPC).
  • Compile for Cancun. VYRE runs ArbOS 40, which is a step behind the newest Ethereum opcode set (the CLZ instruction comes with ArbOS 51), and compilers move their default target up over time. Set evm_version = "cancun" in foundry.toml, or settings: { evmVersion: 'cancun' } in Hardhat's solidity config.
  • The explorer's old Etherscan-style API (https://testnet-explorer.vyrechain.com/api) answers reads without a key and takes no writes: contracts are published through the form, as above.

VYRE's testnet has no value: its USDC is for testing. On mainnet, trading is risky and nothing here is advice. USDC is issued by Circle; VYRE is an independent project, not affiliated with or endorsed by Circle. Questions: team@vyrechain.com