Overview
S Balance
0 S
S Value
-More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
307793 | 24 days ago | Contract Creation | 0 S |
Loading...
Loading
Contract Name:
ReleaseRegistry
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at SonicScan.org on 2024-12-11 */ // SPDX-License-Identifier: GNU AGPLv3 pragma solidity >=0.8.18; // lib/tokenized-strategy-periphery/src/utils/Governance.sol contract Governance { /// @notice Emitted when the governance address is updated. event GovernanceTransferred( address indexed previousGovernance, address indexed newGovernance ); modifier onlyGovernance() { _checkGovernance(); _; } /// @notice Checks if the msg sender is the governance. function _checkGovernance() internal view virtual { require(governance == msg.sender, "!governance"); } /// @notice Address that can set the default base fee and provider address public governance; constructor(address _governance) { governance = _governance; emit GovernanceTransferred(address(0), _governance); } /** * @notice Sets a new address as the governance of the contract. * @dev Throws if the caller is not current governance. * @param _newGovernance The new governance address. */ function transferGovernance( address _newGovernance ) external virtual onlyGovernance { require(_newGovernance != address(0), "ZERO ADDRESS"); address oldGovernance = governance; governance = _newGovernance; emit GovernanceTransferred(oldGovernance, _newGovernance); } } // lib/tokenized-strategy-periphery/src/utils/Governance2Step.sol contract Governance2Step is Governance { /// @notice Emitted when the pending governance address is set. event UpdatePendingGovernance(address indexed newPendingGovernance); /// @notice Address that is set to take over governance. address public pendingGovernance; constructor(address _governance) Governance(_governance) {} /** * @notice Sets a new address as the `pendingGovernance` of the contract. * @dev Throws if the caller is not current governance. * @param _newGovernance The new governance address. */ function transferGovernance( address _newGovernance ) external virtual override onlyGovernance { require(_newGovernance != address(0), "ZERO ADDRESS"); pendingGovernance = _newGovernance; emit UpdatePendingGovernance(_newGovernance); } /** * @notice Allows the `pendingGovernance` to accept the role. */ function acceptGovernance() external virtual { require(msg.sender == pendingGovernance, "!pending governance"); emit GovernanceTransferred(governance, msg.sender); governance = msg.sender; pendingGovernance = address(0); } } // src/registry/ReleaseRegistry.sol interface IFactory { function apiVersion() external view returns (string memory); } interface ITokenizedStrategy { function apiVersion() external view returns (string memory); } /** * @title YearnV3 Release Registry * @author yearn.finance * @notice * Used by Yearn Governance to track on chain all * releases of the V3 vaults by API Version. */ contract ReleaseRegistry is Governance2Step { event NewRelease( uint256 indexed releaseId, address indexed factory, address indexed tokenizedStrategy, string apiVersion ); string public constant name = "Yearn V3 Release Registry"; // The total number of releases that have been deployed uint256 public numReleases; // Mapping of release id starting at 0 to the address // of the corresponding factory for that release. mapping(uint256 => address) public factories; // Mapping of release id starting at 0 to the address // of the corresponding Tokenized Strategy for that release. mapping(uint256 => address) public tokenizedStrategies; // Mapping of the API version for a specific release to the // place in the order it was released. mapping(string => uint256) public releaseTargets; constructor(address _governance) Governance2Step(_governance) {} /** * @notice Returns the latest factory. * @return The address of the factory for the latest release. */ function latestFactory() external view virtual returns (address) { uint256 _numReleases = numReleases; if (_numReleases == 0) return address(0); return factories[numReleases - 1]; } /** * @notice Returns the latest tokenized strategy. * @return The address of the tokenized strategy for the latest release. */ function latestTokenizedStrategy() external view virtual returns (address) { uint256 _numReleases = numReleases; if (_numReleases == 0) return address(0); return tokenizedStrategies[numReleases - 1]; } /** * @notice Returns the api version of the latest release. * @return The api version of the latest release. */ function latestRelease() external view virtual returns (string memory) { uint256 _numReleases = numReleases; if (_numReleases == 0) return ""; return IFactory(factories[numReleases - 1]).apiVersion(); } /** * @notice Issue a new release using a deployed factory. * @dev Stores the factory address in `factories` and the release * target in `releaseTargets` with its associated API version. * * Throws if caller isn't `governance`. * Throws if the api version is the same as the previous release. * Throws if the factory does not have the same api version as the tokenized strategy. * Emits a `NewRelease` event. * * @param _factory The factory that will be used create new vaults. */ function newRelease( address _factory, address _tokenizedStrategy ) external virtual onlyGovernance { // Check if the release is different from the current one uint256 releaseId = numReleases; string memory apiVersion = IFactory(_factory).apiVersion(); string memory tokenizedStrategyApiVersion = ITokenizedStrategy( _tokenizedStrategy ).apiVersion(); require( keccak256(bytes(apiVersion)) == keccak256(bytes(tokenizedStrategyApiVersion)), "ReleaseRegistry: api version mismatch" ); if (releaseId > 0) { // Make sure this isn't the same as the last one require( keccak256( bytes(IFactory(factories[releaseId - 1]).apiVersion()) ) != keccak256(bytes(apiVersion)), "ReleaseRegistry: same api version" ); } // Update latest release. factories[releaseId] = _factory; tokenizedStrategies[releaseId] = _tokenizedStrategy; // Set the api to the target. releaseTargets[apiVersion] = releaseId; // Increase our number of releases. numReleases = releaseId + 1; // Log the release for external listeners emit NewRelease(releaseId, _factory, _tokenizedStrategy, apiVersion); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_governance","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousGovernance","type":"address"},{"indexed":true,"internalType":"address","name":"newGovernance","type":"address"}],"name":"GovernanceTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"releaseId","type":"uint256"},{"indexed":true,"internalType":"address","name":"factory","type":"address"},{"indexed":true,"internalType":"address","name":"tokenizedStrategy","type":"address"},{"indexed":false,"internalType":"string","name":"apiVersion","type":"string"}],"name":"NewRelease","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newPendingGovernance","type":"address"}],"name":"UpdatePendingGovernance","type":"event"},{"inputs":[],"name":"acceptGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"factories","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governance","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRelease","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestTokenizedStrategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_tokenizedStrategy","type":"address"}],"name":"newRelease","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"numReleases","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingGovernance","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"releaseTargets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenizedStrategies","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newGovernance","type":"address"}],"name":"transferGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50604051610bb2380380610bb283398101604081905261002f91610081565b600080546001600160a01b0319166001600160a01b038316908117825560405183928392917f5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce80908290a35050506100b1565b60006020828403121561009357600080fd5b81516001600160a01b03811681146100aa57600080fd5b9392505050565b610af2806100c06000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80635aa6e6751161008c578063d38bfff411610066578063d38bfff4146101fb578063e704cba71461020e578063f0d3a17c14610216578063f39c38a01461022957600080fd5b80635aa6e675146101b7578063672383c4146101ca5780637be0ca5e146101f357600080fd5b806303c0b755146100d457806306fdde03146101125780630fd2afe81461015b578063238efcbc1461019c5780634e55dc0a146101a657806356e0a94b146101ae575b600080fd5b6100ff6100e2366004610886565b805160208183018101805160058252928201919093012091525481565b6040519081526020015b60405180910390f35b61014e6040518060400160405280601981526020017f596561726e2056332052656c656173652052656769737472790000000000000081525081565b604051610109919061092a565b61018461016936600461095d565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610109565b6101a461023c565b005b6101846102e9565b6100ff60025481565b600054610184906001600160a01b031681565b6101846101d836600461095d565b6003602052600090815260409020546001600160a01b031681565b61014e610331565b6101a4610209366004610992565b6103f4565b61018461048b565b6101a46102243660046109b4565b6104b3565b600154610184906001600160a01b031681565b6001546001600160a01b031633146102915760405162461bcd60e51b81526020600482015260136024820152722170656e64696e6720676f7665726e616e636560681b60448201526064015b60405180910390fd5b6000805460405133926001600160a01b03909216917f5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce8091a3600080546001600160a01b03199081163317909155600180549091169055565b6002546000908082036102fe57600091505090565b60036000600160025461031191906109fd565b81526020810191909152604001600020546001600160a01b031692915050565b600254606090600081900361035457505060408051602081019091526000815290565b60036000600160025461036791906109fd565b815260200190815260200160002060009054906101000a90046001600160a01b03166001600160a01b031663258294106040518163ffffffff1660e01b8152600401600060405180830381865afa1580156103c6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103ee9190810190610a16565b91505090565b6103fc6107cd565b6001600160a01b0381166104415760405162461bcd60e51b815260206004820152600c60248201526b5a45524f204144445245535360a01b6044820152606401610288565b600180546001600160a01b0319166001600160a01b0383169081179091556040517fa443b483867b0f9db5b03913474dd21935ac5ba70fa6c94e3423ba9be157c44b90600090a250565b6002546000908082036104a057600091505090565b60046000600160025461031191906109fd565b6104bb6107cd565b600060025490506000836001600160a01b031663258294106040518163ffffffff1660e01b8152600401600060405180830381865afa158015610502573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261052a9190810190610a16565b90506000836001600160a01b031663258294106040518163ffffffff1660e01b8152600401600060405180830381865afa15801561056c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105949190810190610a16565b905080805190602001208280519060200120146106015760405162461bcd60e51b815260206004820152602560248201527f52656c6561736552656769737472793a206170692076657273696f6e206d69736044820152640dac2e8c6d60db1b6064820152608401610288565b821561070257815160208301206003600061061d6001876109fd565b815260200190815260200160002060009054906101000a90046001600160a01b03166001600160a01b031663258294106040518163ffffffff1660e01b8152600401600060405180830381865afa15801561067c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106a49190810190610a16565b80519060200120036107025760405162461bcd60e51b815260206004820152602160248201527f52656c6561736552656769737472793a2073616d65206170692076657273696f6044820152603760f91b6064820152608401610288565b600083815260036020908152604080832080546001600160a01b03808b166001600160a01b031992831617909255600490935292819020805493881693909216929092179055518390600590610759908590610a8d565b90815260405190819003602001902055610774836001610aa9565b600281905550836001600160a01b0316856001600160a01b0316847f1e64daea1fff30af27f156c266895d276293b147737b2219edb8845994d18b4f856040516107be919061092a565b60405180910390a45050505050565b6000546001600160a01b031633146108155760405162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b6044820152606401610288565b565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561085657610856610817565b604052919050565b600067ffffffffffffffff82111561087857610878610817565b50601f01601f191660200190565b60006020828403121561089857600080fd5b813567ffffffffffffffff8111156108af57600080fd5b8201601f810184136108c057600080fd5b80356108d36108ce8261085e565b61082d565b8181528560208385010111156108e857600080fd5b81602084016020830137600091810160200191909152949350505050565b60005b83811015610921578181015183820152602001610909565b50506000910152565b6020815260008251806020840152610949816040850160208701610906565b601f01601f19169190910160400192915050565b60006020828403121561096f57600080fd5b5035919050565b80356001600160a01b038116811461098d57600080fd5b919050565b6000602082840312156109a457600080fd5b6109ad82610976565b9392505050565b600080604083850312156109c757600080fd5b6109d083610976565b91506109de60208401610976565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610a1057610a106109e7565b92915050565b600060208284031215610a2857600080fd5b815167ffffffffffffffff811115610a3f57600080fd5b8201601f81018413610a5057600080fd5b8051610a5e6108ce8261085e565b818152856020838501011115610a7357600080fd5b610a84826020830160208601610906565b95945050505050565b60008251610a9f818460208701610906565b9190910192915050565b80820180821115610a1057610a106109e756fea2646970667358221220f88027a70ec897a26f3070932c8f155ab072da3e0762492098d92b65205f1eff64736f6c634300081200330000000000000000000000006f3cbe2ab3483ec4ba7b672fbdca0e9b33f88db8
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80635aa6e6751161008c578063d38bfff411610066578063d38bfff4146101fb578063e704cba71461020e578063f0d3a17c14610216578063f39c38a01461022957600080fd5b80635aa6e675146101b7578063672383c4146101ca5780637be0ca5e146101f357600080fd5b806303c0b755146100d457806306fdde03146101125780630fd2afe81461015b578063238efcbc1461019c5780634e55dc0a146101a657806356e0a94b146101ae575b600080fd5b6100ff6100e2366004610886565b805160208183018101805160058252928201919093012091525481565b6040519081526020015b60405180910390f35b61014e6040518060400160405280601981526020017f596561726e2056332052656c656173652052656769737472790000000000000081525081565b604051610109919061092a565b61018461016936600461095d565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610109565b6101a461023c565b005b6101846102e9565b6100ff60025481565b600054610184906001600160a01b031681565b6101846101d836600461095d565b6003602052600090815260409020546001600160a01b031681565b61014e610331565b6101a4610209366004610992565b6103f4565b61018461048b565b6101a46102243660046109b4565b6104b3565b600154610184906001600160a01b031681565b6001546001600160a01b031633146102915760405162461bcd60e51b81526020600482015260136024820152722170656e64696e6720676f7665726e616e636560681b60448201526064015b60405180910390fd5b6000805460405133926001600160a01b03909216917f5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce8091a3600080546001600160a01b03199081163317909155600180549091169055565b6002546000908082036102fe57600091505090565b60036000600160025461031191906109fd565b81526020810191909152604001600020546001600160a01b031692915050565b600254606090600081900361035457505060408051602081019091526000815290565b60036000600160025461036791906109fd565b815260200190815260200160002060009054906101000a90046001600160a01b03166001600160a01b031663258294106040518163ffffffff1660e01b8152600401600060405180830381865afa1580156103c6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103ee9190810190610a16565b91505090565b6103fc6107cd565b6001600160a01b0381166104415760405162461bcd60e51b815260206004820152600c60248201526b5a45524f204144445245535360a01b6044820152606401610288565b600180546001600160a01b0319166001600160a01b0383169081179091556040517fa443b483867b0f9db5b03913474dd21935ac5ba70fa6c94e3423ba9be157c44b90600090a250565b6002546000908082036104a057600091505090565b60046000600160025461031191906109fd565b6104bb6107cd565b600060025490506000836001600160a01b031663258294106040518163ffffffff1660e01b8152600401600060405180830381865afa158015610502573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261052a9190810190610a16565b90506000836001600160a01b031663258294106040518163ffffffff1660e01b8152600401600060405180830381865afa15801561056c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105949190810190610a16565b905080805190602001208280519060200120146106015760405162461bcd60e51b815260206004820152602560248201527f52656c6561736552656769737472793a206170692076657273696f6e206d69736044820152640dac2e8c6d60db1b6064820152608401610288565b821561070257815160208301206003600061061d6001876109fd565b815260200190815260200160002060009054906101000a90046001600160a01b03166001600160a01b031663258294106040518163ffffffff1660e01b8152600401600060405180830381865afa15801561067c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106a49190810190610a16565b80519060200120036107025760405162461bcd60e51b815260206004820152602160248201527f52656c6561736552656769737472793a2073616d65206170692076657273696f6044820152603760f91b6064820152608401610288565b600083815260036020908152604080832080546001600160a01b03808b166001600160a01b031992831617909255600490935292819020805493881693909216929092179055518390600590610759908590610a8d565b90815260405190819003602001902055610774836001610aa9565b600281905550836001600160a01b0316856001600160a01b0316847f1e64daea1fff30af27f156c266895d276293b147737b2219edb8845994d18b4f856040516107be919061092a565b60405180910390a45050505050565b6000546001600160a01b031633146108155760405162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b6044820152606401610288565b565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561085657610856610817565b604052919050565b600067ffffffffffffffff82111561087857610878610817565b50601f01601f191660200190565b60006020828403121561089857600080fd5b813567ffffffffffffffff8111156108af57600080fd5b8201601f810184136108c057600080fd5b80356108d36108ce8261085e565b61082d565b8181528560208385010111156108e857600080fd5b81602084016020830137600091810160200191909152949350505050565b60005b83811015610921578181015183820152602001610909565b50506000910152565b6020815260008251806020840152610949816040850160208701610906565b601f01601f19169190910160400192915050565b60006020828403121561096f57600080fd5b5035919050565b80356001600160a01b038116811461098d57600080fd5b919050565b6000602082840312156109a457600080fd5b6109ad82610976565b9392505050565b600080604083850312156109c757600080fd5b6109d083610976565b91506109de60208401610976565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610a1057610a106109e7565b92915050565b600060208284031215610a2857600080fd5b815167ffffffffffffffff811115610a3f57600080fd5b8201601f81018413610a5057600080fd5b8051610a5e6108ce8261085e565b818152856020838501011115610a7357600080fd5b610a84826020830160208601610906565b95945050505050565b60008251610a9f818460208701610906565b9190910192915050565b80820180821115610a1057610a106109e756fea2646970667358221220f88027a70ec897a26f3070932c8f155ab072da3e0762492098d92b65205f1eff64736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000006f3cbe2ab3483ec4ba7b672fbdca0e9b33f88db8
-----Decoded View---------------
Arg [0] : _governance (address): 0x6f3cBE2ab3483EC4BA7B672fbdCa0E9B33F88db8
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000006f3cbe2ab3483ec4ba7b672fbdca0e9b33f88db8
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
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.