Description:
Multi-signature wallet contract requiring multiple confirmations for transaction execution.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"src/perspectives/GovernedPerspective.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.26;
import {IPerspective} from "euler-earn/src/interfaces/IPerspective.sol";
import {Ownable} from "openzeppelin-contracts/access/Ownable.sol";
/// @title GovernedPerspective
/// @notice A simple governed perspective where the owner can verify/unverify vaults
/// @dev This is a whitelist-based perspective with owner control
contract GovernedPerspective is IPerspective, Ownable {
/// @notice Mapping of vault addresses to their verification status
mapping(address => bool) private _verified;
/// @notice Emitted when a vault is verified
event VaultVerified(address indexed vault);
/// @notice Emitted when a vault is unverified
event VaultUnverified(address indexed vault);
/// @notice Contract name for identification
string public name;
/// @notice Constructor
/// @param _owner The owner of the perspective contract
/// @param _name The name of this perspective
constructor(address _owner, string memory _name) Ownable(_owner) {
name = _name;
}
/// @notice Verify a vault (mark it as trusted)
/// @param vault The address of the vault to verify
/// @dev Only the owner can call this function
function verify(address vault) external onlyOwner {
require(vault != address(0), "GovernedPerspective: zero address");
_verified[vault] = true;
emit VaultVerified(vault);
}
/// @notice Unverify a vault (remove from trusted list)
/// @param vault The address of the vault to unverify
/// @dev Only the owner can call this function
function unverify(address vault) external onlyOwner {
_verified[vault] = false;
emit VaultUnverified(vault);
}
/// @notice Batch verify multiple vaults
/// @param vaults Array of vault addresses to verify
/// @dev Only the owner can call this function
function batchVerify(address[] calldata vaults) external onlyOwner {
for (uint256 i = 0; i < vaults.length; i++) {
require(vaults[i] != address(0), "GovernedPerspective: zero address");
_verified[vaults[i]] = true;
emit VaultVerified(vaults[i]);
}
}
/// @notice Batch unverify multiple vaults
/// @param vaults Array of vault addresses to unverify
/// @dev Only the owner can call this function
function batchUnverify(address[] calldata vaults) external onlyOwner {
for (uint256 i = 0; i < vaults.length; i++) {
_verified[vaults[i]] = false;
emit VaultUnverified(vaults[i]);
}
}
/// @inheritdoc IPerspective
/// @notice Check if a vault is verified
/// @param vault The address of the vault to check
/// @return True if the vault is verified, false otherwise
function isVerified(address vault) external view override returns (bool) {
return _verified[vault];
}
}
"
},
"lib/euler-earn/src/interfaces/IPerspective.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.8.0;
/// @title IPerspective
/// @custom:security-contact security@euler.xyz
/// @author Euler Labs (https://www.eulerlabs.com/)
/// @notice A contract that verifies the properties of a vault.
interface IPerspective {
/// @notice Checks if a vault is verified.
/// @param vault The address of the vault to check.
/// @return True if the vault is verified, false otherwise.
function isVerified(address vault) external view returns (bool);
}
"
},
"lib/euler-earn/lib/openzeppelin-contracts/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
"
},
"lib/euler-earn/lib/openzeppelin-contracts/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
"
}
},
"settings": {
"remappings": [
"forge-std/=lib/euler-earn/lib/forge-std/src/",
"openzeppelin-contracts/=lib/euler-earn/lib/openzeppelin-contracts/contracts/",
"ethereum-vault-connector/=lib/euler-earn/lib/ethereum-vault-connector/src/",
"permit2/=lib/euler-earn/lib/euler-vault-kit/lib/permit2/",
"solmate/=lib/euler-earn/lib/euler-vault-kit/lib/permit2/lib/solmate/src/",
"euler-earn/=lib/euler-earn/",
"@base64-sol/=lib/ajna-core/lib/base64/",
"@clones/=lib/ajna-core/lib/clones-with-immutable-args/src/",
"@openzeppelin/=lib/yearn-tokenized-strategy/lib/openzeppelin-contracts/",
"@prb-math/=lib/ajna-core/lib/prb-math/",
"@solmate/=lib/ajna-core/lib/solmate/src/",
"@std/=lib/ajna-core/lib/forge-std/src/",
"@uniswap/v3-core/=lib/enzyme-protocol/lib/uniswap-v3-core/",
"ajna-core/=lib/ajna-core/src/",
"ds-test/=lib/enzyme-protocol/lib/forge-std/lib/ds-test/src/",
"enzyme-protocol/=lib/enzyme-protocol/contracts/",
"erc4626-tests/=lib/euler-earn/lib/erc4626-tests/",
"euler-vault-kit/=lib/euler-earn/lib/euler-vault-kit/",
"forge-gas-snapshot/=lib/euler-earn/lib/euler-vault-kit/lib/permit2/lib/forge-gas-snapshot/src/",
"halmos-cheatcodes/=lib/euler-earn/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"morpho-blue/=lib/enzyme-protocol/lib/morpho-blue/src/libraries/",
"openzeppelin-solc-0.6/=lib/enzyme-protocol/lib/openzeppelin-solc-0.6/contracts/",
"openzeppelin-solc-0.7/=lib/enzyme-protocol/lib/openzeppelin-solc-0.7/contracts/",
"openzeppelin-solc-0.8/=lib/enzyme-protocol/lib/openzeppelin-solc-0.8/contracts/",
"openzeppelin/=lib/euler-earn/lib/ethereum-vault-connector/lib/openzeppelin-contracts/contracts/",
"src/=lib/ajna-core/src/",
"uniswap-v3-core-0.8/=lib/enzyme-protocol/lib/uniswap-v3-core-0.8/",
"uniswap-v3-core/=lib/enzyme-protocol/lib/uniswap-v3-core/",
"uniswap-v3-periphery/=lib/enzyme-protocol/lib/uniswap-v3-periphery/contracts/",
"yearn-erc4626-router/=lib/yearn-erc4626-router/src/",
"yearn-tokenized-strategy/=lib/yearn-tokenized-strategy/src/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": true
}
}}
Submitted on: 2025-11-06 11:42:14
Comments
Log in to comment.
No comments yet.