Interacting with Precompiles
Learn how to interact with Avalanche L1 precompiles using the Builder Hub Developer Console or Remix IDE.
This guide shows you how to interact with precompiled contracts on your Avalanche L1. For standard precompile implementations, we recommend using the Builder Hub Developer Console for the best experience. For custom implementations or advanced use cases, you can use Remix IDE with browser wallets.
Recommended: Using Builder Hub Developer Console
The Builder Hub provides dedicated tools for interacting with standard Avalanche L1 precompiles. These tools offer:
- ✅ User-friendly interface - No need to manually enter contract addresses or ABIs
- ✅ Built-in validation - Prevents common configuration mistakes
- ✅ Connected to your Builder account - Track your L1s and configurations
- ✅ Visual feedback - See changes reflected in real-time
Available Console Tools
| Precompile | Console Tool |
|---|---|
| Fee Manager | Fee Manager Console |
| Reward Manager | Reward Manager Console |
| Native Minter | Native Minter Console |
| Contract Deployer Allowlist | Deployer Allowlist Console |
| Transaction Allowlist | Transactor Allowlist Console |
How to Use Console Tools
- Navigate to the appropriate console tool from the table above
- Connect your wallet (Core or MetaMask)
- Switch to your L1 network in your wallet
- The tool will automatically detect your permissions
- Configure using the visual interface:
- For Fee Manager: Adjust gas limits, base fees, and target rates
- For Native Minter: Mint tokens to specific addresses
- For Allowlists: Add or remove addresses with specific roles
- For Reward Manager: Configure fee distribution settings
- Review the transaction details
- Submit and approve in your wallet
Why use the Developer Console?
Using the Builder Hub console tools allows us to:
- Provide better support for your L1
- Track feature usage to improve the platform
- Build your profile in our builders/developers database
- Offer personalized recommendations and resources
Example Workflows
Configuring Transaction Fees:
- Go to Fee Manager Console
- Connect wallet and switch to your L1
- Adjust fee parameters using sliders and inputs
- See real-time preview of how changes affect gas costs
- Submit transaction to update fees
Minting Native Tokens:
- Go to Native Minter Console
- Connect with an admin/manager address
- Enter recipient address and amount
- Review the minting transaction
- Approve to mint tokens instantly
Managing Permissions:
- Go to Deployer Allowlist or Transactor Allowlist
- Connect with an admin address
- Add addresses with desired roles (Admin, Manager, Enabled)
- Remove addresses by changing their role to "None"
- View current allowlist status
Alternative: Using Remix IDE
For custom precompile implementations or if you prefer a code-based approach, you can use Remix IDE to interact with precompiles directly.
When to Use Remix
Use Remix when:
- You have a custom precompile implementation (non-standard addresses or interfaces)
- You need to interact with precompiles programmatically
- You're debugging contract interactions
- The Builder Console doesn't support your specific use case
Prerequisites
- Access to an Avalanche L1 where you have admin/manager rights for a precompile
- Core Browser Extension or MetaMask
- Private key for an admin/manager address on your L1
- Your L1's RPC URL and Chain ID
Setup Your Wallet
Using Core
-
Install the Core Browser Extension
-
Import or create the account with admin/manager privileges
-
Enable Testnet Mode (if using testnet):
- Open Core extension
- Click hamburger menu → Advanced
- Toggle Testnet Mode on
-
Add your L1 network:
- Click the networks dropdown
- Select Manage Networks
- Click Add Network and enter:
- Network Name: Your L1 name
- RPC URL: Your L1's RPC endpoint
- Chain ID: Your L1's chain ID
- Symbol: Your native token symbol
- Explorer: (Optional) Your L1's explorer URL
-
Switch to your L1 network in the dropdown
Using MetaMask
- Install MetaMask browser extension
- Import the account with admin/manager privileges
- Add your L1 network:
- Click the networks dropdown
- Click Add Network → Add a network manually
- Enter your L1's network details
- Click Save
Connect Remix to Your L1
-
Open Remix IDE in your browser
-
In the left sidebar, click the Deploy & run transactions icon
-
In the Environment dropdown, select Injected Provider - MetaMask (or Core)
-
Approve the connection request in your wallet extension
-
Verify the connection shows your L1's network (e.g., "Custom (11111) network")
Load Precompile Interfaces
You need to load the Solidity interfaces for the precompiles you want to interact with.
Available Precompile Interfaces
From the Remix home screen, use load from GitHub to import:
Required for all precompiles:
Specific precompile interfaces:
- IFeeManager.sol - For fee configuration
- INativeMinter.sol - For minting native tokens
- IAllowList.sol - For transaction/deployer allowlists
- IRewardManager.sol - For block rewards
Compile the Interface
- In Remix, click the Solidity Compiler icon in the left sidebar
- Select the precompile interface file (e.g.,
IFeeManager.sol) - Click Compile
Interact with Precompiles
Connect to Deployed Precompile
Each precompile is deployed at a fixed address on your L1:
| Precompile | Address |
|---|---|
| NativeMinter | 0x0200000000000000000000000000000000000001 |
| ContractDeployerAllowList | 0x0200000000000000000000000000000000000000 |
| FeeManager | 0x0200000000000000000000000000000000000003 |
| RewardManager | 0x0200000000000000000000000000000000000004 |
| TransactionAllowList | 0x0200000000000000000000000000000000000002 |
- In Remix, click Deploy & run transactions
- In the Contract dropdown, select your compiled interface
- Paste the precompile address in the At Address field
- Click At Address
The precompile contract will appear in the Deployed Contracts section.
Example: Using Fee Manager
Read Current Fee Configuration
Anyone can read the current fee configuration (no special permissions required):
- Expand the FeeManager contract in Deployed Contracts
- Click getFeeConfig
- View the current fee parameters:
gasLimit: Maximum gas per blocktargetBlockRate: Target time between blocks (seconds)minBaseFee: Minimum base fee (wei)targetGas: Target gas per secondbaseFeeChangeDenominator: Rate of base fee adjustmentminBlockGasCost: Minimum gas cost for a blockmaxBlockGasCost: Maximum gas cost for a blockblockGasCostStep: Increment for block gas cost
Update Fee Configuration
Only admin addresses can update the fee configuration:
- Ensure you're connected with the admin address in your wallet
- Expand setFeeConfig in the FeeManager contract
- Fill in the new fee parameters:
gasLimit: 8000000 targetBlockRate: 2 minBaseFee: 25000000000 targetGas: 15000000 baseFeeChangeDenominator: 36 minBlockGasCost: 0 maxBlockGasCost: 1000000 blockGasCostStep: 200000 - Click transact
- Approve the transaction in your wallet
- Wait for transaction confirmation
The new fee configuration takes effect immediately after the transaction is accepted.
Example: Using Native Minter
Mint Native Tokens
Only admin, manager, or enabled addresses can mint native tokens:
- Expand the NativeMinter contract in Deployed Contracts
- Click on mintNativeCoin
- Fill in the parameters:
addr: Recipient address (e.g.,0xB78cbAa319ffBD899951AA30D4320f5818938310)amount: Amount to mint in wei (e.g.,1000000000000000000for 1 token)
- Click transact
- Approve the transaction in your wallet
The minted tokens are added directly to the recipient's balance by the EVM (no sender transaction).
Check Minting Permissions
Anyone can check who has minting permissions:
- Click readAllowList with an address parameter
- Returns:
0: No permission1: Enabled (can mint)2: Manager (can mint and manage enabled addresses)3: Admin (full control)
Example: Managing Allow Lists
Add Address to Allow List
Admins can add addresses to transaction or deployer allow lists:
- Expand the AllowList contract
- Use setAdmin, setManager, or setEnabled:
addr: 0x1234...5678 - Click transact
- Approve in wallet
Remove Address from Allow List
- Use setNone with the address:
addr: 0x1234...5678 - Click transact
Check Address Status
- Click readAllowList:
addr: 0x1234...5678 - Returns permission level (0-3)
Best Practices
Security
- Never share private keys for admin addresses
- Use hardware wallets for admin accounts when possible
- Test on testnet first before making changes on mainnet
- Use multi-sig contracts for critical admin operations
- Document all changes and announce them to validators
Network Upgrades
When enabling precompiles via network upgrades:
- Announce upgrades well in advance on social media and Discord
- Coordinate with validators to ensure they update their nodes
- Use upgrade.json to schedule precompile activation (see Precompile Upgrades)
- Test the upgrade on a testnet first
- Monitor the network after activation
Troubleshooting
Connection Issues:
- Verify your wallet is connected to the correct network
- Check that the RPC URL is accessible
- Ensure you have native tokens for gas fees
Transaction Failures:
- Confirm you're using an admin/manager address
- Check that the precompile is enabled on your L1
- Verify parameter formats (addresses must be checksummed)
- Ensure sufficient gas limit
Precompile Not Found:
- Verify the precompile address is correct
- Confirm the precompile is activated in your genesis or upgrade.json
- Check that you're on the correct network
Additional Resources
Builder Hub Console Tools
- Fee Manager Console - Configure transaction fees
- Reward Manager Console - Manage fee distribution
- Native Minter Console - Mint native tokens
- Deployer Allowlist Console - Control contract deployment
- Transactor Allowlist Console - Control transaction submission
Documentation
- Precompile Configuration - Overview of precompiles
- Fee Manager - Fee Manager details
- Reward Manager - Reward Manager details
- Native Minter - Native Minter details
- Deployer AllowList - Deployer Allowlist details
- Transaction AllowList - Transaction Allowlist details
- Warp Messenger - Warp Messenger details
- Precompile Upgrades - Network upgrade process
- AllowList Interface - Role-based access control
- Subnet-EVM Contracts - Precompile interfaces
Conclusion
For standard Avalanche L1 precompiles, we strongly recommend using the Builder Hub Developer Console tools for the best experience. These tools provide:
- ✅ Guided workflows with validation
- ✅ No need to manage contract addresses or ABIs manually
- ✅ Integration with your Builder Hub account
- ✅ Support from the Builder Hub team
For custom implementations or advanced scenarios, the Remix IDE approach provides flexibility to interact with any contract at any address. This is useful for:
- Custom precompile implementations
- Testing and debugging
- Programmatic interactions
- Non-standard use cases
Whichever method you choose, always test on testnet first and follow security best practices when managing admin keys.
Is this guide helpful?
Warp Messenger
Enable cross-chain communication between Avalanche L1s using Avalanche Warp Messaging.
Custom Precompiles
In this tutorial, we are going to walk through how we can generate a stateful precompile from scratch. Before we start, let's brush up on what a precompile is, what a stateful precompile is, and why this is extremely useful.