ETH Price: $2,269.48 (-6.24%)
Gas: 0.05 GWei

Contract

0x1E1aBC5aFFA2FadBDf8c10CfA4C432E6f6B674De

Overview

ETH Balance

Scroll LogoScroll LogoScroll Logo0 ETH

ETH Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...69130162024-06-26 22:59:5481 days ago1719442794IN
0x1E1aBC5a...6f6B674De
0 ETH0.000008160.2515
0x6080604069129792024-06-26 22:58:0381 days ago1719442683IN
 Create: StakingConfig
0 ETH0.000146220.2515

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakingConfig

Compiler Version
v0.8.22+commit.4fc1097e

Optimization Enabled:
Yes with 10000 runs

Other Settings:
paris EvmVersion
File 1 of 4 : StakingConfig.sol
// SPDX-License-Identifier: BUSL 1.1
pragma solidity =0.8.22;

import "openzeppelin-contracts/contracts/access/Ownable.sol";
import "./interfaces/IStakingConfig.sol";


// Contract owned by the DAO with parameters modifiable only by the DAO
contract StakingConfig is IStakingConfig, Ownable
    {
    event MinUnstakeWeeksChanged(uint256 newMinUnstakeWeeks);
    event MaxUnstakeWeeksChanged(uint256 newMaxUnstakeWeeks);
    event MinUnstakePercentChanged(uint256 newMinUnstakePercent);
    event ModificationCooldownChanged(uint256 newModificationCooldown);

    // The minimum number of weeks for an unstake request at which point minUnstakePercent of the original staked ZERO tokens is reclaimable.
	// Range: 2 to 12 with an adjustment of 1
	uint256 public minUnstakeWeeks = 2;  // minUnstakePercent returned for unstaking this number of weeks

	// The maximum number of weeks for an unstake request at which point 100% of the original staked ZERO tokens is reclaimable.
	// Range: 20 to 108 with an adjustment of 8
	uint256 public maxUnstakeWeeks = 52;

	// The percentage of the original staked ZERO tokens that is reclaimable when unstaking the minimum number of weeks.
	// Range: 10 to 50 with an adjustment of 5
	uint256 public minUnstakePercent = 20;

	// Minimum time between increasing and decreasing user share in SharedRewards contracts.
	// Prevents reward hunting where users could frontrun reward distributions and then immediately withdraw.
	// Range: 15 minutes to 6 hours with an adjustment of 15 minutes
	uint256 public modificationCooldown = 15 minutes;


	function changeMinUnstakeWeeks(bool increase) external onlyOwner
        {
        if (increase)
            {
            if (minUnstakeWeeks < 12)
                minUnstakeWeeks += 1;
            }
        else
            {
            if (minUnstakeWeeks > 2)
                minUnstakeWeeks -= 2;
            }

		emit MinUnstakeWeeksChanged(minUnstakeWeeks);
        }


	function changeMaxUnstakeWeeks(bool increase) external onlyOwner
        {
        if (increase)
            {
            if (maxUnstakeWeeks < 108)
                maxUnstakeWeeks += 8;
            }
        else
            {
            if (maxUnstakeWeeks > 20)
                maxUnstakeWeeks -= 8;
            }

		emit MaxUnstakeWeeksChanged(maxUnstakeWeeks);
        }


	function changeMinUnstakePercent(bool increase) external onlyOwner
        {
        if (increase)
            {
            if (minUnstakePercent < 50)
                minUnstakePercent += 5;
            }
        else
            {
            if (minUnstakePercent > 10)
                minUnstakePercent -= 5;
            }

		emit MinUnstakePercentChanged(minUnstakePercent);
        }


	function changeModificationCooldown(bool increase) external onlyOwner
        {
        if (increase)
            {
            if (modificationCooldown < 6 hours)
                modificationCooldown += 15 minutes;
            }
        else
            {
            if (modificationCooldown > 15 minutes)
                modificationCooldown -= 15 minutes;
            }

		emit ModificationCooldownChanged(modificationCooldown);
        }
    }

File 2 of 4 : 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 4 : IStakingConfig.sol
// SPDX-License-Identifier: BUSL 1.1
pragma solidity =0.8.22;


interface IStakingConfig
	{
	function changeMinUnstakeWeeks(bool increase) external; // onlyOwner
	function changeMaxUnstakeWeeks(bool increase) external; // onlyOwner
	function changeMinUnstakePercent(bool increase) external; // onlyOwner
	function changeModificationCooldown(bool increase) external; // onlyOwner

	// Views
    function minUnstakeWeeks() external view returns (uint256);
    function maxUnstakeWeeks() external view returns (uint256);
    function minUnstakePercent() external view returns (uint256);
    function modificationCooldown() external view returns (uint256);
	}

File 4 of 4 : 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;
    }
}

Settings
{
  "remappings": [
    "chainlink/=lib/chainlink/",
    "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/openzeppelin-contracts/lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/",
    "v3-core/=lib/v3-core/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 10000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxUnstakeWeeks","type":"uint256"}],"name":"MaxUnstakeWeeksChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMinUnstakePercent","type":"uint256"}],"name":"MinUnstakePercentChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMinUnstakeWeeks","type":"uint256"}],"name":"MinUnstakeWeeksChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newModificationCooldown","type":"uint256"}],"name":"ModificationCooldownChanged","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":[{"internalType":"bool","name":"increase","type":"bool"}],"name":"changeMaxUnstakeWeeks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"increase","type":"bool"}],"name":"changeMinUnstakePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"increase","type":"bool"}],"name":"changeMinUnstakeWeeks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"increase","type":"bool"}],"name":"changeModificationCooldown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxUnstakeWeeks","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minUnstakePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minUnstakeWeeks","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"modificationCooldown","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405260026001556034600255601460035561038460045534801561002557600080fd5b5061002f33610034565b610084565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610692806100936000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c8063715018a61161008157806390d609651161005b57806390d60965146101715780639852e4191461017a578063f2fde38b1461018357600080fd5b8063715018a61461012e5780638383269e146101365780638da5cb5b1461014957600080fd5b80631d370380116100b25780631d370380146100f65780632c3fe7371461011257806340cf22741461012557600080fd5b80630f80c7c2146100ce57806315935df9146100e3575b600080fd5b6100e16100dc3660046105a2565b610196565b005b6100e16100f13660046105a2565b61022f565b6100ff60025481565b6040519081526020015b60405180910390f35b6100e16101203660046105a2565b6102bd565b6100ff60035481565b6100e161034a565b6100e16101443660046105a2565b61035e565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610109565b6100ff60015481565b6100ff60045481565b6100e16101913660046105cb565b6103f0565b61019e6104ac565b80156101cd57606c60025410156101c8576008600260008282546101c29190610630565b90915550505b6101f1565b601460025411156101f1576008600260008282546101eb9190610649565b90915550505b7ff9ef5147a134cae002adbde84194c8fd999b2a10b98fc249a366989d3184bf6760025460405161022491815260200190565b60405180910390a150565b6102376104ac565b801561026657603260035410156102615760056003600082825461025b9190610630565b90915550505b61028a565b600a600354111561028a576005600360008282546102849190610649565b90915550505b7f207bb0e1af4496665645ec109f5844c11cee374785b4aa4ee530613bc689ca6a60035460405161022491815260200190565b6102c56104ac565b80156102f357600c60015410156102ee5760018060008282546102e89190610630565b90915550505b610317565b60026001541115610317576002600160008282546103119190610649565b90915550505b7fad48b55cce5d7a822f73c38437dfdaad98872abd21e19b258f765e14c8a85da260015460405161022491815260200190565b6103526104ac565b61035c600061052d565b565b6103666104ac565b8015610397576154606004541015610392576103846004600082825461038c9190610630565b90915550505b6103bd565b61038460045411156103bd57610384600460008282546103b79190610649565b90915550505b7f7966c3c050d8852755f54fc4115429391c2ac1b973f9da1c9ec00b69f3529e6e60045460405161022491815260200190565b6103f86104ac565b73ffffffffffffffffffffffffffffffffffffffff81166104a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6104a98161052d565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331461035c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610497565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156105b457600080fd5b813580151581146105c457600080fd5b9392505050565b6000602082840312156105dd57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146105c457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561064357610643610601565b92915050565b818103818111156106435761064361060156fea2646970667358221220209230627a0d6d16fb4084413242010bb7f43d2e74439ecdff083f9cc49ecebf64736f6c63430008160033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100c95760003560e01c8063715018a61161008157806390d609651161005b57806390d60965146101715780639852e4191461017a578063f2fde38b1461018357600080fd5b8063715018a61461012e5780638383269e146101365780638da5cb5b1461014957600080fd5b80631d370380116100b25780631d370380146100f65780632c3fe7371461011257806340cf22741461012557600080fd5b80630f80c7c2146100ce57806315935df9146100e3575b600080fd5b6100e16100dc3660046105a2565b610196565b005b6100e16100f13660046105a2565b61022f565b6100ff60025481565b6040519081526020015b60405180910390f35b6100e16101203660046105a2565b6102bd565b6100ff60035481565b6100e161034a565b6100e16101443660046105a2565b61035e565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610109565b6100ff60015481565b6100ff60045481565b6100e16101913660046105cb565b6103f0565b61019e6104ac565b80156101cd57606c60025410156101c8576008600260008282546101c29190610630565b90915550505b6101f1565b601460025411156101f1576008600260008282546101eb9190610649565b90915550505b7ff9ef5147a134cae002adbde84194c8fd999b2a10b98fc249a366989d3184bf6760025460405161022491815260200190565b60405180910390a150565b6102376104ac565b801561026657603260035410156102615760056003600082825461025b9190610630565b90915550505b61028a565b600a600354111561028a576005600360008282546102849190610649565b90915550505b7f207bb0e1af4496665645ec109f5844c11cee374785b4aa4ee530613bc689ca6a60035460405161022491815260200190565b6102c56104ac565b80156102f357600c60015410156102ee5760018060008282546102e89190610630565b90915550505b610317565b60026001541115610317576002600160008282546103119190610649565b90915550505b7fad48b55cce5d7a822f73c38437dfdaad98872abd21e19b258f765e14c8a85da260015460405161022491815260200190565b6103526104ac565b61035c600061052d565b565b6103666104ac565b8015610397576154606004541015610392576103846004600082825461038c9190610630565b90915550505b6103bd565b61038460045411156103bd57610384600460008282546103b79190610649565b90915550505b7f7966c3c050d8852755f54fc4115429391c2ac1b973f9da1c9ec00b69f3529e6e60045460405161022491815260200190565b6103f86104ac565b73ffffffffffffffffffffffffffffffffffffffff81166104a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6104a98161052d565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331461035c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610497565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156105b457600080fd5b813580151581146105c457600080fd5b9392505050565b6000602082840312156105dd57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146105c457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561064357610643610601565b92915050565b818103818111156106435761064361060156fea2646970667358221220209230627a0d6d16fb4084413242010bb7f43d2e74439ecdff083f9cc49ecebf64736f6c63430008160033

Block Transaction Gas Used Reward
view all blocks sequenced

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
[ 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.