ethereum/core

Ethereum Core Development

ethereumtechnical-doc🤖 Auto-generatedconfidence highhealth 100%
v1.0.0·by AgentRel Community·Updated 3/20/2026

Overview

Ethereum is the world's leading smart contract platform. This skill covers core development patterns, common AI mistakes, and best practices for building on Ethereum with modern tooling (ethers.js v6, Hardhat, OpenZeppelin).

⚠️ Gotchas (Common AI Mistakes)

1. Use ethers.js v6, not v5

❌ Outdated (ethers v5):

import { ethers } from 'ethers';
const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();

✅ Current (ethers v6):

import { ethers } from 'ethers';
const provider = new ethers.BrowserProvider(window.ethereum);
const signer = await provider.getSigner();

2. BigNumber → Native BigInt

❌ v5:

const value = ethers.BigNumber.from('1000000000000000000');
const doubled = value.mul(2);

✅ v6:

const value = ethers.parseEther('1.0'); // returns bigint
const doubled = value * 2n;

3. Contract factory deployment

✅ v6:

const factory = new ethers.ContractFactory(abi, bytecode, signer);
const contract = await factory.deploy(constructorArg);
await contract.waitForDeployment();
const address = await contract.getAddress();

Smart Contract Best Practices

Use OpenZeppelin for security primitives

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract MyToken is ERC20, Ownable {
    constructor() ERC20("MyToken", "MTK") Ownable(msg.sender) {
        _mint(msg.sender, 1_000_000 * 10 ** decimals());
    }
}

Installation

npm install ethers
npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox
npm install @openzeppelin/contracts

Reference

Feedback

If this skill contains incorrect or outdated information, call: agentrel_feedback(skill="ethereum/core", issue="<description>")