ETH Price: $2,335.17 (-0.65%)

Contract

0xB49f6D281b84D3B29203BA38360a7cb97780B2f1
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Create Bribe Mar...189416322024-01-05 14:21:47257 days ago1704464507IN
0xB49f6D28...97780B2f1
0 ETH0.0082455733
Create Bribe Mar...189174652024-01-02 4:55:35260 days ago1704171335IN
0xB49f6D28...97780B2f1
0 ETH0.0034974514
Create Bribe Mar...186705282023-11-28 13:50:11295 days ago1701179411IN
0xB49f6D28...97780B2f1
0 ETH0.0090683936.3
Create Bribe Mar...182674702023-10-03 3:56:59351 days ago1696305419IN
0xB49f6D28...97780B2f1
0 ETH0.001998928
Create Bribe Mar...181603522023-09-18 4:05:47366 days ago1695009947IN
0xB49f6D28...97780B2f1
0 ETH0.002248259
Create Bribe Mar...181603362023-09-18 4:02:35366 days ago1695009755IN
0xB49f6D28...97780B2f1
0 ETH0.001998258
Transfer Ownersh...176219572023-07-04 17:12:11442 days ago1688490731IN
0xB49f6D28...97780B2f1
0 ETH0.0018601738
Create Bribe Mar...176219522023-07-04 17:11:11442 days ago1688490671IN
0xB49f6D28...97780B2f1
0 ETH0.0094930838
Create Bribe Mar...176219472023-07-04 17:10:11442 days ago1688490611IN
0xB49f6D28...97780B2f1
0 ETH0.0094926238
Create Bribe Mar...176219422023-07-04 17:09:11442 days ago1688490551IN
0xB49f6D28...97780B2f1
0 ETH0.0094939938
Create Bribe Mar...176219372023-07-04 17:08:11442 days ago1688490491IN
0xB49f6D28...97780B2f1
0 ETH0.0094926238
Create Bribe Mar...176219322023-07-04 17:07:11442 days ago1688490431IN
0xB49f6D28...97780B2f1
0 ETH0.0094921738
Create Bribe Mar...176219272023-07-04 17:05:59442 days ago1688490359IN
0xB49f6D28...97780B2f1
0 ETH0.0094917138
Create Bribe Mar...176219222023-07-04 17:04:59442 days ago1688490299IN
0xB49f6D28...97780B2f1
0 ETH0.0094939938
0x60806040176219132023-07-04 17:03:11442 days ago1688490191IN
 Create: BribeFactory
0 ETH0.0309112538

Latest 13 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
189416322024-01-05 14:21:47257 days ago1704464507
0xB49f6D28...97780B2f1
 Contract Creation0 ETH
189174652024-01-02 4:55:35260 days ago1704171335
0xB49f6D28...97780B2f1
 Contract Creation0 ETH
186705282023-11-28 13:50:11295 days ago1701179411
0xB49f6D28...97780B2f1
 Contract Creation0 ETH
182674702023-10-03 3:56:59351 days ago1696305419
0xB49f6D28...97780B2f1
 Contract Creation0 ETH
181603522023-09-18 4:05:47366 days ago1695009947
0xB49f6D28...97780B2f1
 Contract Creation0 ETH
181603362023-09-18 4:02:35366 days ago1695009755
0xB49f6D28...97780B2f1
 Contract Creation0 ETH
176219522023-07-04 17:11:11442 days ago1688490671
0xB49f6D28...97780B2f1
 Contract Creation0 ETH
176219472023-07-04 17:10:11442 days ago1688490611
0xB49f6D28...97780B2f1
 Contract Creation0 ETH
176219422023-07-04 17:09:11442 days ago1688490551
0xB49f6D28...97780B2f1
 Contract Creation0 ETH
176219372023-07-04 17:08:11442 days ago1688490491
0xB49f6D28...97780B2f1
 Contract Creation0 ETH
176219322023-07-04 17:07:11442 days ago1688490431
0xB49f6D28...97780B2f1
 Contract Creation0 ETH
176219272023-07-04 17:05:59442 days ago1688490359
0xB49f6D28...97780B2f1
 Contract Creation0 ETH
176219222023-07-04 17:04:59442 days ago1688490299
0xB49f6D28...97780B2f1
 Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BribeFactory

Compiler Version
v0.8.12+commit.f00d7308

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : BribeFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;

import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {IBribeMarket} from "./interfaces/IBribeMarket.sol";
import {IBribeVault} from "./interfaces/IBribeVault.sol";
import {Errors} from "./libraries/Errors.sol";

contract BribeFactory is Ownable2Step {
    address public bribeMarketImplementation;
    address public bribeVault;
    uint256 public constant MAX_PERIODS = 10;
    uint256 public constant MAX_PERIOD_DURATION = 30 days;

    event BribeMarketCreated(address indexed bribeMarket);
    event BribeMarketImplementationUpdated(
        address indexed bribeMarketImplementation
    );
    event BribeVaultUpdated(address indexed bribeVault);

    /**
        @notice Check if the specified address is a contract
        @param  _address  Address to be checked
     */
    modifier isContract(address _address) {
        uint256 codeSize;
        assembly {
            codeSize := extcodesize(_address)
        }
        if (codeSize == 0) revert Errors.NotAContract();
        _;
    }

    /**
        @param  _implementation  Address of the implementation contract
        @param  _bribeVault      Address of the bribe vault
     */
    constructor(address _implementation, address _bribeVault) {
        _setBribeMarketImplementation(_implementation);
        _setBribeVault(_bribeVault);
    }

    /**
        @notice Deploy a new bribe market
        @param  _protocol        address  Market name/identifier
        @param  _maxPeriods      uint256  Maximum number of periods for bribe deposits
        @param  _periodDuration  uint256  Period duration in each voting round
     */
    function createBribeMarket(
        string calldata _protocol,
        uint256 _maxPeriods,
        uint256 _periodDuration
    ) external returns (address) {
        if (_maxPeriods == 0 || _maxPeriods > MAX_PERIODS)
            revert Errors.InvalidMaxPeriod();
        if (_periodDuration == 0 || _periodDuration > MAX_PERIOD_DURATION)
            revert Errors.InvalidPeriodDuration();

        address bribeMarket = Clones.clone(bribeMarketImplementation);

        IBribeMarket(bribeMarket).initialize(
            bribeVault,
            msg.sender,
            _protocol,
            _maxPeriods,
            _periodDuration
        );
        IBribeVault(bribeVault).grantDepositorRole(bribeMarket);

        emit BribeMarketCreated(bribeMarket);

        return bribeMarket;
    }

    /**
        @notice Set the bribe market implementation address
        @param  _implementation  address  Implementation address
     */
    function setBribeMarketImplementation(
        address _implementation
    ) external onlyOwner {
        _setBribeMarketImplementation(_implementation);

        emit BribeMarketImplementationUpdated(_implementation);
    }

    /**
        @notice Set the bribe vault address
        @param  _bribeVault  address  Bribe vault address
     */
    function setBribeVault(address _bribeVault) external onlyOwner {
        _setBribeVault(_bribeVault);

        emit BribeVaultUpdated(_bribeVault);
    }

    /**
        @notice Internal method to set the bribe market implementation address
        @param  _implementation  address  Implementation address
     */
    function _setBribeMarketImplementation(
        address _implementation
    ) internal isContract(_implementation) {
        bribeMarketImplementation = _implementation;
    }

    /**
        @notice Internal method to set the bribe vault address
        @param  _bribeVault  address  Bribe vault address
     */
    function _setBribeVault(
        address _bribeVault
    ) internal isContract(_bribeVault) {
        uint256 codeSize;
        assembly {
            codeSize := extcodesize(_bribeVault)
        }
        if (codeSize == 0) revert Errors.NotAContract();

        bribeVault = _bribeVault;
    }
}

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

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * 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 Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _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);
    }
}

File 3 of 9 : Ownable2Step.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.0;

import "./Ownable.sol";

/**
 * @dev Contract module which provides 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} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

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

    /**
     * @dev Returns the address of the pending owner.
     */
    function pendingOwner() public view virtual returns (address) {
        return _pendingOwner;
    }

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
        _transferOwnership(sender);
    }
}

File 4 of 9 : Clones.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/Clones.sol)

pragma solidity ^0.8.0;

/**
 * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
 * deploying minimal proxy contracts, also known as "clones".
 *
 * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
 * > a minimal bytecode implementation that delegates all calls to a known, fixed address.
 *
 * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
 * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
 * deterministic method.
 *
 * _Available since v3.4._
 */
library Clones {
    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
     *
     * This function uses the create opcode, which should never revert.
     */
    function clone(address implementation) internal returns (address instance) {
        /// @solidity memory-safe-assembly
        assembly {
            // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
            // of the `implementation` address with the bytecode before the address.
            mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
            // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
            mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
            instance := create(0, 0x09, 0x37)
        }
        require(instance != address(0), "ERC1167: create failed");
    }

    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
     *
     * This function uses the create2 opcode and a `salt` to deterministically deploy
     * the clone. Using the same `implementation` and `salt` multiple time will revert, since
     * the clones cannot be deployed twice at the same address.
     */
    function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
        /// @solidity memory-safe-assembly
        assembly {
            // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
            // of the `implementation` address with the bytecode before the address.
            mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
            // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
            mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
            instance := create2(0, 0x09, 0x37, salt)
        }
        require(instance != address(0), "ERC1167: create2 failed");
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(
        address implementation,
        bytes32 salt,
        address deployer
    ) internal pure returns (address predicted) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(add(ptr, 0x38), deployer)
            mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)
            mstore(add(ptr, 0x14), implementation)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)
            mstore(add(ptr, 0x58), salt)
            mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))
            predicted := keccak256(add(ptr, 0x43), 0x55)
        }
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(
        address implementation,
        bytes32 salt
    ) internal view returns (address predicted) {
        return predictDeterministicAddress(implementation, salt, address(this));
    }
}

File 5 of 9 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 6 of 9 : IBribeMarket.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;

interface IBribeMarket {
    /**
        @notice Initialize the contract
        @param  _bribeVault  Bribe vault address
        @param  _admin       Admin address
        @param  _protocol    Protocol name
        @param  _maxPeriods  Maximum number of periods
        @param  _periodDuration  Period duration
     */
    function initialize(
        address _bribeVault,
        address _admin,
        string calldata _protocol,
        uint256 _maxPeriods,
        uint256 _periodDuration
    ) external;
}

File 7 of 9 : IBribeVault.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;

import "../libraries/Common.sol";

interface IBribeVault {
    /**
        @notice Deposit bribe (ERC20 only)
        @param  _depositParams  DepositBribeParams  Deposit data
     */
    function depositBribe(
        Common.DepositBribeParams calldata _depositParams
    ) external;

    /**
        @notice Get bribe information based on the specified identifier
        @param  _bribeIdentifier  bytes32  The specified bribe identifier
     */
    function getBribe(
        bytes32 _bribeIdentifier
    ) external view returns (address token, uint256 amount);

    /**
        @notice Transfer fees to fee recipient and bribes to distributor and update rewards metadata
        @param  _rewardIdentifiers  bytes32[]  List of rewardIdentifiers
     */
    function transferBribes(bytes32[] calldata _rewardIdentifiers) external;

    /**
        @notice Grant the depositor role to an address
        @param  _depositor  address  Address to grant the depositor role
     */
    function grantDepositorRole(address _depositor) external;
}

File 8 of 9 : Common.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;

library Common {
    /**
     * @param identifier  bytes32  Identifier of the distribution
     * @param token       address  Address of the token to distribute
     * @param merkleRoot  bytes32  Merkle root of the distribution
     * @param proof       bytes32  Proof of the distribution
     */
    struct Distribution {
        bytes32 identifier;
        address token;
        bytes32 merkleRoot;
        bytes32 proof;
    }

    /**
     * @param proposal          bytes32  Proposal to bribe
     * @param token             address  Token to bribe with
     * @param briber            address  Address of the briber
     * @param amount            uint256  Amount of tokens to bribe with
     * @param maxTokensPerVote  uint256  Maximum amount of tokens to use per vote
     * @param periods           uint256  Number of periods to bribe for
     * @param periodDuration    uint256  Duration of each period
     * @param proposalDeadline  uint256  Deadline for the proposal
     * @param permitDeadline    uint256  Deadline for the permit2 signature
     * @param signature         bytes    Permit2 signature
     */
    struct DepositBribeParams {
        bytes32 proposal;
        address token;
        address briber;
        uint256 amount;
        uint256 maxTokensPerVote;
        uint256 periods;
        uint256 periodDuration;
        uint256 proposalDeadline;
        uint256 permitDeadline;
        bytes signature;
    }

    /**
     * @param rwIdentifier      bytes32    Identifier for claiming reward
     * @param fromToken         address    Address of token to swap from
     * @param toToken           address    Address of token to swap to
     * @param fromAmount        uint256    Amount of fromToken to swap
     * @param toAmount          uint256    Amount of toToken to receive
     * @param deadline          uint256    Timestamp until which swap may be fulfilled
     * @param callees           address[]  Array of addresses to call (DEX addresses)
     * @param callLengths       uint256[]  Index of the beginning of each call in exchangeData
     * @param values            uint256[]  Array of encoded values for each call in exchangeData
     * @param exchangeData      bytes      Calldata to execute on callees
     * @param rwMerkleProof     bytes32[]  Merkle proof for the reward claim
     */
    struct ClaimAndSwapData {
        bytes32 rwIdentifier;
        address fromToken;
        address toToken;
        uint256 fromAmount;
        uint256 toAmount;
        uint256 deadline;
        address[] callees;
        uint256[] callLengths;
        uint256[] values;
        bytes exchangeData;
        bytes32[] rwMerkleProof;
    }

    /**
     * @param identifier   bytes32    Identifier for claiming reward
     * @param account      address    Address of the account to claim for
     * @param amount       uint256    Amount of tokens to claim
     * @param merkleProof  bytes32[]  Merkle proof for the reward claim
     */
    struct Claim {
        bytes32 identifier;
        address account;
        uint256 amount;
        bytes32[] merkleProof;
    }
}

File 9 of 9 : Errors.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;

library Errors {
    /**
     * @notice max period 0 or greater than MAX_PERIODS
     */
    error InvalidMaxPeriod();

    /**
     * @notice period duration 0 or greater than MAX_PERIOD_DURATION
     */
    error InvalidPeriodDuration();

    /**
     * @notice address provided is not a contract
     */
    error NotAContract();

    /**
     * @notice not authorized
     */
    error NotAuthorized();

    /**
     * @notice contract already initialized
     */
    error AlreadyInitialized();

    /**
     * @notice address(0)
     */
    error InvalidAddress();

    /**
     * @notice empty bytes identifier
     */
    error InvalidIdentifier();

    /**
     * @notice invalid protocol name
     */
    error InvalidProtocol();

    /**
     * @notice invalid number of choices
     */
    error InvalidChoiceCount();

    /**
     * @notice invalid input amount
     */
    error InvalidAmount();

    /**
     * @notice not team member
     */
    error NotTeamMember();

    /**
     * @notice cannot whitelist BRIBE_VAULT
     */
    error NoWhitelistBribeVault();

    /**
     * @notice token already whitelisted
     */
    error TokenWhitelisted();

    /**
     * @notice token not whitelisted
     */
    error TokenNotWhitelisted();

    /**
     * @notice voter already blacklisted
     */
    error VoterBlacklisted();

    /**
     * @notice voter not blacklisted
     */
    error VoterNotBlacklisted();

    /**
     * @notice deadline has passed
     */
    error DeadlinePassed();

    /**
     * @notice invalid period
     */
    error InvalidPeriod();

    /**
     * @notice invalid deadline
     */
    error InvalidDeadline();

    /**
     * @notice invalid max fee
     */
    error InvalidMaxFee();

    /**
     * @notice invalid fee
     */
    error InvalidFee();

    /**
     * @notice invalid fee recipient
     */
    error InvalidFeeRecipient();

    /**
     * @notice invalid distributor
     */
    error InvalidDistributor();

    /**
     * @notice invalid briber
     */
    error InvalidBriber();

    /**
     * @notice address does not have DEPOSITOR_ROLE
     */
    error NotDepositor();

    /**
     * @notice no array given
     */
    error InvalidArray();

    /**
     * @notice invalid reward identifier
     */
    error InvalidRewardIdentifier();

    /**
     * @notice bribe has already been transferred
     */
    error BribeAlreadyTransferred();

    /**
     * @notice distribution does not exist
     */
    error InvalidDistribution();

    /**
     * @notice invalid merkle root
     */
    error InvalidMerkleRoot();

    /**
     * @notice token is address(0)
     */
    error InvalidToken();

    /**
     * @notice claim does not exist
     */
    error InvalidClaim();

    /**
     * @notice reward is not yet active for claiming
     */
    error RewardInactive();

    /**
     * @notice timer duration is invalid
     */
    error InvalidTimerDuration();

    /**
     * @notice merkle proof is invalid
     */
    error InvalidProof();

    /**
     * @notice ETH transfer failed
     */
    error ETHTransferFailed();

    /**
     * @notice Invalid operator address
     */
    error InvalidOperator();

    /**
     * @notice call to TokenTransferProxy contract
     */
    error TokenTransferProxyCall();

    /**
     * @notice calling TransferFrom
     */
    error TransferFromCall();

    /**
     * @notice external call failed
     */
    error ExternalCallFailure();

    /**
     * @notice returned tokens too few
     */
    error InsufficientReturn();

    /**
     * @notice swapDeadline expired
     */
    error DeadlineBreach();

    /**
     * @notice expected tokens returned are 0
     */
    error ZeroExpectedReturns();

    /**
     * @notice arrays in SwapData.exchangeData have wrong lengths
     */
    error ExchangeDataArrayMismatch();
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200,
    "details": {
      "yulDetails": {
        "optimizerSteps": "u"
      }
    }
  },
  "viaIR": true,
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"address","name":"_bribeVault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidMaxPeriod","type":"error"},{"inputs":[],"name":"InvalidPeriodDuration","type":"error"},{"inputs":[],"name":"NotAContract","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"bribeMarket","type":"address"}],"name":"BribeMarketCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"bribeMarketImplementation","type":"address"}],"name":"BribeMarketImplementationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"bribeVault","type":"address"}],"name":"BribeVaultUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","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"},{"inputs":[],"name":"MAX_PERIODS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PERIOD_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"bribeMarketImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bribeVault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_protocol","type":"string"},{"internalType":"uint256","name":"_maxPeriods","type":"uint256"},{"internalType":"uint256","name":"_periodDuration","type":"uint256"}],"name":"createBribeMarket","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_implementation","type":"address"}],"name":"setBribeMarketImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_bribeVault","type":"address"}],"name":"setBribeVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523462000032575b620000206200001962000113565b906200013a565b604051610c1c620003508239610c1c90f35b6200003c62000042565b6200000b565b50600080fd5b50634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b038211176200008157604052565b6200008b62000048565b604052565b90620000a76200009f60405190565b92836200005f565b565b6001600160a01b031690565b90565b6001600160a01b03811614156200004257565b90505190620000a782620000b8565b9190620000b59060408482031262000103575b620000f98185620000cb565b93602001620000cb565b6200010d62000042565b620000ed565b6200013662000f6c803803806200012a8162000090565b928339810190620000da565b9091565b9062000154620000a7926200014e6200015a565b620002f7565b62000344565b620000a78033620001e1565b916001600160a01b0360089290920291821b911b5b9181191691161790565b620000b590620000a9906001600160a01b031682565b620000b59062000185565b620000b5906200019b565b9190620001c6620000b5620001cf93620001a6565b90835462000166565b9055565b620000a791600091620001b1565b620000a790620001f460006001620001d3565b6200023d565b620000b590620000a9565b620000b59054620001fa565b906001600160a01b03906200017b565b9062000235620000b5620001cf92620001a6565b825462000211565b62000249600062000205565b906200025781600062000221565b6200028e620002877f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093620001a6565b91620001a6565b916200029960405190565b600090a3565b620000b5620000b5620000b59290565b803b620002c5620002c160006200029f565b9190565b14620002d657620000a790620002ea565b50506040516309ee12d560e01b8152600490fd5b620000a790600262000221565b620000a790620002af565b803b62000314620002c160006200029f565b14620002d657620000a790803b62000331620002c160006200029f565b14620002d657620000a790600362000221565b620000a7906200030256fe60806040526004361015610018575b6100166102b2565b005b60003560e01c80630a25464014610288578063152bb06d146102615780631a00ab3314610237578063715018a614610210578063742a6c43146101e257806379ba5097146101bb5780637fb84bed14610181578063833d657e146101575780638da5cb5b1461012d578063a8f6902314610106578063e30c3978146100d05763f2fde38b146100a65761000e565b346100c3575b6100166100ba36600461031d565b610609565b0390f35b6100cb6102b2565b6100ac565b50346100f9575b6100e23660046102b8565b6100bf6100ed610541565b60405191829182610372565b6101016102b2565b6100d7565b5034610120575b61001661011b36600461031d565b610afe565b6101286102b2565b61010d565b503461014a575b61013f3660046102b8565b6100bf6100ed610471565b6101526102b2565b610134565b5034610174575b6101693660046102b8565b6100bf6100ed610452565b61017c6102b2565b61015e565b50346101ae575b6101933660046102b8565b6100bf61019e61044a565b6040519182918290815260200190565b6101b66102b2565b610188565b50346101d5575b6101cd3660046102b8565b61001661070d565b6101dd6102b2565b6101c2565b5034610203575b6100bf6100ed6101fa3660046103de565b92919091610800565b61020b6102b2565b6101e9565b503461022a575b6102223660046102b8565b6100166104b3565b6102326102b2565b610217565b5034610254575b6102493660046102b8565b6100bf6100ed61035d565b61025c6102b2565b61023e565b503461027b575b61001661027636600461031d565b610b46565b6102836102b2565b610268565b50346102a5575b61029a3660046102b8565b6100bf61019e6102e7565b6102ad6102b2565b61028f565b50600080fd5b60009103126102c357565b6102cb6102b2565b565b6102da6102da6102da9290565b90565b6102da600a6102cd565b6102da6102dd565b9052565b6001600160a01b031690565b610308816102f3565b14156102b257565b905035906102cb826102ff565b906102da9160208183031261033157610310565b6103396102b2565b610310565b6102da916008021c6001600160a01b031690565b906102da915461033e565b6102da60006002610352565b6102ef906102f3565b6020810192916102cb9190610369565b909182601f830112156103be575b602082359267ffffffffffffffff84116103b1575b0192828401116102c357565b6103b96102b2565b6103a5565b6103c66102b2565b610390565b80610308565b905035906102cb826103cb565b6102da9192606082850312610431575b61040b84833567ffffffffffffffff8111610424575b8401610382565b93909461041b81602086016103d1565b936040016103d1565b61042c6102b2565b610404565b6104396102b2565b6103ee565b6102da62278d006102cd565b6102da61043e565b6102da60006003610352565b6102da906102f3565b6102da905461045e565b6102da6000610467565b610483610519565b6102cb6104a1565b6102f36102da6102da9290565b6102da9061048b565b6102cb6104ae6000610498565b610650565b6102cb61047b565b0190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b156104fb57565b5060405162461bcd60e51b815280610515600482016104bf565b0390fd5b6102cb610524610471565b61053b610535336102f3565b6102f3565b916102f3565b146104f4565b6102da6001610467565b6102cb90610557610519565b6105b2565b906001600160a01b03905b9181191691161790565b6102da906102f3906001600160a01b031682565b6102da90610571565b6102da90610585565b906105a76102da6105ae9261058e565b825461055c565b9055565b6105bd816001610597565b6105c5610471565b906105f96105f37f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227009361058e565b9161058e565b9161060360405190565b600090a3565b6102cb9061054b565b916001600160a01b0360089290920291821b911b610567565b919061063c6102da6105ae9361058e565b908354610612565b6102cb9160009161062b565b6102cb9061066060006001610644565b61066a6000610467565b90610676816000610597565b6105f96105f37f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361058e565b60208082526029908201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206040820152683732bb9037bbb732b960b91b606082015260800190565b156106f357565b5060405162461bcd60e51b815280610515600482016106a3565b6102cb336104ae61071c610541565b610728610535846102f3565b146106ec565b50634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff82111761076757604052565b61076f61072e565b604052565b90826000939282370152565b919061079e81610797816104bb9560209181520190565b8095610774565b601f01601f191690565b916107ef916102cb969897956080956107da6107e7946107d060a089019560008a0190610369565b6020880190610369565b8583036040870152610780565b966060830152565b0152565b506040513d6000823e3d90fd5b91929091600091610810836102cd565b851480156109e8575b6109ca57610826836102cd565b811480156109b7575b610999576108d69383916108908361084f61084a6002610467565b610a4c565b9861089b61086461085f8c61058e565b61058e565b94638d23507f926108756003610467565b97339a883b1561098c575b6040519b8c9a8b998a9860e01b90565b8852600488016107a8565b03925af1801561097f575b61096b575b506108bc61085f61085f6003610467565b63172becff90803b1561095e575b60405193849260e01b90565b82528183816108e88860048301610372565b03925af18015610951575b610934575b507fc079bf405ebc76ac163f8dab16cc2e0570562f5b2d7cb957c69d4bf1f8d22fe86109238261058e565b9061092d60405190565b600090a290565b61094b906109423d82610745565b3d8101906102b8565b386108f8565b6109596107f3565b6108f3565b6109666102b2565b6108ca565b610979906109423d82610745565b386108ab565b6109876107f3565b6108a6565b6109946102b2565b610880565b5050505050506109a860405190565b634f08daf360e11b8152600490fd5b506109c36102da61043e565b811161082f565b5050505050506109d960405190565b63c17d8a0360e01b8152600490fd5b506109f46102da6102dd565b8511610819565b602080825260169082015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604082015260600190565b15610a3257565b5060405162461bcd60e51b815280610515600482016109fb565b6e5af43d82803e903d91602b57fd5bf390763d602d80600a3d3981f3363d3d373d3d3d363d730000008160601b60e81c1760005260781b17602052603760096000f0906102cb610a9f6105306000610498565b610aa8846102f3565b1415610a2b565b6102cb90610abb610519565b610ac481610b8f565b610aee7f2f64067393bb7145c8b43796303f94efd9c3c4633a970158de88b74aaae198e19161058e565b90610af860405190565b600090a2565b6102cb90610aaf565b6102cb90610b13610519565b610b1c81610bcf565b610aee7f8bd91d825017fca95e546ffcdf4ff56d37b0d717a6e77e5b472174db55250a809161058e565b6102cb90610b07565b803b610b62610b5e60006102cd565b9190565b14610b70576102cb90610b84565b50506040516309ee12d560e01b8152600490fd5b6102cb906002610597565b6102cb90610b4f565b803b610ba7610b5e60006102cd565b14610b70576102cb90803b610bbf610b5e60006102cd565b14610b70576102cb906003610597565b6102cb90610b9856fea3646970667358221220c1c0a25da8a7d392e02e025ffb270054edcd35c60295ac9ed9ac4c918a558bd06c6578706572696d656e74616cf564736f6c634300080c00410000000000000000000000000f7983eb3d146477b6c7d4c5aab427d3340db38e000000000000000000000000e00fe722e5be7ad45b1a16066e431e47df476cec

Deployed Bytecode

0x60806040526004361015610018575b6100166102b2565b005b60003560e01c80630a25464014610288578063152bb06d146102615780631a00ab3314610237578063715018a614610210578063742a6c43146101e257806379ba5097146101bb5780637fb84bed14610181578063833d657e146101575780638da5cb5b1461012d578063a8f6902314610106578063e30c3978146100d05763f2fde38b146100a65761000e565b346100c3575b6100166100ba36600461031d565b610609565b0390f35b6100cb6102b2565b6100ac565b50346100f9575b6100e23660046102b8565b6100bf6100ed610541565b60405191829182610372565b6101016102b2565b6100d7565b5034610120575b61001661011b36600461031d565b610afe565b6101286102b2565b61010d565b503461014a575b61013f3660046102b8565b6100bf6100ed610471565b6101526102b2565b610134565b5034610174575b6101693660046102b8565b6100bf6100ed610452565b61017c6102b2565b61015e565b50346101ae575b6101933660046102b8565b6100bf61019e61044a565b6040519182918290815260200190565b6101b66102b2565b610188565b50346101d5575b6101cd3660046102b8565b61001661070d565b6101dd6102b2565b6101c2565b5034610203575b6100bf6100ed6101fa3660046103de565b92919091610800565b61020b6102b2565b6101e9565b503461022a575b6102223660046102b8565b6100166104b3565b6102326102b2565b610217565b5034610254575b6102493660046102b8565b6100bf6100ed61035d565b61025c6102b2565b61023e565b503461027b575b61001661027636600461031d565b610b46565b6102836102b2565b610268565b50346102a5575b61029a3660046102b8565b6100bf61019e6102e7565b6102ad6102b2565b61028f565b50600080fd5b60009103126102c357565b6102cb6102b2565b565b6102da6102da6102da9290565b90565b6102da600a6102cd565b6102da6102dd565b9052565b6001600160a01b031690565b610308816102f3565b14156102b257565b905035906102cb826102ff565b906102da9160208183031261033157610310565b6103396102b2565b610310565b6102da916008021c6001600160a01b031690565b906102da915461033e565b6102da60006002610352565b6102ef906102f3565b6020810192916102cb9190610369565b909182601f830112156103be575b602082359267ffffffffffffffff84116103b1575b0192828401116102c357565b6103b96102b2565b6103a5565b6103c66102b2565b610390565b80610308565b905035906102cb826103cb565b6102da9192606082850312610431575b61040b84833567ffffffffffffffff8111610424575b8401610382565b93909461041b81602086016103d1565b936040016103d1565b61042c6102b2565b610404565b6104396102b2565b6103ee565b6102da62278d006102cd565b6102da61043e565b6102da60006003610352565b6102da906102f3565b6102da905461045e565b6102da6000610467565b610483610519565b6102cb6104a1565b6102f36102da6102da9290565b6102da9061048b565b6102cb6104ae6000610498565b610650565b6102cb61047b565b0190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b156104fb57565b5060405162461bcd60e51b815280610515600482016104bf565b0390fd5b6102cb610524610471565b61053b610535336102f3565b6102f3565b916102f3565b146104f4565b6102da6001610467565b6102cb90610557610519565b6105b2565b906001600160a01b03905b9181191691161790565b6102da906102f3906001600160a01b031682565b6102da90610571565b6102da90610585565b906105a76102da6105ae9261058e565b825461055c565b9055565b6105bd816001610597565b6105c5610471565b906105f96105f37f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227009361058e565b9161058e565b9161060360405190565b600090a3565b6102cb9061054b565b916001600160a01b0360089290920291821b911b610567565b919061063c6102da6105ae9361058e565b908354610612565b6102cb9160009161062b565b6102cb9061066060006001610644565b61066a6000610467565b90610676816000610597565b6105f96105f37f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361058e565b60208082526029908201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206040820152683732bb9037bbb732b960b91b606082015260800190565b156106f357565b5060405162461bcd60e51b815280610515600482016106a3565b6102cb336104ae61071c610541565b610728610535846102f3565b146106ec565b50634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff82111761076757604052565b61076f61072e565b604052565b90826000939282370152565b919061079e81610797816104bb9560209181520190565b8095610774565b601f01601f191690565b916107ef916102cb969897956080956107da6107e7946107d060a089019560008a0190610369565b6020880190610369565b8583036040870152610780565b966060830152565b0152565b506040513d6000823e3d90fd5b91929091600091610810836102cd565b851480156109e8575b6109ca57610826836102cd565b811480156109b7575b610999576108d69383916108908361084f61084a6002610467565b610a4c565b9861089b61086461085f8c61058e565b61058e565b94638d23507f926108756003610467565b97339a883b1561098c575b6040519b8c9a8b998a9860e01b90565b8852600488016107a8565b03925af1801561097f575b61096b575b506108bc61085f61085f6003610467565b63172becff90803b1561095e575b60405193849260e01b90565b82528183816108e88860048301610372565b03925af18015610951575b610934575b507fc079bf405ebc76ac163f8dab16cc2e0570562f5b2d7cb957c69d4bf1f8d22fe86109238261058e565b9061092d60405190565b600090a290565b61094b906109423d82610745565b3d8101906102b8565b386108f8565b6109596107f3565b6108f3565b6109666102b2565b6108ca565b610979906109423d82610745565b386108ab565b6109876107f3565b6108a6565b6109946102b2565b610880565b5050505050506109a860405190565b634f08daf360e11b8152600490fd5b506109c36102da61043e565b811161082f565b5050505050506109d960405190565b63c17d8a0360e01b8152600490fd5b506109f46102da6102dd565b8511610819565b602080825260169082015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604082015260600190565b15610a3257565b5060405162461bcd60e51b815280610515600482016109fb565b6e5af43d82803e903d91602b57fd5bf390763d602d80600a3d3981f3363d3d373d3d3d363d730000008160601b60e81c1760005260781b17602052603760096000f0906102cb610a9f6105306000610498565b610aa8846102f3565b1415610a2b565b6102cb90610abb610519565b610ac481610b8f565b610aee7f2f64067393bb7145c8b43796303f94efd9c3c4633a970158de88b74aaae198e19161058e565b90610af860405190565b600090a2565b6102cb90610aaf565b6102cb90610b13610519565b610b1c81610bcf565b610aee7f8bd91d825017fca95e546ffcdf4ff56d37b0d717a6e77e5b472174db55250a809161058e565b6102cb90610b07565b803b610b62610b5e60006102cd565b9190565b14610b70576102cb90610b84565b50506040516309ee12d560e01b8152600490fd5b6102cb906002610597565b6102cb90610b4f565b803b610ba7610b5e60006102cd565b14610b70576102cb90803b610bbf610b5e60006102cd565b14610b70576102cb906003610597565b6102cb90610b9856fea3646970667358221220c1c0a25da8a7d392e02e025ffb270054edcd35c60295ac9ed9ac4c918a558bd06c6578706572696d656e74616cf564736f6c634300080c0041

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000000f7983eb3d146477b6c7d4c5aab427d3340db38e000000000000000000000000e00fe722e5be7ad45b1a16066e431e47df476cec

-----Decoded View---------------
Arg [0] : _implementation (address): 0x0F7983eb3D146477B6c7d4C5aAB427D3340DB38E
Arg [1] : _bribeVault (address): 0xE00fe722e5bE7ad45b1A16066E431E47Df476CeC

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000f7983eb3d146477b6c7d4c5aab427d3340db38e
Arg [1] : 000000000000000000000000e00fe722e5be7ad45b1a16066e431e47df476cec


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.