A TypeScript and Solidity development toolkit for USDU Finance smart contract integrations.
This package provides a complete development environment for building and deploying Solidity smart contracts for USDU Finance, with built-in support for Aragon DAO integrations, multi-chain deployments, and comprehensive testing infrastructure.
- Multi-Chain Support: Pre-configured for Ethereum, Polygon, Optimism, Arbitrum, Base, Avalanche, Gnosis, and Sonic
- Type-Safe Deployments: Hardhat Ignition modules with TypeScript support
- Chain Configuration: Built-in chain IDs and Chainlink CCIP selectors
- Development Tools: Wallet management, constructor argument storage, and ABI export
- Testing Infrastructure: Hardhat test suite with coverage reporting
- NPM Package Ready: Configured with tsup for library distribution
usdu-finance-utils/
├── contracts/ # Solidity source files (add your contracts here)
├── test/ # Test suite
├── ignition/ # Hardhat Ignition deployment modules
│ └── modules/ # Deployment module templates
├── helper/ # Helper utilities
│ ├── wallet.ts # HD wallet derivation functions
│ ├── wallet.info.ts # Wallet info CLI tool
│ └── store.args.ts # Constructor args storage
├── exports/ # NPM package exports
│ ├── index.ts # Main export file
│ ├── address.config.ts # Chain configurations
│ └── address.types.ts # Chain type definitions
├── abi/ # Generated contract ABIs (auto-generated)
├── typechain/ # TypeScript bindings (auto-generated)
└── artifacts/ # Compilation artifacts (auto-generated)
- Install dependencies:
yarn install- Configure environment:
cp .env.example .envEdit .env and add:
DEPLOYER_SEED: Your mnemonic phrase (12-24 words)DEPLOYER_SEED_INDEX: Derivation index (default: 1)ALCHEMY_RPC_KEY: Alchemy API key for RPC accessETHERSCAN_API: Etherscan API key for contract verification
# Compile contracts
yarn compile
# Run tests
yarn test
# Run test coverage
yarn coverage
# Check wallet info from seed
yarn wallet:info# Deploy using Hardhat Ignition
yarn deploy ignition/modules/<module>.ts --network <network-name> --verify --deployment-id <deployment-id>
# Example: Deploy to Sepolia testnet
yarn deploy ignition/modules/<module>.ts --network sepolia --verify --deployment-id <deployment-id>Manual Verification:
npx hardhat verify --network mainnet --constructor-args ./ignition/constructor-args/$FILE.js $ADDRESS
npx hardhat ignition verify $DEPLOYMENT --include-unrelated-contractsThe Hardhat configuration includes support for:
- Testnets: Sepolia
- Mainnets: Ethereum, Polygon, Optimism, Arbitrum, Base, Avalanche, Gnosis, Sonic
Network-specific settings can be configured in hardhat.config.ts.
The package exports chain configurations with IDs and Chainlink CCIP selectors:
import { ADDRESS, SupportedChains, SupportedChainIds } from '@wrytes/usdu-finance-utils';
// Access chain IDs and selectors
const mainnetConfig = ADDRESS[1]; // { chainId: 1, chainSelector: '...' }
// Get all supported chains
const chains = SupportedChains; // { mainnet, polygon, arbitrum, ... }
const chainIds = SupportedChainIds; // [1, 137, 42161, ...]- Create your Solidity contracts in the
contracts/directory - Compile contracts:
yarn compile - Run tests:
yarn test - Generate coverage report:
yarn coverage
- Create a new deployment module in
ignition/modules/ - Use
PermissionERC1271.tsas a template - Update the contract name, parameters, and constructor arguments
- Deploy using:
yarn deploy ignition/modules/YourContract.ts --network <network>
# Start local Hardhat node
npx hardhat node
# Deploy to local network
yarn deploy ignition/modules/YourContract.ts --network localhost --deployment-id local-dev# Deploy to Sepolia
yarn deploy ignition/modules/YourContract.ts --network sepolia --verify --deployment-id sepolia-v1# Deploy to mainnet
yarn deploy ignition/modules/YourContract.ts --network mainnet --verify --deployment-id mainnet-v1The package is configured to be published as @wrytes/usdu-finance-utils:
# Build the package
yarn npm:build
# Publish to npm (requires authentication)
yarn npm:publishThe package exports chain configurations and types that can be imported by other projects.
- Hardhat Documentation
- Hardhat Ignition
- OpenZeppelin Contracts
- Aragon OSx Documentation
- Viem Documentation
- TypeScript Documentation
GPL-3.0