ETH Price: $2,031.95 (-2.93%)

Contract

0x70cDD0026c73bb1C28df005F7894ea8cD8e7bf08
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Execute211042392024-11-03 2:50:35505 days ago1730602235IN
0x70cDD002...cD8e7bf08
0 ETH0.001766597.5436666
Execute211041992024-11-03 2:42:35505 days ago1730601755IN
0x70cDD002...cD8e7bf08
0 ETH0.001800357.59697661
Execute210388232024-10-24 23:43:35514 days ago1729813415IN
0x70cDD002...cD8e7bf08
0 ETH0.001345155.67618345
Execute210316012024-10-23 23:33:11515 days ago1729726391IN
0x70cDD002...cD8e7bf08
0 ETH0.001357455.79654933
Execute210315602024-10-23 23:24:59515 days ago1729725899IN
0x70cDD002...cD8e7bf08
0 ETH0.001355855.78971911
Execute210315202024-10-23 23:16:59515 days ago1729725419IN
0x70cDD002...cD8e7bf08
0 ETH0.001348695.69111777
Execute209384042024-10-10 23:08:59528 days ago1728601739IN
0x70cDD002...cD8e7bf08
0 ETH0.0028728511.07002321

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Method Block
From
To
0x3d602d80208946622024-10-04 20:50:23534 days ago1728075023  Contract Creation0 ETH
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Minimal Proxy Contract for 0xc6fef20e99f1a6d4a30cd12e7581ee8b5336278a

Contract Name:
AuctionHausShamanModule

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7 <0.9.0;

import { Enum } from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import { INounsAuctionHouseV2 } from "../libs/INounsAuctionHouseV2.sol";
import { INounsDelegator } from "../libs/INounsDelegator.sol";

import { ManagerShaman } from "../shaman/ManagerShaman.sol";
import { IShaman } from "../shaman/interfaces/IShaman.sol";
import { ZodiacModuleShaman } from "../shaman/ZodiacModuleShaman.sol";
import { IAuctionHausShaman } from "./IAuctionHausShaman.sol";

// import "hardhat/console.sol";

// @notice Provided end time is invalid
error AuctionHausShamanModule__InvalidEndTime();

// @notice invalid captain
error AuctionHausShamanModule__InvalidCaptain();

// @notice Function should be called only by the Baal vault
error AuctionHausShamanModule__BaalVaultOnly();

// @notice MultiSend execution failed
error AuctionHausShamanModule__ExecutionFailed(bytes returnData);

// @notice Insufficient balance
error AuctionHausShamanModule__InsufficientBalance();

// @notice Auction has already been settled
error AuctionHausShamanModule__AuctionAlreadySettled();

// @notice Auction has completed
error AuctionHausShamanModule__AuctionCompleted();

// @notice Current bidder is the Baal target
error AuctionHausShamanModule__CurrentBidder();

// @notice Max bid amount is over the limit
error AuctionHausShamanModule__MaxOverBid();

/**
 * @title A Shaman Role to interact with Nouns DAO Auction House. Elected Captain can execute auctions
 * and receivce a reward for their service.
 * @author DAOHaus
 * @notice It uses Yeeter for token pre-sales and AuctionHaus for token auctions
 * @dev In order to operate the contract should have Baal Admin privileges as well as being added as
 * a Safe module to the Baal/Yeeter vault.
 */
contract AuctionHausShamanModule is IAuctionHausShaman, ZodiacModuleShaman, ManagerShaman {
    address public captain;
    uint256 public captainsReward;

    uint256 public lastBidAmount;
    uint96 public lastBidTokenId;

    /// @notice endTime whn campaign expires
    uint256 public endTime;

    INounsAuctionHouseV2 public auctionHouseContract;

    /// @notice emitted when the contract is initialized
    /// @param baal baal address
    /// @param vault baal vault address
    /// @param endTime campaign end timestamp in seconds
    /// @param captain delegated bidder
    /// @param captainsReward captain reward
    /// @param auctionHouseAddress auction house address
    event Setup(
        address indexed baal,
        address indexed vault,
        uint256 endTime,
        address captain,
        uint256 captainsReward,
        address auctionHouseAddress
    );

    /// @notice emitted when a token is successfully launched
    /// @param tokenId token address
    /// @param ethSupply ETH liquidity amount
    event Executed(uint96 indexed tokenId, uint256 ethSupply);

    /// @notice A modifier for methods that require to be called by the Baal vault
    modifier baalVaultOnly() {
        if (_msgSender() != vault()) revert AuctionHausShamanModule__BaalVaultOnly();
        _;
    }

    /// @notice A modifier for methods that require to be called by the captain
    modifier captainOnly() {
        if (_msgSender() != captain) revert AuctionHausShamanModule__InvalidCaptain();
        _;
    }

    /**
     * @notice Initializer function
     * @param _baal baal address
     * @param _vault bal vault address
     * @param _endTime campaign end timestamp is seconds
     * @param _captain delegated bidder
     * @param _captainsReward captain reward
     * @param _auctionHouse auction house address
     */
    function __AuctionHausShamanModule__init(
        address _baal,
        address _vault,
        uint256 _endTime,
        address _captain,
        uint256 _captainsReward,
        address _auctionHouse
    ) internal onlyInitializing {
        __ZodiacModuleShaman__init("AuctionHausShamanModule", _baal, _vault);
        __ManagerShaman_init_unchained();
        __AuctionHausShamanModule__init_unchained(_endTime, _captain, _captainsReward, _auctionHouse);
    }

    /**
     * @notice Local initializer function
     * @param _endTime campaign end timestamp is seconds
     * @param _captain delegated bidder
     * @param _captainsReward captain reward
     * @param _auctionHouse auction house address
     */
    function __AuctionHausShamanModule__init_unchained(
        uint256 _endTime,
        address _captain,
        uint256 _captainsReward,
        address _auctionHouse
    ) internal onlyInitializing {
        if (_endTime <= block.timestamp) revert AuctionHausShamanModule__InvalidEndTime();
        endTime = _endTime;
        captain = _captain;
        captainsReward = _captainsReward;
        auctionHouseContract = INounsAuctionHouseV2(_auctionHouse);
    }

    /**
     * @notice Main initializer function to setup the shaman config
     * @inheritdoc IShaman
     */
    function setup(address _baal, address _vault, bytes memory _initializeParams) public override(IShaman) initializer {
        (uint256 _expiration, address _captain, uint256 _captainsReward, address _auctionHouse) = abi.decode(
            _initializeParams,
            (uint256, address, uint256, address)
        );
        __AuctionHausShamanModule__init(_baal, _vault, _expiration, _captain, _captainsReward, _auctionHouse);
        emit Setup(_baal, _vault, _expiration, _captain, _captainsReward, _auctionHouse);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(
        bytes4 interfaceId
    ) public view virtual override(ZodiacModuleShaman, ManagerShaman) returns (bool) {
        return interfaceId == type(IAuctionHausShaman).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @notice proposal helper delegates votes to vault
     */
    function resetDelegation() public baalVaultOnly {
        delegateVotesToVault();
    }

    /**
     * @notice sets a new captain
     * @param _captain new captain address
     */
    function setCaptain(address _captain) public baalVaultOnly {
        captain = _captain;
    }

    /**
     * @notice sets a new captains reward
     * @param _captainsReward new captains reward
     */
    function setCaptainsReward(uint256 _captainsReward) public baalVaultOnly isBaalManager {
        captainsReward = _captainsReward;
    }

    /**
     * @notice renounces captainship
     */
    function renounceCaptain() public captainOnly {
        captain = address(0);
        delegateVotesToVault();
    }

    /**
     * @notice delegates votes to a given address
     * @param delegatee address to delegate votes to
     */
    function delegateVotes(address delegatee) public isModuleEnabled captainOnly {
        address nounsAddress = auctionHouseContract.nouns();
        INounsDelegator delegator = INounsDelegator(nounsAddress);

        bytes memory delegateCalldata = abi.encodeCall(delegator.delegate, (delegatee));
        (bool success, bytes memory returnData) = execAndReturnData(
            nounsAddress,
            0,
            delegateCalldata,
            Enum.Operation.Call
        );

        if (!success) revert AuctionHausShamanModule__ExecutionFailed(returnData);
    }

    /**
     * @notice delegates votes to vault
     */
    function delegateVotesToVault() internal {
        address nounsAddress = auctionHouseContract.nouns();
        INounsDelegator delegator = INounsDelegator(nounsAddress);

        bytes memory delegateCalldata = abi.encodeCall(delegator.delegate, (vault()));
        (bool success, bytes memory returnData) = execAndReturnData(
            nounsAddress,
            0,
            delegateCalldata,
            Enum.Operation.Call
        );

        if (!success) revert AuctionHausShamanModule__ExecutionFailed(returnData);
    }

    /**
     * @notice Executes the auction bid
     * @inheritdoc IAuctionHausShaman
     * @dev The function can be called only by the captain
     * @dev TODO: rename to executeAuctionBid
     */
    function execute(uint256 maxBid) public nonReentrant isModuleEnabled isBaalManager captainOnly {
        uint256 yeethBalance = vault().balance;

        if (block.timestamp >= endTime) {
            revert AuctionHausShamanModule__InvalidEndTime();
        }

        INounsAuctionHouseV2.AuctionV2View memory currentAuction = auctionHouseContract.auction();

        uint96 tokenId = currentAuction.nounId;

        uint192 amount = nextBidAmount(currentAuction);

        if (amount > maxBid) {
            revert AuctionHausShamanModule__MaxOverBid();
        }
        if (yeethBalance < amount) {
            revert AuctionHausShamanModule__InsufficientBalance();
        }
        if (currentAuction.bidder == _baal.target()) {
            revert AuctionHausShamanModule__CurrentBidder();
        }
        if (currentAuction.settled) {
            revert AuctionHausShamanModule__AuctionAlreadySettled();
        }
        if (block.timestamp >= currentAuction.endTime) {
            revert AuctionHausShamanModule__AuctionCompleted();
        }

        // is client id (8441) an arbitrary referrer code? 8441/BAAL for v2
        bytes memory bidCalldata = abi.encodeCall(auctionHouseContract.createBid, (tokenId, 8441));
        // bytes memory bidCalldata = abi.encodeCall(auctionHouseContract.createBid, (tokenId));

        (bool success, bytes memory returnData) = execAndReturnData(
            address(auctionHouseContract),
            amount,
            bidCalldata,
            Enum.Operation.Call
        );

        if (!success) revert AuctionHausShamanModule__ExecutionFailed(returnData);

        lastBidAmount = amount;
        lastBidTokenId = tokenId;

        if (captainsReward > 0) {
            address[] memory receivers = new address[](1);
            receivers[0] = captain;
            uint256[] memory amounts = new uint256[](1);
            amounts[0] = captainsReward;
            _baal.mintShares(receivers, amounts);
        }

        emit Executed(tokenId, lastBidAmount);
    }

    function nextBidAmount(INounsAuctionHouseV2.AuctionV2View memory currentAuction) public view returns (uint192) {
        // INounsAuctionHouseV2.AuctionV2View memory currentAuction = auctionHouseContract.auction();
        uint192 minBidIncrementPercentage = auctionHouseContract.minBidIncrementPercentage();
        uint192 reservePrice = auctionHouseContract.reservePrice();

        uint192 amount = currentAuction.amount < reservePrice
            ? reservePrice
            : currentAuction.amount + ((currentAuction.amount * minBidIncrementPercentage) / 100);

        return amount;
    }

    function auctionHouse() public view returns (address) {
        return address(auctionHouseContract);
    }
}

File 2 of 27 : IBaal.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

interface IBaal {
    // DATA STRUCTURES
    struct Proposal {
        /*Baal proposal details*/
        uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/
        uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */
        uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/
        uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/
        uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/
        uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */
        uint256 baalGas; /* gas needed to process proposal */
        uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/
        uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/
        uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/
        uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/
        bool[4] status; /* [cancelled, processed, passed, actionFailed] */
        address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */
        bytes32 proposalDataHash; /*hash of raw data associated with state updates*/
    }

    /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed
                              \-> Cancelled  \-> Defeated   */
    enum ProposalState {
        Unborn, /* 0 - can submit */
        Submitted, /* 1 - can sponsor -> voting */
        Voting, /* 2 - can be cancelled, otherwise proceeds to grace */
        Cancelled, /* 3 - terminal state, counts as processed */
        Grace, /* 4 - proceeds to ready/defeated */
        Ready, /* 5 - can be processed */
        Processed, /* 6 - terminal state */
        Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */
    }

    function lootToken() external view returns (address);
    function sharesToken() external view returns (address);
    function votingPeriod() external view returns (uint32);
    function gracePeriod() external view returns (uint32);
    function proposalCount() external view returns (uint32);
    function proposalOffering() external view returns (uint256);
    function quorumPercent() external view returns (uint256);
    function sponsorThreshold() external view returns (uint256);
    function minRetentionPercent() external view returns (uint256);
    function latestSponsoredProposalId() external view returns (uint32);
    function state(uint32 id) external view returns (ProposalState);
    function proposals(uint32 id) external view returns (Proposal memory);

    function setUp(bytes memory initializationParams) external;
    function multisendLibrary() external view returns (address);
    // Module
    function avatar() external view returns (address);
    function target() external view returns (address);
    function setAvatar(address avatar) external;
    function setTarget(address avatar) external;
    // BaseRelayRecipient
    function trustedForwarder() external view returns (address);
    function setTrustedForwarder(address trustedForwarderAddress) external;

    function mintLoot(address[] calldata to, uint256[] calldata amount) external;
    function burnLoot(address[] calldata from, uint256[] calldata amount) external;
    function mintShares(address[] calldata to, uint256[] calldata amount) external;
    function burnShares(address[] calldata from, uint256[] calldata amount) external;
    function totalLoot() external view returns (uint256);
    function totalShares() external view returns (uint256);
    function totalSupply() external view returns (uint256);
    function lootPaused() external view returns (bool);
    function sharesPaused() external view returns (bool);
    
    function shamans(address shaman) external view returns (uint256);
    function setShamans(address[] calldata shamans, uint256[] calldata permissions) external;
    function isAdmin(address shaman) external view returns (bool);
    function isManager(address shaman) external view returns (bool);
    function isGovernor(address shaman) external view returns (bool);
    function lockAdmin() external;
    function lockManager() external;
    function lockGovernor() external;
    function adminLock() external view returns (bool);
    function managerLock() external view returns (bool);
    function governorLock() external view returns (bool);
    function setAdminConfig(bool pauseShares, bool pauseLoot) external;
    function setGovernanceConfig(bytes memory governanceConfig) external;

    function submitProposal(
        bytes calldata proposalData,
        uint32 expiration,
        uint256 baalGas,
        string calldata details
    ) external payable returns (uint256);
    function sponsorProposal(uint32 id) external;
    function processProposal(uint32 id, bytes calldata proposalData) external;
    function cancelProposal(uint32 id) external;
    function getProposalStatus(uint32 id) external returns (bool[4] memory);
    function submitVote(uint32 id, bool approved) external;
    function submitVoteWithSig(
        address voter,
        uint256 expiry,
        uint256 nonce,
        uint32 id,
        bool approved,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    function executeAsBaal(address to, uint256 value, bytes calldata data) external;
    function ragequit(address to, uint256 sharesToBurn, uint256 lootToBurn, address[] calldata tokens) external;

    function hashOperation(bytes memory transactions) external pure returns (bytes32);
    function encodeMultisend(bytes[] memory calls, address target) external pure returns (bytes memory);
}

File 3 of 27 : Enum.sol
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

/// @title Enum - Collection of enums
/// @author Richard Meissner - <richard@gnosis.pm>
contract Enum {
    enum Operation {Call, DelegateCall}
}

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

/// @title Multi Send - Allows to batch multiple transactions into one.
/// @author Nick Dodson - <nick.dodson@consensys.net>
/// @author Gonçalo Sá - <goncalo.sa@consensys.net>
/// @author Stefan George - <stefan@gnosis.io>
/// @author Richard Meissner - <richard@gnosis.io>
contract MultiSend {
    address private immutable multisendSingleton;

    constructor() {
        multisendSingleton = address(this);
    }

    /// @dev Sends multiple transactions and reverts all if one fails.
    /// @param transactions Encoded transactions. Each transaction is encoded as a packed bytes of
    ///                     operation as a uint8 with 0 for a call or 1 for a delegatecall (=> 1 byte),
    ///                     to as a address (=> 20 bytes),
    ///                     value as a uint256 (=> 32 bytes),
    ///                     data length as a uint256 (=> 32 bytes),
    ///                     data as bytes.
    ///                     see abi.encodePacked for more information on packed encoding
    /// @notice This method is payable as delegatecalls keep the msg.value from the previous call
    ///         If the calling method (e.g. execTransaction) received ETH this would revert otherwise
    function multiSend(bytes memory transactions) public payable {
        require(address(this) != multisendSingleton, "MultiSend should only be called via delegatecall");
        // solhint-disable-next-line no-inline-assembly
        assembly {
            let length := mload(transactions)
            let i := 0x20
            for {
                // Pre block is not used in "while mode"
            } lt(i, length) {
                // Post block is not used in "while mode"
            } {
                // First byte of the data is the operation.
                // We shift by 248 bits (256 - 8 [operation byte]) it right since mload will always load 32 bytes (a word).
                // This will also zero out unused data.
                let operation := shr(0xf8, mload(add(transactions, i)))
                // We offset the load address by 1 byte (operation byte)
                // We shift it right by 96 bits (256 - 160 [20 address bytes]) to right-align the data and zero out unused data.
                let to := shr(0x60, mload(add(transactions, add(i, 0x01))))
                // We offset the load address by 21 byte (operation byte + 20 address bytes)
                let value := mload(add(transactions, add(i, 0x15)))
                // We offset the load address by 53 byte (operation byte + 20 address bytes + 32 value bytes)
                let dataLength := mload(add(transactions, add(i, 0x35)))
                // We offset the load address by 85 byte (operation byte + 20 address bytes + 32 value bytes + 32 data length bytes)
                let data := add(transactions, add(i, 0x55))
                let success := 0
                switch operation
                    case 0 {
                        success := call(gas(), to, value, data, dataLength, 0, 0)
                    }
                    case 1 {
                        success := delegatecall(gas(), to, data, dataLength, 0, 0)
                    }
                if eq(success, 0) {
                    revert(0, 0)
                }
                // Next entry starts at 85 byte + data length
                i := add(i, add(0x55, dataLength))
            }
        }
    }
}

// SPDX-License-Identifier: LGPL-3.0-only

/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.
pragma solidity >=0.7.0 <0.9.0;

import "../interfaces/IAvatar.sol";
import "../factory/FactoryFriendly.sol";
import "../guard/Guardable.sol";

abstract contract Module is FactoryFriendly, Guardable {
    /// @dev Address that will ultimately execute function calls.
    address public avatar;
    /// @dev Address that this module will pass transactions to.
    address public target;

    /// @dev Emitted each time the avatar is set.
    event AvatarSet(address indexed previousAvatar, address indexed newAvatar);
    /// @dev Emitted each time the Target is set.
    event TargetSet(address indexed previousTarget, address indexed newTarget);

    /// @dev Sets the avatar to a new avatar (`newAvatar`).
    /// @notice Can only be called by the current owner.
    function setAvatar(address _avatar) public onlyOwner {
        address previousAvatar = avatar;
        avatar = _avatar;
        emit AvatarSet(previousAvatar, _avatar);
    }

    /// @dev Sets the target to a new target (`newTarget`).
    /// @notice Can only be called by the current owner.
    function setTarget(address _target) public onlyOwner {
        address previousTarget = target;
        target = _target;
        emit TargetSet(previousTarget, _target);
    }

    /// @dev Passes a transaction to be executed by the avatar.
    /// @notice Can only be called by this contract.
    /// @param to Destination address of module transaction.
    /// @param value Ether value of module transaction.
    /// @param data Data payload of module transaction.
    /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.
    function exec(
        address to,
        uint256 value,
        bytes memory data,
        Enum.Operation operation
    ) internal returns (bool success) {
        (success, ) = _exec(to, value, data, operation);
    }

    /// @dev Passes a transaction to be executed by the target and returns data.
    /// @notice Can only be called by this contract.
    /// @param to Destination address of module transaction.
    /// @param value Ether value of module transaction.
    /// @param data Data payload of module transaction.
    /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.
    function execAndReturnData(
        address to,
        uint256 value,
        bytes memory data,
        Enum.Operation operation
    ) internal returns (bool success, bytes memory returnData) {
        (success, returnData) = _exec(to, value, data, operation);
    }

    function _exec(
        address to,
        uint256 value,
        bytes memory data,
        Enum.Operation operation
    ) private returns (bool success, bytes memory returnData) {
        address currentGuard = guard;
        if (currentGuard != address(0)) {
            IGuard(currentGuard).checkTransaction(
                /// Transaction info used by module transactions.
                to,
                value,
                data,
                operation,
                /// Zero out the redundant transaction information only used for Safe multisig transctions.
                0,
                0,
                0,
                address(0),
                payable(0),
                "",
                msg.sender
            );
            (success, returnData) = IAvatar(target)
                .execTransactionFromModuleReturnData(
                    to,
                    value,
                    data,
                    operation
                );
            IGuard(currentGuard).checkAfterExecution("", success);
        } else {
            (success, returnData) = IAvatar(target)
                .execTransactionFromModuleReturnData(
                    to,
                    value,
                    data,
                    operation
                );
        }
    }
}

File 6 of 27 : FactoryFriendly.sol
// SPDX-License-Identifier: LGPL-3.0-only

/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state
pragma solidity >=0.7.0 <0.9.0;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

abstract contract FactoryFriendly is OwnableUpgradeable {
    function setUp(bytes memory initializeParams) public virtual;
}

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "../interfaces/IGuard.sol";

abstract contract BaseGuard is IERC165 {
    function supportsInterface(bytes4 interfaceId)
        external
        pure
        override
        returns (bool)
    {
        return
            interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a
            interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7
    }

    /// @dev Module transactions only use the first four parameters: to, value, data, and operation.
    /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.
    /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.
    function checkTransaction(
        address to,
        uint256 value,
        bytes memory data,
        Enum.Operation operation,
        uint256 safeTxGas,
        uint256 baseGas,
        uint256 gasPrice,
        address gasToken,
        address payable refundReceiver,
        bytes memory signatures,
        address msgSender
    ) external virtual;

    function checkAfterExecution(bytes32 txHash, bool success) external virtual;
}

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "./BaseGuard.sol";

/// @title Guardable - A contract that manages fallback calls made to this contract
contract Guardable is OwnableUpgradeable {
    address public guard;

    event ChangedGuard(address guard);

    /// `guard_` does not implement IERC165.
    error NotIERC165Compliant(address guard_);

    /// @dev Set a guard that checks transactions before execution.
    /// @param _guard The address of the guard to be used or the 0 address to disable the guard.
    function setGuard(address _guard) external onlyOwner {
        if (_guard != address(0)) {
            if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))
                revert NotIERC165Compliant(_guard);
        }
        guard = _guard;
        emit ChangedGuard(guard);
    }

    function getGuard() external view returns (address _guard) {
        return guard;
    }
}

// SPDX-License-Identifier: LGPL-3.0-only

/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.
pragma solidity >=0.7.0 <0.9.0;

import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";

interface IAvatar {
    event EnabledModule(address module);
    event DisabledModule(address module);
    event ExecutionFromModuleSuccess(address indexed module);
    event ExecutionFromModuleFailure(address indexed module);

    /// @dev Enables a module on the avatar.
    /// @notice Can only be called by the avatar.
    /// @notice Modules should be stored as a linked list.
    /// @notice Must emit EnabledModule(address module) if successful.
    /// @param module Module to be enabled.
    function enableModule(address module) external;

    /// @dev Disables a module on the avatar.
    /// @notice Can only be called by the avatar.
    /// @notice Must emit DisabledModule(address module) if successful.
    /// @param prevModule Address that pointed to the module to be removed in the linked list
    /// @param module Module to be removed.
    function disableModule(address prevModule, address module) external;

    /// @dev Allows a Module to execute a transaction.
    /// @notice Can only be called by an enabled module.
    /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.
    /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.
    /// @param to Destination address of module transaction.
    /// @param value Ether value of module transaction.
    /// @param data Data payload of module transaction.
    /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.
    function execTransactionFromModule(
        address to,
        uint256 value,
        bytes memory data,
        Enum.Operation operation
    ) external returns (bool success);

    /// @dev Allows a Module to execute a transaction and return data
    /// @notice Can only be called by an enabled module.
    /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.
    /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.
    /// @param to Destination address of module transaction.
    /// @param value Ether value of module transaction.
    /// @param data Data payload of module transaction.
    /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.
    function execTransactionFromModuleReturnData(
        address to,
        uint256 value,
        bytes memory data,
        Enum.Operation operation
    ) external returns (bool success, bytes memory returnData);

    /// @dev Returns if an module is enabled
    /// @return True if the module is enabled
    function isModuleEnabled(address module) external view returns (bool);

    /// @dev Returns array of modules.
    /// @param start Start of the page.
    /// @param pageSize Maximum number of modules that should be returned.
    /// @return array Array of modules.
    /// @return next Start of the next page.
    function getModulesPaginated(address start, uint256 pageSize)
        external
        view
        returns (address[] memory array, address next);
}

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";

interface IGuard {
    function checkTransaction(
        address to,
        uint256 value,
        bytes memory data,
        Enum.Operation operation,
        uint256 safeTxGas,
        uint256 baseGas,
        uint256 gasPrice,
        address gasToken,
        address payable refundReceiver,
        bytes memory signatures,
        address msgSender
    ) external;

    function checkAfterExecution(bytes32 txHash, bool success) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.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.
 *
 * By default, the owner account will be the one that deploys the contract. 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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

    /**
     * @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 {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _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);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuardUpgradeable is Initializable {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)

pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    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;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165Upgradeable {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7 <0.9.0;

interface IAuctionHausShaman {
    function execute(uint256 maxBid) external;

    // function endTime() external view returns (uint256);

    // function captain() external view returns (address);

    // function balance() external view returns (uint256);

    // function auctionHouse() external view returns (address);
}

// SPDX-License-Identifier: GPL-3.0

/// @title Interface for Noun Auction Houses V2

/*********************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░██░░░████░░██░░░████░░░ *
 * ░░██████░░░████████░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 *********************************/

pragma solidity ^0.8.19;

interface INounsAuctionHouseV2 {
    struct AuctionV2 {
        // ID for the Noun (ERC721 token ID)
        uint96 nounId;
        // ID of the client that facilitated the latest bid, used for client rewards
        uint32 clientId;
        // The current highest bid amount
        uint128 amount;
        // The time that the auction started
        uint40 startTime;
        // The time that the auction is scheduled to end
        uint40 endTime;
        // The address of the current highest bid
        address payable bidder;
        // Whether or not the auction has been settled
        bool settled;
    }

    /// @dev We use this struct as the return value of the `auction` function, to maintain backwards compatibility.
    struct AuctionV2View {
        // ID for the Noun (ERC721 token ID)
        uint96 nounId;
        // The current highest bid amount
        uint128 amount;
        // The time that the auction started
        uint40 startTime;
        // The time that the auction is scheduled to end
        uint40 endTime;
        // The address of the current highest bid
        address payable bidder;
        // Whether or not the auction has been settled
        bool settled;
    }

    struct SettlementState {
        // The block.timestamp when the auction was settled.
        uint32 blockTimestamp;
        // The winning bid amount, with 10 decimal places (reducing accuracy to save bits).
        uint64 amount;
        // The address of the auction winner.
        address winner;
        // ID of the client that facilitated the winning bid, used for client rewards.
        uint32 clientId;
        // Used only to warm up the storage slot for clientId without setting the clientId value.
        bool slotWarmedUp;
    }

    struct Settlement {
        // The block.timestamp when the auction was settled.
        uint32 blockTimestamp;
        // The winning bid amount, converted from 10 decimal places to 18, for better client UX.
        uint256 amount;
        // The address of the auction winner.
        address winner;
        // ID for the Noun (ERC721 token ID).
        uint256 nounId;
        // ID of the client that facilitated the winning bid, used for client rewards
        uint32 clientId;
    }

    /// @dev Using this struct when setting historic prices, and excluding clientId to save gas.
    struct SettlementNoClientId {
        // The block.timestamp when the auction was settled.
        uint32 blockTimestamp;
        // The winning bid amount, converted from 10 decimal places to 18, for better client UX.
        uint256 amount;
        // The address of the auction winner.
        address winner;
        // ID for the Noun (ERC721 token ID).
        uint256 nounId;
    }

    event AuctionCreated(uint256 indexed nounId, uint256 startTime, uint256 endTime);

    event AuctionBid(uint256 indexed nounId, address sender, uint256 value, bool extended);

    event AuctionBidWithClientId(uint256 indexed nounId, uint256 value, uint32 indexed clientId);

    event AuctionExtended(uint256 indexed nounId, uint256 endTime);

    event AuctionSettled(uint256 indexed nounId, address winner, uint256 amount);

    event AuctionSettledWithClientId(uint256 indexed nounId, uint32 indexed clientId);

    event AuctionTimeBufferUpdated(uint256 timeBuffer);

    event AuctionReservePriceUpdated(uint256 reservePrice);

    event AuctionMinBidIncrementPercentageUpdated(uint256 minBidIncrementPercentage);

    function settleAuction() external;

    function settleCurrentAndCreateNewAuction() external;

    // function createBid(uint256 nounId) external payable;

    function createBid(uint256 nounId, uint32 clientId) external payable;

    function pause() external;

    function unpause() external;

    function setTimeBuffer(uint56 timeBuffer) external;

    function setReservePrice(uint192 reservePrice) external;

    function setMinBidIncrementPercentage(uint8 minBidIncrementPercentage) external;

    function auction() external view returns (AuctionV2View memory);

    function getSettlements(
        uint256 auctionCount,
        bool skipEmptyValues
    ) external view returns (Settlement[] memory settlements);

    function getPrices(uint256 auctionCount) external view returns (uint256[] memory prices);

    function getSettlements(
        uint256 startId,
        uint256 endId,
        bool skipEmptyValues
    ) external view returns (Settlement[] memory settlements);

    function getSettlementsFromIdtoTimestamp(
        uint256 startId,
        uint256 endTimestamp,
        bool skipEmptyValues
    ) external view returns (Settlement[] memory settlements);

    function warmUpSettlementState(uint256 startId, uint256 endId) external;

    function duration() external view returns (uint256);

    function biddingClient(uint256 nounId) external view returns (uint32 clientId);

    function reservePrice() external view returns (uint192);

    function minBidIncrementPercentage() external view returns (uint8);

    function nouns() external view returns (address);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface INounsDelegator {
    function delegate(address delegatee) external;
}

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7 <0.9.0;

import { IShaman } from "./IShaman.sol";

/**
 * @title Baal Shaman Manager interface
 * @author DAOHaus
 * @notice Interface to implement a Shaman contract with manager capabilities
 * @dev Inherits base ISHaman interface
 * Interface ID: 0xf7c8b398
 */
interface IManagerShaman is IShaman {
    /**
     * @notice Returns true if Baal shaman has manager permissions
     * @dev Should use baal to fetch shaman permissions
     * @return true whether shaman has manager permissions or not
     */
    function isManager() external view returns (bool);

    /**
     * @notice Mint an amount of baal shares to specified addresses
     * @dev Should fail if baal revoked shamans permissions
     * @param to a list of recipient address
     * @param amount a list of share amounts to mint per recipient
     */
    function mintShares(address[] calldata to, uint256[] calldata amount) external;

    /**
     * @notice Burn an amount of baal shares to specified addresses
     * @dev Should fail if baal revoked shamans permissions
     * @param from a list of addresses to burn shares
     * @param amount a list of share amounts to burn per recipient
     */
    function burnShares(address[] calldata from, uint256[] calldata amount) external;

    /**
     * @notice Mint an amount of baal loot to specified addresses
     * @dev Should fail if baal revoked shamans permissions
     * @param to a list of recipient address
     * @param amount a list of loot amounts to mint per recipient
     */
    function mintLoot(address[] calldata to, uint256[] calldata amount) external;

    /**
     * @notice Burn an amount of baal loot to specified addresses
     * @dev Should fail if baal revoked shamans permissions
     * @param from a list of addresses to burn loot tokens
     * @param amount a list of loot amounts to burn per recipient
     */
    function burnLoot(address[] calldata from, uint256[] calldata amount) external;
}

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7 <0.9.0;

import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * @title Baal Shaman Base interface
 * @author DAOHaus
 * @notice Base interface to implement a Shaman contract
 * @dev Supports ERC165 to detect what interfaces a smart contract implements
 * Interface ID: 0xd2296f8d
 */
interface IShaman is IERC165 {
    /**
     * @notice Gets the dao address associated with the shaman
     * @dev Should return the Baal address
     * @return dao address
     */
    function baal() external view returns (address);

    /**
     * @notice Gets the name of the shaman
     * @dev name is set during setup
     * @return shaman name as string
     */
    function name() external view returns (string memory);

    /**
     * @notice Initializer function to setup the shaman config
     * @dev Extra parameters should be ABI encoded in `initializeParams`.
     * Should be called during contract initialization.
     * @param baal Baal address
     * @param vault Vault address used by `baal`
     * @param initializeParams ABI encoded parameters
     */
    function setup(address baal, address vault, bytes memory initializeParams) external;

    /**
     * @notice Gets the vault address associated with `baal`
     * @dev Should return either a main treasury Baal vault or a sidecar vault
     * @return vault address
     */
    function vault() external view returns (address);
}

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7 <0.9.0;

import { IManagerShaman } from "./interfaces/IManagerShaman.sol";
import { IERC165, ShamanBase } from "./ShamanBase.sol";

/// @notice Shaman does not have manager privileges
error ManagerShaman__NoManagerRole();

/**
 * @title Baal Shaman Manager contract
 * @author DAOHaus
 * @notice Implement the base functionality for a Shaman with manager privileges
 * @dev Inherits from ShamanBase
 */
abstract contract ManagerShaman is ShamanBase, IManagerShaman {
    /**
     * @notice A modifier for methods that require to check shaman manager privileges
     */
    modifier isBaalManager() {
        if (!isManager()) revert ManagerShaman__NoManagerRole();
        _;
    }

    /**
     * @notice A modifier for methods that require to check shaman admin privileges
     */
    modifier baalOrManagerOnly() {
        if (_msgSender() != _vault && !_baal.isManager(_msgSender())) revert ManagerShaman__NoManagerRole();
        _;
    }

    /**
     * @notice Initializer function
     * @dev Should be called during contract initializaton
     * @param _name shaman name
     * @param _baalAddress baal address
     * @param _vaultAddress baal vault address
     */
    function __ManagerShaman_init(
        string memory _name,
        address _baalAddress,
        address _vaultAddress
    ) internal onlyInitializing {
        __ShamanBase_init(_name, _baalAddress, _vaultAddress);
        __ManagerShaman_init_unchained();
    }

    /**
     * @notice Local initializer function
     * @dev Should be called through main initializer to set any local state variables
     */
    function __ManagerShaman_init_unchained() internal onlyInitializing {}

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ShamanBase, IERC165) returns (bool) {
        return interfaceId == type(IManagerShaman).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     *
     * @inheritdoc IManagerShaman
     */
    function isManager() public view virtual returns (bool) {
        return _baal.isManager(address(this));
    }

    /**
     * @notice Mint an amount of baal shares to specified addresses
     * @inheritdoc IManagerShaman
     */
    function mintShares(address[] calldata to, uint256[] calldata amount) public virtual baalOrManagerOnly {
        _baal.mintShares(to, amount);
    }

    /**
     * @notice Burn an amount of baal shares to specified addresses
     * @inheritdoc IManagerShaman
     */
    function burnShares(address[] calldata from, uint256[] calldata amount) public virtual baalOrManagerOnly {
        _baal.burnShares(from, amount);
    }

    /**
     * @notice Mint an amount of baal loot to specified addresses
     * @inheritdoc IManagerShaman
     */
    function mintLoot(address[] calldata to, uint256[] calldata amount) public virtual baalOrManagerOnly {
        _baal.mintLoot(to, amount);
    }

    /**
     * @notice Burn an amount of baal loot to specified addresses
     * @inheritdoc IManagerShaman
     */
    function burnLoot(address[] calldata from, uint256[] calldata amount) public virtual baalOrManagerOnly {
        _baal.burnLoot(from, amount);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7 <0.9.0;

import { IBaal } from "@daohaus/baal-contracts/contracts/interfaces/IBaal.sol";
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import { ERC165Upgradeable } from "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import { ContextUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import {
    ReentrancyGuardUpgradeable
} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";

import { IShaman } from "./interfaces/IShaman.sol";

/// @notice Provided address is invalid
error ShamanBase__InvalidAddress();
/// @notice Provided name is invalid
error ShamanBase__InvalidName();

/**
 * @title Baal Shaman Base contract
 * @author DAOHaus
 * @notice Implement the base functionality for a Shaman contract
 * @dev This contract should not be be directly inherited. Use one of the shaman flavours instead
 *      (e.g. admin, manager, governor)
 */
abstract contract ShamanBase is IShaman, ContextUpgradeable, ReentrancyGuardUpgradeable, ERC165Upgradeable {
    /// @notice shaman name
    string internal NAME;
    /// @notice baal address
    IBaal internal _baal;
    /// @notice vault address
    address internal _vault;

    /**
     * @notice Initializer function
     * @dev Should be called during contract initializaton
     * @param _name shaman name
     * @param _baalAddress baal address
     * @param _vaultAddress baal vault address
     */
    function __ShamanBase_init(
        string memory _name,
        address _baalAddress,
        address _vaultAddress
    ) internal onlyInitializing {
        if (bytes(_name).length == 0) revert ShamanBase__InvalidName();
        if (_baalAddress == address(0)) revert ShamanBase__InvalidAddress();
        __Context_init();
        __ReentrancyGuard_init();
        __ERC165_init();
        __ShamanBase_init_unchained(_name, _baalAddress, _vaultAddress);
    }

    /**
     * @notice Local initializer function
     * @dev Should be called through main initializer to set any local state variables
     * @param _name shaman name
     * @param _baalAddress baal address
     * @param _vaultAddress baal vault address
     */
    function __ShamanBase_init_unchained(
        string memory _name,
        address _baalAddress,
        address _vaultAddress
    ) internal onlyInitializing {
        NAME = _name;
        _baal = IBaal(_baalAddress);
        _vault = _vaultAddress == address(0) ? _baal.avatar() : _vaultAddress;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(
        bytes4 interfaceId
    ) public view virtual override(ERC165Upgradeable, IERC165) returns (bool) {
        return interfaceId == type(IShaman).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @notice Gets the dao address associated with the shaman
     * @inheritdoc IShaman
     */
    function baal() public view returns (address) {
        return address(_baal);
    }

    /**
     * @notice Gets the name of the shaman
     * @inheritdoc IShaman
     */
    function name() public view returns (string memory) {
        return NAME;
    }

    /**
     * @notice Gets the vault address associated with `baal`
     * @inheritdoc IShaman
     */
    function vault() public view returns (address) {
        return _vault;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7 <0.9.0;

import { FactoryFriendly, Module } from "@gnosis.pm/zodiac/contracts/core/Module.sol";

/**
 * @title Zodiac Base Module contract
 * @author DAOHaus
 * @notice Implement the base functionality for a contract to become a Zodiac module
 * @dev Inherits from Gnosis Module
 * Interface ID: 0x8195a8d8
 */
abstract contract ZodiacModule is Module {
    /**
     * @notice Returns true if the contract is set as a Safe module
     * @dev Should use avatar to eval if contract is currently added as a module
     * @return whether or not the contract is enabled as a module
     */
    function moduleEnabled() public view virtual returns (bool);

    /**
     * @notice Initializer function
     * @dev Parameters should be ABI encoded in `_initializeParams`
     */
    function setUp(bytes memory _initializeParams) public virtual override(FactoryFriendly) onlyInitializing {
        __Ownable_init();
        (avatar, target) = abi.decode(_initializeParams, (address, address));
    }
}

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7 <0.9.0;

import { Enum } from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import { MultiSend } from "@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.sol";
import { IAvatar } from "@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol";

import { ShamanBase } from "./ShamanBase.sol";
import { ZodiacModule } from "./ZodiacModule.sol";

/// @notice Contract is currently not enabled as a module
error ZodiacModuleShaman__NotEnabledModule();

/**
 * @title Baal Shaman + Zodiac Module contract
 * @author DAOHaus
 * @notice Implement the base functionality for a Shaman contract to also have Zodiac module capabilities
 * @dev Inherits from ZodiacModule
 */
abstract contract ZodiacModuleShaman is ZodiacModule, ShamanBase {
    /**
     * A modifier for methods that require to check zodiac module privileges
     */
    modifier isModuleEnabled() {
        if (!moduleEnabled()) revert ZodiacModuleShaman__NotEnabledModule();
        _;
    }

    /**
     * @notice Initializer function
     * @param _name shaman name
     * @param _baalAddress baal address
     * @param _vaultAddress ball vault address
     */
    function __ZodiacModuleShaman__init(
        string memory _name,
        address _baalAddress,
        address _vaultAddress
    ) internal onlyInitializing {
        __ShamanBase_init(_name, _baalAddress, _vaultAddress);
        _vaultAddress = vault();
        __ZodiacModuleShaman__init_unchained(abi.encode(_vaultAddress, _vaultAddress));
    }

    /**
     * @notice Local initializer function
     * @param _initializeParams Abi encoded Zodiac initialization params
     */
    function __ZodiacModuleShaman__init_unchained(bytes memory _initializeParams) internal onlyInitializing {
        setUp(_initializeParams);
    }

    /**
     * @notice Zodiac initializer function
     * @inheritdoc ZodiacModule
     */
    function setUp(bytes memory _initializeParams) public virtual override(ZodiacModule) onlyInitializing {
        super.setUp(_initializeParams);
        transferOwnership(vault());
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ShamanBase) returns (bool) {
        return interfaceId == type(ZodiacModule).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @notice Returns true if the contract is set as a Safe module
     * @inheritdoc ZodiacModule
     */
    function moduleEnabled() public view override returns (bool) {
        return IAvatar(vault()).isModuleEnabled(address(this));
    }

    /**
     * @notice Util function to encode a tx call as a Safe multiSend action
     * @param _operation call or delegate call
     * @param _to calling contract or recipient address
     * @param _value value to be sent
     * @param _callData calldata to be called on recipient
     */
    function encodeMultiSendAction(
        Enum.Operation _operation,
        address _to,
        uint256 _value,
        bytes memory _callData
    ) public pure returns (bytes memory) {
        return abi.encodePacked(_operation, _to, _value, _callData.length, _callData);
    }

    /**
     * @notice Encodes and executes a multiSend tx to `avatar` using the contract Zodiac module privileges
     * @dev transactions should follow the same encoding method used by the Safe MultiSend library
     * @param _transactions multiSend-like encoded transactions
     * @return success whether or not the multiSend call succeeded
     * @return returnData data returned by the multiSend call
     */
    function execMultiSendCall(bytes memory _transactions) internal returns (bool success, bytes memory returnData) {
        bytes memory multiSendCalldata = abi.encodeCall(MultiSend.multiSend, (_transactions));

        (success, returnData) = execAndReturnData(
            _baal.multisendLibrary(),
            0,
            multiSendCalldata,
            Enum.Operation.DelegateCall
        );
    }
}

Settings
{
  "metadata": {
    "bytecodeHash": "none",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

API
[{"inputs":[],"name":"AuctionHausShamanModule__AuctionAlreadySettled","type":"error"},{"inputs":[],"name":"AuctionHausShamanModule__AuctionCompleted","type":"error"},{"inputs":[],"name":"AuctionHausShamanModule__BaalVaultOnly","type":"error"},{"inputs":[],"name":"AuctionHausShamanModule__CurrentBidder","type":"error"},{"inputs":[{"internalType":"bytes","name":"returnData","type":"bytes"}],"name":"AuctionHausShamanModule__ExecutionFailed","type":"error"},{"inputs":[],"name":"AuctionHausShamanModule__InsufficientBalance","type":"error"},{"inputs":[],"name":"AuctionHausShamanModule__InvalidCaptain","type":"error"},{"inputs":[],"name":"AuctionHausShamanModule__InvalidEndTime","type":"error"},{"inputs":[],"name":"AuctionHausShamanModule__MaxOverBid","type":"error"},{"inputs":[],"name":"ManagerShaman__NoManagerRole","type":"error"},{"inputs":[{"internalType":"address","name":"guard_","type":"address"}],"name":"NotIERC165Compliant","type":"error"},{"inputs":[],"name":"ShamanBase__InvalidAddress","type":"error"},{"inputs":[],"name":"ShamanBase__InvalidName","type":"error"},{"inputs":[],"name":"ZodiacModuleShaman__NotEnabledModule","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousAvatar","type":"address"},{"indexed":true,"internalType":"address","name":"newAvatar","type":"address"}],"name":"AvatarSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"guard","type":"address"}],"name":"ChangedGuard","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint96","name":"tokenId","type":"uint96"},{"indexed":false,"internalType":"uint256","name":"ethSupply","type":"uint256"}],"name":"Executed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"baal","type":"address"},{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"},{"indexed":false,"internalType":"address","name":"captain","type":"address"},{"indexed":false,"internalType":"uint256","name":"captainsReward","type":"uint256"},{"indexed":false,"internalType":"address","name":"auctionHouseAddress","type":"address"}],"name":"Setup","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousTarget","type":"address"},{"indexed":true,"internalType":"address","name":"newTarget","type":"address"}],"name":"TargetSet","type":"event"},{"inputs":[],"name":"auctionHouse","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionHouseContract","outputs":[{"internalType":"contract INounsAuctionHouseV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"avatar","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baal","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"from","type":"address[]"},{"internalType":"uint256[]","name":"amount","type":"uint256[]"}],"name":"burnLoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"from","type":"address[]"},{"internalType":"uint256[]","name":"amount","type":"uint256[]"}],"name":"burnShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"captain","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captainsReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegateVotes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum Enum.Operation","name":"_operation","type":"uint8"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_callData","type":"bytes"}],"name":"encodeMultiSendAction","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"endTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxBid","type":"uint256"}],"name":"execute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getGuard","outputs":[{"internalType":"address","name":"_guard","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"guard","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastBidAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastBidTokenId","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"amount","type":"uint256[]"}],"name":"mintLoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"amount","type":"uint256[]"}],"name":"mintShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"moduleEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint96","name":"nounId","type":"uint96"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint40","name":"startTime","type":"uint40"},{"internalType":"uint40","name":"endTime","type":"uint40"},{"internalType":"address payable","name":"bidder","type":"address"},{"internalType":"bool","name":"settled","type":"bool"}],"internalType":"struct INounsAuctionHouseV2.AuctionV2View","name":"currentAuction","type":"tuple"}],"name":"nextBidAmount","outputs":[{"internalType":"uint192","name":"","type":"uint192"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceCaptain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resetDelegation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_avatar","type":"address"}],"name":"setAvatar","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_captain","type":"address"}],"name":"setCaptain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_captainsReward","type":"uint256"}],"name":"setCaptainsReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_guard","type":"address"}],"name":"setGuard","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"}],"name":"setTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_initializeParams","type":"bytes"}],"name":"setUp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_baal","type":"address"},{"internalType":"address","name":"_vault","type":"address"},{"internalType":"bytes","name":"_initializeParams","type":"bytes"}],"name":"setup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"target","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ 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.