Project Scaffolding, Build, and Deploy
For project layout,Scarb.toml, build, declare/deploy, and verification steps, see:
Testing
Running Tests
Test Structure
Test Utilities
Network Configuration
RPC Endpoints
LayerZero Contract Addresses
Check the LayerZero Deployments page for current addresses:Public Key vs Address
Starknet accounts are smart contracts (native account abstraction), so an account address is a contract address, not a public-key-derived identifier. There is no default deterministic link between the key(s) controlling an account and its address, and keys can be rotated by the account logic. See Accounts and Account keys and addresses derivation standard. Practical takeaways:- Use the account address anywhere an API expects a
ContractAddress. - Treat the public key as signer metadata owned by the account contract, not as the account identifier.
Authority Management
Ownership Pattern
LayerZero Starknet contracts use OpenZeppelin’sOwnableComponent:
Delegate Pattern
Set a delegate for configuration without transferring ownership:- Set library configurations
- Update DVN settings
- Manage pathway configurations
- Transfer ownership
- Set peers (owner only)
Technical Constraints
Contract Size
Starknet has contract size limits (see the chain info cheat sheet for current values):
Mitigation: Split large contracts into components or use libraries.
Storage
Compute
Upgradeability
Upgradeable Contracts
Use OpenZeppelin’sUpgradeableComponent:
Upgrade Process
- Declare new contract version
- Call
upgrade(new_class_hash)on existing contract - Verify new implementation
Common Commands Reference
Scarb Commands
snforge Commands
sncast Commands
Class Hash Mismatch Errors
When declaring contracts, you may encounter:Common Causes
Version Compatibility Matrix
Debugging Steps
-
Verify versions match:
-
Clean and rebuild:
-
Check Scarb.toml dependency:
-
Verify RPC version:
Next Steps
- OApp Overview - Building OApps
- OFT Overview - Token transfers
- Configuration Guide - Security setup
- Troubleshooting - Common errors