Deploy a contract
16ane runs the Ethereum Virtual Machine unchanged, so contracts and tools need no changes. This uses Foundry; Hardhat, viem and ethers work the same way with the RPC URL and chain ID from Network details.
A contract
Section titled “A contract”[profile.default]src = "src"// SPDX-License-Identifier: Apache-2.0pragma solidity ^0.8.28;
contract Counter { uint256 public number;
function increment() external { number += 1; }}Deploy it
Section titled “Deploy it”Use a key funded from the faucet. Keep keys out of your shell history and
repositories; for anything long-lived use cast wallet import and --account instead.
export ETH_RPC_URL=https://rpc.testnet.16ane.netforge create src/Counter.sol:Counter --private-key "$PRIVATE_KEY" --broadcast# Deployed to: 0x…Call it
Section titled “Call it”cast send <address> "increment()" --private-key "$PRIVATE_KEY"cast call <address> "number()(uint256)"# 1Then open the address on explorer.16ane.net: the deployment reads
“created a contract”, and each increment() shows as a call with its network fee.
Network fees
Section titled “Network fees”Fees are paid in ANE, priced like Ethereum’s (EIP-1559): a base fee that is burned, plus an optional tip to the validator. On a quiet testnet the base fee is a few wei per gas, so a deployment costs a tiny fraction of one ANE. See ANE and network fees.