Robinhood MainnetChain ID: 4663
Contract detail

AddressRegistry

Live Robinhood Chain account facts for 0xee028a8f…40191b60 with at least 18 observed transactions. The history total is updating as indexing continues.

Address type
Smart contract
Transactions
18+ observed
First indexed block
#60762057
Latest indexed block
#69152761
History coverage
Recent activity available; total is catching up
Verification
Verified
Compiler
0.8.26+commit.8a97fa7a
Verification match
exact
Creation transaction
0x3fd0cf7c…e1246d2d
Created at block
#60762057
Language
Solidity
EVM version
cancun
License
MIT
Compiler optimization
Enabled · 200 runs
Deployed bytecode hash
0x4bc2798aa1a11439e51d53a665bdcc1bb3aa590baaded3081cd0994da77ae774
Related activity

Transactions

Verified contract

Contract source code

// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import {Ownable, Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {IAddressRegistry} from "../interfaces/IAddressRegistry.sol";
import {AddressId} from "../libraries/AddressId.sol";
import {Errors} from "../libraries/Errors.sol";

/// @title AddressRegistry
/// @notice Central registry of protocol contract addresses. Its owner (a timelock / multisig)
/// is also the admin of every vault.
contract AddressRegistry is IAddressRegistry, Ownable2Step {
    mapping(uint256 => address) private _addresses;
    mapping(address => bool) private _swapTargets;

    constructor(address initialOwner, address weth9) Ownable(initialOwner) {
        if (weth9 == address(0)) revert Errors.ZeroAddress();
        _addresses[AddressId.WETH9] = weth9;
        emit AddressSet(msg.sender, AddressId.WETH9, weth9);
    }

    function setAddress(uint256 id, address newAddress) external onlyOwner {
        _addresses[id] = newAddress;
        emit AddressSet(msg.sender, id, newAddress);
    }

    function getAddress(uint256 id) external view returns (address) {
        return _addresses[id];
    }

    /// @notice Allow or disallow an external swap target (aggregator router) for vault swaps.
    /// @dev Only whitelist routers that execute swaps atomically and send the output to `msg.sender`;
    /// vaults approve exactly the input amount for the duration of the call.
    function setSwapTarget(address target, bool allowed) external onlyOwner {
        if (target == address(0)) revert Errors.ZeroAddress();
        _swapTargets[target] = allowed;
        emit SwapTargetSet(target, allowed);
    }

    function isSwapTarget(address target) external view returns (bool) {
        return _swapTargets[target];
    }

    function owner() public view override(IAddressRegistry, Ownable) returns (address) {
        return Ownable.owner();
    }
}