Production-grade upgradeable smart contract vault for the Avail Nexus cross-chain intent settlement protocol.
Nexus Vault enables secure handling of cross-chain intents with support for ERC20 tokens and native assets across multiple blockchain ecosystems (Ethereum, Fuel, Solana, Tron). The vault uses an intent-based architecture where users sign messages off-chain and relayers execute transactions on their behalf.
- Vault.sol - Main upgradeable contract handling deposits, fulfillments, and settlements
- Intent-Based Execution: Users sign intents off-chain; relayers execute on-chain
- Gasless User Experience: Users only pay gas once for token approvals
- Cross-Chain Support: Handles intents across Ethereum, Fuel, Solana, and Tron
- Signature Verification: EIP-191 compliant message signing
- Reentrancy Protection: Transient reentrancy guards for gas efficiency
- Access Control: Role-based permissions for upgrades and settlements
- Deposit - User signs intent, relayer deposits funds into vault
- Fulfillment - Solver fulfills the intent on destination chain
- Settlement - Avail blockchain multisig settles payments to solvers
node >= 18.0.0
npm >= 9.0.0npm install# Run full test suite
npx hardhat test
# Run tests with coverage
npx hardhat coverage
# Run tests on local network
npm run test:local# Compile contracts
npm run compile
# Deploy to multiple networks
npm run deploy:multi
# Upgrade existing proxies
npm run upgrade:multi
# Estimate gas costs
npm run estimate-gasMainnet and testnet addresses to be added post-deployment
- Audits: Contracts are designed following OpenZeppelin best practices
- Upgradeability: UUPS proxy pattern with role-based upgrade authorization
- Reentrancy: Transient reentrancy guards protect all state-changing functions
- Signature Replay Protection: Nonce-based replay protection for all operations
Vault.depositMayan verifies the user signature over the canonical Request fields only.
The route-specific routeData is intentionally relayer-supplied and is not included in the
Vault-level signed message. Safety for those route parameters is enforced by the Mayan
contracts during execution. This means the Vault treats Mayan as the validation boundary for
swap path, intermediate token, minimum middle amount, and related route execution parameters.
DEFAULT_ADMIN_ROLE- Contract administrationUPGRADER_ROLE- Contract upgrade authorizationSETTLEMENT_VERIFIER_ROLE- Settlement signature verification
- @openzeppelin/contracts ^5.5.0
- @openzeppelin/contracts-upgradeable ^5.5.0
- hardhat ^2.28.0
MIT License - see individual contract files for SPDX identifiers.
Built by Avail - The unification layer of Web3