igneum/docs/build/first-contract.md

3.6 KiB

Your first contract on Devnet 3, in five minutes

With Foundry. Tested end to end on Devnet 3 from a build box on 8 October 2026; the pass line and the exact output are at the end. Hardhat, ethers and viem work the same way: chain id 4464 (4463 before the class v5 floor of 8 October 2026) and the RPC below.

0. What you need

  • Foundry: curl -L https://foundry.paradigm.xyz | bash && foundryup. About a minute.
  • The RPC. Devnet 3's public endpoint is https://rpc.devnet.igneum.network. A node you run yourself serves http://127.0.0.1:26790.
  • Nothing else. No account, no sign-up.
export RPC=https://rpc.devnet.igneum.network
cast chain-id --rpc-url $RPC          # 4464 since the class v5 floor of 8 October 2026 (the PASS line below ran at 4463, before it)

1. A key, for the devnet only

cast wallet new

It prints an address and a private key. Keep the key for this walkthrough and nothing else: devnet coins have no value and the chain resets without notice.

export PK=0x...                       # the private key cast printed
export ME=$(cast wallet address $PK)

2. Coins from the faucet

Paste $ME into igneum.network/faucet. It sends 10 IGN and shows the transaction hash. Once per address per day.

cast balance $ME --rpc-url $RPC --ether      # 10.000000000000000000

3. Deploy

Foundry's template is a counter. Initialise it and deploy it as it is.

forge init counter && cd counter
forge create src/Counter.sol:Counter --rpc-url $RPC --private-key $PK --broadcast

Expected:

Deployer: 0x...
Deployed to: 0x...
Transaction hash: 0x...
export C=0x...                        # the Deployed to address

4. Call it

cast send $C "increment()" --rpc-url $RPC --private-key $PK
cast call $C "number()(uint256)" --rpc-url $RPC      # 1
cast send $C "setNumber(uint256)" 41 --rpc-url $RPC --private-key $PK
cast call $C "number()(uint256)" --rpc-url $RPC      # 41

cast send waits for the receipt. A block takes about a second.

5. See it

Paste the transaction hash into igneum.network/explorer. The receipt is also one call away:

cast receipt 0xTXHASH --rpc-url $RPC

What is different under the hood

  • Gas has two dimensions, execution and proving. The node folds the second into the price it quotes, so forge and cast estimate and pay as on Ethereum. igneum_estimateGas shows both numbers and whether a call exceeds the proving limit.
  • Your transaction is in a block within about a second, proven tens of seconds later, and locked by miner signatures in about two minutes. igneum_getTransactionStatus reports each stage.
  • A transaction signed for another chain id is refused. EIP-155, EIP-1559 and legacy envelopes are accepted.

The test record

Run on a build box against its own Devnet 3 node (the box that also fronts the public RPC and runs the faucet), with Foundry 1.8.5 and a fresh key, through docs/build/first-contract-test.sh. The pass line is appended below by the run.

PASS 10:17:23Z: Devnet 3 chain id 4463, faucet drip 0x8620e9d894484e824e4ac33002946a00e2f75823ea6db0da0ad29f1af142e8f2, deployed Counter at 0x6345265C6Db0b3713eb6645d795d0B52FE0a4201 (tx 0xcf77b4822d51f3c60ecdf6d7dbbe67524d42071f06c76e1cf9b0511d64783574), increment then setNumber(41) read back 41, receipt status 1 (success), block 27055, 24 s end to end, Foundry 1.8.5

Through the public endpoints, https://rpc.devnet.igneum.network and https://faucet.igneum.network, from the box: the first faucet drip and the first reader-path deploy on Devnet 3.