Any EVM toolchain works. Three settings matter on OysBio:
| Setting | Value | Why |
|---|---|---|
| EVM version | paris (default), shanghai or cancun |
London rules plus four newer opcodes: PUSH0, MCOPY, TLOAD and TSTORE (the OysBio EVM extension: Mainnet from block 57,000, Testnet from block 147,100). Not on OysBio: blob opcodes, the Cancun change to SELFDESTRUCT (EIP-6780) and the initcode size limit (EIP-3860) |
| Chain ID | 69797 |
OysBio Chain |
| RPC | https://rpc.oys.bio |
send signed transactions with eth_sendRawTransaction |
Get testnet coins from the faucet first.
Foundry (recommended): the OysBio template#
Download the ready project from Downloads (oysbio-foundry-template.zip): an ERC-20 token (burnable, EIP-2612 permit, owner mint) on OpenZeppelin 5.4, tests, a deployment script, and foundry.toml already set to evm_version = "paris".
OpenZeppelin version. The template uses OpenZeppelin Contracts 5.4.0, which compiles for paris and has no known advisories. From 5.5 on, Strings (and with it ERC-721, EIP-712 and ERC20Permit) imports Bytes, which uses the mcopy opcode: those versions need evm_version = "cancun". Clones and ReentrancyGuardTransient need cancun in every 5.x release; with paris, use ReentrancyGuard instead. Avoid SELFDESTRUCT: on OysBio it keeps its pre-Cancun behaviour.
Tested on OysBio. ERC-20, EIP-2612 permit, ERC-721, ERC-1155 and ERC-4626 from OpenZeppelin 5.4.0, and Uniswap V2 (core 1.0.1, periphery 1.1.0-beta.0) as published, run unchanged on a real OysBio node; the explorer indexes ERC-20, ERC-721 and ERC-1155 transfers. ERC-4626 vaults: override _decimalsOffset() (for example return 6;). With the default of 0, a donation to an empty vault can round the next deposit down to 0 shares. The attacker loses money doing it, but the depositor loses the deposit. Depositors and frontends should also check previewDeposit (or a minimum number of shares) before depositing.
curl -fsSLO https://docs.oys.bio/downloads/oysbio-foundry-template.zip
unzip oysbio-foundry-template.zip -d my-token && cd my-token
forge install foundry-rs/[email protected] OpenZeppelin/[email protected] --no-git --shallow
forge build && forge test
cp .env.example .env # PRIVATE_KEY and OYSBIO_TESTNET_RPC
source .env
forge script script/Deploy.s.sol --rpc-url oysbio_testnet --broadcast
foundry.toml of the template:
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
solc_version = "0.8.28"
evm_version = "paris"
optimizer = true
optimizer_runs = 200
build_info = true # needed by `oysbio verify`
[rpc_endpoints]
oysbio_testnet = "${OYSBIO_TESTNET_RPC}"
oysbio = "${OYSBIO_RPC}"
Hardhat#
// hardhat.config.js
module.exports = {
solidity: { version: '0.8.28', settings: { evmVersion: 'paris', optimizer: { enabled: true, runs: 200 } } },
networks: {
oysbioTestnet: { url: process.env.OYSBIO_TESTNET_RPC, chainId: 69798, accounts: [process.env.PRIVATE_KEY] },
oysbio: { url: process.env.OYSBIO_RPC, chainId: 69797, accounts: [process.env.PRIVATE_KEY] },
},
};
npx hardhat run scripts/deploy.js --network oysbioTestnet. Hardhat keeps build info in artifacts/build-info, which oysbio verify reads.
Remix#
Compiler tab: Advanced Configurations → EVM version paris. Deploy tab: Injected Provider - MetaMask with MetaMask on OysBio Chain. Verify afterwards with the explorer's Verify contract page (paste the flattened source or the standard JSON input).
viem (scripts, backends)#
import { createPublicClient, createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { oysbioChain, waitForSafe } from '@oysbio/sdk';
const chain = oysbioChain('mainnet', { rpcUrl: 'https://rpc.oys.bio' });
const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const wallet = createWalletClient({ chain, account, transport: http() });
const client = createPublicClient({ chain, transport: http() });
const hash = await wallet.deployContract({ abi, bytecode, args: [] }); // bytecode compiled for paris
const receipt = await waitForSafe(client, { hash }); // final, not just included
console.log(receipt.contractAddress);
Verifying the source#
Verification is open to everyone: it only proves that the published source compiles to the deployed code. The explorer compiles the exact standard JSON input of your build.
From Foundry or Hardhat with the SDK command (the key only signs in to the explorer; nothing is sent on chain):
oysbio verify 0xYourContract src/MyToken.sol:MyToken \
--network mainnet --build-info out/build-info # Hardhat: artifacts/build-info
# environment: OYSBIO_PRIVATE_KEY (or PRIVATE_KEY), optional OYSBIO_EXPLORER_URL
With Foundry's or Hardhat's own Sourcify verifier (no key, no sign-in): the explorer answers Sourcify's verification API at https://explorer.oys.bio/api/sourcify.
forge verify-contract 0xYourContract src/MyToken.sol:MyToken \
--chain-id 69797 --verifier sourcify --verifier-url https://explorer.oys.bio/api/sourcify/ --watch
// hardhat.config.js (@nomicfoundation/hardhat-verify), then: npx hardhat verify --network oysbio 0xYourContract
sourcify: { enabled: true, apiUrl: 'https://explorer.oys.bio/api/sourcify' },
The match is the same as on the Verify contract page: "exact_match" when the metadata matches too, "match" when only the code does. Lookups: GET https://explorer.oys.bio/api/sourcify/v2/contract/69797/<address>.
In the browser: explorer → Verify contract → sign in with your wallet → paste the standard JSON input or single-file source, pick the compiler version and settings.
Through the API: POST https://explorer.oys.bio/api/verify after Sign-In with Ethereum, see Explorer API.
Constructor arguments are found automatically from the deployment transaction.
After deployment#
- Wait for Safe, not just a receipt, before you treat a deployment or a payment as final:
waitForSafe(SDK) oreth_getBlockByNumber("safe"). - Contract interactions are listed on the explorer at
https://explorer.oys.bio/address/<contract>; once verified, the Read contract and Write contract tabs work with any wallet. - System contracts already deployed on each network (Multi-Send, Safe multisig) are listed by the explorer API (
/multisend,/multisig).