PERI Finance
  • PERI Finance
  • PERI Finance
    • What is PERI Finance?
    • 📈dApps
      • 🥩PERI Staking
      • 💱PERI Exchange(DEX)
    • PERI Tokenomics
    • ➡️Token Contract Addresses
    • Guides
      • PERI DEX Bridge Guide
      • 1️Staking dApp — 1. Setting/Stake-Mint
      • 2️Staking dApp — 2. Burn
      • 3️Staking dApp — 3. Reward
      • 4️Staking dApp— 4. Earn(LP Reward)
      • 🦄PERI Token Swap Guide - BASE UniSwap
      • 📣PERI Finance LP Rewards Program
      • 🤽‍♂️Details of APY — PERI Finance dApp
    • Security & Audits
    • FAQs
  • Development Resources
    • Protocol
      • VALUE RECEPIENTS
      • PERI STAKING REWARDS
      • PROTOCOL CORE EQUATIONS
    • Deployed Contract
      • MAINNET
        • 🔵BASE MAINNET
        • ⚫ETHEREUM MAINNET
        • 🟡BSC MAINNET
        • 🟣POLYGON MAINNET
        • 🔴MOONBEAM MAINNET
        • 🟢MOONRIVER MAINNET
      • TESTNET
        • ETHEREUM KOVAN TESTNET
        • POLYGON TESTNET
        • BSC TESTNET
    • Protocol Integrations
      • INTEGRATED PROJECT
      • PERI FINANCE HISTORICAL DATA
      • PERI FINANCE STAKING
        • STAKING PERI
    • Smart Contract Architecture
    • Deployment Procedure
    • Common Transactions
    • Source Code Description
      • SOLIDITY CONTRACT
        • AddressResolver
        • BaseDebtCache
        • BasePeriFinance
        • BaseRewardEscrowV2
        • BinaryOption
        • BinaryOptionMarket
        • BinaryOptionMarketData
        • BinaryOptionMarketFactory
        • BinaryOptionMarketManager
        • BlacklistManager
        • BridgeState
        • Collateral
        • CollateralErc20
        • CollateralEth
        • CollateralManager
        • CollateralManagerState
        • CollateralShort
        • CollateralState
        • ContractStorage
        • DappMaintenance
        • DebtCache
        • DelegateApprovals
        • Depot
        • EmptyCollateralManager
        • EmptyEtherCollateral
        • EscrowChecker
        • EternalStorage
        • EtherCollateral
        • EtherCollateralpUSD
        • ExchangeRates
        • ExchangeRatesWithoutInvPricing
        • ExchangeState
        • Exchanger
        • ExchangerWithVirtualPynth
        • ExternStateToken
        • ExternalRateAggregator
        • ExternalTokenStakeManager
        • FeePool
        • FeePoolEternalStorage
        • FeePoolState
        • FlexibleStorage
        • ImportableRewardEscrowV2
        • Issuer
        • IssuerWithoutLiquidations
        • LimitedSetup
        • Liquidations
        • Math
        • MintablePeriFinance
        • MixinResolver
        • MixinSystemSettings
        • MultiCollateralPynth
        • Owned
        • Pausable
        • PeriFinance
        • PeriFinanceBridgeToBase
        • PeriFinanceBridgeToOptimism
        • PeriFinanceEscrow
        • PeriFinanceState
        • PeriFinanceStateWithLimitedSetup
        • PeriFinanceToBSC
        • PeriFinanceToEthereum
        • PeriFinanceToPolygon
        • Proxy
        • ProxyERC20
        • Proxyable
        • PurgeablePynth
        • Pynth
        • PynthUtil
        • ReadProxy
        • RealtimeDebtCache
        • RewardEscrow
        • RewardEscrowV2
        • RewardsDistribution
        • RewardsDistributionRecipient
        • SafeDecimalMath
        • ShortingRewards
        • StakingRewards
        • StakingState
        • StakingStateUSDC
        • State
        • SupplySchedule
        • SystemSettings
        • SystemStatus
        • TokenState
        • TradingRewards
        • VirtualPynth
      • SOLIDITY INTERFACES
        • IAddressResolver
        • IBinaryOption
        • IBinaryOptionMarket
        • IBinaryOptionMarketManager
        • IBridgeState
        • ICollateralErc20
        • ICollateralEth
        • ICollateralLoan
        • ICollateralManager
        • IDebtCache
        • IDelegateApprovals
        • IDepot
        • IERC20
        • IEtherCollateral
        • IEtherCollateralpUSD
        • IExchangeRates
        • IExchangeState
        • IExchanger
        • IExternalTokenStakeManager
        • IFeePool
        • IFlexibleStorage
        • IHasBalance
        • IIssuer
        • ILiquidations
        • IPeriFinance
        • IPeriFinanceBridgeToBase
        • IPeriFinanceBridgeToOptimism
        • IPeriFinanceState
        • IPynth
        • IRewardEscrow
        • IRewardEscrowV2
        • IRewardsDistribution
        • IShortingRewards
        • IStakingRewards
        • IStakingState
        • IStakingStateUSDC
        • ISupplySchedule
        • ISystemSettings
        • ISystemStatus
        • ITradingRewards
        • IVirtualPynth
      • SOLIDITY LIBRARIES
        • AddressSetLib
        • Bytes32SetLib
        • Math
        • SafeDecimalMath
        • SafeMath
  • Resources
    • Whitepaper
      • English
    • Media Kit
      • Logo with Texts
      • Logo Only
      • Text Only
      • .ai files
      • .svg files
    • 🛠️Update
Powered by GitBook
On this page
  • Description
  • Variables
  • Constructor
  • Views
  • Restricted Functions
  • External Functions
  • Events
  1. Development Resources
  2. Source Code Description
  3. SOLIDITY CONTRACT

AddressResolver

PreviousSOLIDITY CONTRACTNextBaseDebtCache

Last updated 3 years ago

Description

This contract is a type of Service Locator pattern that allows for easier interaction between multiple contracts. Instead of contract A needing references to contracts B and C (and updating every release), contract A can refer to an AddressResolver and query for B and C at transaction time. Then, during a release, the AddressResolver is updated with the latest B and C contract. Thus this ensures that contract A always has the latest B and C contracts.

Source:

Variables

repository

The mapping of contract name to address

Type: mapping(bytes32 => address)

Constructor

constructor

Signature

constructor(address _owner)

Visibility

public

State Mutability

Views

areAddressesImported

Signature

areAddressesImported(bytes32[] names, address[] destinations) view returns (bool)

Visibility

external

State Mutability

view

getAddress

Returns a single address by it's bytes32 key.Details

getPynth

Returns Issuer address

Signature

getSynth(bytes32 key) view returns (address)

Visibility

external

State Mutability

view

Requires

  • require(..., "Cannot find Issuer address")

requireAndGetAddress

Signature

requireAndGetAddress(bytes32 name, string reason) view returns (address)

Visibility

external

State Mutability

view

Requires

Restricted Functions

importAddresses

Import one or more addresses into the system for the given keys. Note: this function will overwrite any previous entries with the same key names, allowing for inline updates.

Signature

importAddresses(bytes32[] names, address[] destinations)

Visibility

external

State Mutability

Requires

Modifiers

  • onlyOwner

External Functions

rebuildCaches

Signature

rebuildCaches(contract MixinResolver[] destinations)

Visibility

external

State Mutability

Events

AddressImported

Signature: AddressImported(bytes32 name, address destination)

contracts/AddressResolver.sol
Source
Source
require(..., "string calldata")
require(..., "Input lengths must match")