This guide gives DApp builders a practical path through the RustChain contract
workspace. The current on-chain contract surface is the wrapped RTC token stack
for Base, with bridge-aware mint and burn flows documented under
contracts/base and contracts/erc20.
Use the Hardhat package when you need the full development loop:
cd contracts/erc20
npm install
npm run compile
npm testFor a smaller reference implementation, inspect contracts/base/wRTC.sol. For
the production-style Base package with permit, bridge operators, pausing, tests,
deployment scripts, and interaction tooling, use contracts/erc20.
- Develop the contract in
contracts/erc20/contracts/WRTC.sol. - Add or update tests in
contracts/erc20/test/WRTC.test.js. - Compile and run the test suite with
npm run compileandnpm test. - Deploy to Base Sepolia first with
npm run deploy:base-sepolia. - Verify the testnet contract before any mainnet deployment.
- Configure bridge operators or ownership only after deployment is verified.
- Monitor mint, burn, pause, unpause, and operator-change events.
Mainnet deployment should happen only after testnet validation, contract review, and bridge-operator confirmation.
Set WRTC_ADDRESS to the deployed token contract and use the provided script for
read-only checks before sending transactions:
cd contracts/erc20
export WRTC_ADDRESS=0xYourDeployedContract
node scripts/interact.js info
node scripts/interact.js balance 0xYourWalletFor write operations, test the exact call on Base Sepolia first:
node scripts/interact.js transfer 0xRecipient 1.5
node scripts/interact.js approve 0xSpender 10Bridge-only operations such as add-operator, bridge-mint, bridge-burn,
pause, and unpause are administrative actions. They should be run by the
configured owner or bridge operator, preferably through a multi-signature wallet
for production deployments.
- Keep private keys and RPC credentials in
.env; never commit them. - Run
npm testafter every Solidity or script change. - Deploy to Base Sepolia before Base mainnet.
- Use a dedicated deployer wallet with only the gas needed for deployment.
- Transfer ownership to a multi-signature wallet for production.
- Treat bridge operator changes as high-risk configuration changes.
- Prefer read-only
infoandbalancechecks when integrating a frontend. - Log deployed addresses, transaction hashes, constructor arguments, and verification status in the PR or deployment record.
Before mainnet, confirm:
- The bridge operator is not the same hot wallet used for routine development.
- The owner address is controlled by the intended production authority.
pauseandunpauseprocedures are documented for incident response.- Mint and burn event monitoring is configured.
- BaseScan verification succeeds and constructor arguments are recorded.
- No test private keys, RPC URLs with tokens, or mnemonic material are committed.
contracts/base/README.md- compact RIP-305 wRTC overview.contracts/erc20/README.md- full Base ERC-20 package guide.contracts/erc20/docs/DEPLOYMENT_GUIDE.md- deployment workflow.contracts/erc20/docs/SECURITY_CONSIDERATIONS.md- production risk notes.contracts/erc20/docs/BRIDGE_INTEGRATION.md- bridge integration details.