ETH Price: $2,862.01 (-2.70%)

Contract

0x95aF0bf00E365e6C7fd3E1De4413aFD3E0B8Da48

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

> 10 Token Transfers found.

Parent Transaction Hash Block From To
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x28B69C6a...f051B6B87
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
RewardsDistributorExternal

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: UNLICENSED
// solhint-disable meta-transactions/no-msg-sender
pragma solidity >=0.8.11 <0.9.0;

import {AccessError} from "@synthetixio/core-contracts/contracts/errors/AccessError.sol";
import {ParameterError} from "@synthetixio/core-contracts/contracts/errors/ParameterError.sol";
import {RewardsDistributor} from "@synthetixio/rewards-distributor/src/RewardsDistributor.sol";

contract RewardsDistributorExternal is RewardsDistributor {
    address public authorizedExternalDistributor;

    constructor(
        address rewardManager_,
        uint128 poolId_,
        address payoutToken_,
        uint8 payoutTokenDecimals_,
        string memory name_,
        address authorizedExternalDistributor_
    ) RewardsDistributor(rewardManager_, poolId_, payoutToken_, payoutTokenDecimals_, name_) {
        if (authorizedExternalDistributor_ == address(0)) {
            revert ParameterError.InvalidParameter(
                "authorizedExternalDistributor",
                "Invalid address"
            );
        }
        authorizedExternalDistributor = authorizedExternalDistributor_;
    }

    function _checkDistributeSender() internal view virtual override {
        if (msg.sender != authorizedExternalDistributor) {
            revert AccessError.Unauthorized(msg.sender);
        }
    }
}

File 2 of 27 : AccessError.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.11 <0.9.0;

/**
 * @title Library for access related errors.
 */
library AccessError {
    /**
     * @dev Thrown when an address tries to perform an unauthorized action.
     * @param addr The address that attempts the action.
     */
    error Unauthorized(address addr);
}

File 3 of 27 : ParameterError.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.11 <0.9.0;

/**
 * @title Library for errors related with expected function parameters.
 */
library ParameterError {
    /**
     * @dev Thrown when an invalid parameter is used in a function.
     * @param parameter The name of the parameter.
     * @param reason The reason why the received parameter is invalid.
     */
    error InvalidParameter(string parameter, string reason);
}

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

/**
 * @title ERC165 interface for determining if a contract supports a given interface.
 */
interface IERC165 {
    /**
     * @notice Determines if the contract in question supports the specified interface.
     * @param interfaceID XOR of all selectors in the contract.
     * @return True if the contract supports the specified interface.
     */
    function supportsInterface(bytes4 interfaceID) external view returns (bool);
}

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

/**
 * @title ERC20 token implementation.
 */
interface IERC20 {
    /**
     * @notice Emitted when tokens have been transferred.
     * @param from The address that originally owned the tokens.
     * @param to The address that received the tokens.
     * @param amount The number of tokens that were transferred.
     */
    event Transfer(address indexed from, address indexed to, uint256 amount);

    /**
     * @notice Emitted when a user has provided allowance to another user for transferring tokens on its behalf.
     * @param owner The address that is providing the allowance.
     * @param spender The address that received the allowance.
     * @param amount The number of tokens that were added to `spender`'s allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /**
     * @notice Thrown when the address interacting with the contract does not have sufficient allowance to transfer tokens from another contract.
     * @param required The necessary allowance.
     * @param existing The current allowance.
     */
    error InsufficientAllowance(uint256 required, uint256 existing);

    /**
     * @notice Thrown when the address interacting with the contract does not have sufficient tokens.
     * @param required The necessary balance.
     * @param existing The current balance.
     */
    error InsufficientBalance(uint256 required, uint256 existing);

    /**
     * @notice Retrieves the name of the token, e.g. "Synthetix Network Token".
     * @return A string with the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @notice Retrieves the symbol of the token, e.g. "SNX".
     * @return A string with the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @notice Retrieves the number of decimals used by the token. The default is 18.
     * @return The number of decimals.
     */
    function decimals() external view returns (uint8);

    /**
     * @notice Returns the total number of tokens in circulation (minted - burnt).
     * @return The total number of tokens.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @notice Returns the balance of a user.
     * @param owner The address whose balance is being retrieved.
     * @return The number of tokens owned by the user.
     */
    function balanceOf(address owner) external view returns (uint256);

    /**
     * @notice Returns how many tokens a user has allowed another user to transfer on its behalf.
     * @param owner The user who has given the allowance.
     * @param spender The user who was given the allowance.
     * @return The amount of tokens `spender` can transfer on `owner`'s behalf.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @notice Transfer tokens from one address to another.
     * @param to The address that will receive the tokens.
     * @param amount The amount of tokens to be transferred.
     * @return A boolean which is true if the operation succeeded.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @notice Allows users to provide allowance to other users so that they can transfer tokens on their behalf.
     * @param spender The address that is receiving the allowance.
     * @param amount The amount of tokens that are being added to the allowance.
     * @return A boolean which is true if the operation succeeded.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @notice Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) external returns (bool);

    /**
     * @notice Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);

    /**
     * @notice Allows a user who has been given allowance to transfer tokens on another user's behalf.
     * @param from The address that owns the tokens that are being transferred.
     * @param to The address that will receive the tokens.
     * @param amount The number of tokens to transfer.
     * @return A boolean which is true if the operation succeeded.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

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

import "../interfaces/IERC20.sol";

library ERC20Helper {
    error FailedTransfer(address from, address to, uint256 value);

    function safeTransfer(address token, address to, uint256 value) internal {
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(IERC20.transfer.selector, to, value)
        );
        if (!success || (data.length != 0 && !abi.decode(data, (bool)))) {
            revert FailedTransfer(address(this), to, value);
        }
    }

    function safeTransferFrom(address token, address from, address to, uint256 value) internal {
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value)
        );
        if (!success || (data.length != 0 && !abi.decode(data, (bool)))) {
            revert FailedTransfer(from, to, value);
        }
    }
}

File 7 of 27 : SafeCast.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.11 <0.9.0;

/**
 * Utilities that convert numeric types avoiding silent overflows.
 */
import "./SafeCast/SafeCastU32.sol";
import "./SafeCast/SafeCastI32.sol";
import "./SafeCast/SafeCastI24.sol";
import "./SafeCast/SafeCastU56.sol";
import "./SafeCast/SafeCastI56.sol";
import "./SafeCast/SafeCastU64.sol";
import "./SafeCast/SafeCastI64.sol";
import "./SafeCast/SafeCastI128.sol";
import "./SafeCast/SafeCastI256.sol";
import "./SafeCast/SafeCastU128.sol";
import "./SafeCast/SafeCastU160.sol";
import "./SafeCast/SafeCastU256.sol";
import "./SafeCast/SafeCastAddress.sol";
import "./SafeCast/SafeCastBytes32.sol";

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

/**
 * @title See SafeCast.sol.
 */
library SafeCastAddress {
    function to256(address x) internal pure returns (uint256) {
        return uint256(uint160(x));
    }

    function toBytes32(address x) internal pure returns (bytes32) {
        return bytes32(uint256(uint160(x)));
    }
}

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

/**
 * @title See SafeCast.sol.
 */
library SafeCastBytes32 {
    function toAddress(bytes32 x) internal pure returns (address) {
        return address(uint160(uint256(x)));
    }

    function toUint(bytes32 x) internal pure returns (uint) {
        return uint(x);
    }
}

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

/**
 * @title See SafeCast.sol.
 */
library SafeCastI128 {
    error OverflowInt128ToUint128();
    error OverflowInt128ToInt32();

    function toUint(int128 x) internal pure returns (uint128) {
        // ----------------<==============o==============>-----------------
        // ----------------xxxxxxxxxxxxxxxo===============>----------------
        if (x < 0) {
            revert OverflowInt128ToUint128();
        }

        return uint128(x);
    }

    function to256(int128 x) internal pure returns (int256) {
        return int256(x);
    }

    function to32(int128 x) internal pure returns (int32) {
        // ----------------<==============o==============>-----------------
        // ----------------xxxxxxxxxxxx<==o==>xxxxxxxxxxxx-----------------
        if (x < int256(type(int32).min) || x > int256(type(int32).max)) {
            revert OverflowInt128ToInt32();
        }

        return int32(x);
    }

    function zero() internal pure returns (int128) {
        return int128(0);
    }
}

File 11 of 27 : SafeCastI24.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.11 <0.9.0;

/**
 * @title See SafeCast.sol.
 */
library SafeCastI24 {
    function to256(int24 x) internal pure returns (int256) {
        return int256(x);
    }
}

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

/**
 * @title See SafeCast.sol.
 */
library SafeCastI256 {
    error OverflowInt256ToUint256();
    error OverflowInt256ToInt128();
    error OverflowInt256ToInt24();

    function to128(int256 x) internal pure returns (int128) {
        // ----<==========================o===========================>----
        // ----xxxxxxxxxxxx<==============o==============>xxxxxxxxxxxxx----
        if (x < int256(type(int128).min) || x > int256(type(int128).max)) {
            revert OverflowInt256ToInt128();
        }

        return int128(x);
    }

    function to24(int256 x) internal pure returns (int24) {
        // ----<==========================o===========================>----
        // ----xxxxxxxxxxxxxxxxxxxx<======o=======>xxxxxxxxxxxxxxxxxxxx----
        if (x < int256(type(int24).min) || x > int256(type(int24).max)) {
            revert OverflowInt256ToInt24();
        }

        return int24(x);
    }

    function toUint(int256 x) internal pure returns (uint256) {
        // ----<==========================o===========================>----
        // ----xxxxxxxxxxxxxxxxxxxxxxxxxxxo===============================>
        if (x < 0) {
            revert OverflowInt256ToUint256();
        }

        return uint256(x);
    }

    function zero() internal pure returns (int256) {
        return int256(0);
    }
}

File 13 of 27 : SafeCastI32.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.11 <0.9.0;

/**
 * @title See SafeCast.sol.
 */
library SafeCastI32 {
    error OverflowInt32ToUint32();

    function toUint(int32 x) internal pure returns (uint32) {
        // ----------------------<========o========>----------------------
        // ----------------------xxxxxxxxxo=========>----------------------
        if (x < 0) {
            revert OverflowInt32ToUint32();
        }

        return uint32(x);
    }
}

File 14 of 27 : SafeCastI56.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.11 <0.9.0;

/**
 * @title See SafeCast.sol.
 */
library SafeCastI56 {
    error OverflowInt56ToInt24();

    function to24(int56 x) internal pure returns (int24) {
        // ----------------------<========o========>-----------------------
        // ----------------------xxx<=====o=====>xxx-----------------------
        if (x < int256(type(int24).min) || x > int256(type(int24).max)) {
            revert OverflowInt56ToInt24();
        }

        return int24(x);
    }
}

File 15 of 27 : SafeCastI64.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.11 <0.9.0;

/**
 * @title See SafeCast.sol.
 */
library SafeCastI64 {
    error OverflowInt64ToUint64();

    function toUint(int64 x) internal pure returns (uint64) {
        // ----------------------<========o========>----------------------
        // ----------------------xxxxxxxxxo=========>----------------------
        if (x < 0) {
            revert OverflowInt64ToUint64();
        }

        return uint64(x);
    }
}

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

/**
 * @title See SafeCast.sol.
 */
library SafeCastU128 {
    error OverflowUint128ToInt128();

    function to256(uint128 x) internal pure returns (uint256) {
        return uint256(x);
    }

    function toInt(uint128 x) internal pure returns (int128) {
        // -------------------------------o===============>----------------
        // ----------------<==============o==============>x----------------
        if (x > uint128(type(int128).max)) {
            revert OverflowUint128ToInt128();
        }

        return int128(x);
    }

    function toBytes32(uint128 x) internal pure returns (bytes32) {
        return bytes32(uint256(x));
    }
}

File 17 of 27 : SafeCastU160.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.11 <0.9.0;

/**
 * @title See SafeCast.sol.
 */
library SafeCastU160 {
    function to256(uint160 x) internal pure returns (uint256) {
        return uint256(x);
    }
}

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

/**
 * @title See SafeCast.sol.
 */
library SafeCastU256 {
    error OverflowUint256ToUint128();
    error OverflowUint256ToInt256();
    error OverflowUint256ToUint64();
    error OverflowUint256ToUint32();
    error OverflowUint256ToUint160();

    function to128(uint256 x) internal pure returns (uint128) {
        // -------------------------------o===============================>
        // -------------------------------o===============>xxxxxxxxxxxxxxxx
        if (x > type(uint128).max) {
            revert OverflowUint256ToUint128();
        }

        return uint128(x);
    }

    function to64(uint256 x) internal pure returns (uint64) {
        // -------------------------------o===============================>
        // -------------------------------o======>xxxxxxxxxxxxxxxxxxxxxxxxx
        if (x > type(uint64).max) {
            revert OverflowUint256ToUint64();
        }

        return uint64(x);
    }

    function to32(uint256 x) internal pure returns (uint32) {
        // -------------------------------o===============================>
        // -------------------------------o===>xxxxxxxxxxxxxxxxxxxxxxxxxxxx
        if (x > type(uint32).max) {
            revert OverflowUint256ToUint32();
        }

        return uint32(x);
    }

    function to160(uint256 x) internal pure returns (uint160) {
        // -------------------------------o===============================>
        // -------------------------------o==================>xxxxxxxxxxxxx
        if (x > type(uint160).max) {
            revert OverflowUint256ToUint160();
        }

        return uint160(x);
    }

    function toBytes32(uint256 x) internal pure returns (bytes32) {
        return bytes32(x);
    }

    function toInt(uint256 x) internal pure returns (int256) {
        // -------------------------------o===============================>
        // ----<==========================o===========================>xxxx
        if (x > uint256(type(int256).max)) {
            revert OverflowUint256ToInt256();
        }

        return int256(x);
    }
}

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

/**
 * @title See SafeCast.sol.
 */
library SafeCastU32 {
    error OverflowUint32ToInt32();

    function toInt(uint32 x) internal pure returns (int32) {
        // -------------------------------o=========>----------------------
        // ----------------------<========o========>x----------------------
        if (x > uint32(type(int32).max)) {
            revert OverflowUint32ToInt32();
        }

        return int32(x);
    }

    function to256(uint32 x) internal pure returns (uint256) {
        return uint256(x);
    }

    function to56(uint32 x) internal pure returns (uint56) {
        return uint56(x);
    }
}

File 20 of 27 : SafeCastU56.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.11 <0.9.0;

/**
 * @title See SafeCast.sol.
 */
library SafeCastU56 {
    error OverflowUint56ToInt56();

    function toInt(uint56 x) internal pure returns (int56) {
        // -------------------------------o=========>----------------------
        // ----------------------<========o========>x----------------------
        if (x > uint56(type(int56).max)) {
            revert OverflowUint56ToInt56();
        }

        return int56(x);
    }
}

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

/**
 * @title See SafeCast.sol.
 */
library SafeCastU64 {
    error OverflowUint64ToInt64();

    function toInt(uint64 x) internal pure returns (int64) {
        // -------------------------------o=========>----------------------
        // ----------------------<========o========>x----------------------
        if (x > uint64(type(int64).max)) {
            revert OverflowUint64ToInt64();
        }

        return int64(x);
    }

    function to256(uint64 x) internal pure returns (uint256) {
        return uint256(x);
    }
}

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

import "../storage/MarketConfiguration.sol";
import "../storage/PoolCollateralConfiguration.sol";

/**
 * @title Module for the creation and management of pools.
 * @dev The pool owner can be specified during creation, can be transferred, and has credentials for configuring the pool.
 */
interface IPoolModule {
    /**
     * @notice Thrown when attempting to disconnect a market whose capacity is locked, and whose removal would cause a decrease in its associated pool's credit delegation proportion.
     */
    error CapacityLocked(uint256 marketId);

    /**
     * @notice Gets fired when pool will be created.
     * @param poolId The id of the newly created pool.
     * @param owner The owner of the newly created pool.
     * @param sender The address that triggered the creation of the pool.
     */
    event PoolCreated(uint128 indexed poolId, address indexed owner, address indexed sender);

    /**
     * @notice Gets fired when pool owner proposes a new owner.
     * @param poolId The id of the pool for which the nomination ocurred.
     * @param nominatedOwner The address that was nominated as the new owner of the pool.
     * @param owner The address of the current owner of the pool.
     */
    event PoolOwnerNominated(
        uint128 indexed poolId,
        address indexed nominatedOwner,
        address indexed owner
    );

    /**
     * @notice Gets fired when pool nominee accepts nomination.
     * @param poolId The id of the pool for which the owner nomination was accepted.
     * @param owner The address of the new owner of the pool, which accepted the nomination.
     */
    event PoolOwnershipAccepted(uint128 indexed poolId, address indexed owner);

    /**
     * @notice Gets fired when pool owner revokes nomination.
     * @param poolId The id of the pool in which the nomination was revoked.
     * @param owner The current owner of the pool.
     */
    event PoolNominationRevoked(uint128 indexed poolId, address indexed owner);

    /**
     * @notice Gets fired when pool nominee renounces nomination.
     * @param poolId The id of the pool for which the owner nomination was renounced.
     * @param owner The current owner of the pool.
     */
    event PoolNominationRenounced(uint128 indexed poolId, address indexed owner);

    /**
     * @notice Gets fired when pool owner renounces his own ownership.
     * @param poolId The id of the pool for which the owner nomination was renounced.
     */
    event PoolOwnershipRenounced(uint128 indexed poolId, address indexed owner);

    /**
     * @notice Gets fired when pool name changes.
     * @param poolId The id of the pool whose name was updated.
     * @param name The new name of the pool.
     * @param sender The address that triggered the rename of the pool.
     */
    event PoolNameUpdated(uint128 indexed poolId, string name, address indexed sender);

    /**
     * @notice Gets fired when pool gets configured.
     * @param poolId The id of the pool whose configuration was set.
     * @param markets Array of configuration data of the markets that were connected to the pool.
     * @param sender The address that triggered the pool configuration.
     */
    event PoolConfigurationSet(
        uint128 indexed poolId,
        MarketConfiguration.Data[] markets,
        address indexed sender
    );

    event PoolCollateralConfigurationUpdated(
        uint128 indexed poolId,
        address collateralType,
        PoolCollateralConfiguration.Data config
    );

    /**
     * @notice Emitted when a system-wide minimum liquidity ratio is set
     * @param minLiquidityRatio The new system-wide minimum liquidity ratio
     */
    event SetMinLiquidityRatio(uint256 minLiquidityRatio);

    /**
     * @notice Allows collaterals accepeted by the system to be accepeted by the pool by default
     * @param poolId The id of the pool.
     * @param disabled Shows if new collateral's will be dsiabled by default for the pool
     */
    event PoolCollateralDisabledByDefaultSet(uint128 poolId, bool disabled);

    /**
     * @notice Creates a pool with the requested pool id.
     * @param requestedPoolId The requested id for the new pool. Reverts if the id is not available.
     * @param owner The address that will own the newly created pool.
     */
    function createPool(uint128 requestedPoolId, address owner) external;

    /**
     * @notice Allows the pool owner to configure the pool.
     * @dev The pool's configuration is composed of an array of MarketConfiguration objects, which describe which markets the pool provides liquidity to, in what proportion, and to what extent.
     * @dev Incoming market ids need to be provided in ascending order.
     * @param poolId The id of the pool whose configuration is being set.
     * @param marketDistribution The array of market configuration objects that define the list of markets that are connected to the system.
     */
    function setPoolConfiguration(
        uint128 poolId,
        MarketConfiguration.Data[] memory marketDistribution
    ) external;

    /**
     * @notice Allows the pool owner to set the configuration of a specific collateral type for their pool.
     * @param poolId The id of the pool whose configuration is being set.
     * @param collateralType The collate
     * @param newConfig The config to set
     */
    function setPoolCollateralConfiguration(
        uint128 poolId,
        address collateralType,
        PoolCollateralConfiguration.Data memory newConfig
    ) external;

    /**
     * @notice Retrieves the pool configuration of a specific collateral type.
     * @param poolId The id of the pool whose configuration is being returned.
     * @param collateralType The address of the collateral.
     * @return config The PoolCollateralConfiguration object that describes the requested collateral configuration of the pool.
     */
    function getPoolCollateralConfiguration(
        uint128 poolId,
        address collateralType
    ) external view returns (PoolCollateralConfiguration.Data memory config);

    /**
     * @notice Allows collaterals accepeted by the system to be accepeted by the pool by default
     * @param poolId The id of the pool.
     * @param disabled If set to true new collaterals will be disabled for the pool.
     */
    function setPoolCollateralDisabledByDefault(uint128 poolId, bool disabled) external;

    /**
     * @notice Retrieves the MarketConfiguration of the specified pool.
     * @param poolId The id of the pool whose configuration is being queried.
     * @return markets The array of MarketConfiguration objects that describe the pool's configuration.
     */
    function getPoolConfiguration(
        uint128 poolId
    ) external view returns (MarketConfiguration.Data[] memory markets);

    /**
     * @notice Allows the owner of the pool to set the pool's name.
     * @param poolId The id of the pool whose name is being set.
     * @param name The new name to give to the pool.
     */
    function setPoolName(uint128 poolId, string memory name) external;

    /**
     * @notice Returns the pool's name.
     * @param poolId The id of the pool whose name is being queried.
     * @return poolName The current name of the pool.
     */
    function getPoolName(uint128 poolId) external view returns (string memory poolName);

    /**
     * @notice Allows the current pool owner to nominate a new owner.
     * @param nominatedOwner The address to nominate os the new pool owner.
     * @param poolId The id whose ownership is being transferred.
     */
    function nominatePoolOwner(address nominatedOwner, uint128 poolId) external;

    /**
     * @notice After a new pool owner has been nominated, allows it to accept the nomination and thus ownership of the pool.
     * @param poolId The id of the pool for which the caller is to accept ownership.
     */
    function acceptPoolOwnership(uint128 poolId) external;

    /**
     * @notice After a new pool owner has been nominated, allows it to reject the nomination.
     * @param poolId The id of the pool for which the new owner nomination is to be revoked.
     */
    function revokePoolNomination(uint128 poolId) external;

    /**
     * @notice Allows the current nominated owner to renounce the nomination.
     * @param poolId The id of the pool for which the caller is renouncing ownership nomination.
     */
    function renouncePoolNomination(uint128 poolId) external;

    /**
     * @notice Allows the current owner to renounce his ownership.
     * @param poolId The id of the pool for which the caller is renouncing ownership nomination.
     */
    function renouncePoolOwnership(uint128 poolId) external;

    /**
     * @notice Returns the current pool owner.
     * @param poolId The id of the pool whose ownership is being queried.
     * @return owner The current owner of the pool.
     */
    function getPoolOwner(uint128 poolId) external view returns (address owner);

    /**
     * @notice Returns the current nominated pool owner.
     * @param poolId The id of the pool whose nominated owner is being queried.
     * @return nominatedOwner The current nominated owner of the pool.
     */
    function getNominatedPoolOwner(uint128 poolId) external view returns (address nominatedOwner);

    /**
     * @notice Allows the system owner (not the pool owner) to set the system-wide minimum liquidity ratio.
     * @param minLiquidityRatio The new system-wide minimum liquidity ratio, denominated with 18 decimals of precision. (100% is represented by 1 followed by 18 zeros.)
     */
    function setMinLiquidityRatio(uint256 minLiquidityRatio) external;

    /**
     @notice returns a pool minimum issuance ratio
     * @param poolId The id of the pool for to check the collateral for.
     * @param collateral The address of the collateral.
     */
    function getPoolCollateralIssuanceRatio(
        uint128 poolId,
        address collateral
    ) external view returns (uint256 issuanceRatioD18);

    /**
     * @notice Retrieves the system-wide minimum liquidity ratio.
     * @return minRatioD18 The current system-wide minimum liquidity ratio, denominated with 18 decimals of precision. (100% is represented by 1 followed by 18 zeros.)
     */
    function getMinLiquidityRatio() external view returns (uint256 minRatioD18);

    /**
     * @notice Distributes cached debt in a pool to its vaults and updates market credit capacities.
     * @param poolId the pool to rebalance
     * @param optionalCollateralType in addition to rebalancing the pool, calculate updated collaterals and debts for the specified vault
     */
    function rebalancePool(uint128 poolId, address optionalCollateralType) external;
}

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

/**
 * @title Module for connecting rewards distributors to vaults.
 */
interface IRewardsManagerModule {
    /**
     * @notice Emitted when a reward distributor returns `false` from `payout` indicating a problem
     * preventing the payout from being executed. In this case, it is advised to check with the
     * project maintainers, and possibly try again in the future.
     * @param distributor the distributor which originated the issue
     */
    error RewardUnavailable(address distributor);

    /**
     * @notice Emitted when the pool owner or an existing reward distributor sets up rewards for vault participants.
     * @param poolId The id of the pool on which rewards were distributed.
     * @param collateralType The collateral type of the pool on which rewards were distributed.
     * @param distributor The reward distributor associated to the rewards that were distributed.
     * @param amount The amount of rewards that were distributed.
     * @param start The date one which the rewards will begin to be claimable.
     * @param duration The time in which all of the distributed rewards will be claimable.
     */
    event RewardsDistributed(
        uint128 indexed poolId,
        address indexed collateralType,
        address distributor,
        uint256 amount,
        uint256 start,
        uint256 duration
    );

    /**
     * @notice Emitted when a vault participant claims rewards.
     * @param accountId The id of the account that claimed the rewards.
     * @param poolId The id of the pool where the rewards were claimed.
     * @param collateralType The address of the collateral used in the pool's rewards.
     * @param distributor The address of the rewards distributor associated with these rewards.
     * @param amount The amount of rewards that were claimed.
     */
    event RewardsClaimed(
        uint128 indexed accountId,
        uint128 indexed poolId,
        address indexed collateralType,
        address distributor,
        uint256 amount
    );

    /**
     * @notice Emitted when a new rewards distributor is registered.
     * @param poolId The id of the pool whose reward distributor was registered.
     * @param collateralType The address of the collateral used in the pool's rewards.
     * @param distributor The address of the newly registered reward distributor.
     */
    event RewardsDistributorRegistered(
        uint128 indexed poolId,
        address indexed collateralType,
        address indexed distributor
    );

    /**
     * @notice Emitted when an already registered rewards distributor is removed.
     * @param poolId The id of the pool whose reward distributor was registered.
     * @param collateralType The address of the collateral used in the pool's rewards.
     * @param distributor The address of the registered reward distributor.
     */
    event RewardsDistributorRemoved(
        uint128 indexed poolId,
        address indexed collateralType,
        address indexed distributor
    );

    /**
     * @notice Called by pool owner to register rewards for vault participants.
     * @param poolId The id of the pool whose rewards are to be managed by the specified distributor.
     * @param collateralType The address of the collateral used in the pool's rewards.
     * @param distributor The address of the reward distributor to be registered.
     */
    function registerRewardsDistributor(
        uint128 poolId,
        address collateralType,
        address distributor
    ) external;

    /**
     * @notice Called by pool owner to remove a registered rewards distributor for vault participants.
     * WARNING: if you remove a rewards distributor, the same address can never be re-registered again. If you
     * simply want to turn off
     * rewards, call `distributeRewards` with 0 emission. If you need to completely reset the rewards distributor
     * again, create a new rewards distributor at a new address and register the new one.
     * This function is provided since the number of rewards distributors added to an account is finite,
     * so you can remove an unused rewards distributor if need be.
     * NOTE: unclaimed rewards can still be claimed after a rewards distributor is removed (though any
     * rewards-over-time will be halted)
     * @param poolId The id of the pool whose rewards are to be managed by the specified distributor.
     * @param collateralType The address of the collateral used in the pool's rewards.
     * @param distributor The address of the reward distributor to be registered.
     */
    function removeRewardsDistributor(
        uint128 poolId,
        address collateralType,
        address distributor
    ) external;

    /**
     * @notice Called by a registered distributor to set up rewards for vault participants.
     * @dev Will revert if the caller is not a registered distributor.
     * @param poolId The id of the pool to distribute rewards to.
     * @param collateralType The address of the collateral used in the pool's rewards.
     * @param amount The amount of rewards to be distributed.
     * @param start The date at which the rewards will begin to be claimable.
     * @param duration The period after which all distributed rewards will be claimable.
     * @return cancelledAmount the amount of reward which was previously issued on a call to `distributeRewards`, but will ultimately not be distributed due to
     * the duration period being interrupted by the start of this new distribution
     */
    function distributeRewards(
        uint128 poolId,
        address collateralType,
        uint256 amount,
        uint64 start,
        uint32 duration
    ) external returns (int256 cancelledAmount);

    /**
     * @notice Called by owner of a pool to set rewards for vault participants. This method
     * of reward setting is generally intended to only be used to recover from a case where the
     * distributor state is out of sync with the core system state, or if the distributor is only
     * able to payout and not capable of distributing its own rewards.
     * @dev Will revert if the caller is not the owner of the pool.
     * @param poolId The id of the pool to distribute rewards to.
     * @param collateralType The address of the collateral used in the pool's rewards.
     * @param rewardsDistributor The address of the reward distributor which pays out the tokens.
     * @param amount The amount of rewards to be distributed.
     * @param start The date at which the rewards will begin to be claimable.
     * @param duration The period after which all distributed rewards will be claimable.
     */
    function distributeRewardsByOwner(
        uint128 poolId,
        address collateralType,
        address rewardsDistributor,
        uint256 amount,
        uint64 start,
        uint32 duration
    ) external returns (int256 cancelledAmount);

    /**
     * @notice Allows a user with appropriate permissions to claim rewards associated with a position.
     * @param accountId The id of the account that is to claim the rewards.
     * @param poolId The id of the pool to claim rewards on.
     * @param collateralType The address of the collateral used in the pool's rewards.
     * @param distributor The address of the rewards distributor associated with the rewards being claimed.
     * @return amountClaimedD18 The amount of rewards that were available for the account and thus claimed.
     */
    function claimRewards(
        uint128 accountId,
        uint128 poolId,
        address collateralType,
        address distributor
    ) external returns (uint256 amountClaimedD18);

    /**
     * @notice Allows a user with appropriate permissions to claim rewards associated with a position for rewards issued at the pool level.
     * @param accountId The id of the account that is to claim the rewards.
     * @param poolId The id of the pool to claim rewards on.
     * @param collateralType The address of the collateral used by the user to gain rewards from the pool level.
     * @param distributor The address of the rewards distributor associated with the rewards being claimed.
     * @return amountClaimedD18 The amount of rewards that were available for the account and thus claimed.
     */
    function claimPoolRewards(
        uint128 accountId,
        uint128 poolId,
        address collateralType,
        address distributor
    ) external returns (uint256 amountClaimedD18);

    /**
     * @notice For a given position, return the rewards that can currently be claimed.
     * @param poolId The id of the pool being queried.
     * @param collateralType The address of the collateral used in the pool's rewards.
     * @param accountId The id of the account whose available rewards are being queried.
     * @return claimableD18 An array of ids of the reward entries that are claimable by the position.
     * @return distributors An array with the addresses of the reward distributors associated with the claimable rewards.
     * @return numPoolRewards Returns how many of the first returned rewards are pool level rewards (the rest are vault)
     */
    function updateRewards(
        uint128 poolId,
        address collateralType,
        uint128 accountId
    )
        external
        returns (
            uint256[] memory claimableD18,
            address[] memory distributors,
            uint256 numPoolRewards
        );

    /**
     * @notice Returns the number of individual units of amount emitted per second per share for the given poolId, collateralType, distributor vault.
     * @param poolId The id of the pool being queried.
     * @param collateralType The address of the collateral used in the pool's rewards.
     * @param distributor The address of the rewards distributor associated with the rewards in question.
     * @return rateD18 The queried rewards rate.
     */
    function getRewardRate(
        uint128 poolId,
        address collateralType,
        address distributor
    ) external view returns (uint256 rateD18);

    /**
     * @notice Returns the amount of claimable rewards for a given account position for a vault distributor.
     * @param accountId The id of the account to look up rewards on.
     * @param poolId The id of the pool to claim rewards on.
     * @param collateralType The address of the collateral used in the pool's rewards.
     * @param distributor The address of the rewards distributor associated with the rewards being claimed.
     * @return rewardAmount The amount of available rewards that are available for the provided account.
     */
    function getAvailableRewards(
        uint128 accountId,
        uint128 poolId,
        address collateralType,
        address distributor
    ) external returns (uint256 rewardAmount);

    /**
     * @notice Returns the amount of claimable rewards for a given account position for a pool level distributor.
     * @param accountId The id of the account to look up rewards on.
     * @param poolId The id of the pool to claim rewards on.
     * @param collateralType The address of the collateral used in the pool's rewards.
     * @param distributor The address of the rewards distributor associated with the rewards being claimed.
     * @return rewardAmount The amount of available rewards that are available for the provided account.
     */
    function getAvailablePoolRewards(
        uint128 accountId,
        uint128 poolId,
        address collateralType,
        address distributor
    ) external returns (uint256 rewardAmount);
}

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

import "@synthetixio/core-contracts/contracts/interfaces/IERC165.sol";

/// @title Interface a reward distributor.
interface IRewardDistributor is IERC165 {
    /// @notice Returns a human-readable name for the reward distributor
    function name() external view returns (string memory);

    /// @notice This function should revert if ERC2771Context._msgSender() is not the Synthetix CoreProxy address.
    /// @return whether or not the payout was executed
    function payout(
        uint128 accountId,
        uint128 poolId,
        address collateralType,
        address sender,
        uint256 amount
    ) external returns (bool);

    /// @notice This function is called by the Synthetix Core Proxy whenever
    /// a position is updated on a pool which this distributor is registered
    function onPositionUpdated(
        uint128 accountId,
        uint128 poolId,
        address collateralType,
        uint256 newShares
    ) external;

    /// @notice Address to ERC-20 token distributed by this distributor, for display purposes only
    /// @dev Return address(0) if providing non ERC-20 rewards
    function token() external view returns (address);
}

File 25 of 27 : MarketConfiguration.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.11 <0.9.0;

/**
 * @title Tracks a market's weight within a Pool, and its maximum debt.
 *
 * Each pool has an array of these, with one entry per market managed by the pool.
 *
 * A market's weight determines how much liquidity the pool provides to the market, and how much debt exposure the market gives the pool.
 *
 * Weights are used to calculate percentages by adding all the weights in the pool and dividing the market's weight by the total weights.
 *
 * A market's maximum debt in a pool is indicated with a maximum debt value per share.
 */
library MarketConfiguration {
    struct Data {
        /**
         * @dev Numeric identifier for the market.
         *
         * Must be unique, and in a list of `MarketConfiguration[]`, must be increasing.
         */
        uint128 marketId;
        /**
         * @dev The ratio of each market's `weight` to the pool's `totalWeights` determines the pro-rata share of the market to the pool's total liquidity.
         */
        uint128 weightD18;
        /**
         * @dev Maximum value per share that a pool will tolerate for this market.
         *
         * If the the limit is met, the markets exceeding debt will be distributed, and it will be disconnected from the pool that no longer provides credit to it.
         *
         * Note: This value will have no effect if the system wide limit is hit first. See `PoolConfiguration.minLiquidityRatioD18`.
         */
        int128 maxDebtShareValueD18;
    }
}

File 26 of 27 : PoolCollateralConfiguration.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.11 <0.9.0;

library PoolCollateralConfiguration {
    bytes32 private constant _SLOT =
        keccak256(abi.encode("io.synthetix.synthetix.PoolCollateralConfiguration"));

    struct Data {
        uint256 collateralLimitD18;
        uint256 issuanceRatioD18;
    }
}

// SPDX-License-Identifier: UNLICENSED
// solhint-disable meta-transactions/no-msg-sender
pragma solidity >=0.8.11 <0.9.0;

import {IRewardDistributor} from "@synthetixio/main/contracts/interfaces/external/IRewardDistributor.sol";
import {IRewardsManagerModule} from "@synthetixio/main/contracts/interfaces/IRewardsManagerModule.sol";
import {IPoolModule} from "@synthetixio/main/contracts/interfaces/IPoolModule.sol";
import {AccessError} from "@synthetixio/core-contracts/contracts/errors/AccessError.sol";
import {ParameterError} from "@synthetixio/core-contracts/contracts/errors/ParameterError.sol";
import {ERC20Helper} from "@synthetixio/core-contracts/contracts/token/ERC20Helper.sol";
import {IERC165} from "@synthetixio/core-contracts/contracts/interfaces/IERC165.sol";
import {IERC20} from "@synthetixio/core-contracts/contracts/interfaces/IERC20.sol";

import {SafeCastU256, SafeCastI256} from "@synthetixio/core-contracts/contracts/utils/SafeCast.sol";

contract RewardsDistributor is IRewardDistributor {
    error NotEnoughRewardsLeft(uint256 amountRequested, uint256 amountLeft);
    error NotEnoughBalance(uint256 amountRequested, uint256 currentBalance);

    using ERC20Helper for address;
    using SafeCastU256 for uint256;
    using SafeCastI256 for int256;

    address public rewardManager;
    uint128 public poolId;
    address public payoutToken;
    string public name;

    uint256 public precision;
    uint256 public constant SYSTEM_PRECISION = 10 ** 18;

    bool public shouldFailPayout;

    // Internal tracking for the remaining rewards, it keeps value in payoutToken precision
    uint256 public rewardedAmount = 0;

    constructor(
        address rewardManager_,
        uint128 poolId_,
        address payoutToken_,
        uint8 payoutTokenDecimals_,
        string memory name_
    ) {
        rewardManager = rewardManager_; // Synthetix CoreProxy
        poolId = poolId_;
        payoutToken = payoutToken_;
        name = name_;

        (bool success, bytes memory data) = payoutToken_.staticcall(
            abi.encodeWithSignature("decimals()")
        );

        if (success && data.length > 0 && abi.decode(data, (uint8)) != payoutTokenDecimals_) {
            revert ParameterError.InvalidParameter(
                "payoutTokenDecimals",
                "Specified token decimals do not match actual token decimals"
            );
        }
        // Fallback to the specified token decimals skipping the check if token does not support decimals method
        precision = 10 ** payoutTokenDecimals_;
    }

    function token() public view returns (address) {
        return payoutToken;
    }

    function setShouldFailPayout(bool shouldFailPayout_) external {
        if (msg.sender != IPoolModule(rewardManager).getPoolOwner(poolId)) {
            revert AccessError.Unauthorized(msg.sender);
        }
        shouldFailPayout = shouldFailPayout_;
    }

    function payout(
        uint128, // accountId,
        uint128 poolId_,
        address, // collateralType,
        address payoutTarget_, // msg.sender of claimRewards() call, payout target address
        uint256 payoutAmount_
    ) external returns (bool) {
        if (shouldFailPayout) {
            return false;
        }
        // IMPORTANT: In production, this function should revert if msg.sender is not the Synthetix CoreProxy address.
        if (msg.sender != rewardManager) {
            revert AccessError.Unauthorized(msg.sender);
        }
        if (poolId_ != poolId) {
            revert ParameterError.InvalidParameter(
                "poolId",
                "Pool does not match the rewards pool"
            );
        }

        // payoutAmount_ is always in 18 decimals precision, adjust actual payout amount to match payout token decimals
        uint256 adjustedAmount = (payoutAmount_ * precision) / SYSTEM_PRECISION;

        if (adjustedAmount > rewardedAmount) {
            revert NotEnoughRewardsLeft(adjustedAmount, rewardedAmount);
        }
        rewardedAmount = rewardedAmount - adjustedAmount;

        payoutToken.safeTransfer(payoutTarget_, adjustedAmount);

        return true;
    }

    function distributeRewards(
        uint128 poolId_,
        address collateralType_,
        uint256 amount_,
        uint64 start_,
        uint32 duration_
    ) public {
        _checkDistributeSender();
        if (poolId_ != poolId) {
            revert ParameterError.InvalidParameter(
                "poolId",
                "Pool does not match the rewards pool"
            );
        }

        // amount_ is in payout token decimals precision, adjust actual distribution amount to 18 decimals that core is making its calculations in
        // this is necessary to avoid rounding issues when doing actual payouts
        uint256 adjustedAmount = (amount_ * SYSTEM_PRECISION) / precision;

        int256 cancelledAmount = IRewardsManagerModule(rewardManager).distributeRewards(
            poolId_,
            collateralType_,
            adjustedAmount,
            start_,
            duration_
        );

        int256 adjustedCancelledAmount = (cancelledAmount * precision.toInt()) /
            SYSTEM_PRECISION.toInt();

        rewardedAmount = ((rewardedAmount + amount_).toInt() - adjustedCancelledAmount).toUint();

        // we check at the end because its the easiest way to verify that the end state is ok
        uint256 balance = IERC20(payoutToken).balanceOf(address(this));
        if (rewardedAmount > balance) {
            revert NotEnoughBalance(amount_, balance);
        }
    }

    function onPositionUpdated(
        uint128, // accountId,
        uint128, // poolId,
        address, // collateralType,
        uint256 // actorSharesD18
    ) external {} // solhint-disable-line no-empty-blocks

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

    function _checkDistributeSender() internal view virtual {
        if (msg.sender != IPoolModule(rewardManager).getPoolOwner(poolId)) {
            revert AccessError.Unauthorized(msg.sender);
        }
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "paris",
  "remappings": [
    "@synthetixio/=../../node_modules/@synthetixio/",
    "forge-std/=../../node_modules/forge-std/src/"
  ],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"rewardManager_","type":"address"},{"internalType":"uint128","name":"poolId_","type":"uint128"},{"internalType":"address","name":"payoutToken_","type":"address"},{"internalType":"uint8","name":"payoutTokenDecimals_","type":"uint8"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"address","name":"authorizedExternalDistributor_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"FailedTransfer","type":"error"},{"inputs":[{"internalType":"string","name":"parameter","type":"string"},{"internalType":"string","name":"reason","type":"string"}],"name":"InvalidParameter","type":"error"},{"inputs":[{"internalType":"uint256","name":"amountRequested","type":"uint256"},{"internalType":"uint256","name":"currentBalance","type":"uint256"}],"name":"NotEnoughBalance","type":"error"},{"inputs":[{"internalType":"uint256","name":"amountRequested","type":"uint256"},{"internalType":"uint256","name":"amountLeft","type":"uint256"}],"name":"NotEnoughRewardsLeft","type":"error"},{"inputs":[],"name":"OverflowInt256ToUint256","type":"error"},{"inputs":[],"name":"OverflowUint256ToInt256","type":"error"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"SYSTEM_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"authorizedExternalDistributor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint128","name":"poolId_","type":"uint128"},{"internalType":"address","name":"collateralType_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"uint64","name":"start_","type":"uint64"},{"internalType":"uint32","name":"duration_","type":"uint32"}],"name":"distributeRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint128","name":"","type":"uint128"},{"internalType":"uint128","name":"","type":"uint128"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"onPositionUpdated","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"","type":"uint128"},{"internalType":"uint128","name":"poolId_","type":"uint128"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"payoutTarget_","type":"address"},{"internalType":"uint256","name":"payoutAmount_","type":"uint256"}],"name":"payout","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"payoutToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolId","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"precision","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"shouldFailPayout_","type":"bool"}],"name":"setShouldFailPayout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shouldFailPayout","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

0x6080604052600060065534801561001557600080fd5b5060405161139038038061139083398101604081905261003491610325565b600080546001600160a01b038089166001600160a01b031992831617909255600180546001600160801b0389166001600160801b031990911617905560028054928716929091169190911790558585858585600361009282826104c0565b5060408051600481526024810182526020810180516001600160e01b031663313ce56760e01b179052905160009182916001600160a01b038716916100d69161057f565b600060405180830381855afa9150503d8060008114610111576040519150601f19603f3d011682016040523d82523d6000602084013e610116565b606091505b5091509150818015610129575060008151115b801561014e57508360ff1681806020019051810190610148919061059b565b60ff1614155b156101fd5760408051634bab873760e11b81526004810191909152601360448201527f7061796f7574546f6b656e446563696d616c7300000000000000000000000000606482015260806024820152603b60848201527f53706563696669656420746f6b656e20646563696d616c7320646f206e6f742060a48201527f6d617463682061637475616c20746f6b656e20646563696d616c73000000000060c482015260e4015b60405180910390fd5b61020884600a6106b9565b6004555050506001600160a01b0385169350610293925050505760408051634bab873760e11b81526004810191909152601d60448201527f617574686f72697a656445787465726e616c4469737472696275746f72000000606482015260806024820152600f60848201526e496e76616c6964206164647265737360881b60a482015260c4016101f4565b600780546001600160a01b0319166001600160a01b0392909216919091179055506106c89350505050565b80516001600160a01b03811681146102d557600080fd5b919050565b805160ff811681146102d557600080fd5b634e487b7160e01b600052604160045260246000fd5b60005b8381101561031c578181015183820152602001610304565b50506000910152565b60008060008060008060c0878903121561033e57600080fd5b610347876102be565b60208801519096506001600160801b038116811461036457600080fd5b9450610372604088016102be565b9350610380606088016102da565b60808801519093506001600160401b038082111561039d57600080fd5b818901915089601f8301126103b157600080fd5b8151818111156103c3576103c36102eb565b604051601f8201601f19908116603f011681019083821181831017156103eb576103eb6102eb565b816040528281528c602084870101111561040457600080fd5b610415836020830160208801610301565b809650505050505061042960a088016102be565b90509295509295509295565b600181811c9082168061044957607f821691505b60208210810361046957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156104bb576000816000526020600020601f850160051c810160208610156104985750805b601f850160051c820191505b818110156104b7578281556001016104a4565b5050505b505050565b81516001600160401b038111156104d9576104d96102eb565b6104ed816104e78454610435565b8461046f565b602080601f831160018114610522576000841561050a5750858301515b600019600386901b1c1916600185901b1785556104b7565b600085815260208120601f198616915b8281101561055157888601518255948401946001909101908401610532565b508582101561056f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251610591818460208701610301565b9190910192915050565b6000602082840312156105ad57600080fd5b6105b6826102da565b9392505050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561060e5781600019048211156105f4576105f46105bd565b8085161561060157918102915b93841c93908002906105d8565b509250929050565b600082610625575060016106b3565b81610632575060006106b3565b816001811461064857600281146106525761066e565b60019150506106b3565b60ff841115610663576106636105bd565b50506001821b6106b3565b5060208310610133831016604e8410600b8410161715610691575081810a6106b3565b61069b83836105d3565b80600019048211156106af576106af6105bd565b0290505b92915050565b60006105b660ff841683610616565b610cb9806106d76000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80634efa82b611610097578063d221e7f211610066578063d221e7f214610213578063d3b5dc3b14610226578063dba251611461022f578063fc0c546a1461023e57600080fd5b80634efa82b6146101c25780635a7ff7c5146101d55780639a99916f146101e8578063afd2c260146101fc57600080fd5b80630f4ef8a6116100d35780630f4ef8a61461014457806310e23da41461016f57806320686c2a146101845780633e0dc34e1461019757600080fd5b806301ffc9a7146100fa57806306fdde03146101225780630effe8b514610137575b600080fd5b61010d610108366004610866565b61024f565b60405190151581526020015b60405180910390f35b61012a610286565b60405161011991906108bb565b60055461010d9060ff1681565b600054610157906001600160a01b031681565b6040516001600160a01b039091168152602001610119565b61018261017d3660046108ff565b610314565b005b600754610157906001600160a01b031681565b6001546101aa906001600160801b031681565b6040516001600160801b039091168152602001610119565b600254610157906001600160a01b031681565b6101826101e336600461094d565b6103d8565b6101826101f63660046109c9565b50505050565b61020560065481565b604051908152602001610119565b61010d610221366004610a16565b6105df565b61020560045481565b610205670de0b6b3a764000081565b6002546001600160a01b0316610157565b60006001600160e01b03198216632c927f3d60e21b148061028057506001600160e01b031982166301ffc9a760e01b145b92915050565b6003805461029390610a76565b80601f01602080910402602001604051908101604052809291908181526020018280546102bf90610a76565b801561030c5780601f106102e15761010080835404028352916020019161030c565b820191906000526020600020905b8154815290600101906020018083116102ef57829003601f168201915b505050505081565b600054600154604051635deebe2d60e11b81526001600160801b0390911660048201526001600160a01b039091169063bbdd7c5a90602401602060405180830381865afa158015610369573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038d9190610ab0565b6001600160a01b0316336001600160a01b0316146103c55760405163472511eb60e11b81523360048201526024015b60405180910390fd5b6005805460ff1916911515919091179055565b6103e06106dd565b6001546001600160801b0386811691161461040e57604051634bab873760e11b81526004016103bc90610acd565b600454600090610426670de0b6b3a764000086610b45565b6104309190610b72565b60008054604051635a7ff7c560e01b81526001600160801b038a1660048201526001600160a01b0389811660248301526044820185905267ffffffffffffffff8816606483015263ffffffff8716608483015293945091921690635a7ff7c59060a4016020604051808303816000875af11580156104b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d69190610b86565b905060006104eb670de0b6b3a764000061070c565b6104f660045461070c565b6105009084610b9f565b61050a9190610bcf565b905061053581610526886006546105219190610bfd565b61070c565b6105309190610c10565b61073a565b6006556002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a59190610b86565b90508060065411156105d457604051634787a10360e11b815260048101889052602481018290526044016103bc565b505050505050505050565b60055460009060ff16156105f5575060006106d4565b6000546001600160a01b031633146106225760405163472511eb60e11b81523360048201526024016103bc565b6001546001600160801b0386811691161461065057604051634bab873760e11b81526004016103bc90610acd565b6000670de0b6b3a7640000600454846106699190610b45565b6106739190610b72565b90506006548111156106a65760065460405163a1b1d25960e01b81526103bc918391600401918252602082015260400190565b806006546106b49190610c37565b6006556002546106ce906001600160a01b0316858361075d565b60019150505b95945050505050565b6007546001600160a01b0316331461070a5760405163472511eb60e11b81523360048201526024016103bc565b565b60006001600160ff1b038211156107365760405163677c430560e11b815260040160405180910390fd5b5090565b6000808212156107365760405163029f024d60e31b815260040160405180910390fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916107b99190610c4a565b6000604051808303816000865af19150503d80600081146107f6576040519150601f19603f3d011682016040523d82523d6000602084013e6107fb565b606091505b509150915081158061082957508051158015906108295750808060200190518101906108279190610c66565b155b1561085f57604051633210e1d960e01b81523060048201526001600160a01b0385166024820152604481018490526064016103bc565b5050505050565b60006020828403121561087857600080fd5b81356001600160e01b03198116811461089057600080fd5b9392505050565b60005b838110156108b257818101518382015260200161089a565b50506000910152565b60208152600082518060208401526108da816040850160208701610897565b601f01601f19169190910160400192915050565b80151581146108fc57600080fd5b50565b60006020828403121561091157600080fd5b8135610890816108ee565b80356001600160801b038116811461093357600080fd5b919050565b6001600160a01b03811681146108fc57600080fd5b600080600080600060a0868803121561096557600080fd5b61096e8661091c565b9450602086013561097e81610938565b935060408601359250606086013567ffffffffffffffff811681146109a257600080fd5b9150608086013563ffffffff811681146109bb57600080fd5b809150509295509295909350565b600080600080608085870312156109df57600080fd5b6109e88561091c565b93506109f66020860161091c565b92506040850135610a0681610938565b9396929550929360600135925050565b600080600080600060a08688031215610a2e57600080fd5b610a378661091c565b9450610a456020870161091c565b93506040860135610a5581610938565b92506060860135610a6581610938565b949793965091946080013592915050565b600181811c90821680610a8a57607f821691505b602082108103610aaa57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215610ac257600080fd5b815161089081610938565b6040808252600690820152651c1bdbdb125960d21b60608201526080602082018190526024908201527f506f6f6c20646f6573206e6f74206d617463682074686520726577617264732060a0820152631c1bdbdb60e21b60c082015260e00190565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761028057610280610b2f565b634e487b7160e01b600052601260045260246000fd5b600082610b8157610b81610b5c565b500490565b600060208284031215610b9857600080fd5b5051919050565b80820260008212600160ff1b84141615610bbb57610bbb610b2f565b818105831482151761028057610280610b2f565b600082610bde57610bde610b5c565b600160ff1b821460001984141615610bf857610bf8610b2f565b500590565b8082018082111561028057610280610b2f565b8181036000831280158383131683831282161715610c3057610c30610b2f565b5092915050565b8181038181111561028057610280610b2f565b60008251610c5c818460208701610897565b9190910192915050565b600060208284031215610c7857600080fd5b8151610890816108ee56fea2646970667358221220c3f88c64faf6be29144dee9e9978e8d9f0ab66087fc38d1ac1d26cc3a64dd06064736f6c63430008190033000000000000000000000000ffffffaeff0b96ea8e4f94b2253f31abdd8758470000000000000000000000000000000000000000000000000000000000000001000000000000000000000000e81be4495f138fae5846d21ac2ca822bef452365000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000d762960c31210cf1bdf75b06a5192d395eedc659000000000000000000000000000000000000000000000000000000000000001e50657270732055534443204c69717569646174696f6e20526577617264730000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80634efa82b611610097578063d221e7f211610066578063d221e7f214610213578063d3b5dc3b14610226578063dba251611461022f578063fc0c546a1461023e57600080fd5b80634efa82b6146101c25780635a7ff7c5146101d55780639a99916f146101e8578063afd2c260146101fc57600080fd5b80630f4ef8a6116100d35780630f4ef8a61461014457806310e23da41461016f57806320686c2a146101845780633e0dc34e1461019757600080fd5b806301ffc9a7146100fa57806306fdde03146101225780630effe8b514610137575b600080fd5b61010d610108366004610866565b61024f565b60405190151581526020015b60405180910390f35b61012a610286565b60405161011991906108bb565b60055461010d9060ff1681565b600054610157906001600160a01b031681565b6040516001600160a01b039091168152602001610119565b61018261017d3660046108ff565b610314565b005b600754610157906001600160a01b031681565b6001546101aa906001600160801b031681565b6040516001600160801b039091168152602001610119565b600254610157906001600160a01b031681565b6101826101e336600461094d565b6103d8565b6101826101f63660046109c9565b50505050565b61020560065481565b604051908152602001610119565b61010d610221366004610a16565b6105df565b61020560045481565b610205670de0b6b3a764000081565b6002546001600160a01b0316610157565b60006001600160e01b03198216632c927f3d60e21b148061028057506001600160e01b031982166301ffc9a760e01b145b92915050565b6003805461029390610a76565b80601f01602080910402602001604051908101604052809291908181526020018280546102bf90610a76565b801561030c5780601f106102e15761010080835404028352916020019161030c565b820191906000526020600020905b8154815290600101906020018083116102ef57829003601f168201915b505050505081565b600054600154604051635deebe2d60e11b81526001600160801b0390911660048201526001600160a01b039091169063bbdd7c5a90602401602060405180830381865afa158015610369573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038d9190610ab0565b6001600160a01b0316336001600160a01b0316146103c55760405163472511eb60e11b81523360048201526024015b60405180910390fd5b6005805460ff1916911515919091179055565b6103e06106dd565b6001546001600160801b0386811691161461040e57604051634bab873760e11b81526004016103bc90610acd565b600454600090610426670de0b6b3a764000086610b45565b6104309190610b72565b60008054604051635a7ff7c560e01b81526001600160801b038a1660048201526001600160a01b0389811660248301526044820185905267ffffffffffffffff8816606483015263ffffffff8716608483015293945091921690635a7ff7c59060a4016020604051808303816000875af11580156104b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d69190610b86565b905060006104eb670de0b6b3a764000061070c565b6104f660045461070c565b6105009084610b9f565b61050a9190610bcf565b905061053581610526886006546105219190610bfd565b61070c565b6105309190610c10565b61073a565b6006556002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a59190610b86565b90508060065411156105d457604051634787a10360e11b815260048101889052602481018290526044016103bc565b505050505050505050565b60055460009060ff16156105f5575060006106d4565b6000546001600160a01b031633146106225760405163472511eb60e11b81523360048201526024016103bc565b6001546001600160801b0386811691161461065057604051634bab873760e11b81526004016103bc90610acd565b6000670de0b6b3a7640000600454846106699190610b45565b6106739190610b72565b90506006548111156106a65760065460405163a1b1d25960e01b81526103bc918391600401918252602082015260400190565b806006546106b49190610c37565b6006556002546106ce906001600160a01b0316858361075d565b60019150505b95945050505050565b6007546001600160a01b0316331461070a5760405163472511eb60e11b81523360048201526024016103bc565b565b60006001600160ff1b038211156107365760405163677c430560e11b815260040160405180910390fd5b5090565b6000808212156107365760405163029f024d60e31b815260040160405180910390fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916107b99190610c4a565b6000604051808303816000865af19150503d80600081146107f6576040519150601f19603f3d011682016040523d82523d6000602084013e6107fb565b606091505b509150915081158061082957508051158015906108295750808060200190518101906108279190610c66565b155b1561085f57604051633210e1d960e01b81523060048201526001600160a01b0385166024820152604481018490526064016103bc565b5050505050565b60006020828403121561087857600080fd5b81356001600160e01b03198116811461089057600080fd5b9392505050565b60005b838110156108b257818101518382015260200161089a565b50506000910152565b60208152600082518060208401526108da816040850160208701610897565b601f01601f19169190910160400192915050565b80151581146108fc57600080fd5b50565b60006020828403121561091157600080fd5b8135610890816108ee565b80356001600160801b038116811461093357600080fd5b919050565b6001600160a01b03811681146108fc57600080fd5b600080600080600060a0868803121561096557600080fd5b61096e8661091c565b9450602086013561097e81610938565b935060408601359250606086013567ffffffffffffffff811681146109a257600080fd5b9150608086013563ffffffff811681146109bb57600080fd5b809150509295509295909350565b600080600080608085870312156109df57600080fd5b6109e88561091c565b93506109f66020860161091c565b92506040850135610a0681610938565b9396929550929360600135925050565b600080600080600060a08688031215610a2e57600080fd5b610a378661091c565b9450610a456020870161091c565b93506040860135610a5581610938565b92506060860135610a6581610938565b949793965091946080013592915050565b600181811c90821680610a8a57607f821691505b602082108103610aaa57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215610ac257600080fd5b815161089081610938565b6040808252600690820152651c1bdbdb125960d21b60608201526080602082018190526024908201527f506f6f6c20646f6573206e6f74206d617463682074686520726577617264732060a0820152631c1bdbdb60e21b60c082015260e00190565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761028057610280610b2f565b634e487b7160e01b600052601260045260246000fd5b600082610b8157610b81610b5c565b500490565b600060208284031215610b9857600080fd5b5051919050565b80820260008212600160ff1b84141615610bbb57610bbb610b2f565b818105831482151761028057610280610b2f565b600082610bde57610bde610b5c565b600160ff1b821460001984141615610bf857610bf8610b2f565b500590565b8082018082111561028057610280610b2f565b8181036000831280158383131683831282161715610c3057610c30610b2f565b5092915050565b8181038181111561028057610280610b2f565b60008251610c5c818460208701610897565b9190910192915050565b600060208284031215610c7857600080fd5b8151610890816108ee56fea2646970667358221220c3f88c64faf6be29144dee9e9978e8d9f0ab66087fc38d1ac1d26cc3a64dd06064736f6c63430008190033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.