Address Provider
The Address Provider contract serves as the central registry for all Amber Finance contract addresses. It enables dynamic contract discovery and facilitates seamless upgrades and migrations by providing a single source of truth for contract locations.
Deployment
- Neutron:
neutron1n6m2ykuq9w83a9kq2p6dr4202dcxjpz7a2hwutw5rk4n9kwqmdxsad65pd
Types
type Uint128 = string
type Addr = stringQueries
config
Returns the contract’s configuration.
{
config: {
}
}Response:
{
data: {
owner?: string | null
proposed_new_owner?: string | null
}
}address
Returns the address for a specific contract type.
{
address: {
contract_type: string
}
}Response:
{
data: {
address: Addr
}
}addresses
Returns all registered contract addresses.
{
addresses: {
limit?: number | null
start_after?: string | null
}
}Response:
{
data: {
addresses: [
{
contract_type: string
address: Addr
},
...
]
}
}owner
Returns contract ownership details.
{
owner: {
}
}Response:
{
data: {
owner?: Addr | null
proposed_new_owner?: Addr | null
}
}Methods
update_owner
Updates the contract owner (admin only).
{
update_owner: {
new_owner: Addr
}
}accept_ownership
Accepts ownership transfer (proposed owner only).
{
accept_ownership: {
}
}set_address
Sets the address for a specific contract type (owner only).
{
set_address: {
contract_type: string
address: Addr
}
}remove_address
Removes a contract address (owner only).
{
remove_address: {
contract_type: string
}
}Contract Types
The Address Provider maintains addresses for the following contract types:
red_bank- Lending and borrowing operationsincentives- Rewards and points distributionoracle- Price feeds and market dataswapper- Bitcoin LST swapping functionalityduality_swapper- Advanced DEX integrationparams- Protocol parameters and configurationzapper- Multi-step strategy executionhealth_computer- Health factor calculationscredit_manager- Core account managementaccount_nft- NFT representation of accounts
Usage Examples
Get Red Bank Address
curl -X GET "https://api.neutron.org/address_provider/address" \
-H "Content-Type: application/json" \
-d '{"contract_type": "red_bank"}'Get All Contract Addresses
curl -X GET "https://api.neutron.org/address_provider/addresses"Get Contract Configuration
curl -X GET "https://api.neutron.org/address_provider/config"Integration
The Address Provider is typically used by other contracts and frontend applications to:
- Dynamic Discovery: Locate contract addresses without hardcoding
- Upgrade Management: Handle contract upgrades seamlessly
- Cross-Contract Communication: Enable contracts to find each other
- Frontend Integration: Provide real-time contract locations
This documentation reflects the Mars Protocol Address Provider contract as deployed by Amber Finance on Neutron.