Source Code
Overview
S Balance
S Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers.
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | ||||
|---|---|---|---|---|---|---|---|
| 40054321 | 185 days ago | 0 S | |||||
| 40054321 | 185 days ago | 0 S | |||||
| 40054321 | 185 days ago | 0 S | |||||
| 40054321 | 185 days ago | 0 S | |||||
| 40054215 | 185 days ago | 0 S | |||||
| 40054215 | 185 days ago | 0 S | |||||
| 40054215 | 185 days ago | 0 S | |||||
| 40054215 | 185 days ago | 0 S | |||||
| 40054215 | 185 days ago | 0 S | |||||
| 40054215 | 185 days ago | 0 S | |||||
| 40054157 | 185 days ago | 0 S | |||||
| 40054157 | 185 days ago | 0 S | |||||
| 40054157 | 185 days ago | 0 S | |||||
| 40054157 | 185 days ago | 0 S | |||||
| 40054157 | 185 days ago | 0 S | |||||
| 40054157 | 185 days ago | 0 S | |||||
| 40054119 | 185 days ago | 0 S | |||||
| 40054119 | 185 days ago | 0 S | |||||
| 40053555 | 185 days ago | 0 S | |||||
| 40053555 | 185 days ago | 0 S | |||||
| 40053555 | 185 days ago | 0 S | |||||
| 40053555 | 185 days ago | 0 S | |||||
| 40053555 | 185 days ago | 0 S | |||||
| 40053555 | 185 days ago | 0 S | |||||
| 40053472 | 185 days ago | 0 S |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
GaugeRegistry
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { ICustomConnectorRegistry } from "contracts/ConnectorRegistry.sol";
interface IGaugeRegistryVoter {
function isGauge(
address target
) external view returns (bool);
function isClGauge(
address target
) external view returns (bool);
function poolForGauge(
address gauge
) external view returns (address);
}
contract GaugeRegistry is ICustomConnectorRegistry {
IGaugeRegistryVoter public immutable voter;
address public immutable connector;
constructor(IGaugeRegistryVoter voter_, address connector_) {
voter = voter_;
connector = connector_;
}
function connectorOf(
address target
) external view override returns (address) {
if (voter.isGauge(target)) {
return connector;
}
return address(0);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Admin } from "contracts/base/Admin.sol";
import { TimelockAdmin } from "contracts/base/TimelockAdmin.sol";
error ConnectorNotRegistered(address target);
error CustomRegistryAlreadyRegistered();
interface ICustomConnectorRegistry {
function connectorOf(
address target
) external view returns (address);
}
contract ConnectorRegistry is Admin, TimelockAdmin {
event ConnectorChanged(address target, address connector);
event CustomRegistryAdded(address registry);
event CustomRegistryRemoved(address registry);
error ConnectorAlreadySet(address target);
error ConnectorNotSet(address target);
error ArrayLengthMismatch();
ICustomConnectorRegistry[] public customRegistries;
mapping(address target => address connector) private connectors_;
constructor(
address admin_,
address timelockAdmin_
) Admin(admin_) TimelockAdmin(timelockAdmin_) { }
/// Admin functions
/// @notice Update connector addresses for a batch of targets.
/// @dev Controls which connector contracts are used for the specified
/// targets.
/// @custom:access Restricted to protocol admin.
function setConnectors(
address[] calldata targets,
address[] calldata connectors
) external onlyAdmin {
if (targets.length != connectors.length) {
revert ArrayLengthMismatch();
}
for (uint256 i; i != targets.length;) {
if (connectors_[targets[i]] != address(0)) {
revert ConnectorAlreadySet(targets[i]);
}
connectors_[targets[i]] = connectors[i];
emit ConnectorChanged(targets[i], connectors[i]);
unchecked {
++i;
}
}
}
function updateConnectors(
address[] calldata targets,
address[] calldata connectors
) external onlyTimelockAdmin {
if (targets.length != connectors.length) {
revert ArrayLengthMismatch();
}
for (uint256 i; i != targets.length;) {
if (connectors_[targets[i]] == address(0)) {
revert ConnectorNotSet(targets[i]);
}
connectors_[targets[i]] = connectors[i];
emit ConnectorChanged(targets[i], connectors[i]);
unchecked {
++i;
}
}
}
/// @notice Append an address to the custom registries list.
/// @custom:access Restricted to protocol admin.
function addCustomRegistry(
ICustomConnectorRegistry registry
) external onlyAdmin {
if (isCustomRegistry(registry)) {
revert CustomRegistryAlreadyRegistered();
}
customRegistries.push(registry);
emit CustomRegistryAdded(address(registry));
}
/// @notice Replace an address in the custom registries list.
/// @custom:access Restricted to protocol admin.
function updateCustomRegistry(
uint256 index,
ICustomConnectorRegistry newRegistry
) external onlyTimelockAdmin {
ICustomConnectorRegistry oldRegistry = customRegistries[index];
emit CustomRegistryRemoved(address(oldRegistry));
customRegistries[index] = newRegistry;
if (address(newRegistry) != address(0)) {
emit CustomRegistryAdded(address(newRegistry));
}
}
/// Public functions
function connectorOf(
address target
) external view returns (address) {
address connector = _getConnector(target);
if (connector != address(0)) {
return connector;
}
revert ConnectorNotRegistered(target);
}
function hasConnector(
address target
) external view returns (bool) {
return _getConnector(target) != address(0);
}
function isCustomRegistry(
ICustomConnectorRegistry registry
) public view returns (bool) {
for (uint256 i; i != customRegistries.length;) {
if (address(customRegistries[i]) == address(registry)) {
return true;
}
unchecked {
++i;
}
}
return false;
}
/// Internal functions
function _getConnector(
address target
) internal view returns (address) {
address connector = connectors_[target];
if (connector != address(0)) {
return connector;
}
uint256 length = customRegistries.length;
for (uint256 i; i != length;) {
if (address(customRegistries[i]) != address(0)) {
(bool success, bytes memory data) = address(customRegistries[i])
.staticcall(
abi.encodeWithSelector(
ICustomConnectorRegistry.connectorOf.selector, target
)
);
if (success && data.length == 32) {
address _connector = abi.decode(data, (address));
if (_connector != address(0)) {
return _connector;
}
}
}
unchecked {
++i;
}
}
return address(0);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/// @title Admin contract
/// @author vfat.tools
/// @notice Provides an administration mechanism allowing restricted functions
abstract contract Admin {
/// ERRORS ///
/// @notice Thrown when the caller is not the admin
error NotAdminError(); //0xb5c42b3b
/// EVENTS ///
/// @notice Emitted when a new admin is set
/// @param oldAdmin Address of the old admin
/// @param newAdmin Address of the new admin
event AdminSet(address oldAdmin, address newAdmin);
/// STORAGE ///
/// @notice Address of the current admin
address public admin;
/// MODIFIERS ///
/// @dev Restricts a function to the admin
modifier onlyAdmin() {
if (msg.sender != admin) revert NotAdminError();
_;
}
/// WRITE FUNCTIONS ///
/// @param admin_ Address of the admin
constructor(
address admin_
) {
emit AdminSet(address(0), admin_);
admin = admin_;
}
/// @notice Sets a new admin
/// @param newAdmin Address of the new admin
/// @custom:access Restricted to protocol admin.
function setAdmin(
address newAdmin
) external onlyAdmin {
emit AdminSet(admin, newAdmin);
admin = newAdmin;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/// @title TimelockAdmin contract
/// @author vfat.tools
/// @notice Provides an timelockAdministration mechanism allowing restricted
/// functions
abstract contract TimelockAdmin {
/// ERRORS ///
/// @notice Thrown when the caller is not the timelockAdmin
error NotTimelockAdminError();
/// EVENTS ///
/// @notice Emitted when a new timelockAdmin is set
/// @param oldTimelockAdmin Address of the old timelockAdmin
/// @param newTimelockAdmin Address of the new timelockAdmin
event TimelockAdminSet(address oldTimelockAdmin, address newTimelockAdmin);
/// STORAGE ///
/// @notice Address of the current timelockAdmin
address public timelockAdmin;
/// MODIFIERS ///
/// @dev Restricts a function to the timelockAdmin
modifier onlyTimelockAdmin() {
if (msg.sender != timelockAdmin) revert NotTimelockAdminError();
_;
}
/// WRITE FUNCTIONS ///
/// @param timelockAdmin_ Address of the timelockAdmin
constructor(address timelockAdmin_) {
emit TimelockAdminSet(timelockAdmin, timelockAdmin_);
timelockAdmin = timelockAdmin_;
}
/// @notice Sets a new timelockAdmin
/// @dev Can only be called by the current timelockAdmin
/// @param newTimelockAdmin Address of the new timelockAdmin
function setTimelockAdmin(address newTimelockAdmin)
external
onlyTimelockAdmin
{
emit TimelockAdminSet(timelockAdmin, newTimelockAdmin);
timelockAdmin = newTimelockAdmin;
}
}{
"remappings": [
"solmate/=lib/solmate/src/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"@morpho-blue/=lib/morpho-blue/src/",
"ds-test/=lib/solmate/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"morpho-blue/=lib/morpho-blue/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IGaugeRegistryVoter","name":"voter_","type":"address"},{"internalType":"address","name":"connector_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"connector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"connectorOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"contract IGaugeRegistryVoter","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60c060405234801561001057600080fd5b506040516102d13803806102d183398101604081905261002f9161005e565b6001600160a01b039182166080521660a052610098565b6001600160a01b038116811461005b57600080fd5b50565b6000806040838503121561007157600080fd5b825161007c81610046565b602084015190925061008d81610046565b809150509250929050565b60805160a0516102096100c860003960008181608e0152610155015260008181604b015260e001526102096000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806346c96aac1461004657806383f3084f14610089578063c79aeaae146100b0575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b61006d6100be366004610181565b60405163aa79979b60e01b81526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063aa79979b90602401602060405180830381865afa158015610129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014d91906101b1565b1561017957507f0000000000000000000000000000000000000000000000000000000000000000919050565b506000919050565b60006020828403121561019357600080fd5b81356001600160a01b03811681146101aa57600080fd5b9392505050565b6000602082840312156101c357600080fd5b815180151581146101aa57600080fdfea26469706673582212207595a8955fb5d330d9f419ba29604bd5ffef1aa2e532e464cff70df27a059b0164736f6c6343000813003300000000000000000000000017fa9da6e01ad59513707f92033a6eb03ccb10b40000000000000000000000003508a7918ac8f31ef3af71f8bb637926b8983596
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100415760003560e01c806346c96aac1461004657806383f3084f14610089578063c79aeaae146100b0575b600080fd5b61006d7f00000000000000000000000017fa9da6e01ad59513707f92033a6eb03ccb10b481565b6040516001600160a01b03909116815260200160405180910390f35b61006d7f0000000000000000000000003508a7918ac8f31ef3af71f8bb637926b898359681565b61006d6100be366004610181565b60405163aa79979b60e01b81526001600160a01b0382811660048301526000917f00000000000000000000000017fa9da6e01ad59513707f92033a6eb03ccb10b49091169063aa79979b90602401602060405180830381865afa158015610129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014d91906101b1565b1561017957507f0000000000000000000000003508a7918ac8f31ef3af71f8bb637926b8983596919050565b506000919050565b60006020828403121561019357600080fd5b81356001600160a01b03811681146101aa57600080fd5b9392505050565b6000602082840312156101c357600080fd5b815180151581146101aa57600080fdfea26469706673582212207595a8955fb5d330d9f419ba29604bd5ffef1aa2e532e464cff70df27a059b0164736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000017fa9da6e01ad59513707f92033a6eb03ccb10b40000000000000000000000003508a7918ac8f31ef3af71f8bb637926b8983596
-----Decoded View---------------
Arg [0] : voter_ (address): 0x17fa9dA6e01aD59513707F92033a6eb03CcB10B4
Arg [1] : connector_ (address): 0x3508A7918ac8F31eF3aF71F8bB637926b8983596
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000017fa9da6e01ad59513707f92033a6eb03ccb10b4
Arg [1] : 0000000000000000000000003508a7918ac8f31ef3af71f8bb637926b8983596
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in S
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.