ETH Price: $2,952.73 (+0.09%)
Gas: 0.06 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Method Block
From
To
0x6020610e219734882025-03-04 12:20:47325 days ago1741090847  Contract Creation0 ETH
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

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

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

Contract Name:
GateSeal

Compiler Version
vyper:0.3.7

Optimization Enabled:
N/A

Other Settings:
paris EvmVersion, GNU GPLv3 license

Contract Source Code (Vyper language format)

# @version 0.3.7

"""
@title GateSeal
@author mymphe
@notice A one-time panic button for pausable contracts
@dev GateSeal is an one-time immediate emergency pause for pausable contracts.
     It must be operated by a multisig committee, though the code does not
     perform any such checks. Bypassing the DAO vote, GateSeal pauses 
     the contract(s) immediately for a set duration, e.g. one week, which gives
     the DAO the time to analyze the situation, decide on the course of action,
     hold a vote, implement fixes, etc. GateSeal can only be used once.
     GateSeal assumes that they have the permission to pause the contracts.

     GateSeals are only a temporary solution and will be deprecated in the future,
     as it is undesireable for the protocol to rely on a multisig. This is why
     each GateSeal has an expiry date. Once expired, GateSeal is no longer
     usable and a new GateSeal must be set up with a new multisig committee. This
     works as a kind of difficulty bomb, a device that encourages the protocol
     to get rid of GateSeals sooner rather than later.

     In the context of GateSeals, sealing is synonymous with pausing the contracts,
     sealables are pausable contracts that implement `pauseFor(duration)` interface.
"""


event Sealed:
    gate_seal: address
    sealed_by: address
    sealed_for: uint256
    sealable: address
    sealed_at: uint256

interface IPausableUntil:
    def pauseFor(_duration: uint256): nonpayable
    def isPaused() -> bool: view

SECONDS_PER_DAY: constant(uint256) = 60 * 60 * 24

# The minimum allowed seal duration is 4 days. This is because it takes at least
# 3 days to pass and enact. Additionally, we want to include a 1-day padding.
MIN_SEAL_DURATION_DAYS: constant(uint256) = 4
MIN_SEAL_DURATION_SECONDS: constant(uint256) = SECONDS_PER_DAY * MIN_SEAL_DURATION_DAYS

# The maximum allowed seal duration is 14 days.
# Anything higher than that may be too long of a disruption for the protocol.
# Keep in mind, that the DAO still retains the ability to resume the contracts
# (or, in the GateSeal terms, "break the seal") prematurely.
MAX_SEAL_DURATION_DAYS: constant(uint256) = 14
MAX_SEAL_DURATION_SECONDS: constant(uint256) = SECONDS_PER_DAY * MAX_SEAL_DURATION_DAYS

# The maximum number of sealables is 8.
# GateSeals were originally designed to pause WithdrawalQueue and ValidatorExitBus,
# however, there is a non-zero chance that there might be more in the future, which
# is why we've opted to use a dynamic-size array.
MAX_SEALABLES: constant(uint256) = 8

# The maximum GateSeal expiry duration is 1 year.
MAX_EXPIRY_PERIOD_DAYS: constant(uint256) = 365
MAX_EXPIRY_PERIOD_SECONDS: constant(uint256) = SECONDS_PER_DAY * MAX_EXPIRY_PERIOD_DAYS

# To simplify the code, we chose not to implement committees in GateSeals.
# Instead, GateSeals are operated by a single account which must be a multisig.
# The code does not perform any such checks but we pinky-promise that
# the sealing committee will always be a multisig. 
SEALING_COMMITTEE: immutable(address)

# The duration of the seal in seconds. This period cannot exceed 14 days. 
# The DAO may decide to resume the contracts prematurely via the DAO voting process.
SEAL_DURATION_SECONDS: immutable(uint256)

# The addresses of pausable contracts. The gate seal must have the permission to
# pause these contracts at the time of the sealing.
# Sealing can be partial, meaning the committee may decide to pause only a subset of this list,
# though GateSeal will still expire immediately.
sealables: DynArray[address, MAX_SEALABLES]

# A unix epoch timestamp starting from which GateSeal is completely unusable
# and a new GateSeal will have to be set up. This timestamp will be changed
# upon sealing to expire GateSeal immediately which will revert any consecutive sealings.
expiry_timestamp: uint256


@external
def __init__(
    _sealing_committee: address,
    _seal_duration_seconds: uint256,
    _sealables: DynArray[address, MAX_SEALABLES],
    _expiry_timestamp: uint256
):
    assert _sealing_committee != empty(address), "sealing committee: zero address"
    assert _seal_duration_seconds >= MIN_SEAL_DURATION_SECONDS, "seal duration: too short"
    assert _seal_duration_seconds <= MAX_SEAL_DURATION_SECONDS, "seal duration: exceeds max"
    assert len(_sealables) > 0, "sealables: empty list"
    assert _expiry_timestamp > block.timestamp, "expiry timestamp: must be in the future"
    assert _expiry_timestamp <= block.timestamp + MAX_EXPIRY_PERIOD_SECONDS, "expiry timestamp: exceeds max expiry period"
    for sealable in _sealables:
        assert sealable != empty(address), "sealables: includes zero address"
    assert not self._has_duplicates(_sealables), "sealables: includes duplicates"

    SEALING_COMMITTEE = _sealing_committee
    SEAL_DURATION_SECONDS = _seal_duration_seconds
    self.sealables = _sealables
    self.expiry_timestamp = _expiry_timestamp


@external
@view
def get_sealing_committee() -> address:
    return SEALING_COMMITTEE


@external
@view
def get_seal_duration_seconds() -> uint256:
    return SEAL_DURATION_SECONDS


@external
@view
def get_sealables() -> DynArray[address, MAX_SEALABLES]:
    return self.sealables


@external
@view
def get_expiry_timestamp() -> uint256:
    return self.expiry_timestamp


@external
@view
def is_expired() -> bool:
    return self._is_expired()


@external
def seal(_sealables: DynArray[address, MAX_SEALABLES]):
    """
    @notice Seal the contract(s).
    @dev    Immediately expires GateSeal and, thus, can only be called once.
    @param _sealables a list of sealables to seal; may include all or only a subset.
    """
    assert msg.sender == SEALING_COMMITTEE, "sender: not SEALING_COMMITTEE"
    assert not self._is_expired(), "gate seal: expired"
    assert len(_sealables) > 0, "sealables: empty subset"
    assert not self._has_duplicates(_sealables), "sealables: includes duplicates"

    self._expire_immediately()

    # Instead of reverting the transaction as soon as one of the sealables fails,
    # we iterate through the entire list and collect the indexes of those that failed
    # and report them in the dynamically-generated error message.
    # This will make it easier for us to debug in a hectic situation.
    failed_indexes: DynArray[uint256, MAX_SEALABLES] = []
    sealable_index: uint256 = 0

    for sealable in _sealables:
        assert sealable in self.sealables, "sealables: includes a non-sealable"

        success: bool = False
        response: Bytes[32] = b""

        # using `raw_call` to catch external revert and continue execution
        # capturing `response` to keep the compiler from acting out but will not be checking it
        # as different sealables may return different values if anything at all
        # for details, see https://docs.vyperlang.org/en/stable/built-in-functions.html#raw_call
        success, response = raw_call(
            sealable,
            _abi_encode(SEAL_DURATION_SECONDS, method_id=method_id("pauseFor(uint256)")),
            max_outsize=32,
            revert_on_failure=False
        )
        
        if success and IPausableUntil(sealable).isPaused():
            log Sealed(self, SEALING_COMMITTEE, SEAL_DURATION_SECONDS, sealable, block.timestamp)
        else:
            failed_indexes.append(sealable_index)
    
        sealable_index += 1

    assert len(failed_indexes) == 0, self._to_error_string(failed_indexes)


@internal
@view
def _is_expired() -> bool:
    return block.timestamp >= self.expiry_timestamp


@internal
def _expire_immediately():
    self.expiry_timestamp = block.timestamp


@internal
@pure
def _has_duplicates(_sealables: DynArray[address, MAX_SEALABLES]) -> bool:
    """
    @notice checks the list for duplicates 
    @param  _sealables list of addresses to check
    """
    unique: DynArray[address, MAX_SEALABLES] = []

    for sealable in _sealables:
        if sealable in unique:
            return True
        unique.append(sealable)

    return False


@internal
@pure
def _to_error_string(_failed_indexes: DynArray[uint256, MAX_SEALABLES]) -> String[78]:
    """
    @notice converts a list of indexes into an error message to faciliate debugging
    @dev    The indexes in the error message are given in the descending order to avoid
            losing leading zeros when casting to string,

            e.g. [0, 2, 3, 6] -> "6320"
    @param _failed_indexes a list of sealable indexes that failed to seal 
    """
    indexes_as_decimal: uint256 = 0
    loop_index: uint256 = 0

    # convert failed indexes to a decimal representation
    for failed_index in _failed_indexes:
        indexes_as_decimal += failed_index * 10 ** loop_index
        loop_index += 1

    # generate error message with indexes as a decimal string
    # return type of `uint2str` is String[78] because 2^256 has 78 digits
    error_message: String[78] = uint2str(indexes_as_decimal)

    return error_message

Contract Security Audit

Contract ABI

API
[{"name":"Sealed","inputs":[{"name":"gate_seal","type":"address","indexed":false},{"name":"sealed_by","type":"address","indexed":false},{"name":"sealed_for","type":"uint256","indexed":false},{"name":"sealable","type":"address","indexed":false},{"name":"sealed_at","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_sealing_committee","type":"address"},{"name":"_seal_duration_seconds","type":"uint256"},{"name":"_sealables","type":"address[]"},{"name":"_expiry_timestamp","type":"uint256"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"get_sealing_committee","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"get_seal_duration_seconds","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_sealables","inputs":[],"outputs":[{"name":"","type":"address[]"}]},{"stateMutability":"view","type":"function","name":"get_expiry_timestamp","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"is_expired","inputs":[],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"seal","inputs":[{"name":"_sealables","type":"address[]"}],"outputs":[]}]

0x6020610e7f6000396000518060a01c610e7a576102c0526020610ebf6000396000516008602082610e7f0160003960005111610e7a57602081610e7f01600039600051806102e05260008160088111610e7a57801561008b57905b60208160051b6020860101610e7f016000396000518060a01c610e7a578160051b610300015260010181811861005a575b5050505034610e7a576102c05161010257601f610400527f7365616c696e6720636f6d6d69747465653a207a65726f2061646472657373006104205261040050610400518061042001601f826000031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b620546006020610e9f600039600051101561017d576018610400527f7365616c206475726174696f6e3a20746f6f2073686f727400000000000000006104205261040050610400518061042001601f826000031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b621275006020610e9f60003960005111156101f857601a610400527f7365616c206475726174696f6e3a2065786365656473206d61780000000000006104205261040050610400518061042001601f826000031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b6102e051610266576015610400527f7365616c61626c65733a20656d707479206c69737400000000000000000000006104205261040050610400518061042001601f826000031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b426020610edf60003960005111610302576027610400527f6578706972792074696d657374616d703a206d75737420626520696e20746865610420527f20667574757265000000000000000000000000000000000000000000000000006104405261040050610400518061042001601f826000031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b426301e133808101818110610e7a5790506020610edf60003960005111156103af57602b610400527f6578706972792074696d657374616d703a2065786365656473206d6178206578610420527f7069727920706572696f640000000000000000000000000000000000000000006104405261040050610400518061042001601f826000031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b60006102e05160088111610e7a57801561044b57905b8060051b61030001516104005261040051610440576020610420527f7365616c61626c65733a20696e636c75646573207a65726f20616464726573736104405261042050610420518061044001601f826000031636823750506308c379a06103e052602061040052601f19601f6104205101166044016103fcfd5b6001018181186103c5575b50506102e051806040528060051b8060608261030060045afa505050610472610400610dbe565b61040051156104e157601e610420527f7365616c61626c65733a20696e636c75646573206475706c69636174657300006104405261042050610420518061044001601f826000031636823750506308c379a06103e052602061040052601f19601f6104205101166044016103fcfd5b6102c051610864526020610e9f600039600051610884526102e051806000558060051b600081601f0160051c60088111610e7a57801561053657905b8060051b6103000151816001015560010181811861051d575b505050506020610edf60003960005160095561086461055a610000396108a4610000f36003361161000c5761065d565b60003560e01c34610852576363832d70811861003e576004361061085257602061086460003960005160405260206040f35b636c7857ba8118610065576004361061085257602061088460003960005160405260206040f35b63a9e1036a81186100cf5760043610610852576020806040528060400160006000548083528060051b600082600881116108525780156100bb57905b80600101548160051b6020880101526001018181186100a1575b505082016020019150509050810190506040f35b632673efe881186100ee57600436106108525760095460405260206040f35b63ac9371688118610111576004361061085257602061010d604061071f565b6040f35b63fc20bdfe811861065b5760443610610852576004356004016008813511610852578035806102c0526000816008811161085257801561017357905b8060051b6020850101358060a01c610852578160051b6102e0015260010181811861014d575b5050505060206108646000396000513318156101ef57601d6103e0527f73656e6465723a206e6f74205345414c494e475f434f4d4d4954544545000000610400526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b6101fa6103e061071f565b6103e05115610269576012610400527f67617465207365616c3a206578706972656400000000000000000000000000006104205261040050610400518061042001601f826000031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b6102c0516102d75760176103e0527f7365616c61626c65733a20656d70747920737562736574000000000000000000610400526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b6102c051806040528060051b806060826102e060045afa5050506102fc6103e0610663565b6103e0511561036b57601e610400527f7365616c61626c65733a20696e636c75646573206475706c69636174657300006104205261040050610400518061042001601f826000031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b61037361072a565b60006103e05260006105005260006102c051600881116108525780156105ee57905b8060051b6102e0015161052052610520516000610540526000600054600881116108525780156103e257905b806001015483186103d7576001610540526103e2565b6001018181186103c1575b5050610540519050610479576022610560527f7365616c61626c65733a20696e636c756465732061206e6f6e2d7365616c6162610580527f6c650000000000000000000000000000000000000000000000000000000000006105a05261056050610560518061058001601f826000031636823750506308c379a061052052602061054052601f19601f61056051011660440161053cfd5b60006105405260006105a0526105a080518061056052505063f3f449c76105a452600460206108846000396000516105c4526020016105a0526105a05060206106206105a0516105c06000610520515af1610540523d602081183d60201002186106005261060080518061056052602082018051610580525050506105405161050357600061054b565b6105205163b187bd266105a05260206105a060046105bc845afa61052c573d600060003e3d6000fd5b60203d10610852576105a0518060011c610852576105e0526105e09050515b610576576103e0516007811161085257600181016103e052610500518160051b6104000152506105ce565b7fdcaf16c65373c6dd97289f5707c92abd53c1d008abe87bea2db1854d387ecdc630610600526020610864600039600051610620526020610884600039600051610640526105205161066052426106805260a0610600a15b610500516001810181811061085257905061050052600101818118610395575b50506103e05115610659576103e051806040528060051b8060608261040060045afa50505061061e610520610730565b61052050610520518061054001601f826000031636823750506308c379a06104e052602061050052601f19601f6105205101166044016104fcfd5b005b505b60006000fd5b60006101605260006040516008811161085257801561071557905b8060051b60600151610280526102805160006102a052600061016051600881116108525780156106cf57905b8060051b610180015183186106c45760016102a0526106cf565b6001018181186106aa575b50506102a0519050156106e8576001835250505061071d565b6101605160078111610852576001810161016052610280518160051b61018001525060010181811861067e575b505060008152505b565b600954421015815250565b42600955565b604036610160376000604051600881116108525780156107b857905b8060051b606001516101a052610160516101a05161018051604d81116108525780600a0a9050808202811583838304141715610852579050905080820182811061085257905090506101605261018051600181018181106108525790506101805260010181811861074c575b505061016051806107d75760306102215260016102205261022061081c565b6000604f905b826107f957808161026e03528061026e0392506108185661080d565b600a83066030018161026e0352600a830492505b6001018181186107dd575b5050805b90508051806101a05260208201816101c0838360045afa505050506101a051808252602082018181836101c060045afa50505050565b600080fda165767970657283000307000b5b600061016052600060405160088111610e7a578015610e7057905b8060051b60600151610280526102805160006102a05260006101605160088111610e7a578015610e2a57905b8060051b61018001518318610e1f5760016102a052610e2a565b600101818118610e05575b50506102a051905015610e435760018352505050610e78565b6101605160078111610e7a576001810161016052610280518160051b610180015250600101818118610dd9575b505060008152505b565b600080fd0000000000000000000000008772e3a2d86b9347a2688f9bc1808a6d8917760c00000000000000000000000000000000000000000000000000000000000e808000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000069a381800000000000000000000000000000000000000000000000000000000000000002000000000000000000000000889edc2edab5f40e902b864ad4d7ade8e412f9b10000000000000000000000000de4ea0184c2ad0baca7183356aea5b8d5bf5c6e

Deployed Bytecode

0x6003361161000c5761065d565b60003560e01c34610852576363832d70811861003e576004361061085257602061086460003960005160405260206040f35b636c7857ba8118610065576004361061085257602061088460003960005160405260206040f35b63a9e1036a81186100cf5760043610610852576020806040528060400160006000548083528060051b600082600881116108525780156100bb57905b80600101548160051b6020880101526001018181186100a1575b505082016020019150509050810190506040f35b632673efe881186100ee57600436106108525760095460405260206040f35b63ac9371688118610111576004361061085257602061010d604061071f565b6040f35b63fc20bdfe811861065b5760443610610852576004356004016008813511610852578035806102c0526000816008811161085257801561017357905b8060051b6020850101358060a01c610852578160051b6102e0015260010181811861014d575b5050505060206108646000396000513318156101ef57601d6103e0527f73656e6465723a206e6f74205345414c494e475f434f4d4d4954544545000000610400526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b6101fa6103e061071f565b6103e05115610269576012610400527f67617465207365616c3a206578706972656400000000000000000000000000006104205261040050610400518061042001601f826000031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b6102c0516102d75760176103e0527f7365616c61626c65733a20656d70747920737562736574000000000000000000610400526103e0506103e0518061040001601f826000031636823750506308c379a06103a05260206103c052601f19601f6103e05101166044016103bcfd5b6102c051806040528060051b806060826102e060045afa5050506102fc6103e0610663565b6103e0511561036b57601e610400527f7365616c61626c65733a20696e636c75646573206475706c69636174657300006104205261040050610400518061042001601f826000031636823750506308c379a06103c05260206103e052601f19601f6104005101166044016103dcfd5b61037361072a565b60006103e05260006105005260006102c051600881116108525780156105ee57905b8060051b6102e0015161052052610520516000610540526000600054600881116108525780156103e257905b806001015483186103d7576001610540526103e2565b6001018181186103c1575b5050610540519050610479576022610560527f7365616c61626c65733a20696e636c756465732061206e6f6e2d7365616c6162610580527f6c650000000000000000000000000000000000000000000000000000000000006105a05261056050610560518061058001601f826000031636823750506308c379a061052052602061054052601f19601f61056051011660440161053cfd5b60006105405260006105a0526105a080518061056052505063f3f449c76105a452600460206108846000396000516105c4526020016105a0526105a05060206106206105a0516105c06000610520515af1610540523d602081183d60201002186106005261060080518061056052602082018051610580525050506105405161050357600061054b565b6105205163b187bd266105a05260206105a060046105bc845afa61052c573d600060003e3d6000fd5b60203d10610852576105a0518060011c610852576105e0526105e09050515b610576576103e0516007811161085257600181016103e052610500518160051b6104000152506105ce565b7fdcaf16c65373c6dd97289f5707c92abd53c1d008abe87bea2db1854d387ecdc630610600526020610864600039600051610620526020610884600039600051610640526105205161066052426106805260a0610600a15b610500516001810181811061085257905061050052600101818118610395575b50506103e05115610659576103e051806040528060051b8060608261040060045afa50505061061e610520610730565b61052050610520518061054001601f826000031636823750506308c379a06104e052602061050052601f19601f6105205101166044016104fcfd5b005b505b60006000fd5b60006101605260006040516008811161085257801561071557905b8060051b60600151610280526102805160006102a052600061016051600881116108525780156106cf57905b8060051b610180015183186106c45760016102a0526106cf565b6001018181186106aa575b50506102a0519050156106e8576001835250505061071d565b6101605160078111610852576001810161016052610280518160051b61018001525060010181811861067e575b505060008152505b565b600954421015815250565b42600955565b604036610160376000604051600881116108525780156107b857905b8060051b606001516101a052610160516101a05161018051604d81116108525780600a0a9050808202811583838304141715610852579050905080820182811061085257905090506101605261018051600181018181106108525790506101805260010181811861074c575b505061016051806107d75760306102215260016102205261022061081c565b6000604f905b826107f957808161026e03528061026e0392506108185661080d565b600a83066030018161026e0352600a830492505b6001018181186107dd575b5050805b90508051806101a05260208201816101c0838360045afa505050506101a051808252602082018181836101c060045afa50505050565b600080fda165767970657283000307000b0000000000000000000000008772e3a2d86b9347a2688f9bc1808a6d8917760c00000000000000000000000000000000000000000000000000000000000e8080

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