Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 1 from a total of 1 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Deploy | 22437211 | 170 days ago | IN | 0 ETH | 0.02611051 |
Latest 13 internal transactions
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
To
|
|||
|---|---|---|---|---|---|---|---|
| 0x61020060 | 22437211 | 170 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22437211 | 170 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22437211 | 170 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22437211 | 170 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22437211 | 170 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22437211 | 170 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22437211 | 170 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22437211 | 170 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22437211 | 170 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22437211 | 170 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22437211 | 170 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22437211 | 170 days ago | Contract Creation | 0 ETH | |||
| 0x61012060 | 22437209 | 170 days ago | Contract Creation | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x026b2F15...A4b6A7B76 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
OPContractsManager
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 5000 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
// Libraries
import { Blueprint } from "src/libraries/Blueprint.sol";
import { Constants } from "src/libraries/Constants.sol";
import { Bytes } from "src/libraries/Bytes.sol";
import { Claim, Hash, Duration, GameType, GameTypes, OutputRoot } from "src/dispute/lib/Types.sol";
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
// Interfaces
import { ISemver } from "interfaces/universal/ISemver.sol";
import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol";
import { IBigStepper } from "interfaces/dispute/IBigStepper.sol";
import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol";
import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol";
import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol";
import { IAddressManager } from "interfaces/legacy/IAddressManager.sol";
import { IProxyAdmin } from "interfaces/universal/IProxyAdmin.sol";
import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol";
import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol";
import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol";
import { IPermissionedDisputeGame } from "interfaces/dispute/IPermissionedDisputeGame.sol";
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
import { IProtocolVersions } from "interfaces/L1/IProtocolVersions.sol";
import { IOptimismPortal2 } from "interfaces/L1/IOptimismPortal2.sol";
import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol";
import { IL1CrossDomainMessenger } from "interfaces/L1/IL1CrossDomainMessenger.sol";
import { IL1ERC721Bridge } from "interfaces/L1/IL1ERC721Bridge.sol";
import { IL1StandardBridge } from "interfaces/L1/IL1StandardBridge.sol";
import { IOptimismMintableERC20Factory } from "interfaces/universal/IOptimismMintableERC20Factory.sol";
import { IHasSuperchainConfig } from "interfaces/L1/IHasSuperchainConfig.sol";
contract OPContractsManager is ISemver {
// -------- Structs --------
/// @notice Represents the roles that can be set when deploying a standard OP Stack chain.
struct Roles {
address opChainProxyAdminOwner;
address systemConfigOwner;
address batcher;
address unsafeBlockSigner;
address proposer;
address challenger;
}
/// @notice The full set of inputs to deploy a new OP Stack chain.
struct DeployInput {
Roles roles;
uint32 basefeeScalar;
uint32 blobBasefeeScalar;
uint256 l2ChainId;
// The correct type is OutputRoot memory but OP Deployer does not yet support structs.
bytes startingAnchorRoot;
// The salt mixer is used as part of making the resulting salt unique.
string saltMixer;
uint64 gasLimit;
// Configurable dispute game parameters.
GameType disputeGameType;
Claim disputeAbsolutePrestate;
uint256 disputeMaxGameDepth;
uint256 disputeSplitDepth;
Duration disputeClockExtension;
Duration disputeMaxClockDuration;
}
/// @notice The full set of outputs from deploying a new OP Stack chain.
struct DeployOutput {
IProxyAdmin opChainProxyAdmin;
IAddressManager addressManager;
IL1ERC721Bridge l1ERC721BridgeProxy;
ISystemConfig systemConfigProxy;
IOptimismMintableERC20Factory optimismMintableERC20FactoryProxy;
IL1StandardBridge l1StandardBridgeProxy;
IL1CrossDomainMessenger l1CrossDomainMessengerProxy;
// Fault proof contracts below.
IOptimismPortal2 optimismPortalProxy;
IDisputeGameFactory disputeGameFactoryProxy;
IAnchorStateRegistry anchorStateRegistryProxy;
IFaultDisputeGame faultDisputeGame;
IPermissionedDisputeGame permissionedDisputeGame;
IDelayedWETH delayedWETHPermissionedGameProxy;
IDelayedWETH delayedWETHPermissionlessGameProxy;
}
/// @notice Addresses of ERC-5202 Blueprint contracts. There are used for deploying full size
/// contracts, to reduce the code size of this factory contract. If it deployed full contracts
/// using the `new Proxy()` syntax, the code size would get large fast, since this contract would
/// contain the bytecode of every contract it deploys. Therefore we instead use Blueprints to
/// reduce the code size of this contract.
struct Blueprints {
address addressManager;
address proxy;
address proxyAdmin;
address l1ChugSplashProxy;
address resolvedDelegateProxy;
address permissionedDisputeGame1;
address permissionedDisputeGame2;
address permissionlessDisputeGame1;
address permissionlessDisputeGame2;
}
/// @notice The latest implementation contracts for the OP Stack.
struct Implementations {
address superchainConfigImpl;
address protocolVersionsImpl;
address l1ERC721BridgeImpl;
address optimismPortalImpl;
address systemConfigImpl;
address optimismMintableERC20FactoryImpl;
address l1CrossDomainMessengerImpl;
address l1StandardBridgeImpl;
address disputeGameFactoryImpl;
address anchorStateRegistryImpl;
address delayedWETHImpl;
address mipsImpl;
}
/// @notice The input required to identify a chain for upgrading, along with new prestate hashes
struct OpChainConfig {
ISystemConfig systemConfigProxy;
IProxyAdmin proxyAdmin;
Claim absolutePrestate;
}
struct AddGameInput {
string saltMixer;
ISystemConfig systemConfig;
IProxyAdmin proxyAdmin;
IDelayedWETH delayedWETH;
GameType disputeGameType;
Claim disputeAbsolutePrestate;
uint256 disputeMaxGameDepth;
uint256 disputeSplitDepth;
Duration disputeClockExtension;
Duration disputeMaxClockDuration;
uint256 initialBond;
IBigStepper vm;
bool permissioned;
}
struct AddGameOutput {
IDelayedWETH delayedWETH;
IFaultDisputeGame faultDisputeGame;
}
// -------- Constants and Variables --------
/// @custom:semver 1.6.0
function version() public pure virtual returns (string memory) {
return "1.6.0";
}
/// @notice Address of the SuperchainConfig contract shared by all chains.
ISuperchainConfig public immutable superchainConfig;
/// @notice Address of the ProtocolVersions contract shared by all chains.
IProtocolVersions public immutable protocolVersions;
/// @notice Address of the SuperchainProxyAdmin contract shared by all chains.
IProxyAdmin public immutable superchainProxyAdmin;
/// @notice L1 smart contracts release deployed by this version of OPCM. This is used in opcm to signal which
/// version of the L1 smart contracts is deployed. It takes the format of `op-contracts/vX.Y.Z`.
string internal L1_CONTRACTS_RELEASE;
/// @notice Addresses of the Blueprint contracts.
/// This is internal because if public the autogenerated getter method would return a tuple of
/// addresses, but we want it to return a struct.
Blueprints internal blueprint;
/// @notice Addresses of the latest implementation contracts.
Implementations internal implementation;
/// @notice The OPContractsManager contract that is currently being used. This is needed in the upgrade function
/// which is intended to be DELEGATECALLed.
OPContractsManager internal immutable thisOPCM;
/// @notice The address of the upgrade controller.
address public immutable upgradeController;
/// @notice Whether this is a release candidate.
bool public isRC = true;
/// @notice Returns the release string. Appends "-rc" if this is a release candidate.
function l1ContractsRelease() external view virtual returns (string memory) {
return isRC ? string.concat(L1_CONTRACTS_RELEASE, "-rc") : L1_CONTRACTS_RELEASE;
}
// -------- Events --------
/// @notice Emitted when a new OP Stack chain is deployed.
/// @param l2ChainId Chain ID of the new chain.
/// @param deployer Address that deployed the chain.
/// @param deployOutput ABI-encoded output of the deployment.
event Deployed(uint256 indexed l2ChainId, address indexed deployer, bytes deployOutput);
/// @notice Emitted when a chain is upgraded
/// @param systemConfig Address of the chain's SystemConfig contract
/// @param upgrader Address that initiated the upgrade
event Upgraded(uint256 indexed l2ChainId, ISystemConfig indexed systemConfig, address indexed upgrader);
/// @notice Emitted when a new game type is added to a chain
/// @param l2ChainId Chain ID of the chain
/// @param gameType Type of the game being
/// @param newDisputeGame Address of the deployed dispute game
/// @param oldDisputeGame Address of the old dispute game
event GameTypeAdded(
uint256 indexed l2ChainId, GameType indexed gameType, IDisputeGame newDisputeGame, IDisputeGame oldDisputeGame
);
// -------- Errors --------
/// @notice Thrown when an address other than the upgrade controller calls the setRC function.
error OnlyUpgradeController();
/// @notice Thrown when an address is the zero address.
error AddressNotFound(address who);
/// @notice Throw when a contract address has no code.
error AddressHasNoCode(address who);
/// @notice Thrown when a release version is already set.
error AlreadyReleased();
/// @notice Thrown when an invalid `l2ChainId` is provided to `deploy`.
error InvalidChainId();
/// @notice Thrown when a role's address is not valid.
error InvalidRoleAddress(string role);
/// @notice Thrown when the latest release is not set upon initialization.
error LatestReleaseNotSet();
/// @notice Thrown when the starting anchor root is not provided.
error InvalidStartingAnchorRoot();
/// @notice Thrown when certain methods are called outside of a DELEGATECALL.
error OnlyDelegatecall();
/// @notice Thrown when game configs passed to addGameType are invalid.
error InvalidGameConfigs();
/// @notice Thrown when the SuperchainConfig of the chain does not match the SuperchainConfig of this OPCM.
error SuperchainConfigMismatch(ISystemConfig systemConfig);
/// @notice Thrown when the SuperchainProxyAdmin does not match the SuperchainConfig's admin.
error SuperchainProxyAdminMismatch();
/// @notice Thrown when a prestate is not set for a game.
error PrestateNotSet();
// -------- Methods --------
constructor(
ISuperchainConfig _superchainConfig,
IProtocolVersions _protocolVersions,
IProxyAdmin _superchainProxyAdmin,
string memory _l1ContractsRelease,
Blueprints memory _blueprints,
Implementations memory _implementations,
address _upgradeController
) {
assertValidContractAddress(address(_superchainConfig));
assertValidContractAddress(address(_protocolVersions));
superchainConfig = _superchainConfig;
protocolVersions = _protocolVersions;
superchainProxyAdmin = _superchainProxyAdmin;
L1_CONTRACTS_RELEASE = _l1ContractsRelease;
blueprint = _blueprints;
implementation = _implementations;
thisOPCM = this;
upgradeController = _upgradeController;
}
function deploy(DeployInput calldata _input) external virtual returns (DeployOutput memory) {
assertValidInputs(_input);
uint256 l2ChainId = _input.l2ChainId;
string memory saltMixer = _input.saltMixer;
DeployOutput memory output;
// -------- Deploy Chain Singletons --------
// The AddressManager is used to store the implementation for the L1CrossDomainMessenger
// due to it's usage of the legacy ResolvedDelegateProxy.
output.addressManager = IAddressManager(
Blueprint.deployFrom(
blueprint.addressManager, computeSalt(l2ChainId, saltMixer, "AddressManager"), abi.encode()
)
);
// The ProxyAdmin is the owner of all proxies for the chain. We temporarily set the owner to
// this contract, and then transfer ownership to the specified owner at the end of deployment.
output.opChainProxyAdmin = IProxyAdmin(
Blueprint.deployFrom(
blueprint.proxyAdmin, computeSalt(l2ChainId, saltMixer, "ProxyAdmin"), abi.encode(address(this))
)
);
// Set the AddressManager on the ProxyAdmin.
output.opChainProxyAdmin.setAddressManager(output.addressManager);
// Transfer ownership of the AddressManager to the ProxyAdmin.
transferOwnership(address(output.addressManager), address(output.opChainProxyAdmin));
// -------- Deploy Proxy Contracts --------
// Deploy ERC-1967 proxied contracts.
output.l1ERC721BridgeProxy =
IL1ERC721Bridge(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "L1ERC721Bridge"));
output.optimismPortalProxy =
IOptimismPortal2(payable(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "OptimismPortal")));
output.systemConfigProxy =
ISystemConfig(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "SystemConfig"));
output.optimismMintableERC20FactoryProxy = IOptimismMintableERC20Factory(
deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "OptimismMintableERC20Factory")
);
output.disputeGameFactoryProxy =
IDisputeGameFactory(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "DisputeGameFactory"));
output.anchorStateRegistryProxy =
IAnchorStateRegistry(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "AnchorStateRegistry"));
// Deploy legacy proxied contracts.
output.l1StandardBridgeProxy = IL1StandardBridge(
payable(
Blueprint.deployFrom(
blueprint.l1ChugSplashProxy,
computeSalt(l2ChainId, saltMixer, "L1StandardBridge"),
abi.encode(output.opChainProxyAdmin)
)
)
);
output.opChainProxyAdmin.setProxyType(address(output.l1StandardBridgeProxy), IProxyAdmin.ProxyType.CHUGSPLASH);
string memory contractName = "OVM_L1CrossDomainMessenger";
output.l1CrossDomainMessengerProxy = IL1CrossDomainMessenger(
Blueprint.deployFrom(
blueprint.resolvedDelegateProxy,
computeSalt(l2ChainId, saltMixer, "L1CrossDomainMessenger"),
abi.encode(output.addressManager, contractName)
)
);
output.opChainProxyAdmin.setProxyType(
address(output.l1CrossDomainMessengerProxy), IProxyAdmin.ProxyType.RESOLVED
);
output.opChainProxyAdmin.setImplementationName(address(output.l1CrossDomainMessengerProxy), contractName);
// Eventually we will switch from DelayedWETHPermissionedGameProxy to DelayedWETHPermissionlessGameProxy.
output.delayedWETHPermissionedGameProxy = IDelayedWETH(
payable(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "DelayedWETHPermissionedGame"))
);
// While not a proxy, we deploy the PermissionedDisputeGame here as well because it's bespoke per chain.
output.permissionedDisputeGame = IPermissionedDisputeGame(
Blueprint.deployFrom(
blueprint.permissionedDisputeGame1,
blueprint.permissionedDisputeGame2,
computeSalt(l2ChainId, saltMixer, "PermissionedDisputeGame"),
encodePermissionedFDGConstructor(
IFaultDisputeGame.GameConstructorParams({
gameType: _input.disputeGameType,
absolutePrestate: _input.disputeAbsolutePrestate,
maxGameDepth: _input.disputeMaxGameDepth,
splitDepth: _input.disputeSplitDepth,
clockExtension: _input.disputeClockExtension,
maxClockDuration: _input.disputeMaxClockDuration,
vm: IBigStepper(implementation.mipsImpl),
weth: IDelayedWETH(payable(address(output.delayedWETHPermissionedGameProxy))),
anchorStateRegistry: IAnchorStateRegistry(address(output.anchorStateRegistryProxy)),
l2ChainId: _input.l2ChainId
}),
_input.roles.proposer,
_input.roles.challenger
)
)
);
// -------- Set and Initialize Proxy Implementations --------
bytes memory data;
data = encodeL1ERC721BridgeInitializer(output);
upgradeToAndCall(
output.opChainProxyAdmin, address(output.l1ERC721BridgeProxy), implementation.l1ERC721BridgeImpl, data
);
data = encodeOptimismPortalInitializer(output);
upgradeToAndCall(
output.opChainProxyAdmin, address(output.optimismPortalProxy), implementation.optimismPortalImpl, data
);
data = encodeSystemConfigInitializer(_input, output);
upgradeToAndCall(
output.opChainProxyAdmin, address(output.systemConfigProxy), implementation.systemConfigImpl, data
);
data = encodeOptimismMintableERC20FactoryInitializer(output);
upgradeToAndCall(
output.opChainProxyAdmin,
address(output.optimismMintableERC20FactoryProxy),
implementation.optimismMintableERC20FactoryImpl,
data
);
data = encodeL1CrossDomainMessengerInitializer(output);
upgradeToAndCall(
output.opChainProxyAdmin,
address(output.l1CrossDomainMessengerProxy),
implementation.l1CrossDomainMessengerImpl,
data
);
data = encodeL1StandardBridgeInitializer(output);
upgradeToAndCall(
output.opChainProxyAdmin, address(output.l1StandardBridgeProxy), implementation.l1StandardBridgeImpl, data
);
data = encodeDelayedWETHInitializer(_input);
// Eventually we will switch from DelayedWETHPermissionedGameProxy to DelayedWETHPermissionlessGameProxy.
upgradeToAndCall(
output.opChainProxyAdmin,
address(output.delayedWETHPermissionedGameProxy),
implementation.delayedWETHImpl,
data
);
// We set the initial owner to this contract, set game implementations, then transfer ownership.
data = encodeDisputeGameFactoryInitializer();
upgradeToAndCall(
output.opChainProxyAdmin,
address(output.disputeGameFactoryProxy),
implementation.disputeGameFactoryImpl,
data
);
setDGFImplementation(
output.disputeGameFactoryProxy,
GameTypes.PERMISSIONED_CANNON,
IDisputeGame(address(output.permissionedDisputeGame))
);
transferOwnership(address(output.disputeGameFactoryProxy), address(_input.roles.opChainProxyAdminOwner));
data = encodeAnchorStateRegistryInitializer(_input, output);
upgradeToAndCall(
output.opChainProxyAdmin,
address(output.anchorStateRegistryProxy),
implementation.anchorStateRegistryImpl,
data
);
// -------- Finalize Deployment --------
// Transfer ownership of the ProxyAdmin from this contract to the specified owner.
transferOwnership(address(output.opChainProxyAdmin), _input.roles.opChainProxyAdminOwner);
emit Deployed(l2ChainId, msg.sender, abi.encode(output));
return output;
}
/// @notice Verifies that all OpChainConfig inputs are valid and reverts if any are invalid.
function assertValidOpChainConfig(OpChainConfig memory _config) internal view {
assertValidContractAddress(address(_config.systemConfigProxy));
assertValidContractAddress(address(_config.proxyAdmin));
}
/// @notice Upgrades a set of chains to the latest implementation contracts
/// @param _opChainConfigs Array of OpChain structs, one per chain to upgrade
/// @dev This function is intended to be called via DELEGATECALL from the Upgrade Controller Safe
function upgrade(OpChainConfig[] memory _opChainConfigs) external virtual {
if (address(this) == address(thisOPCM)) revert OnlyDelegatecall();
// If this is delegatecalled by the upgrade controller, set isRC to false first, else, continue execution.
if (address(this) == upgradeController) {
// Set isRC to false.
// This function asserts that the caller is the upgrade controller.
thisOPCM.setRC(false);
}
Implementations memory impls = getImplementations();
Blueprints memory bps = getBlueprints();
// If the SuperchainConfig is not already upgraded, upgrade it.
if (superchainProxyAdmin.getProxyImplementation(address(superchainConfig)) != impls.superchainConfigImpl) {
// Attempt to upgrade. If the ProxyAdmin is not the SuperchainConfig's admin, this will revert.
upgradeTo(superchainProxyAdmin, address(superchainConfig), impls.superchainConfigImpl);
}
// If the ProtocolVersions contract is not already upgraded, upgrade it.
if (superchainProxyAdmin.getProxyImplementation(address(protocolVersions)) != impls.protocolVersionsImpl) {
upgradeTo(superchainProxyAdmin, address(protocolVersions), impls.protocolVersionsImpl);
}
for (uint256 i = 0; i < _opChainConfigs.length; i++) {
assertValidOpChainConfig(_opChainConfigs[i]);
// After Upgrade 13, we will be able to use systemConfigProxy.getAddresses() here.
ISystemConfig.Addresses memory opChainAddrs = ISystemConfig.Addresses({
l1CrossDomainMessenger: _opChainConfigs[i].systemConfigProxy.l1CrossDomainMessenger(),
l1ERC721Bridge: _opChainConfigs[i].systemConfigProxy.l1ERC721Bridge(),
l1StandardBridge: _opChainConfigs[i].systemConfigProxy.l1StandardBridge(),
disputeGameFactory: address(getDisputeGameFactory(_opChainConfigs[i].systemConfigProxy)),
optimismPortal: _opChainConfigs[i].systemConfigProxy.optimismPortal(),
optimismMintableERC20Factory: _opChainConfigs[i].systemConfigProxy.optimismMintableERC20Factory()
});
// Check that all contracts have the correct superchainConfig
if (
getSuperchainConfig(opChainAddrs.optimismPortal) != superchainConfig
|| getSuperchainConfig(opChainAddrs.l1CrossDomainMessenger) != superchainConfig
|| getSuperchainConfig(opChainAddrs.l1ERC721Bridge) != superchainConfig
|| getSuperchainConfig(opChainAddrs.l1StandardBridge) != superchainConfig
) {
revert SuperchainConfigMismatch(_opChainConfigs[i].systemConfigProxy);
}
// -------- Upgrade Contracts Stored in SystemConfig --------
upgradeTo(
_opChainConfigs[i].proxyAdmin, address(_opChainConfigs[i].systemConfigProxy), impls.systemConfigImpl
);
upgradeTo(
_opChainConfigs[i].proxyAdmin, opChainAddrs.l1CrossDomainMessenger, impls.l1CrossDomainMessengerImpl
);
upgradeTo(_opChainConfigs[i].proxyAdmin, opChainAddrs.l1ERC721Bridge, impls.l1ERC721BridgeImpl);
upgradeTo(_opChainConfigs[i].proxyAdmin, opChainAddrs.l1StandardBridge, impls.l1StandardBridgeImpl);
upgradeTo(_opChainConfigs[i].proxyAdmin, opChainAddrs.disputeGameFactory, impls.disputeGameFactoryImpl);
upgradeTo(_opChainConfigs[i].proxyAdmin, opChainAddrs.optimismPortal, impls.optimismPortalImpl);
upgradeTo(
_opChainConfigs[i].proxyAdmin,
opChainAddrs.optimismMintableERC20Factory,
impls.optimismMintableERC20FactoryImpl
);
// -------- Discover and Upgrade Proofs Contracts --------
// Note that, the code below uses several independently scoped blocks to avoid stack too deep errors.
// All chains have the Permissioned Dispute Game. We get it first so that we can use it to
// retrieve its WETH and the Anchor State Registry when we need them.
IPermissionedDisputeGame permissionedDisputeGame = IPermissionedDisputeGame(
address(
getGameImplementation(
IDisputeGameFactory(opChainAddrs.disputeGameFactory), GameTypes.PERMISSIONED_CANNON
)
)
);
// We're also going to need the l2ChainId below, so we cache it in the outer scope.
uint256 l2ChainId = getL2ChainId(IFaultDisputeGame(address(permissionedDisputeGame)));
// Replace the Anchor State Registry Proxy with a new Proxy and Implementation
// For this upgrade, we are replacing the previous Anchor State Registry, thus we:
// 1. deploy a new Anchor State Registry proxy
// 2. get the starting anchor root corresponding to the currently respected game type.
// 3. initialize the proxy with that anchor root
IAnchorStateRegistry newAnchorStateRegistryProxy;
{
// Deploy a new proxy, because we're replacing the old one.
// Include the system config address in the salt to ensure that the new proxy is unique,
// even if another chains with the same L2 chain ID has been deployed by this contract.
newAnchorStateRegistryProxy = IAnchorStateRegistry(
deployProxy({
_l2ChainId: l2ChainId,
_proxyAdmin: _opChainConfigs[i].proxyAdmin,
_saltMixer: reusableSaltMixer(_opChainConfigs[i]),
_contractName: "AnchorStateRegistry"
})
);
// Get the starting anchor root by:
// 1. getting the anchor state registry from the Permissioned Dispute Game.
// 2. getting the respected game type from the OptimismPortal.
// 3. getting the anchor root for the respected game type from the Anchor State Registry.
{
GameType gameType = IOptimismPortal2(payable(opChainAddrs.optimismPortal)).respectedGameType();
(Hash root, uint256 l2BlockNumber) =
getAnchorStateRegistry(IFaultDisputeGame(address(permissionedDisputeGame))).anchors(gameType);
OutputRoot memory startingAnchorRoot = OutputRoot({ root: root, l2BlockNumber: l2BlockNumber });
upgradeToAndCall(
_opChainConfigs[i].proxyAdmin,
address(newAnchorStateRegistryProxy),
impls.anchorStateRegistryImpl,
abi.encodeCall(
IAnchorStateRegistry.initialize,
(
superchainConfig,
IDisputeGameFactory(opChainAddrs.disputeGameFactory),
IOptimismPortal2(payable(opChainAddrs.optimismPortal)),
startingAnchorRoot
)
)
);
}
// Deploy and set a new permissioned game to update its prestate
deployAndSetNewGameImpl({
_l2ChainId: l2ChainId,
_disputeGame: IDisputeGame(address(permissionedDisputeGame)),
_newAnchorStateRegistryProxy: newAnchorStateRegistryProxy,
_gameType: GameTypes.PERMISSIONED_CANNON,
_opChainConfig: _opChainConfigs[i],
_implementations: impls,
_blueprints: bps,
_opChainAddrs: opChainAddrs
});
}
// Now retrieve the permissionless game. If it exists, upgrade its weth and replace its implementation.
IFaultDisputeGame permissionlessDisputeGame = IFaultDisputeGame(
address(getGameImplementation(IDisputeGameFactory(opChainAddrs.disputeGameFactory), GameTypes.CANNON))
);
if (address(permissionlessDisputeGame) != address(0)) {
// Deploy and set a new permissionless game to update its prestate
deployAndSetNewGameImpl({
_l2ChainId: l2ChainId,
_disputeGame: IDisputeGame(address(permissionlessDisputeGame)),
_newAnchorStateRegistryProxy: newAnchorStateRegistryProxy,
_gameType: GameTypes.CANNON,
_opChainConfig: _opChainConfigs[i],
_implementations: impls,
_blueprints: bps,
_opChainAddrs: opChainAddrs
});
}
// Emit the upgraded event with the address of the caller. Since this will be a delegatecall,
// the caller will be the value of the ADDRESS opcode.
emit Upgraded(l2ChainId, _opChainConfigs[i].systemConfigProxy, address(this));
}
}
/// @notice addGameType deploys a new dispute game and links it to the DisputeGameFactory. The inputted _gameConfigs
/// must be added in ascending GameType order.
function addGameType(AddGameInput[] memory _gameConfigs) public virtual returns (AddGameOutput[] memory) {
if (address(this) == address(thisOPCM)) revert OnlyDelegatecall();
if (_gameConfigs.length == 0) revert InvalidGameConfigs();
AddGameOutput[] memory outputs = new AddGameOutput[](_gameConfigs.length);
Blueprints memory bps = getBlueprints();
// Store last game config as an int256 so that we can ensure that the same game config is not added twice.
// Using int256 generates cheaper, simpler bytecode.
int256 lastGameConfig = -1;
for (uint256 i = 0; i < _gameConfigs.length; i++) {
AddGameInput memory gameConfig = _gameConfigs[i];
// This conversion is safe because the GameType is a uint32, which will always fit in an int256.
int256 gameTypeInt = int256(uint256(gameConfig.disputeGameType.raw()));
// Ensure that the game configs are added in ascending order, and not duplicated.
if (lastGameConfig >= gameTypeInt) revert InvalidGameConfigs();
lastGameConfig = gameTypeInt;
// Grab the permissioned and fault dispute games from the SystemConfig.
// We keep the FDG type as it reduces casting below.
IFaultDisputeGame pdg = IFaultDisputeGame(
address(
getGameImplementation(getDisputeGameFactory(gameConfig.systemConfig), GameTypes.PERMISSIONED_CANNON)
)
);
// Pull out the chain ID.
uint256 l2ChainId = getL2ChainId(pdg);
// Deploy a new DelayedWETH proxy for this game if one hasn't already been specified. Leaving
/// gameConfig.delayedWETH as the zero address will cause a new DelayedWETH to be deployed for this game.
if (address(gameConfig.delayedWETH) == address(0)) {
string memory contractName = string.concat(
"DelayedWETH-",
// This is a safe cast because GameType is a uint256 under the hood and no operation has been done
// on it at this point
Strings.toString(uint256(gameTypeInt))
);
outputs[i].delayedWETH = IDelayedWETH(
payable(deployProxy(l2ChainId, gameConfig.proxyAdmin, gameConfig.saltMixer, contractName))
);
// Initialize the proxy.
upgradeToAndCall(
gameConfig.proxyAdmin,
address(outputs[i].delayedWETH),
getImplementations().delayedWETHImpl,
abi.encodeCall(IDelayedWETH.initialize, (gameConfig.proxyAdmin.owner(), superchainConfig))
);
} else {
outputs[i].delayedWETH = gameConfig.delayedWETH;
}
// The FDG is only used for the event below, and only if it is being replaced,
// so we declare it here, but only assign it below if needed.
IFaultDisputeGame fdg;
// The below sections are functionally the same. Both deploy a new dispute game. The dispute game type is
// either permissioned or permissionless depending on game config.
if (gameConfig.permissioned) {
outputs[i].faultDisputeGame = IFaultDisputeGame(
Blueprint.deployFrom(
bps.permissionedDisputeGame1,
bps.permissionedDisputeGame2,
computeSalt(l2ChainId, gameConfig.saltMixer, "PermissionedDisputeGame"),
encodePermissionedFDGConstructor(
IFaultDisputeGame.GameConstructorParams(
gameConfig.disputeGameType,
gameConfig.disputeAbsolutePrestate,
gameConfig.disputeMaxGameDepth,
gameConfig.disputeSplitDepth,
gameConfig.disputeClockExtension,
gameConfig.disputeMaxClockDuration,
gameConfig.vm,
outputs[i].delayedWETH,
getAnchorStateRegistry(pdg),
l2ChainId
),
getProposer(IPermissionedDisputeGame(address(pdg))),
getChallenger(IPermissionedDisputeGame(address(pdg)))
)
)
);
} else {
fdg = IFaultDisputeGame(
address(getGameImplementation(getDisputeGameFactory(gameConfig.systemConfig), GameTypes.CANNON))
);
outputs[i].faultDisputeGame = IFaultDisputeGame(
Blueprint.deployFrom(
bps.permissionlessDisputeGame1,
bps.permissionlessDisputeGame2,
computeSalt(l2ChainId, gameConfig.saltMixer, "PermissionlessDisputeGame"),
encodePermissionlessFDGConstructor(
IFaultDisputeGame.GameConstructorParams(
gameConfig.disputeGameType,
gameConfig.disputeAbsolutePrestate,
gameConfig.disputeMaxGameDepth,
gameConfig.disputeSplitDepth,
gameConfig.disputeClockExtension,
gameConfig.disputeMaxClockDuration,
gameConfig.vm,
outputs[i].delayedWETH,
// We can't assume that there is an existing fault dispute game,
// so get the Anchor State Registry from the permissioned game.
getAnchorStateRegistry(pdg),
l2ChainId
)
)
)
);
}
// As a last step, register the new game type with the DisputeGameFactory. If the game type already exists,
// then its implementation will be overwritten.
IDisputeGameFactory dgf = getDisputeGameFactory(gameConfig.systemConfig);
setDGFImplementation(dgf, gameConfig.disputeGameType, IDisputeGame(address(outputs[i].faultDisputeGame)));
dgf.setInitBond(gameConfig.disputeGameType, gameConfig.initialBond);
if (gameConfig.permissioned) {
// Emit event for the newly added game type with the old permissioned dispute game
emit GameTypeAdded(
l2ChainId, gameConfig.disputeGameType, outputs[i].faultDisputeGame, IDisputeGame(address(pdg))
);
} else {
// Emit event for the newly added game type with the old fault dispute game
emit GameTypeAdded(
l2ChainId, gameConfig.disputeGameType, outputs[i].faultDisputeGame, IDisputeGame(address(fdg))
);
}
}
return outputs;
}
// -------- Utilities --------
/// @notice Verifies that all inputs are valid and reverts if any are invalid.
/// Typically the proxy admin owner is expected to have code, but this is not enforced here.
function assertValidInputs(DeployInput calldata _input) internal view {
if (_input.l2ChainId == 0 || _input.l2ChainId == block.chainid) revert InvalidChainId();
if (_input.roles.opChainProxyAdminOwner == address(0)) revert InvalidRoleAddress("opChainProxyAdminOwner");
if (_input.roles.systemConfigOwner == address(0)) revert InvalidRoleAddress("systemConfigOwner");
if (_input.roles.batcher == address(0)) revert InvalidRoleAddress("batcher");
if (_input.roles.unsafeBlockSigner == address(0)) revert InvalidRoleAddress("unsafeBlockSigner");
if (_input.roles.proposer == address(0)) revert InvalidRoleAddress("proposer");
if (_input.roles.challenger == address(0)) revert InvalidRoleAddress("challenger");
if (_input.startingAnchorRoot.length == 0) revert InvalidStartingAnchorRoot();
if (bytes32(_input.startingAnchorRoot) == bytes32(0)) revert InvalidStartingAnchorRoot();
}
/// @notice Maps an L2 chain ID to an L1 batch inbox address as defined by the standard
/// configuration's convention. This convention is `versionByte || keccak256(bytes32(chainId))[:19]`,
/// where || denotes concatenation`, versionByte is 0x00, and chainId is a uint256.
/// https://specs.optimism.io/protocol/configurability.html#consensus-parameters
function chainIdToBatchInboxAddress(uint256 _l2ChainId) public pure returns (address) {
bytes1 versionByte = 0x00;
bytes32 hashedChainId = keccak256(bytes.concat(bytes32(_l2ChainId)));
bytes19 first19Bytes = bytes19(hashedChainId);
return address(uint160(bytes20(bytes.concat(versionByte, first19Bytes))));
}
/// @notice Helper method for computing a salt that's used in CREATE2 deployments.
/// Including the contract name ensures that the resultant address from CREATE2 is unique
/// across our smart contract system. For example, we deploy multiple proxy contracts
/// with the same bytecode from this contract, so they each require a unique salt for determinism.
function computeSalt(
uint256 _l2ChainId,
string memory _saltMixer,
string memory _contractName
)
internal
pure
returns (bytes32)
{
return keccak256(abi.encode(_l2ChainId, _saltMixer, _contractName));
}
/// @notice Helper method for computing a reusable salt mixer
/// This method should be used as the salt mixer when deploying contracts when there is no user
/// provided salt mixer. This protects against a situation where multiple chains with the same
/// L2 chain ID exist, which would otherwise result in address collisions.
function reusableSaltMixer(OpChainConfig memory _opChainConfig) internal pure returns (string memory) {
return string(bytes.concat(bytes32(uint256(uint160(address(_opChainConfig.systemConfigProxy))))));
}
/// @notice Deterministically deploys a new proxy contract owned by the provided ProxyAdmin.
/// The salt is computed as a function of the L2 chain ID, the salt mixer and the contract name.
/// This is required because we deploy many identical proxies, so they each require a unique salt for determinism.
function deployProxy(
uint256 _l2ChainId,
IProxyAdmin _proxyAdmin,
string memory _saltMixer,
string memory _contractName
)
internal
returns (address)
{
bytes32 salt = computeSalt(_l2ChainId, _saltMixer, _contractName);
return Blueprint.deployFrom(getBlueprints().proxy, salt, abi.encode(_proxyAdmin));
}
// -------- Initializer Encoding --------
/// @notice Helper method for encoding the L1ERC721Bridge initializer data.
function encodeL1ERC721BridgeInitializer(DeployOutput memory _output)
internal
view
virtual
returns (bytes memory)
{
return abi.encodeCall(IL1ERC721Bridge.initialize, (_output.l1CrossDomainMessengerProxy, superchainConfig));
}
/// @notice Helper method for encoding the OptimismPortal initializer data.
function encodeOptimismPortalInitializer(DeployOutput memory _output)
internal
view
virtual
returns (bytes memory)
{
return abi.encodeCall(
IOptimismPortal2.initialize,
(
_output.disputeGameFactoryProxy,
_output.systemConfigProxy,
superchainConfig,
GameTypes.PERMISSIONED_CANNON
)
);
}
/// @notice Helper method for encoding the SystemConfig initializer data.
function encodeSystemConfigInitializer(
DeployInput memory _input,
DeployOutput memory _output
)
internal
view
virtual
returns (bytes memory)
{
(IResourceMetering.ResourceConfig memory referenceResourceConfig, ISystemConfig.Addresses memory opChainAddrs) =
defaultSystemConfigParams(_input, _output);
return abi.encodeCall(
ISystemConfig.initialize,
(
_input.roles.systemConfigOwner,
_input.basefeeScalar,
_input.blobBasefeeScalar,
bytes32(uint256(uint160(_input.roles.batcher))), // batcherHash
_input.gasLimit,
_input.roles.unsafeBlockSigner,
referenceResourceConfig,
chainIdToBatchInboxAddress(_input.l2ChainId),
opChainAddrs
)
);
}
/// @notice Helper method for encoding the OptimismMintableERC20Factory initializer data.
function encodeOptimismMintableERC20FactoryInitializer(DeployOutput memory _output)
internal
pure
virtual
returns (bytes memory)
{
return abi.encodeCall(IOptimismMintableERC20Factory.initialize, (address(_output.l1StandardBridgeProxy)));
}
/// @notice Helper method for encoding the L1CrossDomainMessenger initializer data.
function encodeL1CrossDomainMessengerInitializer(DeployOutput memory _output)
internal
view
virtual
returns (bytes memory)
{
return abi.encodeCall(IL1CrossDomainMessenger.initialize, (superchainConfig, _output.optimismPortalProxy));
}
/// @notice Helper method for encoding the L1StandardBridge initializer data.
function encodeL1StandardBridgeInitializer(DeployOutput memory _output)
internal
view
virtual
returns (bytes memory)
{
return abi.encodeCall(IL1StandardBridge.initialize, (_output.l1CrossDomainMessengerProxy, superchainConfig));
}
function encodeDisputeGameFactoryInitializer() internal view virtual returns (bytes memory) {
// This contract must be the initial owner so we can set game implementations, then
// ownership is transferred after.
return abi.encodeCall(IDisputeGameFactory.initialize, (address(this)));
}
function encodeAnchorStateRegistryInitializer(
DeployInput memory _input,
DeployOutput memory _output
)
internal
view
virtual
returns (bytes memory)
{
OutputRoot memory startingAnchorRoot = abi.decode(_input.startingAnchorRoot, (OutputRoot));
return abi.encodeCall(
IAnchorStateRegistry.initialize,
(superchainConfig, _output.disputeGameFactoryProxy, _output.optimismPortalProxy, startingAnchorRoot)
);
}
function encodeDelayedWETHInitializer(DeployInput memory _input) internal view virtual returns (bytes memory) {
return abi.encodeCall(IDelayedWETH.initialize, (_input.roles.opChainProxyAdminOwner, superchainConfig));
}
function encodePermissionlessFDGConstructor(IFaultDisputeGame.GameConstructorParams memory _params)
internal
view
virtual
returns (bytes memory)
{
bytes memory dataWithSelector = abi.encodeCall(IFaultDisputeGame.__constructor__, (_params));
return Bytes.slice(dataWithSelector, 4);
}
function encodePermissionedFDGConstructor(
IFaultDisputeGame.GameConstructorParams memory _params,
address _proposer,
address _challenger
)
internal
view
virtual
returns (bytes memory)
{
bytes memory dataWithSelector =
abi.encodeCall(IPermissionedDisputeGame.__constructor__, (_params, _proposer, _challenger));
return Bytes.slice(dataWithSelector, 4);
}
/// @notice Returns default, standard config arguments for the SystemConfig initializer.
/// This is used by subclasses to reduce code duplication.
function defaultSystemConfigParams(
DeployInput memory, /* _input */
DeployOutput memory _output
)
internal
view
virtual
returns (IResourceMetering.ResourceConfig memory resourceConfig_, ISystemConfig.Addresses memory opChainAddrs_)
{
resourceConfig_ = Constants.DEFAULT_RESOURCE_CONFIG();
opChainAddrs_ = ISystemConfig.Addresses({
l1CrossDomainMessenger: address(_output.l1CrossDomainMessengerProxy),
l1ERC721Bridge: address(_output.l1ERC721BridgeProxy),
l1StandardBridge: address(_output.l1StandardBridgeProxy),
disputeGameFactory: address(_output.disputeGameFactoryProxy),
optimismPortal: address(_output.optimismPortalProxy),
optimismMintableERC20Factory: address(_output.optimismMintableERC20FactoryProxy)
});
assertValidContractAddress(opChainAddrs_.l1CrossDomainMessenger);
assertValidContractAddress(opChainAddrs_.l1ERC721Bridge);
assertValidContractAddress(opChainAddrs_.l1StandardBridge);
assertValidContractAddress(opChainAddrs_.disputeGameFactory);
assertValidContractAddress(opChainAddrs_.optimismPortal);
assertValidContractAddress(opChainAddrs_.optimismMintableERC20Factory);
}
/// @notice Makes an external call to the target to initialize the proxy with the specified data.
/// First performs safety checks to ensure the target, implementation, and proxy admin are valid.
function upgradeToAndCall(
IProxyAdmin _proxyAdmin,
address _target,
address _implementation,
bytes memory _data
)
internal
{
assertValidContractAddress(_implementation);
_proxyAdmin.upgradeAndCall(payable(address(_target)), _implementation, _data);
}
/// @notice Updates the implementation of a proxy without calling the initializer.
/// First performs safety checks to ensure the target, implementation, and proxy admin are valid.
function upgradeTo(IProxyAdmin _proxyAdmin, address _target, address _implementation) internal {
assertValidContractAddress(_implementation);
_proxyAdmin.upgrade(payable(address(_target)), _implementation);
}
function assertValidContractAddress(address _who) internal view {
if (_who.code.length == 0) revert AddressHasNoCode(_who);
}
/// @notice Returns the blueprint contract addresses.
function blueprints() public view returns (Blueprints memory) {
return blueprint;
}
/// @notice Returns the implementation contract addresses.
function implementations() public view returns (Implementations memory) {
return implementation;
}
/// @notice Returns the implementation contract address for a given game type.
function getGameImplementation(
IDisputeGameFactory _disputeGameFactory,
GameType _gameType
)
internal
view
returns (IDisputeGame)
{
return _disputeGameFactory.gameImpls(_gameType);
}
/// @notice Sets the RC flag.
function setRC(bool _isRC) external {
if (msg.sender != upgradeController) revert OnlyUpgradeController();
isRC = _isRC;
}
/// @notice Sets a game implementation on the dispute game factory
function setDGFImplementation(IDisputeGameFactory _dgf, GameType _gameType, IDisputeGame _newGame) internal {
_dgf.setImplementation(_gameType, _newGame);
}
/// @notice Transfers ownership
function transferOwnership(address _target, address _newOwner) internal {
// All transferOwnership targets have the same selector, so we just use IAddressManager
IAddressManager(_target).transferOwnership(_newOwner);
}
/// @notice Retrieves the constructor params for a given game.
function getGameConstructorParams(IFaultDisputeGame _disputeGame)
internal
view
returns (IFaultDisputeGame.GameConstructorParams memory)
{
IFaultDisputeGame.GameConstructorParams memory params = IFaultDisputeGame.GameConstructorParams({
gameType: _disputeGame.gameType(),
absolutePrestate: _disputeGame.absolutePrestate(),
maxGameDepth: _disputeGame.maxGameDepth(),
splitDepth: _disputeGame.splitDepth(),
clockExtension: _disputeGame.clockExtension(),
maxClockDuration: _disputeGame.maxClockDuration(),
vm: _disputeGame.vm(),
weth: getWETH(_disputeGame),
anchorStateRegistry: getAnchorStateRegistry(_disputeGame),
l2ChainId: getL2ChainId(_disputeGame)
});
return params;
}
/// @notice Retrieves the Superchain Config for a bridge contract
function getSuperchainConfig(address _hasSuperchainConfig) internal view returns (ISuperchainConfig) {
return IHasSuperchainConfig(_hasSuperchainConfig).superchainConfig();
}
/// @notice Retrieves the Anchor State Registry for a given game
function getAnchorStateRegistry(IFaultDisputeGame _disputeGame) internal view returns (IAnchorStateRegistry) {
return _disputeGame.anchorStateRegistry();
}
/// @notice Retrieves the DelayedWETH address for a given game
function getWETH(IFaultDisputeGame _disputeGame) internal view returns (IDelayedWETH) {
return _disputeGame.weth();
}
/// @notice Retrieves the L2 chain ID for a given game
function getL2ChainId(IFaultDisputeGame _disputeGame) internal view returns (uint256) {
return _disputeGame.l2ChainId();
}
/// @notice Retrieves the proposer address for a given game
function getProposer(IPermissionedDisputeGame _disputeGame) internal view returns (address) {
return _disputeGame.proposer();
}
/// @notice Retrieves the challenger address for a given game
function getChallenger(IPermissionedDisputeGame _disputeGame) internal view returns (address) {
return _disputeGame.challenger();
}
/// @notice Retrieves the DisputeGameFactory address for a given SystemConfig
function getDisputeGameFactory(ISystemConfig _systemConfig) internal view returns (IDisputeGameFactory) {
return IDisputeGameFactory(_systemConfig.disputeGameFactory());
}
/// @notice Retrieves the implementation addresses stored in this OPCM contract
function getImplementations() internal view returns (Implementations memory) {
return thisOPCM.implementations();
}
/// @notice Retrieves the blueprint addresses stored in this OPCM contract
function getBlueprints() internal view returns (Blueprints memory) {
return thisOPCM.blueprints();
}
function getProxyImplementation(IProxyAdmin _proxyAdmin, address _proxy) internal view returns (address) {
return _proxyAdmin.getProxyImplementation(_proxy);
}
/// @notice Deploys and sets a new dispute game implementation
/// @param _l2ChainId The L2 chain ID
/// @param _disputeGame The current dispute game implementation
/// @param _newAnchorStateRegistryProxy The new anchor state registry proxy
/// @param _gameType The type of game to deploy
/// @param _opChainConfig The OP chain configuration
/// @param _blueprints The blueprint addresses
/// @param _implementations The implementation addresses
/// @param _opChainAddrs The OP chain addresses
function deployAndSetNewGameImpl(
uint256 _l2ChainId,
IDisputeGame _disputeGame,
IAnchorStateRegistry _newAnchorStateRegistryProxy,
GameType _gameType,
OpChainConfig memory _opChainConfig,
Blueprints memory _blueprints,
Implementations memory _implementations,
ISystemConfig.Addresses memory _opChainAddrs
)
internal
{
// independently scoped block to avoid stack too deep
{
// Get and upgrade the WETH proxy
IDelayedWETH delayedWethProxy = getWETH(IFaultDisputeGame(address(_disputeGame)));
upgradeTo(_opChainConfig.proxyAdmin, address(delayedWethProxy), _implementations.delayedWETHImpl);
}
// Get the constructor params for the game
IFaultDisputeGame.GameConstructorParams memory params =
getGameConstructorParams(IFaultDisputeGame(address(_disputeGame)));
// Modify the params with the new anchorStateRegistry and vm values.
params.anchorStateRegistry = IAnchorStateRegistry(address(_newAnchorStateRegistryProxy));
params.vm = IBigStepper(_implementations.mipsImpl);
if (Claim.unwrap(_opChainConfig.absolutePrestate) == bytes32(0)) {
revert PrestateNotSet();
}
params.absolutePrestate = _opChainConfig.absolutePrestate;
IDisputeGame newGame;
if (GameType.unwrap(_gameType) == GameType.unwrap(GameTypes.PERMISSIONED_CANNON)) {
address proposer = getProposer(IPermissionedDisputeGame(address(_disputeGame)));
address challenger = getChallenger(IPermissionedDisputeGame(address(_disputeGame)));
newGame = IDisputeGame(
Blueprint.deployFrom(
_blueprints.permissionedDisputeGame1,
_blueprints.permissionedDisputeGame2,
computeSalt(_l2ChainId, reusableSaltMixer(_opChainConfig), "PermissionedDisputeGame"),
encodePermissionedFDGConstructor(params, proposer, challenger)
)
);
} else {
newGame = IDisputeGame(
Blueprint.deployFrom(
_blueprints.permissionlessDisputeGame1,
_blueprints.permissionlessDisputeGame2,
computeSalt(_l2ChainId, reusableSaltMixer(_opChainConfig), "PermissionlessDisputeGame"),
encodePermissionlessFDGConstructor(params)
)
);
}
setDGFImplementation(IDisputeGameFactory(_opChainAddrs.disputeGameFactory), _gameType, IDisputeGame(newGame));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { Bytes } from "src/libraries/Bytes.sol";
/// @notice Methods for working with ERC-5202 blueprint contracts.
/// https://eips.ethereum.org/EIPS/eip-5202
library Blueprint {
/// @notice The structure of a blueprint contract per ERC-5202.
struct Preamble {
uint8 ercVersion;
bytes preambleData;
bytes initcode;
}
/// @notice Thrown when converting a bytes array to a uint256 and the bytes array is too long.
error BytesArrayTooLong();
/// @notice Throw when contract deployment fails.
error DeploymentFailed();
/// @notice Thrown when parsing a blueprint preamble and the resulting initcode is empty.
error EmptyInitcode();
/// @notice Thrown when call to the identity precompile fails.
error IdentityPrecompileCallFailed();
/// @notice Thrown when parsing a blueprint preamble and the bytecode does not contain the expected prefix bytes.
error NotABlueprint();
/// @notice Thrown when parsing a blueprint preamble and the reserved bits are set.
error ReservedBitsSet();
/// @notice Thrown when parsing a blueprint preamble and the preamble data is not empty.
/// We do not use the preamble data, so it's expected to be empty.
error UnexpectedPreambleData(bytes data);
/// @notice Thrown during deployment if the ERC version is not supported.
error UnsupportedERCVersion(uint8 version);
/// @notice Takes the desired initcode for a blueprint as a parameter, and returns EVM code
/// which will deploy a corresponding blueprint contract (with no data section). Based on the
/// reference implementation in https://eips.ethereum.org/EIPS/eip-5202.
function blueprintDeployerBytecode(bytes memory _initcode) internal pure returns (bytes memory) {
// Check that the initcode is not empty.
if (_initcode.length == 0) revert EmptyInitcode();
bytes memory blueprintPreamble = hex"FE7100"; // ERC-5202 preamble.
bytes memory blueprintBytecode = bytes.concat(blueprintPreamble, _initcode);
// The length of the deployed code in bytes.
bytes2 lenBytes = bytes2(uint16(blueprintBytecode.length));
// Copy <blueprintBytecode> to memory and `RETURN` it per EVM creation semantics.
// PUSH2 <len> RETURNDATASIZE DUP2 PUSH1 10 RETURNDATASIZE CODECOPY RETURN
bytes memory deployBytecode = bytes.concat(hex"61", lenBytes, hex"3d81600a3d39f3");
return bytes.concat(deployBytecode, blueprintBytecode);
}
/// @notice Given bytecode as a sequence of bytes, parse the blueprint preamble and deconstruct
/// the bytecode into the ERC version, preamble data and initcode. Reverts if the bytecode is
/// not a valid blueprint contract according to ERC-5202.
function parseBlueprintPreamble(bytes memory _bytecode) internal view returns (Preamble memory) {
if (_bytecode.length < 2 || _bytecode[0] != 0xFE || _bytecode[1] != 0x71) {
revert NotABlueprint();
}
uint8 ercVersion = uint8(_bytecode[2] & 0xFC) >> 2;
uint8 nLengthBytes = uint8(_bytecode[2] & 0x03);
if (nLengthBytes == 0x03) revert ReservedBitsSet();
uint256 dataLength = 0;
if (nLengthBytes > 0) {
bytes memory lengthBytes = new bytes(nLengthBytes);
for (uint256 i = 0; i < nLengthBytes; i++) {
lengthBytes[i] = _bytecode[3 + i];
}
dataLength = bytesToUint(lengthBytes);
}
bytes memory preambleData = new bytes(dataLength);
if (nLengthBytes != 0) {
uint256 dataStart = 3 + nLengthBytes;
// This loop is very small, so not worth using the identity precompile like we do with initcode below.
for (uint256 i = 0; i < dataLength; i++) {
preambleData[i] = _bytecode[dataStart + i];
}
}
// Parsing the initcode byte-by-byte is too costly for long initcode, so we perform a staticcall
// to the identity precompile at address(0x04) to copy the initcode.
uint256 initcodeStart = 3 + nLengthBytes + dataLength;
uint256 initcodeLength = _bytecode.length - initcodeStart;
if (initcodeLength == 0) revert EmptyInitcode();
bytes memory initcode = new bytes(initcodeLength);
bool success;
assembly ("memory-safe") {
// Calculate the memory address of the input data (initcode) within _bytecode.
// - add(_bytecode, 32): Moves past the length field to the start of _bytecode's data.
// - add(..., initcodeStart): Adds the offset to reach the initcode within _bytecode.
let inputData := add(add(_bytecode, 32), initcodeStart)
// Calculate the memory address for the output data in initcode.
let outputData := add(initcode, 32)
// Perform the staticcall to the identity precompile.
success := staticcall(gas(), 0x04, inputData, initcodeLength, outputData, initcodeLength)
}
if (!success) revert IdentityPrecompileCallFailed();
return Preamble(ercVersion, preambleData, initcode);
}
/// @notice Parses the code at the given `_target` as a blueprint and deploys the resulting initcode.
/// This version of `deployFrom` is used when the initcode requires no constructor arguments.
function deployFrom(address _target, bytes32 _salt) internal returns (address) {
return deployFrom(_target, _salt, new bytes(0));
}
/// @notice Parses the code at the given `_target` as a blueprint and deploys the resulting initcode
/// with the given `_data` appended, i.e. `_data` is the ABI-encoded constructor arguments.
function deployFrom(address _target, bytes32 _salt, bytes memory _data) internal returns (address newContract_) {
Preamble memory preamble = parseBlueprintPreamble(address(_target).code);
if (preamble.ercVersion != 0) revert UnsupportedERCVersion(preamble.ercVersion);
if (preamble.preambleData.length != 0) revert UnexpectedPreambleData(preamble.preambleData);
bytes memory initcode = bytes.concat(preamble.initcode, _data);
assembly ("memory-safe") {
newContract_ := create2(0, add(initcode, 0x20), mload(initcode), _salt)
}
if (newContract_ == address(0)) revert DeploymentFailed();
}
/// @notice Parses the code at two target addresses as individual blueprints, concatentates them and then deploys
/// the resulting initcode with the given `_data` appended, i.e. `_data` is the ABI-encoded constructor arguments.
function deployFrom(
address _target1,
address _target2,
bytes32 _salt,
bytes memory _data
)
internal
returns (address newContract_)
{
Preamble memory preamble1 = parseBlueprintPreamble(address(_target1).code);
if (preamble1.ercVersion != 0) revert UnsupportedERCVersion(preamble1.ercVersion);
if (preamble1.preambleData.length != 0) revert UnexpectedPreambleData(preamble1.preambleData);
Preamble memory preamble2 = parseBlueprintPreamble(address(_target2).code);
if (preamble2.ercVersion != 0) revert UnsupportedERCVersion(preamble2.ercVersion);
if (preamble2.preambleData.length != 0) revert UnexpectedPreambleData(preamble2.preambleData);
bytes memory initcode = bytes.concat(preamble1.initcode, preamble2.initcode, _data);
assembly ("memory-safe") {
newContract_ := create2(0, add(initcode, 0x20), mload(initcode), _salt)
}
if (newContract_ == address(0)) revert DeploymentFailed();
}
/// @notice Deploys a blueprint contract with the given `_rawBytecode` and `_salt`. If the blueprint is too large to
/// fit in a single deployment, it is split across two addresses. It is the responsibility of the caller to handle
/// large contracts by checking if the second return value is not address(0).
function create(
bytes memory _rawBytecode,
bytes32 _salt
)
internal
returns (address newContract1_, address newContract2_)
{
if (_rawBytecode.length <= maxInitCodeSize()) {
newContract1_ = deploySmallBytecode(blueprintDeployerBytecode(_rawBytecode), _salt);
return (newContract1_, address(0));
}
(newContract1_, newContract2_) = deployBigBytecode(_rawBytecode, _salt);
}
/// @notice Deploys a blueprint contract that can fit in a single address.
function deploySmallBytecode(bytes memory _bytecode, bytes32 _salt) internal returns (address newContract_) {
assembly ("memory-safe") {
newContract_ := create2(0, add(_bytecode, 0x20), mload(_bytecode), _salt)
}
require(newContract_ != address(0), "Blueprint: create2 failed");
}
/// @notice Deploys a two blueprint contracts, splitting the bytecode across both of them.
function deployBigBytecode(
bytes memory _bytecode,
bytes32 _salt
)
internal
returns (address newContract1_, address newContract2_)
{
uint32 maxSize = maxInitCodeSize();
bytes memory part1Slice = Bytes.slice(_bytecode, 0, maxSize);
bytes memory part1 = blueprintDeployerBytecode(part1Slice);
bytes memory part2Slice = Bytes.slice(_bytecode, maxSize, _bytecode.length - maxSize);
bytes memory part2 = blueprintDeployerBytecode(part2Slice);
newContract1_ = deploySmallBytecode(part1, _salt);
newContract2_ = deploySmallBytecode(part2, _salt);
}
/// @notice Convert a bytes array to a uint256.
function bytesToUint(bytes memory _b) internal pure returns (uint256) {
if (_b.length > 32) revert BytesArrayTooLong();
uint256 number;
for (uint256 i = 0; i < _b.length; i++) {
number = number + uint256(uint8(_b[i])) * (2 ** (8 * (_b.length - (i + 1))));
}
return number;
}
/// @notice Returns the maximum init code size for each blueprint. The preamble needs 3 bytes.
function maxInitCodeSize() internal pure returns (uint32) {
return 24576 - 3;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Interfaces
import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol";
/// @title Constants
/// @notice Constants is a library for storing constants. Simple! Don't put everything in here, just
/// the stuff used in multiple contracts. Constants that only apply to a single contract
/// should be defined in that contract instead.
library Constants {
/// @notice Special address to be used as the tx origin for gas estimation calls in the
/// OptimismPortal and CrossDomainMessenger calls. You only need to use this address if
/// the minimum gas limit specified by the user is not actually enough to execute the
/// given message and you're attempting to estimate the actual necessary gas limit. We
/// use address(1) because it's the ecrecover precompile and therefore guaranteed to
/// never have any code on any EVM chain.
address internal constant ESTIMATION_ADDRESS = address(1);
/// @notice Value used for the L2 sender storage slot in both the OptimismPortal and the
/// CrossDomainMessenger contracts before an actual sender is set. This value is
/// non-zero to reduce the gas cost of message passing transactions.
address internal constant DEFAULT_L2_SENDER = 0x000000000000000000000000000000000000dEaD;
/// @notice The storage slot that holds the address of a proxy implementation.
/// @dev `bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)`
bytes32 internal constant PROXY_IMPLEMENTATION_ADDRESS =
0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/// @notice The storage slot that holds the address of the owner.
/// @dev `bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)`
bytes32 internal constant PROXY_OWNER_ADDRESS = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/// @notice The address that represents ether when dealing with ERC20 token addresses.
address internal constant ETHER = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
/// @notice The address that represents the system caller responsible for L1 attributes
/// transactions.
address internal constant DEPOSITOR_ACCOUNT = 0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001;
/// @notice Returns the default values for the ResourceConfig. These are the recommended values
/// for a production network.
function DEFAULT_RESOURCE_CONFIG() internal pure returns (IResourceMetering.ResourceConfig memory) {
IResourceMetering.ResourceConfig memory config = IResourceMetering.ResourceConfig({
maxResourceLimit: 20_000_000,
elasticityMultiplier: 10,
baseFeeMaxChangeDenominator: 8,
minimumBaseFee: 1 gwei,
systemTxMaxGas: 1_000_000,
maximumBaseFee: type(uint128).max
});
return config;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title Bytes
/// @notice Bytes is a library for manipulating byte arrays.
library Bytes {
/// @custom:attribution https://github.com/GNSPS/solidity-bytes-utils
/// @notice Slices a byte array with a given starting index and length. Returns a new byte array
/// as opposed to a pointer to the original array. Will throw if trying to slice more
/// bytes than exist in the array.
/// @param _bytes Byte array to slice.
/// @param _start Starting index of the slice.
/// @param _length Length of the slice.
/// @return Slice of the input byte array.
function slice(bytes memory _bytes, uint256 _start, uint256 _length) internal pure returns (bytes memory) {
unchecked {
require(_length + 31 >= _length, "slice_overflow");
require(_start + _length >= _start, "slice_overflow");
require(_bytes.length >= _start + _length, "slice_outOfBounds");
}
bytes memory tempBytes;
assembly {
switch iszero(_length)
case 0 {
// Get a location of some free memory and store it in tempBytes as
// Solidity does for memory variables.
tempBytes := mload(0x40)
// The first word of the slice result is potentially a partial
// word read from the original array. To read it, we calculate
// the length of that partial word and start copying that many
// bytes into the array. The first word we copy will start with
// data we don't care about, but the last `lengthmod` bytes will
// land at the beginning of the contents of the new array. When
// we're done copying, we overwrite the full first word with
// the actual length of the slice.
let lengthmod := and(_length, 31)
// The multiplication in the next line is necessary
// because when slicing multiples of 32 bytes (lengthmod == 0)
// the following copy loop was copying the origin's length
// and then ending prematurely not copying everything it should.
let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
let end := add(mc, _length)
for {
// The multiplication in the next line has the same exact purpose
// as the one above.
let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
} lt(mc, end) {
mc := add(mc, 0x20)
cc := add(cc, 0x20)
} { mstore(mc, mload(cc)) }
mstore(tempBytes, _length)
//update free-memory pointer
//allocating the array padded to 32 bytes like the compiler does now
mstore(0x40, and(add(mc, 31), not(31)))
}
//if we want a zero-length slice let's just return a zero-length array
default {
tempBytes := mload(0x40)
//zero out the 32 bytes slice we are about to return
//we need to do it because Solidity does not garbage collect
mstore(tempBytes, 0)
mstore(0x40, add(tempBytes, 0x20))
}
}
return tempBytes;
}
/// @notice Slices a byte array with a given starting index up to the end of the original byte
/// array. Returns a new array rathern than a pointer to the original.
/// @param _bytes Byte array to slice.
/// @param _start Starting index of the slice.
/// @return Slice of the input byte array.
function slice(bytes memory _bytes, uint256 _start) internal pure returns (bytes memory) {
if (_start >= _bytes.length) {
return bytes("");
}
return slice(_bytes, _start, _bytes.length - _start);
}
/// @notice Converts a byte array into a nibble array by splitting each byte into two nibbles.
/// Resulting nibble array will be exactly twice as long as the input byte array.
/// @param _bytes Input byte array to convert.
/// @return Resulting nibble array.
function toNibbles(bytes memory _bytes) internal pure returns (bytes memory) {
bytes memory _nibbles;
assembly {
// Grab a free memory offset for the new array
_nibbles := mload(0x40)
// Load the length of the passed bytes array from memory
let bytesLength := mload(_bytes)
// Calculate the length of the new nibble array
// This is the length of the input array times 2
let nibblesLength := shl(0x01, bytesLength)
// Update the free memory pointer to allocate memory for the new array.
// To do this, we add the length of the new array + 32 bytes for the array length
// rounded up to the nearest 32 byte boundary to the current free memory pointer.
mstore(0x40, add(_nibbles, and(not(0x1F), add(nibblesLength, 0x3F))))
// Store the length of the new array in memory
mstore(_nibbles, nibblesLength)
// Store the memory offset of the _bytes array's contents on the stack
let bytesStart := add(_bytes, 0x20)
// Store the memory offset of the nibbles array's contents on the stack
let nibblesStart := add(_nibbles, 0x20)
// Loop through each byte in the input array
for { let i := 0x00 } lt(i, bytesLength) { i := add(i, 0x01) } {
// Get the starting offset of the next 2 bytes in the nibbles array
let offset := add(nibblesStart, shl(0x01, i))
// Load the byte at the current index within the `_bytes` array
let b := byte(0x00, mload(add(bytesStart, i)))
// Pull out the first nibble and store it in the new array
mstore8(offset, shr(0x04, b))
// Pull out the second nibble and store it in the new array
mstore8(add(offset, 0x01), and(b, 0x0F))
}
}
return _nibbles;
}
/// @notice Compares two byte arrays by comparing their keccak256 hashes.
/// @param _bytes First byte array to compare.
/// @param _other Second byte array to compare.
/// @return True if the two byte arrays are equal, false otherwise.
function equal(bytes memory _bytes, bytes memory _other) internal pure returns (bool) {
return keccak256(_bytes) == keccak256(_other);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
// Libraries
import {
Position,
Hash,
GameType,
VMStatus,
Timestamp,
Duration,
Clock,
GameId,
Claim,
LibGameId,
LibClock
} from "src/dispute/lib/LibUDT.sol";
/// @notice The current status of the dispute game.
enum GameStatus {
// The game is currently in progress, and has not been resolved.
IN_PROGRESS,
// The game has concluded, and the `rootClaim` was challenged successfully.
CHALLENGER_WINS,
// The game has concluded, and the `rootClaim` could not be contested.
DEFENDER_WINS
}
/// @notice The game's bond distribution type. Games are expected to start in the `UNDECIDED`
/// state, and then choose either `NORMAL` or `REFUND`.
enum BondDistributionMode {
// Bond distribution strategy has not been chosen.
UNDECIDED,
// Bonds should be distributed as normal.
NORMAL,
// Bonds should be refunded to claimants.
REFUND
}
/// @notice Represents an L2 output root and the L2 block number at which it was generated.
/// @custom:field root The output root.
/// @custom:field l2BlockNumber The L2 block number at which the output root was generated.
struct OutputRoot {
Hash root;
uint256 l2BlockNumber;
}
/// @title GameTypes
/// @notice A library that defines the IDs of games that can be played.
library GameTypes {
/// @dev A dispute game type the uses the cannon vm.
GameType internal constant CANNON = GameType.wrap(0);
/// @dev A permissioned dispute game type that uses the cannon vm.
GameType internal constant PERMISSIONED_CANNON = GameType.wrap(1);
/// @notice A dispute game type that uses the asterisc vm.
GameType internal constant ASTERISC = GameType.wrap(2);
/// @notice A dispute game type that uses the asterisc vm with Kona.
GameType internal constant ASTERISC_KONA = GameType.wrap(3);
/// @notice A dispute game type that uses OP Succinct
GameType internal constant OP_SUCCINCT = GameType.wrap(6);
/// @notice A dispute game type with short game duration for testing withdrawals.
/// Not intended for production use.
GameType internal constant FAST = GameType.wrap(254);
/// @notice A dispute game type that uses an alphabet vm.
/// Not intended for production use.
GameType internal constant ALPHABET = GameType.wrap(255);
/// @notice A dispute game type that uses RISC Zero's Kailua
GameType internal constant KAILUA = GameType.wrap(1337);
}
/// @title VMStatuses
/// @notice Named type aliases for the various valid VM status bytes.
library VMStatuses {
/// @notice The VM has executed successfully and the outcome is valid.
VMStatus internal constant VALID = VMStatus.wrap(0);
/// @notice The VM has executed successfully and the outcome is invalid.
VMStatus internal constant INVALID = VMStatus.wrap(1);
/// @notice The VM has paniced.
VMStatus internal constant PANIC = VMStatus.wrap(2);
/// @notice The VM execution is still in progress.
VMStatus internal constant UNFINISHED = VMStatus.wrap(3);
}
/// @title LocalPreimageKey
/// @notice Named type aliases for local `PreimageOracle` key identifiers.
library LocalPreimageKey {
/// @notice The identifier for the L1 head hash.
uint256 internal constant L1_HEAD_HASH = 0x01;
/// @notice The identifier for the starting output root.
uint256 internal constant STARTING_OUTPUT_ROOT = 0x02;
/// @notice The identifier for the disputed output root.
uint256 internal constant DISPUTED_OUTPUT_ROOT = 0x03;
/// @notice The identifier for the disputed L2 block number.
uint256 internal constant DISPUTED_L2_BLOCK_NUMBER = 0x04;
/// @notice The identifier for the chain ID.
uint256 internal constant CHAIN_ID = 0x05;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title ISemver
/// @notice ISemver is a simple contract for ensuring that contracts are
/// versioned using semantic versioning.
interface ISemver {
/// @notice Getter for the semantic version of the contract. This is not
/// meant to be used onchain but instead meant to be used by offchain
/// tooling.
/// @return Semver contract version as a string.
function version() external view returns (string memory);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IResourceMetering {
struct ResourceParams {
uint128 prevBaseFee;
uint64 prevBoughtGas;
uint64 prevBlockNum;
}
struct ResourceConfig {
uint32 maxResourceLimit;
uint8 elasticityMultiplier;
uint8 baseFeeMaxChangeDenominator;
uint32 minimumBaseFee;
uint32 systemTxMaxGas;
uint128 maximumBaseFee;
}
error OutOfGas();
event Initialized(uint8 version);
function params() external view returns (uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum); // nosemgrep
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IPreimageOracle } from "interfaces/cannon/IPreimageOracle.sol";
/// @title IBigStepper
/// @notice Describes a state machine that can perform a single instruction step, provided a prestate and an optional
/// proof.
/// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
/// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⠶⢅⠒⢄⢔⣶⡦⣤⡤⠄⣀⠀⠀⠀⠀⠀⠀⠀
/// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠨⡏⠀⠀⠈⠢⣙⢯⣄⠀⢨⠯⡺⡘⢄⠀⠀⠀⠀⠀
/// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣶⡆⠀⠀⠀⠀⠈⠓⠬⡒⠡⣀⢙⡜⡀⠓⠄⠀⠀⠀
/// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡷⠿⣧⣀⡀⠀⠀⠀⠀⠀⠀⠉⠣⣞⠩⠥⠀⠼⢄⠀⠀
/// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⠀⠀⠉⢹⣶⠒⠒⠂⠈⠉⠁⠘⡆⠀⣿⣿⠫⡄⠀
/// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⢶⣤⣀⡀⠀⠀⢸⡿⠀⠀⠀⠀⠀⢀⠞⠀⠀⢡⢨⢀⡄⠀
/// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡒⣿⢿⡤⠝⡣⠉⠁⠚⠛⠀⠤⠤⣄⡰⠁⠀⠀⠀⠉⠙⢸⠀⠀
/// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡤⢯⡌⡿⡇⠘⡷⠀⠁⠀⠀⢀⣰⠢⠲⠛⣈⣸⠦⠤⠶⠴⢬⣐⣊⡂⠀
/// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⡪⡗⢫⠞⠀⠆⣀⠻⠤⠴⠐⠚⣉⢀⠦⠂⠋⠁⠀⠁⠀⠀⠀⠀⢋⠉⠇⠀
/// ⠀⠀⠀⠀⣀⡤⠐⠒⠘⡹⠉⢸⠇⠸⠀⠀⠀⠀⣀⣤⠴⠚⠉⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠼⠀⣾⠀
/// ⠀⠀⠀⡰⠀⠉⠉⠀⠁⠀⠀⠈⢇⠈⠒⠒⠘⠈⢀⢡⡂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⠀⢸⡄
/// ⠀⠀⠸⣿⣆⠤⢀⡀⠀⠀⠀⠀⢘⡌⠀⠀⣀⣀⣀⡈⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⢸⡇
/// ⠀⠀⢸⣀⠀⠉⠒⠐⠛⠋⠭⠭⠍⠉⠛⠒⠒⠒⠀⠒⠚⠛⠛⠛⠩⠭⠭⠭⠭⠤⠤⠤⠤⠤⠭⠭⠉⠓⡆
/// ⠀⠀⠘⠿⣷⣶⣤⣤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇
/// ⠀⠀⠀⠀⠀⠉⠙⠛⠛⠻⠿⢿⣿⣿⣷⣶⣶⣶⣤⣤⣀⣁⣛⣃⣒⠿⠿⠿⠤⠠⠄⠤⠤⢤⣛⣓⣂⣻⡇
/// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠙⠛⠻⠿⠿⠿⢿⣿⣿⣿⣷⣶⣶⣾⣿⣿⣿⣿⠿⠟⠁
/// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠈⠉⠉⠉⠉⠁⠀⠀⠀⠀⠀
interface IBigStepper {
/// @notice Performs the state transition from a given prestate and returns the hash of the post state witness.
/// @param _stateData The raw opaque prestate data.
/// @param _proof Opaque proof data, can be used to prove things about the prestate in relation to the state of the
/// interface's implementation.
/// @param _localContext The local key context for the preimage oracle. Optional, can be set as a constant if the
/// implementation only requires one set of local keys.
/// @return postState_ The hash of the post state witness after the state transition.
function step(
bytes calldata _stateData,
bytes calldata _proof,
bytes32 _localContext
)
external
returns (bytes32 postState_);
/// @notice Returns the preimage oracle used by the state machine.
function oracle() external view returns (IPreimageOracle oracle_);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
interface IDelayedWETH {
struct WithdrawalRequest {
uint256 amount;
uint256 timestamp;
}
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event Initialized(uint8 version);
fallback() external payable;
receive() external payable;
function config() external view returns (ISuperchainConfig);
function delay() external view returns (uint256);
function hold(address _guy) external;
function hold(address _guy, uint256 _wad) external;
function initialize(address _owner, ISuperchainConfig _config) external;
function owner() external view returns (address);
function recover(uint256 _wad) external;
function transferOwnership(address newOwner) external; // nosemgrep
function renounceOwnership() external;
function unlock(address _guy, uint256 _wad) external;
function withdraw(address _guy, uint256 _wad) external;
function withdrawals(address, address) external view returns (uint256 amount, uint256 timestamp);
function version() external view returns (string memory);
function withdraw(uint256 _wad) external;
event Approval(address indexed src, address indexed guy, uint256 wad);
event Transfer(address indexed src, address indexed dst, uint256 wad);
event Deposit(address indexed dst, uint256 wad);
event Withdrawal(address indexed src, uint256 wad);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function balanceOf(address src) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function deposit() external payable;
function totalSupply() external view returns (uint256);
function approve(address guy, uint256 wad) external returns (bool);
function transfer(address dst, uint256 wad) external returns (bool);
function transferFrom(address src, address dst, uint256 wad) external returns (bool);
function __constructor__(uint256 _delay) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol";
import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol";
import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol";
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
import { IOptimismPortal2 } from "interfaces/L1/IOptimismPortal2.sol";
import { GameType, Hash, OutputRoot } from "src/dispute/lib/Types.sol";
interface IAnchorStateRegistry {
error AnchorStateRegistry_Unauthorized();
error AnchorStateRegistry_InvalidAnchorGame();
error AnchorStateRegistry_AnchorGameBlacklisted();
event AnchorNotUpdated(IFaultDisputeGame indexed game);
event AnchorUpdated(IFaultDisputeGame indexed game);
event Initialized(uint8 version);
function anchorGame() external view returns (IFaultDisputeGame);
function anchors(GameType) external view returns (Hash, uint256);
function getAnchorRoot() external view returns (Hash, uint256);
function disputeGameFactory() external view returns (IDisputeGameFactory);
function initialize(
ISuperchainConfig _superchainConfig,
IDisputeGameFactory _disputeGameFactory,
IOptimismPortal2 _portal,
OutputRoot memory _startingAnchorRoot
)
external;
function isGameBlacklisted(IDisputeGame _game) external view returns (bool);
function isGameProper(IDisputeGame _game) external view returns (bool);
function isGameRegistered(IDisputeGame _game) external view returns (bool);
function isGameResolved(IDisputeGame _game) external view returns (bool);
function isGameRespected(IDisputeGame _game) external view returns (bool);
function isGameRetired(IDisputeGame _game) external view returns (bool);
function isGameFinalized(IDisputeGame _game) external view returns (bool);
function isGameClaimValid(IDisputeGame _game) external view returns (bool);
function portal() external view returns (IOptimismPortal2);
function respectedGameType() external view returns (GameType);
function setAnchorState(IDisputeGame _game) external;
function superchainConfig() external view returns (ISuperchainConfig);
function version() external view returns (string memory);
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IInitializable } from "interfaces/dispute/IInitializable.sol";
import { Timestamp, GameStatus, GameType, Claim, Hash } from "src/dispute/lib/Types.sol";
interface IDisputeGame is IInitializable {
event Resolved(GameStatus indexed status);
function createdAt() external view returns (Timestamp);
function resolvedAt() external view returns (Timestamp);
function status() external view returns (GameStatus);
function gameType() external view returns (GameType gameType_);
function gameCreator() external pure returns (address creator_);
function rootClaim() external pure returns (Claim rootClaim_);
function l1Head() external pure returns (Hash l1Head_);
function l2BlockNumber() external pure returns (uint256 l2BlockNumber_);
function extraData() external pure returns (bytes memory extraData_);
function resolve() external returns (GameStatus status_);
function gameData() external view returns (GameType gameType_, Claim rootClaim_, bytes memory extraData_);
function wasRespectedGameTypeWhenCreated() external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IOwnable } from "interfaces/universal/IOwnable.sol";
/// @title IAddressManager
/// @notice Interface for the AddressManager contract.
interface IAddressManager is IOwnable {
event AddressSet(string indexed name, address newAddress, address oldAddress);
function getAddress(string memory _name) external view returns (address);
function setAddress(string memory _name, address _address) external;
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IAddressManager } from "interfaces/legacy/IAddressManager.sol";
interface IProxyAdmin {
enum ProxyType {
ERC1967,
CHUGSPLASH,
RESOLVED
}
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function addressManager() external view returns (IAddressManager);
function changeProxyAdmin(address payable _proxy, address _newAdmin) external;
function getProxyAdmin(address payable _proxy) external view returns (address);
function getProxyImplementation(address _proxy) external view returns (address);
function implementationName(address) external view returns (string memory);
function isUpgrading() external view returns (bool);
function owner() external view returns (address);
function proxyType(address) external view returns (ProxyType);
function renounceOwnership() external;
function setAddress(string memory _name, address _address) external;
function setAddressManager(IAddressManager _address) external;
function setImplementationName(address _address, string memory _name) external;
function setProxyType(address _address, ProxyType _type) external;
function setUpgrading(bool _upgrading) external;
function transferOwnership(address newOwner) external; // nosemgrep
function upgrade(address payable _proxy, address _implementation) external;
function upgradeAndCall(address payable _proxy, address _implementation, bytes memory _data) external payable;
function __constructor__(address _owner) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol";
import { GameId, Timestamp, Claim, Hash, GameType } from "src/dispute/lib/Types.sol";
interface IDisputeGameFactory {
struct GameSearchResult {
uint256 index;
GameId metadata;
Timestamp timestamp;
Claim rootClaim;
bytes extraData;
}
error GameAlreadyExists(Hash uuid);
error IncorrectBondAmount();
error NoImplementation(GameType gameType);
event DisputeGameCreated(address indexed disputeProxy, GameType indexed gameType, Claim indexed rootClaim);
event ImplementationSet(address indexed impl, GameType indexed gameType);
event InitBondUpdated(GameType indexed gameType, uint256 indexed newBond);
event Initialized(uint8 version);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function create(
GameType _gameType,
Claim _rootClaim,
bytes memory _extraData
)
external
payable
returns (IDisputeGame proxy_);
function findLatestGames(
GameType _gameType,
uint256 _start,
uint256 _n
)
external
view
returns (GameSearchResult[] memory games_);
function gameAtIndex(uint256 _index)
external
view
returns (GameType gameType_, Timestamp timestamp_, IDisputeGame proxy_);
function gameCount() external view returns (uint256 gameCount_);
function gameImpls(GameType) external view returns (IDisputeGame);
function games(
GameType _gameType,
Claim _rootClaim,
bytes memory _extraData
)
external
view
returns (IDisputeGame proxy_, Timestamp timestamp_);
function getGameUUID(
GameType _gameType,
Claim _rootClaim,
bytes memory _extraData
)
external
pure
returns (Hash uuid_);
function initBonds(GameType) external view returns (uint256);
function initialize(address _owner) external;
function owner() external view returns (address);
function renounceOwnership() external;
function setImplementation(GameType _gameType, IDisputeGame _impl) external;
function setInitBond(GameType _gameType, uint256 _initBond) external;
function transferOwnership(address newOwner) external; // nosemgrep
function version() external view returns (string memory);
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol";
import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol";
import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol";
import { IBigStepper } from "interfaces/dispute/IBigStepper.sol";
import { Types } from "src/libraries/Types.sol";
import { GameType, Claim, Position, Clock, Hash, Duration, BondDistributionMode } from "src/dispute/lib/Types.sol";
interface IFaultDisputeGame is IDisputeGame {
struct ClaimData {
uint32 parentIndex;
address counteredBy;
address claimant;
uint128 bond;
Claim claim;
Position position;
Clock clock;
}
struct ResolutionCheckpoint {
bool initialCheckpointComplete;
uint32 subgameIndex;
Position leftmostPosition;
address counteredBy;
}
struct GameConstructorParams {
GameType gameType;
Claim absolutePrestate;
uint256 maxGameDepth;
uint256 splitDepth;
Duration clockExtension;
Duration maxClockDuration;
IBigStepper vm;
IDelayedWETH weth;
IAnchorStateRegistry anchorStateRegistry;
uint256 l2ChainId;
}
error AlreadyInitialized();
error AnchorRootNotFound();
error BlockNumberMatches();
error BondTransferFailed();
error CannotDefendRootClaim();
error ClaimAboveSplit();
error ClaimAlreadyExists();
error ClaimAlreadyResolved();
error ClockNotExpired();
error ClockTimeExceeded();
error ContentLengthMismatch();
error DuplicateStep();
error EmptyItem();
error GameDepthExceeded();
error GameNotInProgress();
error IncorrectBondAmount();
error InvalidChallengePeriod();
error InvalidClockExtension();
error InvalidDataRemainder();
error InvalidDisputedClaimIndex();
error InvalidHeader();
error InvalidHeaderRLP();
error InvalidLocalIdent();
error InvalidOutputRootProof();
error InvalidParent();
error InvalidPrestate();
error InvalidSplitDepth();
error L2BlockNumberChallenged();
error MaxDepthTooLarge();
error NoCreditToClaim();
error OutOfOrderResolution();
error UnexpectedList();
error UnexpectedRootClaim(Claim rootClaim);
error UnexpectedString();
error ValidStep();
error InvalidBondDistributionMode();
error GameNotFinalized();
error GameNotResolved();
error ReservedGameType();
event Move(uint256 indexed parentIndex, Claim indexed claim, address indexed claimant);
event GameClosed(BondDistributionMode bondDistributionMode);
function absolutePrestate() external view returns (Claim absolutePrestate_);
function addLocalData(uint256 _ident, uint256 _execLeafIdx, uint256 _partOffset) external;
function anchorStateRegistry() external view returns (IAnchorStateRegistry registry_);
function attack(Claim _disputed, uint256 _parentIndex, Claim _claim) external payable;
function bondDistributionMode() external view returns (BondDistributionMode);
function challengeRootL2Block(Types.OutputRootProof memory _outputRootProof, bytes memory _headerRLP) external;
function claimCredit(address _recipient) external;
function claimData(uint256)
external
view // nosemgrep
returns (
uint32 parentIndex,
address counteredBy,
address claimant,
uint128 bond,
Claim claim,
Position position,
Clock clock
);
function claimDataLen() external view returns (uint256 len_);
function claims(Hash) external view returns (bool);
function clockExtension() external view returns (Duration clockExtension_);
function closeGame() external;
function credit(address _recipient) external view returns (uint256 credit_);
function defend(Claim _disputed, uint256 _parentIndex, Claim _claim) external payable;
function getChallengerDuration(uint256 _claimIndex) external view returns (Duration duration_);
function getNumToResolve(uint256 _claimIndex) external view returns (uint256 numRemainingChildren_);
function getRequiredBond(Position _position) external view returns (uint256 requiredBond_);
function hasUnlockedCredit(address) external view returns (bool);
function l2BlockNumber() external pure returns (uint256 l2BlockNumber_);
function l2BlockNumberChallenged() external view returns (bool);
function l2BlockNumberChallenger() external view returns (address);
function l2ChainId() external view returns (uint256 l2ChainId_);
function maxClockDuration() external view returns (Duration maxClockDuration_);
function maxGameDepth() external view returns (uint256 maxGameDepth_);
function move(Claim _disputed, uint256 _challengeIndex, Claim _claim, bool _isAttack) external payable;
function normalModeCredit(address) external view returns (uint256);
function refundModeCredit(address) external view returns (uint256);
function resolutionCheckpoints(uint256)
external
view
returns (bool initialCheckpointComplete, uint32 subgameIndex, Position leftmostPosition, address counteredBy); // nosemgrep
function resolveClaim(uint256 _claimIndex, uint256 _numToResolve) external;
function resolvedSubgames(uint256) external view returns (bool);
function splitDepth() external view returns (uint256 splitDepth_);
function startingBlockNumber() external view returns (uint256 startingBlockNumber_);
function startingOutputRoot() external view returns (Hash root, uint256 l2BlockNumber); // nosemgrep
function startingRootHash() external view returns (Hash startingRootHash_);
function step(uint256 _claimIndex, bool _isAttack, bytes memory _stateData, bytes memory _proof) external;
function subgames(uint256, uint256) external view returns (uint256);
function version() external pure returns (string memory);
function vm() external view returns (IBigStepper vm_);
function wasRespectedGameTypeWhenCreated() external view returns (bool);
function weth() external view returns (IDelayedWETH weth_);
function __constructor__(GameConstructorParams memory _params) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { Types } from "src/libraries/Types.sol";
import { Claim, Position, Clock, Hash, Duration, BondDistributionMode } from "src/dispute/lib/Types.sol";
import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol";
import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol";
import { IBigStepper } from "interfaces/dispute/IBigStepper.sol";
import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol";
import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol";
interface IPermissionedDisputeGame is IDisputeGame {
struct ClaimData {
uint32 parentIndex;
address counteredBy;
address claimant;
uint128 bond;
Claim claim;
Position position;
Clock clock;
}
struct ResolutionCheckpoint {
bool initialCheckpointComplete;
uint32 subgameIndex;
Position leftmostPosition;
address counteredBy;
}
error AlreadyInitialized();
error AnchorRootNotFound();
error BlockNumberMatches();
error BondTransferFailed();
error CannotDefendRootClaim();
error ClaimAboveSplit();
error ClaimAlreadyExists();
error ClaimAlreadyResolved();
error ClockNotExpired();
error ClockTimeExceeded();
error ContentLengthMismatch();
error DuplicateStep();
error EmptyItem();
error GameDepthExceeded();
error GameNotInProgress();
error IncorrectBondAmount();
error InvalidChallengePeriod();
error InvalidClockExtension();
error InvalidDataRemainder();
error InvalidDisputedClaimIndex();
error InvalidHeader();
error InvalidHeaderRLP();
error InvalidLocalIdent();
error InvalidOutputRootProof();
error InvalidParent();
error InvalidPrestate();
error InvalidSplitDepth();
error L2BlockNumberChallenged();
error MaxDepthTooLarge();
error NoCreditToClaim();
error OutOfOrderResolution();
error UnexpectedList();
error UnexpectedRootClaim(Claim rootClaim);
error UnexpectedString();
error ValidStep();
error InvalidBondDistributionMode();
error GameNotFinalized();
error GameNotResolved();
error ReservedGameType();
event Move(uint256 indexed parentIndex, Claim indexed claim, address indexed claimant);
event GameClosed(BondDistributionMode bondDistributionMode);
function absolutePrestate() external view returns (Claim absolutePrestate_);
function addLocalData(uint256 _ident, uint256 _execLeafIdx, uint256 _partOffset) external;
function anchorStateRegistry() external view returns (IAnchorStateRegistry registry_);
function attack(Claim _disputed, uint256 _parentIndex, Claim _claim) external payable;
function bondDistributionMode() external view returns (BondDistributionMode);
function challengeRootL2Block(Types.OutputRootProof memory _outputRootProof, bytes memory _headerRLP) external;
function claimCredit(address _recipient) external;
function claimData(uint256)
external
view // nosemgrep
returns (
uint32 parentIndex,
address counteredBy,
address claimant,
uint128 bond,
Claim claim,
Position position,
Clock clock
);
function claimDataLen() external view returns (uint256 len_);
function claims(Hash) external view returns (bool);
function clockExtension() external view returns (Duration clockExtension_);
function closeGame() external;
function credit(address _recipient) external view returns (uint256 credit_);
function defend(Claim _disputed, uint256 _parentIndex, Claim _claim) external payable;
function getChallengerDuration(uint256 _claimIndex) external view returns (Duration duration_);
function getNumToResolve(uint256 _claimIndex) external view returns (uint256 numRemainingChildren_);
function getRequiredBond(Position _position) external view returns (uint256 requiredBond_);
function hasUnlockedCredit(address) external view returns (bool);
function initialize() external payable;
function l2BlockNumber() external pure returns (uint256 l2BlockNumber_);
function l2BlockNumberChallenged() external view returns (bool);
function l2BlockNumberChallenger() external view returns (address);
function l2ChainId() external view returns (uint256 l2ChainId_);
function maxClockDuration() external view returns (Duration maxClockDuration_);
function maxGameDepth() external view returns (uint256 maxGameDepth_);
function move(Claim _disputed, uint256 _challengeIndex, Claim _claim, bool _isAttack) external payable;
function normalModeCredit(address) external view returns (uint256);
function refundModeCredit(address) external view returns (uint256);
function resolutionCheckpoints(uint256)
external
view
returns (bool initialCheckpointComplete, uint32 subgameIndex, Position leftmostPosition, address counteredBy); // nosemgrep
function resolveClaim(uint256 _claimIndex, uint256 _numToResolve) external;
function resolvedSubgames(uint256) external view returns (bool);
function splitDepth() external view returns (uint256 splitDepth_);
function startingBlockNumber() external view returns (uint256 startingBlockNumber_);
function startingOutputRoot() external view returns (Hash root, uint256 l2BlockNumber); // nosemgrep
function startingRootHash() external view returns (Hash startingRootHash_);
function step(uint256 _claimIndex, bool _isAttack, bytes memory _stateData, bytes memory _proof) external;
function subgames(uint256, uint256) external view returns (uint256);
function version() external pure returns (string memory);
function vm() external view returns (IBigStepper vm_);
function wasRespectedGameTypeWhenCreated() external view returns (bool);
function weth() external view returns (IDelayedWETH weth_);
error BadAuth();
function proposer() external view returns (address proposer_);
function challenger() external view returns (address challenger_);
function __constructor__(
IFaultDisputeGame.GameConstructorParams memory _params,
address _proposer,
address _challenger
)
external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface ISuperchainConfig {
enum UpdateType {
GUARDIAN
}
event ConfigUpdate(UpdateType indexed updateType, bytes data);
event Initialized(uint8 version);
event Paused(string identifier);
event Unpaused();
function GUARDIAN_SLOT() external view returns (bytes32);
function PAUSED_SLOT() external view returns (bytes32);
function guardian() external view returns (address guardian_);
function initialize(address _guardian, bool _paused) external;
function pause(string memory _identifier) external;
function paused() external view returns (bool paused_);
function unpause() external;
function version() external view returns (string memory);
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
type ProtocolVersion is uint256;
interface IProtocolVersions {
enum UpdateType {
REQUIRED_PROTOCOL_VERSION,
RECOMMENDED_PROTOCOL_VERSION
}
event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data);
event Initialized(uint8 version);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function RECOMMENDED_SLOT() external view returns (bytes32);
function REQUIRED_SLOT() external view returns (bytes32);
function VERSION() external view returns (uint256);
function initialize(address _owner, ProtocolVersion _required, ProtocolVersion _recommended) external;
function owner() external view returns (address);
function recommended() external view returns (ProtocolVersion out_);
function renounceOwnership() external;
function required() external view returns (ProtocolVersion out_);
function setRecommended(ProtocolVersion _recommended) external;
function setRequired(ProtocolVersion _required) external;
function transferOwnership(address newOwner) external; // nosemgrep
function version() external view returns (string memory);
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { Types } from "src/libraries/Types.sol";
import { GameType, Timestamp } from "src/dispute/lib/LibUDT.sol";
import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol";
import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol";
import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol";
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
interface IOptimismPortal2 {
error AlreadyFinalized();
error BadTarget();
error Blacklisted();
error CallPaused();
error ContentLengthMismatch();
error EmptyItem();
error GasEstimation();
error InvalidDataRemainder();
error InvalidDisputeGame();
error InvalidGameType();
error InvalidHeader();
error InvalidMerkleProof();
error InvalidProof();
error LargeCalldata();
error NonReentrant();
error OutOfGas();
error ProposalNotValidated();
error SmallGasLimit();
error Unauthorized();
error UnexpectedList();
error UnexpectedString();
error Unproven();
error LegacyGame();
event DisputeGameBlacklisted(IDisputeGame indexed disputeGame);
event Initialized(uint8 version);
event RespectedGameTypeSet(GameType indexed newGameType, Timestamp indexed updatedAt);
event TransactionDeposited(address indexed from, address indexed to, uint256 indexed version, bytes opaqueData);
event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success);
event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to);
event WithdrawalProvenExtension1(bytes32 indexed withdrawalHash, address indexed proofSubmitter);
receive() external payable;
function blacklistDisputeGame(IDisputeGame _disputeGame) external;
function checkWithdrawal(bytes32 _withdrawalHash, address _proofSubmitter) external view;
function depositTransaction(
address _to,
uint256 _value,
uint64 _gasLimit,
bool _isCreation,
bytes memory _data
)
external
payable;
function disputeGameBlacklist(IDisputeGame) external view returns (bool);
function disputeGameFactory() external view returns (IDisputeGameFactory);
function disputeGameFinalityDelaySeconds() external view returns (uint256);
function donateETH() external payable;
function finalizeWithdrawalTransaction(Types.WithdrawalTransaction memory _tx) external;
function finalizeWithdrawalTransactionExternalProof(
Types.WithdrawalTransaction memory _tx,
address _proofSubmitter
)
external;
function finalizedWithdrawals(bytes32) external view returns (bool);
function guardian() external view returns (address);
function initialize(
IDisputeGameFactory _disputeGameFactory,
ISystemConfig _systemConfig,
ISuperchainConfig _superchainConfig,
GameType _initialRespectedGameType
)
external;
function l2Sender() external view returns (address);
function minimumGasLimit(uint64 _byteCount) external pure returns (uint64);
function numProofSubmitters(bytes32 _withdrawalHash) external view returns (uint256);
function params() external view returns (uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum); // nosemgrep
function paused() external view returns (bool);
function proofMaturityDelaySeconds() external view returns (uint256);
function proofSubmitters(bytes32, uint256) external view returns (address);
function proveWithdrawalTransaction(
Types.WithdrawalTransaction memory _tx,
uint256 _disputeGameIndex,
Types.OutputRootProof memory _outputRootProof,
bytes[] memory _withdrawalProof
)
external;
function provenWithdrawals(
bytes32,
address
)
external
view
returns (IDisputeGame disputeGameProxy, uint64 timestamp); // nosemgrep
function respectedGameType() external view returns (GameType);
function respectedGameTypeUpdatedAt() external view returns (uint64);
function setRespectedGameType(GameType _gameType) external;
function superchainConfig() external view returns (ISuperchainConfig);
function systemConfig() external view returns (ISystemConfig);
function version() external pure returns (string memory);
function __constructor__(uint256 _proofMaturityDelaySeconds, uint256 _disputeGameFinalityDelaySeconds) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol";
interface ISystemConfig {
enum UpdateType {
BATCHER,
FEE_SCALARS,
GAS_LIMIT,
UNSAFE_BLOCK_SIGNER,
EIP_1559_PARAMS
}
struct Addresses {
address l1CrossDomainMessenger;
address l1ERC721Bridge;
address l1StandardBridge;
address disputeGameFactory;
address optimismPortal;
address optimismMintableERC20Factory;
}
event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data);
event Initialized(uint8 version);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function BATCH_INBOX_SLOT() external view returns (bytes32);
function DISPUTE_GAME_FACTORY_SLOT() external view returns (bytes32);
function L1_CROSS_DOMAIN_MESSENGER_SLOT() external view returns (bytes32);
function L1_ERC_721_BRIDGE_SLOT() external view returns (bytes32);
function L1_STANDARD_BRIDGE_SLOT() external view returns (bytes32);
function OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT() external view returns (bytes32);
function OPTIMISM_PORTAL_SLOT() external view returns (bytes32);
function START_BLOCK_SLOT() external view returns (bytes32);
function UNSAFE_BLOCK_SIGNER_SLOT() external view returns (bytes32);
function VERSION() external view returns (uint256);
function basefeeScalar() external view returns (uint32);
function batchInbox() external view returns (address addr_);
function batcherHash() external view returns (bytes32);
function blobbasefeeScalar() external view returns (uint32);
function disputeGameFactory() external view returns (address addr_);
function gasLimit() external view returns (uint64);
function eip1559Denominator() external view returns (uint32);
function eip1559Elasticity() external view returns (uint32);
function getAddresses() external view returns (Addresses memory);
function initialize(
address _owner,
uint32 _basefeeScalar,
uint32 _blobbasefeeScalar,
bytes32 _batcherHash,
uint64 _gasLimit,
address _unsafeBlockSigner,
IResourceMetering.ResourceConfig memory _config,
address _batchInbox,
Addresses memory _addresses
)
external;
function l1CrossDomainMessenger() external view returns (address addr_);
function l1ERC721Bridge() external view returns (address addr_);
function l1StandardBridge() external view returns (address addr_);
function maximumGasLimit() external pure returns (uint64);
function minimumGasLimit() external view returns (uint64);
function optimismMintableERC20Factory() external view returns (address addr_);
function optimismPortal() external view returns (address addr_);
function overhead() external view returns (uint256);
function owner() external view returns (address);
function renounceOwnership() external;
function resourceConfig() external view returns (IResourceMetering.ResourceConfig memory);
function scalar() external view returns (uint256);
function setBatcherHash(bytes32 _batcherHash) external;
function setGasConfig(uint256 _overhead, uint256 _scalar) external;
function setGasConfigEcotone(uint32 _basefeeScalar, uint32 _blobbasefeeScalar) external;
function setGasLimit(uint64 _gasLimit) external;
function setUnsafeBlockSigner(address _unsafeBlockSigner) external;
function setEIP1559Params(uint32 _denominator, uint32 _elasticity) external;
function startBlock() external view returns (uint256 startBlock_);
function transferOwnership(address newOwner) external; // nosemgrep
function unsafeBlockSigner() external view returns (address addr_);
function version() external pure returns (string memory);
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { ICrossDomainMessenger } from "interfaces/universal/ICrossDomainMessenger.sol";
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
import { IOptimismPortal2 as IOptimismPortal } from "interfaces/L1/IOptimismPortal2.sol";
interface IL1CrossDomainMessenger is ICrossDomainMessenger {
function PORTAL() external view returns (IOptimismPortal);
function initialize(
ISuperchainConfig _superchainConfig,
IOptimismPortal _portal
)
external;
function portal() external view returns (IOptimismPortal);
function superchainConfig() external view returns (ISuperchainConfig);
function version() external view returns (string memory);
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IERC721Bridge } from "interfaces/universal/IERC721Bridge.sol";
import { ICrossDomainMessenger } from "interfaces/universal/ICrossDomainMessenger.sol";
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
interface IL1ERC721Bridge is IERC721Bridge {
function bridgeERC721(
address _localToken,
address _remoteToken,
uint256 _tokenId,
uint32 _minGasLimit,
bytes memory _extraData
)
external;
function bridgeERC721To(
address _localToken,
address _remoteToken,
address _to,
uint256 _tokenId,
uint32 _minGasLimit,
bytes memory _extraData
)
external;
function deposits(address, address, uint256) external view returns (bool);
function finalizeBridgeERC721(
address _localToken,
address _remoteToken,
address _from,
address _to,
uint256 _tokenId,
bytes memory _extraData
)
external;
function initialize(ICrossDomainMessenger _messenger, ISuperchainConfig _superchainConfig) external;
function paused() external view returns (bool);
function superchainConfig() external view returns (ISuperchainConfig);
function version() external view returns (string memory);
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IStandardBridge } from "interfaces/universal/IStandardBridge.sol";
import { ICrossDomainMessenger } from "interfaces/universal/ICrossDomainMessenger.sol";
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
interface IL1StandardBridge is IStandardBridge {
event ERC20DepositInitiated(
address indexed l1Token,
address indexed l2Token,
address indexed from,
address to,
uint256 amount,
bytes extraData
);
event ERC20WithdrawalFinalized(
address indexed l1Token,
address indexed l2Token,
address indexed from,
address to,
uint256 amount,
bytes extraData
);
event ETHDepositInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData);
event ETHWithdrawalFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData);
function depositERC20(
address _l1Token,
address _l2Token,
uint256 _amount,
uint32 _minGasLimit,
bytes memory _extraData
)
external;
function depositERC20To(
address _l1Token,
address _l2Token,
address _to,
uint256 _amount,
uint32 _minGasLimit,
bytes memory _extraData
)
external;
function depositETH(uint32 _minGasLimit, bytes memory _extraData) external payable;
function depositETHTo(address _to, uint32 _minGasLimit, bytes memory _extraData) external payable;
function finalizeERC20Withdrawal(
address _l1Token,
address _l2Token,
address _from,
address _to,
uint256 _amount,
bytes memory _extraData
)
external;
function finalizeETHWithdrawal(
address _from,
address _to,
uint256 _amount,
bytes memory _extraData
)
external
payable;
function initialize(
ICrossDomainMessenger _messenger,
ISuperchainConfig _superchainConfig
)
external;
function l2TokenBridge() external view returns (address);
function superchainConfig() external view returns (ISuperchainConfig);
function version() external view returns (string memory);
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IOptimismMintableERC20Factory {
event Initialized(uint8 version);
event OptimismMintableERC20Created(address indexed localToken, address indexed remoteToken, address deployer);
event StandardL2TokenCreated(address indexed remoteToken, address indexed localToken);
function BRIDGE() external view returns (address);
function bridge() external view returns (address);
function createOptimismMintableERC20(
address _remoteToken,
string memory _name,
string memory _symbol
)
external
returns (address);
function createOptimismMintableERC20WithDecimals(
address _remoteToken,
string memory _name,
string memory _symbol,
uint8 _decimals
)
external
returns (address);
function createStandardL2Token(
address _remoteToken,
string memory _name,
string memory _symbol
)
external
returns (address);
function deployments(address) external view returns (address);
function initialize(address _bridge) external;
function version() external view returns (string memory);
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
/// @notice Generic interface for contracts that have a superchain config.
interface IHasSuperchainConfig {
/// @notice Retrieves the superchain config for a given contract.
function superchainConfig() external view returns (ISuperchainConfig);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
// Libraries
import { Position } from "src/dispute/lib/LibPosition.sol";
using LibClaim for Claim global;
using LibHash for Hash global;
using LibDuration for Duration global;
using LibClock for Clock global;
using LibGameId for GameId global;
using LibTimestamp for Timestamp global;
using LibVMStatus for VMStatus global;
using LibGameType for GameType global;
/// @notice A `Clock` represents a packed `Duration` and `Timestamp`
/// @dev The packed layout of this type is as follows:
/// ┌────────────┬────────────────┐
/// │ Bits │ Value │
/// ├────────────┼────────────────┤
/// │ [0, 64) │ Duration │
/// │ [64, 128) │ Timestamp │
/// └────────────┴────────────────┘
type Clock is uint128;
/// @title LibClock
/// @notice This library contains helper functions for working with the `Clock` type.
library LibClock {
/// @notice Packs a `Duration` and `Timestamp` into a `Clock` type.
/// @param _duration The `Duration` to pack into the `Clock` type.
/// @param _timestamp The `Timestamp` to pack into the `Clock` type.
/// @return clock_ The `Clock` containing the `_duration` and `_timestamp`.
function wrap(Duration _duration, Timestamp _timestamp) internal pure returns (Clock clock_) {
assembly {
clock_ := or(shl(0x40, _duration), _timestamp)
}
}
/// @notice Pull the `Duration` out of a `Clock` type.
/// @param _clock The `Clock` type to pull the `Duration` out of.
/// @return duration_ The `Duration` pulled out of `_clock`.
function duration(Clock _clock) internal pure returns (Duration duration_) {
// Shift the high-order 64 bits into the low-order 64 bits, leaving only the `duration`.
assembly {
duration_ := shr(0x40, _clock)
}
}
/// @notice Pull the `Timestamp` out of a `Clock` type.
/// @param _clock The `Clock` type to pull the `Timestamp` out of.
/// @return timestamp_ The `Timestamp` pulled out of `_clock`.
function timestamp(Clock _clock) internal pure returns (Timestamp timestamp_) {
// Clean the high-order 192 bits by shifting the clock left and then right again, leaving
// only the `timestamp`.
assembly {
timestamp_ := shr(0xC0, shl(0xC0, _clock))
}
}
/// @notice Get the value of a `Clock` type in the form of the underlying uint128.
/// @param _clock The `Clock` type to get the value of.
/// @return clock_ The value of the `Clock` type as a uint128 type.
function raw(Clock _clock) internal pure returns (uint128 clock_) {
assembly {
clock_ := _clock
}
}
}
/// @notice A `GameId` represents a packed 4 byte game ID, a 8 byte timestamp, and a 20 byte address.
/// @dev The packed layout of this type is as follows:
/// ┌───────────┬───────────┐
/// │ Bits │ Value │
/// ├───────────┼───────────┤
/// │ [0, 32) │ Game Type │
/// │ [32, 96) │ Timestamp │
/// │ [96, 256) │ Address │
/// └───────────┴───────────┘
type GameId is bytes32;
/// @title LibGameId
/// @notice Utility functions for packing and unpacking GameIds.
library LibGameId {
/// @notice Packs values into a 32 byte GameId type.
/// @param _gameType The game type.
/// @param _timestamp The timestamp of the game's creation.
/// @param _gameProxy The game proxy address.
/// @return gameId_ The packed GameId.
function pack(
GameType _gameType,
Timestamp _timestamp,
address _gameProxy
)
internal
pure
returns (GameId gameId_)
{
assembly {
gameId_ := or(or(shl(224, _gameType), shl(160, _timestamp)), _gameProxy)
}
}
/// @notice Unpacks values from a 32 byte GameId type.
/// @param _gameId The packed GameId.
/// @return gameType_ The game type.
/// @return timestamp_ The timestamp of the game's creation.
/// @return gameProxy_ The game proxy address.
function unpack(GameId _gameId)
internal
pure
returns (GameType gameType_, Timestamp timestamp_, address gameProxy_)
{
assembly {
gameType_ := shr(224, _gameId)
timestamp_ := and(shr(160, _gameId), 0xFFFFFFFFFFFFFFFF)
gameProxy_ := and(_gameId, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
}
}
}
/// @notice A claim represents an MPT root representing the state of the fault proof program.
type Claim is bytes32;
/// @title LibClaim
/// @notice This library contains helper functions for working with the `Claim` type.
library LibClaim {
/// @notice Get the value of a `Claim` type in the form of the underlying bytes32.
/// @param _claim The `Claim` type to get the value of.
/// @return claim_ The value of the `Claim` type as a bytes32 type.
function raw(Claim _claim) internal pure returns (bytes32 claim_) {
assembly {
claim_ := _claim
}
}
/// @notice Hashes a claim and a position together.
/// @param _claim A Claim type.
/// @param _position The position of `claim`.
/// @param _challengeIndex The index of the claim being moved against.
/// @return claimHash_ A hash of abi.encodePacked(claim, position|challengeIndex);
function hashClaimPos(
Claim _claim,
Position _position,
uint256 _challengeIndex
)
internal
pure
returns (Hash claimHash_)
{
assembly {
mstore(0x00, _claim)
mstore(0x20, or(shl(128, _position), and(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, _challengeIndex)))
claimHash_ := keccak256(0x00, 0x40)
}
}
}
/// @notice A dedicated duration type.
/// @dev Unit: seconds
type Duration is uint64;
/// @title LibDuration
/// @notice This library contains helper functions for working with the `Duration` type.
library LibDuration {
/// @notice Get the value of a `Duration` type in the form of the underlying uint64.
/// @param _duration The `Duration` type to get the value of.
/// @return duration_ The value of the `Duration` type as a uint64 type.
function raw(Duration _duration) internal pure returns (uint64 duration_) {
assembly {
duration_ := _duration
}
}
}
/// @notice A custom type for a generic hash.
type Hash is bytes32;
/// @title LibHash
/// @notice This library contains helper functions for working with the `Hash` type.
library LibHash {
/// @notice Get the value of a `Hash` type in the form of the underlying bytes32.
/// @param _hash The `Hash` type to get the value of.
/// @return hash_ The value of the `Hash` type as a bytes32 type.
function raw(Hash _hash) internal pure returns (bytes32 hash_) {
assembly {
hash_ := _hash
}
}
}
/// @notice A dedicated timestamp type.
type Timestamp is uint64;
/// @title LibTimestamp
/// @notice This library contains helper functions for working with the `Timestamp` type.
library LibTimestamp {
/// @notice Get the value of a `Timestamp` type in the form of the underlying uint64.
/// @param _timestamp The `Timestamp` type to get the value of.
/// @return timestamp_ The value of the `Timestamp` type as a uint64 type.
function raw(Timestamp _timestamp) internal pure returns (uint64 timestamp_) {
assembly {
timestamp_ := _timestamp
}
}
}
/// @notice A `VMStatus` represents the status of a VM execution.
type VMStatus is uint8;
/// @title LibVMStatus
/// @notice This library contains helper functions for working with the `VMStatus` type.
library LibVMStatus {
/// @notice Get the value of a `VMStatus` type in the form of the underlying uint8.
/// @param _vmstatus The `VMStatus` type to get the value of.
/// @return vmstatus_ The value of the `VMStatus` type as a uint8 type.
function raw(VMStatus _vmstatus) internal pure returns (uint8 vmstatus_) {
assembly {
vmstatus_ := _vmstatus
}
}
}
/// @notice A `GameType` represents the type of game being played.
type GameType is uint32;
/// @title LibGameType
/// @notice This library contains helper functions for working with the `GameType` type.
library LibGameType {
/// @notice Get the value of a `GameType` type in the form of the underlying uint32.
/// @param _gametype The `GameType` type to get the value of.
/// @return gametype_ The value of the `GameType` type as a uint32 type.
function raw(GameType _gametype) internal pure returns (uint32 gametype_) {
assembly {
gametype_ := _gametype
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { LibKeccak } from "@lib-keccak/LibKeccak.sol";
import { LPPMetaData } from "src/cannon/libraries/CannonTypes.sol";
interface IPreimageOracle {
struct Leaf {
bytes input;
uint256 index;
bytes32 stateCommitment;
}
error ActiveProposal();
error AlreadyFinalized();
error AlreadyInitialized();
error BadProposal();
error BondTransferFailed();
error InsufficientBond();
error InvalidInputSize();
error InvalidPreimage();
error InvalidProof();
error NotEOA();
error NotInitialized();
error PartOffsetOOB();
error PostStateMatches();
error StatesNotContiguous();
error TreeSizeOverflow();
error WrongStartingBlock();
function KECCAK_TREE_DEPTH() external view returns (uint256);
function MAX_LEAF_COUNT() external view returns (uint256);
function MIN_BOND_SIZE() external view returns (uint256);
function PRECOMPILE_CALL_RESERVED_GAS() external view returns (uint256);
function addLeavesLPP(
uint256 _uuid,
uint256 _inputStartBlock,
bytes memory _input,
bytes32[] memory _stateCommitments,
bool _finalize
)
external;
function challengeFirstLPP(
address _claimant,
uint256 _uuid,
Leaf memory _postState,
bytes32[] memory _postStateProof
)
external;
function challengeLPP(
address _claimant,
uint256 _uuid,
LibKeccak.StateMatrix memory _stateMatrix,
Leaf memory _preState,
bytes32[] memory _preStateProof,
Leaf memory _postState,
bytes32[] memory _postStateProof
)
external;
function challengePeriod() external view returns (uint256 challengePeriod_);
function getTreeRootLPP(address _owner, uint256 _uuid) external view returns (bytes32 treeRoot_);
function initLPP(uint256 _uuid, uint32 _partOffset, uint32 _claimedSize) external payable;
function loadBlobPreimagePart(
uint256 _z,
uint256 _y,
bytes memory _commitment,
bytes memory _proof,
uint256 _partOffset
)
external;
function loadKeccak256PreimagePart(uint256 _partOffset, bytes memory _preimage) external;
function loadLocalData(
uint256 _ident,
bytes32 _localContext,
bytes32 _word,
uint256 _size,
uint256 _partOffset
)
external
returns (bytes32 key_);
function loadPrecompilePreimagePart(
uint256 _partOffset,
address _precompile,
uint64 _requiredGas,
bytes memory _input
)
external;
function loadSha256PreimagePart(uint256 _partOffset, bytes memory _preimage) external;
function minProposalSize() external view returns (uint256 minProposalSize_);
function preimageLengths(bytes32) external view returns (uint256);
function preimagePartOk(bytes32, uint256) external view returns (bool);
function preimageParts(bytes32, uint256) external view returns (bytes32);
function proposalBlocks(address, uint256, uint256) external view returns (uint64);
function proposalBlocksLen(address _claimant, uint256 _uuid) external view returns (uint256 len_);
function proposalBonds(address, uint256) external view returns (uint256);
function proposalBranches(address, uint256, uint256) external view returns (bytes32);
function proposalCount() external view returns (uint256 count_);
function proposalMetadata(address, uint256) external view returns (LPPMetaData);
function proposalParts(address, uint256) external view returns (bytes32);
function proposals(uint256) external view returns (address claimant, uint256 uuid); // nosemgrep:
// sol-style-return-arg-fmt
function readPreimage(bytes32 _key, uint256 _offset) external view returns (bytes32 dat_, uint256 datLen_);
function squeezeLPP(
address _claimant,
uint256 _uuid,
LibKeccak.StateMatrix memory _stateMatrix,
Leaf memory _preState,
bytes32[] memory _preStateProof,
Leaf memory _postState,
bytes32[] memory _postStateProof
)
external;
function version() external view returns (string memory);
function zeroHashes(uint256) external view returns (bytes32);
function __constructor__(uint256 _minProposalSize, uint256 _challengePeriod) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IInitializable {
function initialize() external payable;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title IOwnable
/// @notice Interface for Ownable.
interface IOwnable {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function owner() external view returns (address);
function renounceOwnership() external;
function transferOwnership(address newOwner) external; // nosemgrep
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title Types
/// @notice Contains various types used throughout the Optimism contract system.
library Types {
/// @notice OutputProposal represents a commitment to the L2 state. The timestamp is the L1
/// timestamp that the output root is posted. This timestamp is used to verify that the
/// finalization period has passed since the output root was submitted.
/// @custom:field outputRoot Hash of the L2 output.
/// @custom:field timestamp Timestamp of the L1 block that the output root was submitted in.
/// @custom:field l2BlockNumber L2 block number that the output corresponds to.
struct OutputProposal {
bytes32 outputRoot;
uint128 timestamp;
uint128 l2BlockNumber;
}
/// @notice Struct representing the elements that are hashed together to generate an output root
/// which itself represents a snapshot of the L2 state.
/// @custom:field version Version of the output root.
/// @custom:field stateRoot Root of the state trie at the block of this output.
/// @custom:field messagePasserStorageRoot Root of the message passer storage trie.
/// @custom:field latestBlockhash Hash of the block this output was generated from.
struct OutputRootProof {
bytes32 version;
bytes32 stateRoot;
bytes32 messagePasserStorageRoot;
bytes32 latestBlockhash;
}
/// @notice Struct representing a deposit transaction (L1 => L2 transaction) created by an end
/// user (as opposed to a system deposit transaction generated by the system).
/// @custom:field from Address of the sender of the transaction.
/// @custom:field to Address of the recipient of the transaction.
/// @custom:field isCreation True if the transaction is a contract creation.
/// @custom:field value Value to send to the recipient.
/// @custom:field mint Amount of ETH to mint.
/// @custom:field gasLimit Gas limit of the transaction.
/// @custom:field data Data of the transaction.
/// @custom:field l1BlockHash Hash of the block the transaction was submitted in.
/// @custom:field logIndex Index of the log in the block the transaction was submitted in.
struct UserDepositTransaction {
address from;
address to;
bool isCreation;
uint256 value;
uint256 mint;
uint64 gasLimit;
bytes data;
bytes32 l1BlockHash;
uint256 logIndex;
}
/// @notice Struct representing a withdrawal transaction.
/// @custom:field nonce Nonce of the withdrawal transaction
/// @custom:field sender Address of the sender of the transaction.
/// @custom:field target Address of the recipient of the transaction.
/// @custom:field value Value to send to the recipient.
/// @custom:field gasLimit Gas limit of the transaction.
/// @custom:field data Data of the transaction.
struct WithdrawalTransaction {
uint256 nonce;
address sender;
address target;
uint256 value;
uint256 gasLimit;
bytes data;
}
/// @notice Enum representing where the FeeVault withdraws funds to.
/// @custom:value L1 FeeVault withdraws funds to L1.
/// @custom:value L2 FeeVault withdraws funds to L2.
enum WithdrawalNetwork {
L1,
L2
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface ICrossDomainMessenger {
event FailedRelayedMessage(bytes32 indexed msgHash);
event Initialized(uint8 version);
event RelayedMessage(bytes32 indexed msgHash);
event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit);
event SentMessageExtension1(address indexed sender, uint256 value);
function MESSAGE_VERSION() external view returns (uint16);
function MIN_GAS_CALLDATA_OVERHEAD() external view returns (uint64);
function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() external view returns (uint64);
function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() external view returns (uint64);
function OTHER_MESSENGER() external view returns (ICrossDomainMessenger);
function RELAY_CALL_OVERHEAD() external view returns (uint64);
function RELAY_CONSTANT_OVERHEAD() external view returns (uint64);
function RELAY_GAS_CHECK_BUFFER() external view returns (uint64);
function RELAY_RESERVED_GAS() external view returns (uint64);
function baseGas(bytes memory _message, uint32 _minGasLimit) external pure returns (uint64);
function failedMessages(bytes32) external view returns (bool);
function messageNonce() external view returns (uint256);
function otherMessenger() external view returns (ICrossDomainMessenger);
function paused() external view returns (bool);
function relayMessage(
uint256 _nonce,
address _sender,
address _target,
uint256 _value,
uint256 _minGasLimit,
bytes memory _message
)
external
payable;
function sendMessage(address _target, bytes memory _message, uint32 _minGasLimit) external payable;
function successfulMessages(bytes32) external view returns (bool);
function xDomainMessageSender() external view returns (address);
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { ICrossDomainMessenger } from "interfaces/universal/ICrossDomainMessenger.sol";
interface IERC721Bridge {
event ERC721BridgeFinalized(
address indexed localToken,
address indexed remoteToken,
address indexed from,
address to,
uint256 tokenId,
bytes extraData
);
event ERC721BridgeInitiated(
address indexed localToken,
address indexed remoteToken,
address indexed from,
address to,
uint256 tokenId,
bytes extraData
);
event Initialized(uint8 version);
function MESSENGER() external view returns (ICrossDomainMessenger);
function OTHER_BRIDGE() external view returns (IERC721Bridge);
function bridgeERC721(
address _localToken,
address _remoteToken,
uint256 _tokenId,
uint32 _minGasLimit,
bytes memory _extraData
)
external;
function bridgeERC721To(
address _localToken,
address _remoteToken,
address _to,
uint256 _tokenId,
uint32 _minGasLimit,
bytes memory _extraData
)
external;
function messenger() external view returns (ICrossDomainMessenger);
function otherBridge() external view returns (IERC721Bridge);
function paused() external view returns (bool);
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { ICrossDomainMessenger } from "interfaces/universal/ICrossDomainMessenger.sol";
interface IStandardBridge {
event ERC20BridgeFinalized(
address indexed localToken,
address indexed remoteToken,
address indexed from,
address to,
uint256 amount,
bytes extraData
);
event ERC20BridgeInitiated(
address indexed localToken,
address indexed remoteToken,
address indexed from,
address to,
uint256 amount,
bytes extraData
);
event ETHBridgeFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData);
event ETHBridgeInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData);
event Initialized(uint8 version);
receive() external payable;
function MESSENGER() external view returns (ICrossDomainMessenger);
function OTHER_BRIDGE() external view returns (IStandardBridge);
function bridgeERC20(
address _localToken,
address _remoteToken,
uint256 _amount,
uint32 _minGasLimit,
bytes memory _extraData
)
external;
function bridgeERC20To(
address _localToken,
address _remoteToken,
address _to,
uint256 _amount,
uint32 _minGasLimit,
bytes memory _extraData
)
external;
function bridgeETH(uint32 _minGasLimit, bytes memory _extraData) external payable;
function bridgeETHTo(address _to, uint32 _minGasLimit, bytes memory _extraData) external payable;
function deposits(address, address) external view returns (uint256);
function finalizeBridgeERC20(
address _localToken,
address _remoteToken,
address _from,
address _to,
uint256 _amount,
bytes memory _extraData
)
external;
function finalizeBridgeETH(address _from, address _to, uint256 _amount, bytes memory _extraData) external payable;
function messenger() external view returns (ICrossDomainMessenger);
function otherBridge() external view returns (IStandardBridge);
function paused() external view returns (bool);
function __constructor__() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
using LibPosition for Position global;
/// @notice A `Position` represents a position of a claim within the game tree.
/// @dev This is represented as a "generalized index" where the high-order bit
/// is the level in the tree and the remaining bits is a unique bit pattern, allowing
/// a unique identifier for each node in the tree. Mathematically, it is calculated
/// as 2^{depth} + indexAtDepth.
type Position is uint128;
/// @title LibPosition
/// @notice This library contains helper functions for working with the `Position` type.
library LibPosition {
/// @notice the `MAX_POSITION_BITLEN` is the number of bits that the `Position` type, and the implementation of
/// its behavior within this library, can safely support.
uint8 internal constant MAX_POSITION_BITLEN = 126;
/// @notice Computes a generalized index (2^{depth} + indexAtDepth).
/// @param _depth The depth of the position.
/// @param _indexAtDepth The index at the depth of the position.
/// @return position_ The computed generalized index.
function wrap(uint8 _depth, uint128 _indexAtDepth) internal pure returns (Position position_) {
assembly {
// gindex = 2^{_depth} + _indexAtDepth
position_ := add(shl(_depth, 1), _indexAtDepth)
}
}
/// @notice Pulls the `depth` out of a `Position` type.
/// @param _position The generalized index to get the `depth` of.
/// @return depth_ The `depth` of the `position` gindex.
/// @custom:attribution Solady <https://github.com/Vectorized/Solady>
function depth(Position _position) internal pure returns (uint8 depth_) {
// Return the most significant bit offset, which signifies the depth of the gindex.
assembly {
depth_ := or(depth_, shl(6, lt(0xffffffffffffffff, shr(depth_, _position))))
depth_ := or(depth_, shl(5, lt(0xffffffff, shr(depth_, _position))))
// For the remaining 32 bits, use a De Bruijn lookup.
_position := shr(depth_, _position)
_position := or(_position, shr(1, _position))
_position := or(_position, shr(2, _position))
_position := or(_position, shr(4, _position))
_position := or(_position, shr(8, _position))
_position := or(_position, shr(16, _position))
depth_ :=
or(
depth_,
byte(
shr(251, mul(_position, shl(224, 0x07c4acdd))),
0x0009010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f
)
)
}
}
/// @notice Pulls the `indexAtDepth` out of a `Position` type.
/// The `indexAtDepth` is the left/right index of a position at a specific depth within
/// the binary tree, starting from index 0. For example, at gindex 2, the `depth` = 1
/// and the `indexAtDepth` = 0.
/// @param _position The generalized index to get the `indexAtDepth` of.
/// @return indexAtDepth_ The `indexAtDepth` of the `position` gindex.
function indexAtDepth(Position _position) internal pure returns (uint128 indexAtDepth_) {
// Return bits p_{msb-1}...p_{0}. This effectively pulls the 2^{depth} out of the gindex,
// leaving only the `indexAtDepth`.
uint256 msb = depth(_position);
assembly {
indexAtDepth_ := sub(_position, shl(msb, 1))
}
}
/// @notice Get the left child of `_position`.
/// @param _position The position to get the left position of.
/// @return left_ The position to the left of `position`.
function left(Position _position) internal pure returns (Position left_) {
assembly {
left_ := shl(1, _position)
}
}
/// @notice Get the right child of `_position`
/// @param _position The position to get the right position of.
/// @return right_ The position to the right of `position`.
function right(Position _position) internal pure returns (Position right_) {
assembly {
right_ := or(1, shl(1, _position))
}
}
/// @notice Get the parent position of `_position`.
/// @param _position The position to get the parent position of.
/// @return parent_ The parent position of `position`.
function parent(Position _position) internal pure returns (Position parent_) {
assembly {
parent_ := shr(1, _position)
}
}
/// @notice Get the deepest, right most gindex relative to the `position`. This is equivalent to
/// calling `right` on a position until the maximum depth is reached.
/// @param _position The position to get the relative deepest, right most gindex of.
/// @param _maxDepth The maximum depth of the game.
/// @return rightIndex_ The deepest, right most gindex relative to the `position`.
function rightIndex(Position _position, uint256 _maxDepth) internal pure returns (Position rightIndex_) {
uint256 msb = depth(_position);
assembly {
let remaining := sub(_maxDepth, msb)
rightIndex_ := or(shl(remaining, _position), sub(shl(remaining, 1), 1))
}
}
/// @notice Get the deepest, right most trace index relative to the `position`. This is
/// equivalent to calling `right` on a position until the maximum depth is reached and
/// then finding its index at depth.
/// @param _position The position to get the relative trace index of.
/// @param _maxDepth The maximum depth of the game.
/// @return traceIndex_ The trace index relative to the `position`.
function traceIndex(Position _position, uint256 _maxDepth) internal pure returns (uint256 traceIndex_) {
uint256 msb = depth(_position);
assembly {
let remaining := sub(_maxDepth, msb)
traceIndex_ := sub(or(shl(remaining, _position), sub(shl(remaining, 1), 1)), shl(_maxDepth, 1))
}
}
/// @notice Gets the position of the highest ancestor of `_position` that commits to the same
/// trace index.
/// @param _position The position to get the highest ancestor of.
/// @return ancestor_ The highest ancestor of `position` that commits to the same trace index.
function traceAncestor(Position _position) internal pure returns (Position ancestor_) {
// Create a field with only the lowest unset bit of `_position` set.
Position lsb;
assembly {
lsb := and(not(_position), add(_position, 1))
}
// Find the index of the lowest unset bit within the field.
uint256 msb = depth(lsb);
// The highest ancestor that commits to the same trace index is the original position
// shifted right by the index of the lowest unset bit.
assembly {
let a := shr(msb, _position)
// Bound the ancestor to the minimum gindex, 1.
ancestor_ := or(a, iszero(a))
}
}
/// @notice Gets the position of the highest ancestor of `_position` that commits to the same
/// trace index, while still being below `_upperBoundExclusive`.
/// @param _position The position to get the highest ancestor of.
/// @param _upperBoundExclusive The exclusive upper depth bound, used to inform where to stop in order
/// to not escape a sub-tree.
/// @return ancestor_ The highest ancestor of `position` that commits to the same trace index.
function traceAncestorBounded(
Position _position,
uint256 _upperBoundExclusive
)
internal
pure
returns (Position ancestor_)
{
// This function only works for positions that are below the upper bound.
if (_position.depth() <= _upperBoundExclusive) {
assembly {
// Revert with `ClaimAboveSplit()`
mstore(0x00, 0xb34b5c22)
revert(0x1C, 0x04)
}
}
// Grab the global trace ancestor.
ancestor_ = traceAncestor(_position);
// If the ancestor is above or at the upper bound, shift it to be below the upper bound.
// This should be a special case that only covers positions that commit to the final leaf
// in a sub-tree.
if (ancestor_.depth() <= _upperBoundExclusive) {
ancestor_ = ancestor_.rightIndex(_upperBoundExclusive + 1);
}
}
/// @notice Get the move position of `_position`, which is the left child of:
/// 1. `_position` if `_isAttack` is true.
/// 2. `_position | 1` if `_isAttack` is false.
/// @param _position The position to get the relative attack/defense position of.
/// @param _isAttack Whether or not the move is an attack move.
/// @return move_ The move position relative to `position`.
function move(Position _position, bool _isAttack) internal pure returns (Position move_) {
assembly {
move_ := shl(1, or(iszero(_isAttack), _position))
}
}
/// @notice Get the value of a `Position` type in the form of the underlying uint128.
/// @param _position The position to get the value of.
/// @return raw_ The value of the `position` as a uint128 type.
function raw(Position _position) internal pure returns (uint128 raw_) {
assembly {
raw_ := _position
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title LibKeccak
/// @notice An EVM implementation of the Keccak-f[1600] permutation.
/// @author clabby <https://github.com/clabby>
/// @custom:attribution geohot <https://github.com/geohot>
library LibKeccak {
/// @notice The block size of the Keccak-f[1600] permutation, 1088 bits (136 bytes).
uint256 internal constant BLOCK_SIZE_BYTES = 136;
/// @notice The round constants for the keccak256 hash function. Packed in memory for efficient reading during the
/// permutation.
bytes internal constant ROUND_CONSTANTS = abi.encode(
0x00000000000000010000000000008082800000000000808a8000000080008000, // r1,r2,r3,r4
0x000000000000808b000000008000000180000000800080818000000000008009, // r5,r6,r7,r8
0x000000000000008a00000000000000880000000080008009000000008000000a, // r9,r10,r11,r12
0x000000008000808b800000000000008b80000000000080898000000000008003, // r13,r14,r15,r16
0x80000000000080028000000000000080000000000000800a800000008000000a, // r17,r18,r19,r20
0x8000000080008081800000000000808000000000800000018000000080008008 // r21,r22,r23,r24
);
/// @notice A mask for 64-bit values.
uint64 private constant U64_MASK = 0xFFFFFFFFFFFFFFFF;
/// @notice The 5x5 state matrix for the keccak-f[1600] permutation.
struct StateMatrix {
uint64[25] state;
}
/// @notice Performs the Keccak-f[1600] permutation on the given 5x5 state matrix.
function permutation(StateMatrix memory _stateMatrix) internal pure {
// Pull the round constants into memory to avoid reallocation in the unrolled permutation loop.
bytes memory roundConstants = ROUND_CONSTANTS;
assembly {
// Add 32 to the state matrix pointer to skip the data location field.
let stateMatrixPtr := add(_stateMatrix, 0x20)
let rcPtr := add(roundConstants, 0x20)
// set a state element in the passed `StateMatrix` struct memory ptr.
function setStateElem(ptr, idx, data) {
mstore(add(ptr, shl(0x05, idx)), and(data, U64_MASK))
}
// fetch a state element from the passed `StateMatrix` struct memory ptr.
function stateElem(ptr, idx) -> elem {
elem := mload(add(ptr, shl(0x05, idx)))
}
// 64 bit logical shift
function shl64(a, b) -> val {
val := and(shl(a, b), U64_MASK)
}
// Performs an indivudual rho + pi computation, to be used in the full `thetaRhoPi` chain.
function rhoPi(ptr, destIdx, srcIdx, fact, dt) {
let xs1 := xor(stateElem(ptr, srcIdx), dt)
let res := xor(shl(fact, xs1), shr(sub(64, fact), xs1))
setStateElem(ptr, destIdx, res)
}
// xor a column in the state matrix
function xorColumn(ptr, col) -> val {
val :=
xor(
xor(xor(stateElem(ptr, col), stateElem(ptr, add(col, 5))), stateElem(ptr, add(col, 10))),
xor(stateElem(ptr, add(col, 15)), stateElem(ptr, add(col, 20)))
)
}
// Performs the `theta`, `rho`, and `pi` steps of the Keccak-f[1600] permutation on
// the passed `StateMatrix` struct memory ptr.
function thetaRhoPi(ptr) {
// Theta
let C0 := xorColumn(ptr, 0)
let C1 := xorColumn(ptr, 1)
let C2 := xorColumn(ptr, 2)
let C3 := xorColumn(ptr, 3)
let C4 := xorColumn(ptr, 4)
let D0 := xor(xor(shl64(1, C1), shr(63, C1)), C4)
let D1 := xor(xor(shl64(1, C2), shr(63, C2)), C0)
let D2 := xor(xor(shl64(1, C3), shr(63, C3)), C1)
let D3 := xor(xor(shl64(1, C4), shr(63, C4)), C2)
let D4 := xor(xor(shl64(1, C0), shr(63, C0)), C3)
let xs1 := xor(stateElem(ptr, 1), D1)
let A1 := xor(shl(1, xs1), shr(63, xs1))
let _ptr := ptr
setStateElem(_ptr, 0, xor(stateElem(_ptr, 0), D0))
rhoPi(_ptr, 1, 6, 44, D1)
rhoPi(_ptr, 6, 9, 20, D4)
rhoPi(_ptr, 9, 22, 61, D2)
rhoPi(_ptr, 22, 14, 39, D4)
rhoPi(_ptr, 14, 20, 18, D0)
rhoPi(_ptr, 20, 2, 62, D2)
rhoPi(_ptr, 2, 12, 43, D2)
rhoPi(_ptr, 12, 13, 25, D3)
rhoPi(_ptr, 13, 19, 8, D4)
rhoPi(_ptr, 19, 23, 56, D3)
rhoPi(_ptr, 23, 15, 41, D0)
rhoPi(_ptr, 15, 4, 27, D4)
rhoPi(_ptr, 4, 24, 14, D4)
rhoPi(_ptr, 24, 21, 2, D1)
rhoPi(_ptr, 21, 8, 55, D3)
rhoPi(_ptr, 8, 16, 45, D1)
rhoPi(_ptr, 16, 5, 36, D0)
rhoPi(_ptr, 5, 3, 28, D3)
rhoPi(_ptr, 3, 18, 21, D3)
rhoPi(_ptr, 18, 17, 15, D2)
rhoPi(_ptr, 17, 11, 10, D1)
rhoPi(_ptr, 11, 7, 6, D2)
rhoPi(_ptr, 7, 10, 3, D0)
setStateElem(_ptr, 10, A1)
}
// Inner `chi` function, unrolled in `chi` for performance.
function innerChi(ptr, start) {
let A0 := stateElem(ptr, start)
let A1 := stateElem(ptr, add(start, 1))
let A2 := stateElem(ptr, add(start, 2))
let A3 := stateElem(ptr, add(start, 3))
let A4 := stateElem(ptr, add(start, 4))
setStateElem(ptr, start, xor(A0, and(not(A1), A2)))
setStateElem(ptr, add(start, 1), xor(A1, and(not(A2), A3)))
setStateElem(ptr, add(start, 2), xor(A2, and(not(A3), A4)))
setStateElem(ptr, add(start, 3), xor(A3, and(not(A4), A0)))
setStateElem(ptr, add(start, 4), xor(A4, and(not(A0), A1)))
}
// Performs the `chi` step of the Keccak-f[1600] permutation on the passed `StateMatrix` struct memory ptr
function chi(ptr) {
innerChi(ptr, 0)
innerChi(ptr, 5)
innerChi(ptr, 10)
innerChi(ptr, 15)
innerChi(ptr, 20)
}
// Perform the full Keccak-f[1600] permutation on a `StateMatrix` struct memory ptr for a given round.
function permute(ptr, roundsPtr, round) {
// Theta, Rho, Pi, Chi
thetaRhoPi(ptr)
chi(ptr)
// Iota
let roundConst := shr(192, mload(add(roundsPtr, shl(0x03, round))))
setStateElem(ptr, 0, xor(stateElem(ptr, 0), roundConst))
}
// Unroll the permutation loop.
permute(stateMatrixPtr, rcPtr, 0)
permute(stateMatrixPtr, rcPtr, 1)
permute(stateMatrixPtr, rcPtr, 2)
permute(stateMatrixPtr, rcPtr, 3)
permute(stateMatrixPtr, rcPtr, 4)
permute(stateMatrixPtr, rcPtr, 5)
permute(stateMatrixPtr, rcPtr, 6)
permute(stateMatrixPtr, rcPtr, 7)
permute(stateMatrixPtr, rcPtr, 8)
permute(stateMatrixPtr, rcPtr, 9)
permute(stateMatrixPtr, rcPtr, 10)
permute(stateMatrixPtr, rcPtr, 11)
permute(stateMatrixPtr, rcPtr, 12)
permute(stateMatrixPtr, rcPtr, 13)
permute(stateMatrixPtr, rcPtr, 14)
permute(stateMatrixPtr, rcPtr, 15)
permute(stateMatrixPtr, rcPtr, 16)
permute(stateMatrixPtr, rcPtr, 17)
permute(stateMatrixPtr, rcPtr, 18)
permute(stateMatrixPtr, rcPtr, 19)
permute(stateMatrixPtr, rcPtr, 20)
permute(stateMatrixPtr, rcPtr, 21)
permute(stateMatrixPtr, rcPtr, 22)
permute(stateMatrixPtr, rcPtr, 23)
}
}
/// @notice Absorb a fixed-sized block into the sponge.
function absorb(StateMatrix memory _stateMatrix, bytes memory _input) internal pure {
assembly {
// The input must be 1088 bits long.
if iszero(eq(mload(_input), BLOCK_SIZE_BYTES)) { revert(0, 0) }
let dataPtr := add(_input, 0x20)
let statePtr := add(_stateMatrix, 0x20)
// set a state element in the passed `StateMatrix` struct memory ptr.
function setStateElem(ptr, idx, data) {
mstore(add(ptr, shl(0x05, idx)), and(data, U64_MASK))
}
// fetch a state element from the passed `StateMatrix` struct memory ptr.
function stateElem(ptr, idx) -> elem {
elem := mload(add(ptr, shl(0x05, idx)))
}
// Inner sha3 absorb XOR function
function absorbInner(stateMatrixPtr, inputPtr, idx) {
let boWord := mload(add(inputPtr, shl(3, idx)))
let res :=
or(
or(
or(shl(56, byte(7, boWord)), shl(48, byte(6, boWord))),
or(shl(40, byte(5, boWord)), shl(32, byte(4, boWord)))
),
or(
or(shl(24, byte(3, boWord)), shl(16, byte(2, boWord))),
or(shl(8, byte(1, boWord)), byte(0, boWord))
)
)
setStateElem(stateMatrixPtr, idx, xor(stateElem(stateMatrixPtr, idx), res))
}
// Unroll the input XOR loop.
absorbInner(statePtr, dataPtr, 0)
absorbInner(statePtr, dataPtr, 1)
absorbInner(statePtr, dataPtr, 2)
absorbInner(statePtr, dataPtr, 3)
absorbInner(statePtr, dataPtr, 4)
absorbInner(statePtr, dataPtr, 5)
absorbInner(statePtr, dataPtr, 6)
absorbInner(statePtr, dataPtr, 7)
absorbInner(statePtr, dataPtr, 8)
absorbInner(statePtr, dataPtr, 9)
absorbInner(statePtr, dataPtr, 10)
absorbInner(statePtr, dataPtr, 11)
absorbInner(statePtr, dataPtr, 12)
absorbInner(statePtr, dataPtr, 13)
absorbInner(statePtr, dataPtr, 14)
absorbInner(statePtr, dataPtr, 15)
absorbInner(statePtr, dataPtr, 16)
}
}
/// @notice Squeezes the final keccak256 digest from the passed `StateMatrix`.
function squeeze(StateMatrix memory _stateMatrix) internal pure returns (bytes32 hash_) {
assembly {
// 64 bit logical shift
function shl64(a, b) -> val {
val := and(shl(a, b), U64_MASK)
}
// convert a big endian 64-bit value to a little endian 64-bit value.
function toLE(beVal) -> leVal {
beVal := or(and(shl64(8, beVal), 0xFF00FF00FF00FF00), and(shr(8, beVal), 0x00FF00FF00FF00FF))
beVal := or(and(shl64(16, beVal), 0xFFFF0000FFFF0000), and(shr(16, beVal), 0x0000FFFF0000FFFF))
leVal := or(shl64(32, beVal), shr(32, beVal))
}
// fetch a state element from the passed `StateMatrix` struct memory ptr.
function stateElem(ptr, idx) -> elem {
elem := mload(add(ptr, shl(0x05, idx)))
}
let stateMatrixPtr := add(_stateMatrix, 0x20)
hash_ :=
or(
or(shl(192, toLE(stateElem(stateMatrixPtr, 0))), shl(128, toLE(stateElem(stateMatrixPtr, 1)))),
or(shl(64, toLE(stateElem(stateMatrixPtr, 2))), toLE(stateElem(stateMatrixPtr, 3)))
)
}
}
/// @notice Pads input data to an even multiple of the Keccak-f[1600] permutation block size, 1088 bits (136 bytes).
function pad(bytes calldata _data) internal pure returns (bytes memory padded_) {
assembly {
padded_ := mload(0x40)
// Grab the original length of `_data`
let len := _data.length
let dataPtr := add(padded_, 0x20)
let endPtr := add(dataPtr, len)
// Copy the data into memory.
calldatacopy(dataPtr, _data.offset, len)
let modBlockSize := mod(len, BLOCK_SIZE_BYTES)
switch modBlockSize
case false {
// Clean the full padding block. It is possible that this memory is dirty, since solidity sometimes does
// not update the free memory pointer when allocating memory, for example with external calls. To do
// this, we read out-of-bounds from the calldata, which will always return 0 bytes.
calldatacopy(endPtr, calldatasize(), BLOCK_SIZE_BYTES)
// If the input is a perfect multiple of the block size, then we add a full extra block of padding.
mstore8(endPtr, 0x01)
mstore8(sub(add(endPtr, BLOCK_SIZE_BYTES), 0x01), 0x80)
// Update the length of the data to include the padding.
mstore(padded_, add(len, BLOCK_SIZE_BYTES))
}
default {
// If the input is not a perfect multiple of the block size, then we add a partial block of padding.
// This should entail a set bit after the input, followed by as many zero bits as necessary to fill
// the block, followed by a single 1 bit in the lowest-order bit of the final block.
let remaining := sub(BLOCK_SIZE_BYTES, modBlockSize)
let newLen := add(len, remaining)
let paddedEndPtr := add(dataPtr, newLen)
// Clean the remainder to ensure that the intermediate data between the padding bits is 0. It is
// possible that this memory is dirty, since solidity sometimes does not update the free memory pointer
// when allocating memory, for example with external calls. To do this, we read out-of-bounds from the
// calldata, which will always return 0 bytes.
let partialRemainder := sub(paddedEndPtr, endPtr)
calldatacopy(endPtr, calldatasize(), partialRemainder)
// Store the padding bits.
mstore8(sub(paddedEndPtr, 0x01), 0x80)
mstore8(endPtr, or(byte(0x00, mload(endPtr)), 0x01))
// Update the length of the data to include the padding. The length should be a multiple of the
// block size after this.
mstore(padded_, newLen)
}
// Update the free memory pointer.
mstore(0x40, add(padded_, and(add(mload(padded_), 0x3F), not(0x1F))))
}
}
/// @notice Pads input data to an even multiple of the Keccak-f[1600] permutation block size, 1088 bits (136 bytes).
function padMemory(bytes memory _data) internal pure returns (bytes memory padded_) {
assembly {
padded_ := mload(0x40)
// Grab the original length of `_data`
let len := mload(_data)
let dataPtr := add(padded_, 0x20)
let endPtr := add(dataPtr, len)
// Copy the data.
let originalDataPtr := add(_data, 0x20)
for { let i := 0x00 } lt(i, len) { i := add(i, 0x20) } {
mstore(add(dataPtr, i), mload(add(originalDataPtr, i)))
}
let modBlockSize := mod(len, BLOCK_SIZE_BYTES)
switch modBlockSize
case false {
// Clean the full padding block. It is possible that this memory is dirty, since solidity sometimes does
// not update the free memory pointer when allocating memory, for example with external calls. To do
// this, we read out-of-bounds from the calldata, which will always return 0 bytes.
calldatacopy(endPtr, calldatasize(), BLOCK_SIZE_BYTES)
// If the input is a perfect multiple of the block size, then we add a full extra block of padding.
mstore8(sub(add(endPtr, BLOCK_SIZE_BYTES), 0x01), 0x80)
mstore8(endPtr, 0x01)
// Update the length of the data to include the padding.
mstore(padded_, add(len, BLOCK_SIZE_BYTES))
}
default {
// If the input is not a perfect multiple of the block size, then we add a partial block of padding.
// This should entail a set bit after the input, followed by as many zero bits as necessary to fill
// the block, followed by a single 1 bit in the lowest-order bit of the final block.
let remaining := sub(BLOCK_SIZE_BYTES, modBlockSize)
let newLen := add(len, remaining)
let paddedEndPtr := add(dataPtr, newLen)
// Clean the remainder to ensure that the intermediate data between the padding bits is 0. It is
// possible that this memory is dirty, since solidity sometimes does not update the free memory pointer
// when allocating memory, for example with external calls. To do this, we read out-of-bounds from the
// calldata, which will always return 0 bytes.
let partialRemainder := sub(paddedEndPtr, endPtr)
calldatacopy(endPtr, calldatasize(), partialRemainder)
// Store the padding bits.
mstore8(sub(paddedEndPtr, 0x01), 0x80)
mstore8(endPtr, or(byte(0x00, mload(endPtr)), 0x01))
// Update the length of the data to include the padding. The length should be a multiple of the
// block size after this.
mstore(padded_, newLen)
}
// Update the free memory pointer.
mstore(0x40, add(padded_, and(add(mload(padded_), 0x3F), not(0x1F))))
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
using LPPMetadataLib for LPPMetaData global;
/// @notice Packed LPP metadata.
/// ┌─────────────┬────────────────────────────────────────────┐
/// │ Bit Offsets │ Description │
/// ├─────────────┼────────────────────────────────────────────┤
/// │ [0, 64) │ Timestamp (Finalized - All data available) │
/// │ [64, 96) │ Part Offset │
/// │ [96, 128) │ Claimed Size │
/// │ [128, 160) │ Blocks Processed (Inclusive of Padding) │
/// │ [160, 192) │ Bytes Processed (Non-inclusive of Padding) │
/// │ [192, 256) │ Countered │
/// └─────────────┴────────────────────────────────────────────┘
type LPPMetaData is bytes32;
/// @notice LPP metadata UDT extension functions.
library LPPMetadataLib {
uint256 private constant U64_MASK = 0xFFFFFFFFFFFFFFFF;
uint256 private constant U32_MASK = 0xFFFFFFFF;
function setTimestamp(LPPMetaData _self, uint64 _timestamp) internal pure returns (LPPMetaData self_) {
assembly {
self_ := or(shl(192, _timestamp), and(_self, not(shl(192, U64_MASK))))
}
}
function setPartOffset(LPPMetaData _self, uint32 _partOffset) internal pure returns (LPPMetaData self_) {
assembly {
self_ := or(shl(160, _partOffset), and(_self, not(shl(160, U32_MASK))))
}
}
function setClaimedSize(LPPMetaData _self, uint32 _claimedSize) internal pure returns (LPPMetaData self_) {
assembly {
self_ := or(shl(128, _claimedSize), and(_self, not(shl(128, U32_MASK))))
}
}
function setBlocksProcessed(LPPMetaData _self, uint32 _blocksProcessed) internal pure returns (LPPMetaData self_) {
assembly {
self_ := or(shl(96, _blocksProcessed), and(_self, not(shl(96, U32_MASK))))
}
}
function setBytesProcessed(LPPMetaData _self, uint32 _bytesProcessed) internal pure returns (LPPMetaData self_) {
assembly {
self_ := or(shl(64, _bytesProcessed), and(_self, not(shl(64, U32_MASK))))
}
}
function setCountered(LPPMetaData _self, bool _countered) internal pure returns (LPPMetaData self_) {
assembly {
self_ := or(_countered, and(_self, not(U64_MASK)))
}
}
function timestamp(LPPMetaData _self) internal pure returns (uint64 timestamp_) {
assembly {
timestamp_ := shr(192, _self)
}
}
function partOffset(LPPMetaData _self) internal pure returns (uint64 partOffset_) {
assembly {
partOffset_ := and(shr(160, _self), U32_MASK)
}
}
function claimedSize(LPPMetaData _self) internal pure returns (uint32 claimedSize_) {
assembly {
claimedSize_ := and(shr(128, _self), U32_MASK)
}
}
function blocksProcessed(LPPMetaData _self) internal pure returns (uint32 blocksProcessed_) {
assembly {
blocksProcessed_ := and(shr(96, _self), U32_MASK)
}
}
function bytesProcessed(LPPMetaData _self) internal pure returns (uint32 bytesProcessed_) {
assembly {
bytesProcessed_ := and(shr(64, _self), U32_MASK)
}
}
function countered(LPPMetaData _self) internal pure returns (bool countered_) {
assembly {
countered_ := and(_self, U64_MASK)
}
}
}{
"remappings": [
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-v5/=lib/openzeppelin-contracts-v5/contracts/",
"@rari-capital/solmate/=lib/solmate/",
"@lib-keccak/=lib/lib-keccak/contracts/lib/",
"@solady/=lib/solady/src/",
"@solady-v0.0.245/=lib/solady-v0.0.245/src/",
"forge-std/=lib/forge-std/src/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"safe-contracts/=lib/safe-contracts/contracts/",
"kontrol-cheatcodes/=lib/kontrol-cheatcodes/src/",
"interfaces/=interfaces/",
"@solady-test/=lib/lib-keccak/lib/solady/test/",
"erc4626-tests/=lib/openzeppelin-contracts-v5/lib/erc4626-tests/",
"lib-keccak/=lib/lib-keccak/contracts/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts-v5/=lib/openzeppelin-contracts-v5/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"solady-v0.0.245/=lib/solady-v0.0.245/src/",
"solady/=lib/solady/",
"solmate/=lib/solmate/src/"
],
"optimizer": {
"enabled": true,
"runs": 5000
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract ISuperchainConfig","name":"_superchainConfig","type":"address"},{"internalType":"contract IProtocolVersions","name":"_protocolVersions","type":"address"},{"internalType":"contract IProxyAdmin","name":"_superchainProxyAdmin","type":"address"},{"internalType":"string","name":"_l1ContractsRelease","type":"string"},{"components":[{"internalType":"address","name":"addressManager","type":"address"},{"internalType":"address","name":"proxy","type":"address"},{"internalType":"address","name":"proxyAdmin","type":"address"},{"internalType":"address","name":"l1ChugSplashProxy","type":"address"},{"internalType":"address","name":"resolvedDelegateProxy","type":"address"},{"internalType":"address","name":"permissionedDisputeGame1","type":"address"},{"internalType":"address","name":"permissionedDisputeGame2","type":"address"},{"internalType":"address","name":"permissionlessDisputeGame1","type":"address"},{"internalType":"address","name":"permissionlessDisputeGame2","type":"address"}],"internalType":"struct OPContractsManager.Blueprints","name":"_blueprints","type":"tuple"},{"components":[{"internalType":"address","name":"superchainConfigImpl","type":"address"},{"internalType":"address","name":"protocolVersionsImpl","type":"address"},{"internalType":"address","name":"l1ERC721BridgeImpl","type":"address"},{"internalType":"address","name":"optimismPortalImpl","type":"address"},{"internalType":"address","name":"systemConfigImpl","type":"address"},{"internalType":"address","name":"optimismMintableERC20FactoryImpl","type":"address"},{"internalType":"address","name":"l1CrossDomainMessengerImpl","type":"address"},{"internalType":"address","name":"l1StandardBridgeImpl","type":"address"},{"internalType":"address","name":"disputeGameFactoryImpl","type":"address"},{"internalType":"address","name":"anchorStateRegistryImpl","type":"address"},{"internalType":"address","name":"delayedWETHImpl","type":"address"},{"internalType":"address","name":"mipsImpl","type":"address"}],"internalType":"struct OPContractsManager.Implementations","name":"_implementations","type":"tuple"},{"internalType":"address","name":"_upgradeController","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"who","type":"address"}],"name":"AddressHasNoCode","type":"error"},{"inputs":[{"internalType":"address","name":"who","type":"address"}],"name":"AddressNotFound","type":"error"},{"inputs":[],"name":"AlreadyReleased","type":"error"},{"inputs":[],"name":"BytesArrayTooLong","type":"error"},{"inputs":[],"name":"DeploymentFailed","type":"error"},{"inputs":[],"name":"EmptyInitcode","type":"error"},{"inputs":[],"name":"IdentityPrecompileCallFailed","type":"error"},{"inputs":[],"name":"InvalidChainId","type":"error"},{"inputs":[],"name":"InvalidGameConfigs","type":"error"},{"inputs":[{"internalType":"string","name":"role","type":"string"}],"name":"InvalidRoleAddress","type":"error"},{"inputs":[],"name":"InvalidStartingAnchorRoot","type":"error"},{"inputs":[],"name":"LatestReleaseNotSet","type":"error"},{"inputs":[],"name":"NotABlueprint","type":"error"},{"inputs":[],"name":"OnlyDelegatecall","type":"error"},{"inputs":[],"name":"OnlyUpgradeController","type":"error"},{"inputs":[],"name":"PrestateNotSet","type":"error"},{"inputs":[],"name":"ReservedBitsSet","type":"error"},{"inputs":[{"internalType":"contract ISystemConfig","name":"systemConfig","type":"address"}],"name":"SuperchainConfigMismatch","type":"error"},{"inputs":[],"name":"SuperchainProxyAdminMismatch","type":"error"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"UnexpectedPreambleData","type":"error"},{"inputs":[{"internalType":"uint8","name":"version","type":"uint8"}],"name":"UnsupportedERCVersion","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"l2ChainId","type":"uint256"},{"indexed":true,"internalType":"address","name":"deployer","type":"address"},{"indexed":false,"internalType":"bytes","name":"deployOutput","type":"bytes"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"l2ChainId","type":"uint256"},{"indexed":true,"internalType":"GameType","name":"gameType","type":"uint32"},{"indexed":false,"internalType":"contract IDisputeGame","name":"newDisputeGame","type":"address"},{"indexed":false,"internalType":"contract IDisputeGame","name":"oldDisputeGame","type":"address"}],"name":"GameTypeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"l2ChainId","type":"uint256"},{"indexed":true,"internalType":"contract ISystemConfig","name":"systemConfig","type":"address"},{"indexed":true,"internalType":"address","name":"upgrader","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[{"components":[{"internalType":"string","name":"saltMixer","type":"string"},{"internalType":"contract ISystemConfig","name":"systemConfig","type":"address"},{"internalType":"contract IProxyAdmin","name":"proxyAdmin","type":"address"},{"internalType":"contract IDelayedWETH","name":"delayedWETH","type":"address"},{"internalType":"GameType","name":"disputeGameType","type":"uint32"},{"internalType":"Claim","name":"disputeAbsolutePrestate","type":"bytes32"},{"internalType":"uint256","name":"disputeMaxGameDepth","type":"uint256"},{"internalType":"uint256","name":"disputeSplitDepth","type":"uint256"},{"internalType":"Duration","name":"disputeClockExtension","type":"uint64"},{"internalType":"Duration","name":"disputeMaxClockDuration","type":"uint64"},{"internalType":"uint256","name":"initialBond","type":"uint256"},{"internalType":"contract IBigStepper","name":"vm","type":"address"},{"internalType":"bool","name":"permissioned","type":"bool"}],"internalType":"struct OPContractsManager.AddGameInput[]","name":"_gameConfigs","type":"tuple[]"}],"name":"addGameType","outputs":[{"components":[{"internalType":"contract IDelayedWETH","name":"delayedWETH","type":"address"},{"internalType":"contract IFaultDisputeGame","name":"faultDisputeGame","type":"address"}],"internalType":"struct OPContractsManager.AddGameOutput[]","name":"","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"blueprints","outputs":[{"components":[{"internalType":"address","name":"addressManager","type":"address"},{"internalType":"address","name":"proxy","type":"address"},{"internalType":"address","name":"proxyAdmin","type":"address"},{"internalType":"address","name":"l1ChugSplashProxy","type":"address"},{"internalType":"address","name":"resolvedDelegateProxy","type":"address"},{"internalType":"address","name":"permissionedDisputeGame1","type":"address"},{"internalType":"address","name":"permissionedDisputeGame2","type":"address"},{"internalType":"address","name":"permissionlessDisputeGame1","type":"address"},{"internalType":"address","name":"permissionlessDisputeGame2","type":"address"}],"internalType":"struct OPContractsManager.Blueprints","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_l2ChainId","type":"uint256"}],"name":"chainIdToBatchInboxAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"opChainProxyAdminOwner","type":"address"},{"internalType":"address","name":"systemConfigOwner","type":"address"},{"internalType":"address","name":"batcher","type":"address"},{"internalType":"address","name":"unsafeBlockSigner","type":"address"},{"internalType":"address","name":"proposer","type":"address"},{"internalType":"address","name":"challenger","type":"address"}],"internalType":"struct OPContractsManager.Roles","name":"roles","type":"tuple"},{"internalType":"uint32","name":"basefeeScalar","type":"uint32"},{"internalType":"uint32","name":"blobBasefeeScalar","type":"uint32"},{"internalType":"uint256","name":"l2ChainId","type":"uint256"},{"internalType":"bytes","name":"startingAnchorRoot","type":"bytes"},{"internalType":"string","name":"saltMixer","type":"string"},{"internalType":"uint64","name":"gasLimit","type":"uint64"},{"internalType":"GameType","name":"disputeGameType","type":"uint32"},{"internalType":"Claim","name":"disputeAbsolutePrestate","type":"bytes32"},{"internalType":"uint256","name":"disputeMaxGameDepth","type":"uint256"},{"internalType":"uint256","name":"disputeSplitDepth","type":"uint256"},{"internalType":"Duration","name":"disputeClockExtension","type":"uint64"},{"internalType":"Duration","name":"disputeMaxClockDuration","type":"uint64"}],"internalType":"struct OPContractsManager.DeployInput","name":"_input","type":"tuple"}],"name":"deploy","outputs":[{"components":[{"internalType":"contract IProxyAdmin","name":"opChainProxyAdmin","type":"address"},{"internalType":"contract IAddressManager","name":"addressManager","type":"address"},{"internalType":"contract IL1ERC721Bridge","name":"l1ERC721BridgeProxy","type":"address"},{"internalType":"contract ISystemConfig","name":"systemConfigProxy","type":"address"},{"internalType":"contract IOptimismMintableERC20Factory","name":"optimismMintableERC20FactoryProxy","type":"address"},{"internalType":"contract IL1StandardBridge","name":"l1StandardBridgeProxy","type":"address"},{"internalType":"contract IL1CrossDomainMessenger","name":"l1CrossDomainMessengerProxy","type":"address"},{"internalType":"contract IOptimismPortal2","name":"optimismPortalProxy","type":"address"},{"internalType":"contract IDisputeGameFactory","name":"disputeGameFactoryProxy","type":"address"},{"internalType":"contract IAnchorStateRegistry","name":"anchorStateRegistryProxy","type":"address"},{"internalType":"contract IFaultDisputeGame","name":"faultDisputeGame","type":"address"},{"internalType":"contract IPermissionedDisputeGame","name":"permissionedDisputeGame","type":"address"},{"internalType":"contract IDelayedWETH","name":"delayedWETHPermissionedGameProxy","type":"address"},{"internalType":"contract IDelayedWETH","name":"delayedWETHPermissionlessGameProxy","type":"address"}],"internalType":"struct OPContractsManager.DeployOutput","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"implementations","outputs":[{"components":[{"internalType":"address","name":"superchainConfigImpl","type":"address"},{"internalType":"address","name":"protocolVersionsImpl","type":"address"},{"internalType":"address","name":"l1ERC721BridgeImpl","type":"address"},{"internalType":"address","name":"optimismPortalImpl","type":"address"},{"internalType":"address","name":"systemConfigImpl","type":"address"},{"internalType":"address","name":"optimismMintableERC20FactoryImpl","type":"address"},{"internalType":"address","name":"l1CrossDomainMessengerImpl","type":"address"},{"internalType":"address","name":"l1StandardBridgeImpl","type":"address"},{"internalType":"address","name":"disputeGameFactoryImpl","type":"address"},{"internalType":"address","name":"anchorStateRegistryImpl","type":"address"},{"internalType":"address","name":"delayedWETHImpl","type":"address"},{"internalType":"address","name":"mipsImpl","type":"address"}],"internalType":"struct OPContractsManager.Implementations","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRC","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"l1ContractsRelease","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolVersions","outputs":[{"internalType":"contract IProtocolVersions","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_isRC","type":"bool"}],"name":"setRC","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"superchainConfig","outputs":[{"internalType":"contract ISuperchainConfig","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"superchainProxyAdmin","outputs":[{"internalType":"contract IProxyAdmin","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract ISystemConfig","name":"systemConfigProxy","type":"address"},{"internalType":"contract IProxyAdmin","name":"proxyAdmin","type":"address"},{"internalType":"Claim","name":"absolutePrestate","type":"bytes32"}],"internalType":"struct OPContractsManager.OpChainConfig[]","name":"_opChainConfigs","type":"tuple[]"}],"name":"upgrade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upgradeController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"}]Contract Creation Code
0x6101206040526016805460ff191660011790553480156200001f57600080fd5b50604051620067ca380380620067ca83398101604081905262000042916200050b565b6200004d8762000240565b620000588662000240565b6001600160a01b0380881660805286811660a052851660c05260006200007f8582620006d9565b508251600180546001600160a01b03199081166001600160a01b039384161790915560208086015160028054841691851691909117905560408087015160038054851691861691909117905560608088015160048054861691871691909117905560808089015160058054871691881691909117905560a0808a015160068054881691891691909117905560c0808b0151600780548916918a1691909117905560e0808c0151600880548a16918b169190911790556101009b8c0151600980548a16918b169190911790558a51600a80548a16918b16919091179055958a0151600b80548916918a1691909117905593890151600c8054881691891691909117905591880151600d80548716918816919091179055870151600e80548616918716919091179055860151600f80548516918616919091179055850151601080548416918516919091179055848101516011805484169185169190911790558486015160128054841691851691909117905561012085015160138054841691851691909117905561014085015160148054841691851691909117905561016090940151601580549092169083161790553090925216905250620007a592505050565b806001600160a01b03163b6000036200027b576040516310d76a3760e31b81526001600160a01b038216600482015260240160405180910390fd5b50565b6001600160a01b03811681146200027b57600080fd5b634e487b7160e01b600052604160045260246000fd5b60405161012081016001600160401b0381118282101715620002d057620002d062000294565b60405290565b60405161018081016001600160401b0381118282101715620002d057620002d062000294565b604051601f8201601f191681016001600160401b038111828210171562000327576200032762000294565b604052919050565b80516200033c816200027e565b919050565b600061012082840312156200035557600080fd5b6200035f620002aa565b90506200036c826200032f565b81526200037c602083016200032f565b60208201526200038f604083016200032f565b6040820152620003a2606083016200032f565b6060820152620003b5608083016200032f565b6080820152620003c860a083016200032f565b60a0820152620003db60c083016200032f565b60c0820152620003ee60e083016200032f565b60e0820152610100620004038184016200032f565b9082015292915050565b600061018082840312156200042157600080fd5b6200042b620002d6565b905062000438826200032f565b815262000448602083016200032f565b60208201526200045b604083016200032f565b60408201526200046e606083016200032f565b606082015262000481608083016200032f565b60808201526200049460a083016200032f565b60a0820152620004a760c083016200032f565b60c0820152620004ba60e083016200032f565b60e0820152610100620004cf8184016200032f565b90820152610120620004e38382016200032f565b90820152610140620004f78382016200032f565b90820152610160620004038382016200032f565b6000806000806000806000610340888a0312156200052857600080fd5b875162000535816200027e565b809750506020808901516200054a816200027e565b60408a01519097506200055d816200027e565b60608a01519096506001600160401b03808211156200057b57600080fd5b818b0191508b601f8301126200059057600080fd5b815181811115620005a557620005a562000294565b620005b9601f8201601f19168501620002fc565b91508082528c84828501011115620005d057600080fd5b60005b81811015620005f0578381018501518382018601528401620005d3565b81811115620006025760008583850101525b5050809650505050620006198960808a0162000341565b92506200062b896101a08a016200040d565b91506200063c61032089016200032f565b905092959891949750929550565b600181811c908216806200065f57607f821691505b6020821081036200068057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620006d457600081815260208120601f850160051c81016020861015620006af5750805b601f850160051c820191505b81811015620006d057828155600101620006bb565b5050505b505050565b81516001600160401b03811115620006f557620006f562000294565b6200070d816200070684546200064a565b8462000686565b602080601f8311600181146200074557600084156200072c5750858301515b600019600386901b1c1916600185901b178555620006d0565b600085815260208120601f198616915b82811015620007765788860151825594840194600190910190840162000755565b5085821015620007955787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e05161010051615f31620008996000396000818161034501528181611ab40152611ba801526000818161046f01528181611b4601528181611bfd015281816128f70152612cc101526000818161011d01528181611cd901528181611d5701528181611e020152611e8001526000818161030901528181611dd60152611ea1015260008181610289015281816107550152818161173101528181611caa01528181611d78015281816121fc015281816122440152818161228d015281816122d60152818161270c0152818161380301528181613973015281816139c40152613a2a0152615f316000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063613e827b1161008c57806387543ef61161006657806387543ef614610340578063b51f9c2b14610367578063f179c48d14610433578063ff2dd5a11461045057600080fd5b8063613e827b146102e45780636624856a146103045780636ccdfe111461032b57600080fd5b8063318b1b80116100c8578063318b1b801461025c57806335cb2e9b1461026f57806335e80ab31461028457806354fd4d50146102ab57600080fd5b80631661a2e9146100ef5780632b96b8391461011857806330e9012c14610157575b600080fd5b6101026100fd366004614ca7565b610463565b60405161010f9190614e54565b60405180910390f35b61013f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161010f565b61024f6040805161018081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810191909152506040805161018081018252600a546001600160a01b039081168252600b5481166020830152600c54811692820192909252600d5482166060820152600e5482166080820152600f54821660a0820152601054821660c0820152601154821660e082015260125482166101008201526013548216610120820152601454821661014082015260155490911661016082015290565b60405161010f9190614eb0565b61013f61026a366004614fca565b610cc4565b610277610d3f565b60405161010f919061503b565b61013f7f000000000000000000000000000000000000000000000000000000000000000081565b60408051808201909152600581527f312e362e300000000000000000000000000000000000000000000000000000006020820152610277565b6102f76102f236600461504e565b610e03565b60405161010f919061508a565b61013f7f000000000000000000000000000000000000000000000000000000000000000081565b61033e6103393660046151ba565b611aa9565b005b61013f7f000000000000000000000000000000000000000000000000000000000000000081565b6104266040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091525060408051610120810182526001546001600160a01b039081168252600254811660208301526003548116928201929092526004548216606082015260055482166080820152600654821660a0820152600754821660c0820152600854821660e082015260095490911661010082015290565b60405161010f91906151d5565b6016546104409060ff1681565b604051901515815260200161010f565b61033e61045e366004615251565b611b3c565b60606001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036104c7576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8151600003610502576040517fea11647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000825167ffffffffffffffff81111561051e5761051e614ac4565b60405190808252806020026020018201604052801561056357816020015b604080518082019091526000808252602082015281526020019060019003908161053c5790505b50905060006105706128ac565b905060001960005b8551811015610cba57600086828151811061059557610595615321565b6020026020010151905060006105b2826080015163ffffffff1690565b63ffffffff1690508084126105f3576040517fea11647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b809350600061060f6106088460200151612978565b60016129e2565b9050600061061c82612a73565b60608501519091506001600160a01b03166107e257600061063c84612ad7565b60405160200161064c9190615337565b6040516020818303038152906040529050610671828660400151876000015184612c14565b89878151811061068357610683615321565b6020026020010151600001906001600160a01b031690816001600160a01b0316815250506107dc85604001518a88815181106106c1576106c1615321565b6020026020010151600001516106d5612c5e565b610140015188604001516001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561071c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107409190615387565b6040516001600160a01b0391821660248201527f0000000000000000000000000000000000000000000000000000000000000000909116604482015260640160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f485cc95500000000000000000000000000000000000000000000000000000000179052612d42565b50610812565b83606001518886815181106107f9576107f9615321565b60209081029190910101516001600160a01b0390911690525b60008461018001511561097e5761094d8860a001518960c001516108708589600001516040518060400160405280601781526020017f5065726d697373696f6e65644469737075746547616d65000000000000000000815250612dcc565b6109486040518061014001604052808b6080015163ffffffff1681526020018b60a0015181526020018b60c0015181526020018b60e0015181526020018b610100015167ffffffffffffffff1681526020018b610120015167ffffffffffffffff1681526020018b61016001516001600160a01b031681526020018f8d815181106108fd576108fd615321565b6020026020010151600001516001600160a01b031681526020016109208a612e02565b6001600160a01b0316815260200188905261093a89612e42565b6109438a612e82565b612ec2565b612f49565b89878151811061095f5761095f615321565b6020908102919091018101516001600160a01b03909216910152610adc565b61099561098e8660200151612978565b60006129e2565b9050610aaf8860e001518961010001516109e98589600001516040518060400160405280601981526020017f5065726d697373696f6e6c6573734469737075746547616d6500000000000000815250612dcc565b6109486040518061014001604052808b6080015163ffffffff1681526020018b60a0015181526020018b60c0015181526020018b60e0015181526020018b610100015167ffffffffffffffff1681526020018b610120015167ffffffffffffffff1681526020018b61016001516001600160a01b031681526020018f8d81518110610a7657610a76615321565b6020026020010151600001516001600160a01b03168152602001610a998a612e02565b6001600160a01b03168152602001889052613145565b898781518110610ac157610ac1615321565b6020908102919091018101516001600160a01b039092169101525b6000610aeb8660200151612978565b9050610b198187608001518c8a81518110610b0857610b08615321565b6020026020010151602001516131bf565b60808601516101408701516040517f1e33424000000000000000000000000000000000000000000000000000000000815263ffffffff909216600483015260248201526001600160a01b03821690631e33424090604401600060405180830381600087803b158015610b8a57600080fd5b505af1158015610b9e573d6000803e3d6000fd5b5050505085610180015115610c2957856080015163ffffffff16837f4b8d2d3f00ea4ebab553d99606c8aea67fd4deb9ef0abee0e7c4b246c59a0e0f8c8a81518110610bec57610bec615321565b60200260200101516020015187604051610c1c9291906001600160a01b0392831681529116602082015260400190565b60405180910390a3610ca1565b856080015163ffffffff16837f4b8d2d3f00ea4ebab553d99606c8aea67fd4deb9ef0abee0e7c4b246c59a0e0f8c8a81518110610c6857610c68615321565b60200260200101516020015185604051610c989291906001600160a01b0392831681529116602082015260400190565b60405180910390a35b5050505050508080610cb2906153ba565b915050610578565b5091949350505050565b604080516020808201849052825180830382018152828401845280519101206000606083018190527fffffffffffffffffffffffffffffffffffffff000000000000000000000000008216606184015283516054818503018152607490930190935282918190610d33906153d4565b60601c95945050505050565b60165460609060ff16610ddc5760008054610d5990615424565b80601f0160208091040260200160405190810160405280929190818152602001828054610d8590615424565b8015610dd25780601f10610da757610100808354040283529160200191610dd2565b820191906000526020600020905b815481529060010190602001808311610db557829003601f168201915b5050505050905090565b6000604051602001610dee919061545e565b6040516020818303038152906040525b905090565b604080516101c081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a0810191909152610e7d82613245565b6101008201356000610e93610140850185615546565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516101c08101825282815260208101839052908101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a0810191909152939450610f3e92505050565b60015460408051808201909152600e81527f416464726573734d616e616765720000000000000000000000000000000000006020820152610fa4916001600160a01b031690610f909086908690612dcc565b604080516000815260208101909152613637565b6001600160a01b0390811660208084019190915260035460408051808201909152600a81527f50726f787941646d696e00000000000000000000000000000000000000000000928101929092526110249216906110049086908690612dcc565b60408051306020820152015b604051602081830303815290604052613637565b6001600160a01b0390811680835260208301516040517f0652b57a0000000000000000000000000000000000000000000000000000000081529216600483015290630652b57a90602401600060405180830381600087803b15801561108857600080fd5b505af115801561109c573d6000803e3d6000fd5b505050602082015182516110b09250613771565b6110f5838260000151846040518060400160405280600e81526020017f4c31455243373231427269646765000000000000000000000000000000000000815250612c14565b6001600160a01b031660408083019190915281518151808301909252600e82527f4f7074696d69736d506f7274616c0000000000000000000000000000000000006020830152611149918591908590612c14565b6001600160a01b031660e0820152805160408051808201909152600c81527f53797374656d436f6e6669670000000000000000000000000000000000000000602082015261119a9185918590612c14565b6001600160a01b03166060820152805160408051808201909152601c81527f4f7074696d69736d4d696e7461626c654552433230466163746f72790000000060208201526111eb9185918590612c14565b6001600160a01b03166080820152805160408051808201909152601281527f4469737075746547616d65466163746f72790000000000000000000000000000602082015261123c9185918590612c14565b6001600160a01b0316610100820152805160408051808201909152601381527f416e63686f725374617465526567697374727900000000000000000000000000602082015261128e9185918590612c14565b6001600160a01b0390811661012083015260045460408051808201909152601081527f4c315374616e646172644272696467650000000000000000000000000000000060208201526113089291909116906112ec9086908690612dcc565b8351604080516001600160a01b03909216602083015201611010565b6001600160a01b0390811660a0830181905282516040517f8d52d4a0000000000000000000000000000000000000000000000000000000008152921691638d52d4a09161135a916001906004016155ab565b600060405180830381600087803b15801561137457600080fd5b505af1158015611388573d6000803e3d6000fd5b5050505060006040518060400160405280601a81526020017f4f564d5f4c3143726f7373446f6d61696e4d657373656e6765720000000000008152509050611437600160040160009054906101000a90046001600160a01b031661142286866040518060400160405280601681526020017f4c3143726f7373446f6d61696e4d657373656e67657200000000000000000000815250612dcc565b602080860151604051611010928791016155e6565b6001600160a01b0390811660c0840181905283516040517f8d52d4a0000000000000000000000000000000000000000000000000000000008152921691638d52d4a091611489916002906004016155ab565b600060405180830381600087803b1580156114a357600080fd5b505af11580156114b7573d6000803e3d6000fd5b5050835160c08501516040517f860f7cda0000000000000000000000000000000000000000000000000000000081526001600160a01b03909216935063860f7cda92506115089185906004016155e6565b600060405180830381600087803b15801561152257600080fd5b505af1158015611536573d6000803e3d6000fd5b5050505061157f848360000151856040518060400160405280601b81526020017f44656c61796564574554485065726d697373696f6e656447616d650000000000815250612c14565b6001600160a01b0390811661018084015260065460075460408051808201909152601781527f5065726d697373696f6e65644469737075746547616d6500000000000000000060208201526116ca939283169291909116906115e49088908890612dcc565b6109486040518061014001604052808c6101800160208101906116079190615608565b63ffffffff1681526101a08d013560208201526101c08d013560408201526101e08d013560608201526080016116456102208e016102008f01615625565b67ffffffffffffffff1681526020016116666102408e016102208f01615625565b67ffffffffffffffff1681526015546001600160a01b0390811660208301526101808a0151811660408301526101208a01511660608201526101008d01356080918201526116ba9060a08e01908e01615642565b61094360c08e0160a08f01615642565b6001600160a01b031661016083015260606116e4836137e9565b83516040850151600c54929350611704926001600160a01b031684612d42565b6117c1836101008101516060808301516040516001600160a01b03938416602482015290831660448201527f00000000000000000000000000000000000000000000000000000000000000009092166064830152600160848301529060a40160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f8e819e540000000000000000000000000000000000000000000000000000000017905292915050565b835160e0850151600d549293506117e1926001600160a01b031684612d42565b6117f36117ed8861570e565b8461388f565b83516060850151600e54929350611813926001600160a01b031684612d42565b6118938360a08101516040516001600160a01b03909116602482015260609060440160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc4d66de80000000000000000000000000000000000000000000000000000000017905292915050565b83516080850151600f549293506118b3926001600160a01b031684612d42565b6118bc83613961565b835160c08501516010549293506118dc926001600160a01b031684612d42565b6118e5836137e9565b835160a0850151601154929350611905926001600160a01b031684612d42565b6119166119118861570e565b6139ac565b8351610180850151601454929350611937926001600160a01b031684612d42565b6119a660405130602482015260609060440160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc4d66de800000000000000000000000000000000000000000000000000000000179052919050565b83516101008501516012549293506119c7926001600160a01b031684612d42565b6119dd83610100015160018561016001516131bf565b6101008301516119f9906119f460208a018a615642565b613771565b611a0b611a058861570e565b846139f6565b8351610120850151601354929350611a2c926001600160a01b031684612d42565b8251611a3f906119f460208a018a615642565b336001600160a01b0316857fb40fb1137b92aa97efb20f29c17d36c5947aac681c3315ba854b0232f834954285604051602001611a7c919061508a565b60408051601f1981840301815290829052611a969161503b565b60405180910390a3509095945050505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611b0b576040517f861c183d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003611b9e576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003611c62576040517f6ccdfe11000000000000000000000000000000000000000000000000000000008152600060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636ccdfe1190602401600060405180830381600087803b158015611c4957600080fd5b505af1158015611c5d573d6000803e3d6000fd5b505050505b6000611c6c612c5e565b90506000611c786128ac565b82516040517f204e1c7a0000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152929350908216917f0000000000000000000000000000000000000000000000000000000000000000169063204e1c7a90602401602060405180830381865afa158015611d20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d449190615387565b6001600160a01b031614611da157611da17f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008460000151613ad7565b60208201516040517f204e1c7a0000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152918216917f0000000000000000000000000000000000000000000000000000000000000000169063204e1c7a90602401602060405180830381865afa158015611e49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6d9190615387565b6001600160a01b031614611eca57611eca7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008460200151613ad7565b60005b83518110156128a657611ef8848281518110611eeb57611eeb615321565b6020026020010151613b2f565b60006040518060c00160405280868481518110611f1757611f17615321565b6020026020010151600001516001600160a01b031663a71198696040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f849190615387565b6001600160a01b03168152602001868481518110611fa457611fa4615321565b6020026020010151600001516001600160a01b031663c4e8ddfa6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611fed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120119190615387565b6001600160a01b0316815260200186848151811061203157612031615321565b6020026020010151600001516001600160a01b031663078f29cf6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561207a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209e9190615387565b6001600160a01b031681526020016120d28785815181106120c1576120c1615321565b602002602001015160000151612978565b6001600160a01b031681526020018684815181106120f2576120f2615321565b6020026020010151600001516001600160a01b0316630a49cb036040518163ffffffff1660e01b8152600401602060405180830381865afa15801561213b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215f9190615387565b6001600160a01b0316815260200186848151811061217f5761217f615321565b6020026020010151600001516001600160a01b0316639b7d7f0a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121ec9190615387565b6001600160a01b031681525090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166122318260800151613b47565b6001600160a01b031614158061228557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166122798260000151613b47565b6001600160a01b031614155b806122ce57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166122c28260200151613b47565b6001600160a01b031614155b8061231757507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661230b8260400151613b47565b6001600160a01b031614155b1561237d5784828151811061232e5761232e615321565b6020908102919091010151516040517fc358e75a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024015b60405180910390fd5b6123c685838151811061239257612392615321565b6020026020010151602001518684815181106123b0576123b0615321565b6020026020010151600001518660800151613ad7565b6123f68583815181106123db576123db615321565b60200260200101516020015182600001518660c00151613ad7565b61242685838151811061240b5761240b615321565b60200260200101516020015182602001518660400151613ad7565b61245685838151811061243b5761243b615321565b60200260200101516020015182604001518660e00151613ad7565b61248785838151811061246b5761246b615321565b6020026020010151602001518260600151866101000151613ad7565b6124b785838151811061249c5761249c615321565b60200260200101516020015182608001518660600151613ad7565b6124e78583815181106124cc576124cc615321565b6020026020010151602001518260a001518660a00151613ad7565b60006124f8826060015160016129e2565b9050600061250582612a73565b905060006125ae8289878151811061251f5761251f615321565b6020026020010151602001516125738b898151811061254057612540615321565b602002602001015151604080516001600160a01b0390921660208084019190915281518084039091018152918101905290565b6040518060400160405280601381526020017f416e63686f725374617465526567697374727900000000000000000000000000815250612c14565b9050600084608001516001600160a01b0316633c9f397c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156125f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612618919061582b565b905060008061262686612e02565b6040517f7258a80700000000000000000000000000000000000000000000000000000000815263ffffffff851660048201526001600160a01b039190911690637258a807906024016040805180830381865afa15801561268a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126ae9190615848565b91509150600060405180604001604052808481526020018381525090506127b68c8a815181106126e0576126e0615321565b6020908102919091018101518101516101208e015160608c015160808d01516040516001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166024830152928316604482015291166064820152855160848201529285015160a4840152909188919060c40160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f060fa21600000000000000000000000000000000000000000000000000000000179052612d42565b505050506127e482848360018c8a815181106127d4576127d4615321565b60200260200101518b8d8b613b87565b60006127f5856060015160006129e2565b90506001600160a01b038116156128305761283083828460008d8b8151811061282057612820615321565b60200260200101518c8e8c613b87565b306001600160a01b031689878151811061284c5761284c615321565b6020026020010151600001516001600160a01b0316847f78bc67b9bf548ef6410becd31a3e10b9ea6c255974ef6b4530728b431df3003060405160405180910390a45050505050808061289e906153ba565b915050611ecd565b50505050565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b51f9c2b6040518163ffffffff1660e01b815260040161012060405180830381865afa158015612954573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe919061586c565b6000816001600160a01b031663f2b4e6176040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129dc9190615387565b92915050565b6040517f1b685b9e00000000000000000000000000000000000000000000000000000000815263ffffffff821660048201526000906001600160a01b03841690631b685b9e90602401602060405180830381865afa158015612a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a6c9190615387565b9392505050565b6000816001600160a01b031663d6ae3cd56040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ab3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129dc9190615922565b606081600003612b1a57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612b445780612b2e816153ba565b9150612b3d9050600a83615951565b9150612b1e565b60008167ffffffffffffffff811115612b5f57612b5f614ac4565b6040519080825280601f01601f191660200182016040528015612b89576020820181803683370190505b5090505b8415612c0c57612b9e600183615965565b9150612bab600a8661597c565b612bb6906030615990565b60f81b818381518110612bcb57612bcb615321565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612c05600a86615951565b9450612b8d565b949350505050565b600080612c22868585612dcc565b9050612c54612c2f6128ac565b60200151828760405160200161101091906001600160a01b0391909116815260200190565b9695505050505050565b6040805161018081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166330e9012c6040518163ffffffff1660e01b815260040161018060405180830381865afa158015612d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe91906159a8565b612d4b82613d76565b6040517f9623609d0000000000000000000000000000000000000000000000000000000081526001600160a01b03851690639623609d90612d9490869086908690600401615a89565b600060405180830381600087803b158015612dae57600080fd5b505af1158015612dc2573d6000803e3d6000fd5b5050505050505050565b6000838383604051602001612de393929190615ab5565b6040516020818303038152906040528051906020012090509392505050565b6000816001600160a01b0316635c0cba336040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129b8573d6000803e3d6000fd5b6000816001600160a01b031663a8e4fb906040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129b8573d6000803e3d6000fd5b6000816001600160a01b031663534db0e26040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129b8573d6000803e3d6000fd5b60606000848484604051602401612edb93929190615b96565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f9ecd8b34000000000000000000000000000000000000000000000000000000001790529050612f40816004613dc5565b95945050505050565b600080612f7a866001600160a01b0316803b806020016040519081016040528181526000908060200190933c613dfb565b805190915060ff1615612fc15780516040517f1a66c69200000000000000000000000000000000000000000000000000000000815260ff9091166004820152602401612374565b602081015151156130045780602001516040517f57a05835000000000000000000000000000000000000000000000000000000008152600401612374919061503b565b6000613034866001600160a01b0316803b806020016040519081016040528181526000908060200190933c613dfb565b805190915060ff161561307b5780516040517f1a66c69200000000000000000000000000000000000000000000000000000000815260ff9091166004820152602401612374565b602081015151156130be5780602001516040517f57a05835000000000000000000000000000000000000000000000000000000008152600401612374919061503b565b600082604001518260400151866040516020016130dd93929190615bc8565b6040516020818303038152906040529050858151602083016000f593506001600160a01b03841661313a576040517f3011642500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050949350505050565b606060008260405160240161315a9190615c0b565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f5599c646000000000000000000000000000000000000000000000000000000001790529050612a6c816004613dc5565b6040517f14f6b1a300000000000000000000000000000000000000000000000000000000815263ffffffff831660048201526001600160a01b0382811660248301528416906314f6b1a3906044015b600060405180830381600087803b15801561322857600080fd5b505af115801561323c573d6000803e3d6000fd5b50505050505050565b610100810135158061325b575046816101000135145b15613292576040517f7a47c9a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006132a16020830183615642565b6001600160a01b031603613311576040517fe646e04300000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f70436861696e50726f787941646d696e4f776e6572000000000000000000006044820152606401612374565b60006133236040830160208401615642565b6001600160a01b031603613393576040517fe646e04300000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f73797374656d436f6e6669674f776e65720000000000000000000000000000006044820152606401612374565b60006133a56060830160408401615642565b6001600160a01b031603613415576040517fe646e04300000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f62617463686572000000000000000000000000000000000000000000000000006044820152606401612374565b60006134276080830160608401615642565b6001600160a01b031603613497576040517fe646e04300000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f756e73616665426c6f636b5369676e65720000000000000000000000000000006044820152606401612374565b60006134a960a0830160808401615642565b6001600160a01b031603613519576040517fe646e04300000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f70726f706f7365720000000000000000000000000000000000000000000000006044820152606401612374565b600061352b60c0830160a08401615642565b6001600160a01b03160361359b576040517fe646e04300000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6368616c6c656e676572000000000000000000000000000000000000000000006044820152606401612374565b6135a9610120820182615546565b90506000036135e4576040517f89e0acdf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006135f4610120830183615546565b6135fd91615c1a565b03613634576040517f89e0acdf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600080613668856001600160a01b0316803b806020016040519081016040528181526000908060200190933c613dfb565b805190915060ff16156136af5780516040517f1a66c69200000000000000000000000000000000000000000000000000000000815260ff9091166004820152602401612374565b602081015151156136f25780602001516040517f57a05835000000000000000000000000000000000000000000000000000000008152600401612374919061503b565b600081604001518460405160200161370b929190615c38565b6040516020818303038152906040529050848151602083016000f592506001600160a01b038316613768576040517f3011642500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50509392505050565b6040517ff2fde38b0000000000000000000000000000000000000000000000000000000081526001600160a01b03828116600483015283169063f2fde38b90602401600060405180830381600087803b1580156137cd57600080fd5b505af11580156137e1573d6000803e3d6000fd5b505050505050565b60c08101516040516001600160a01b0391821660248201527f000000000000000000000000000000000000000000000000000000000000000090911660448201526060906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f485cc9550000000000000000000000000000000000000000000000000000000017905292915050565b606060008061389e85856142ba565b91509150846000015160200151856020015186604001518760000151604001516001600160a01b031660001b8860c00151896000015160600151876138e68c60600151610cc4565b886040516024016138ff99989796959493929190615c67565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fca407f0c000000000000000000000000000000000000000000000000000000001790529250505092915050565b60e08101516040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660248301529091166044820152606090606401613831565b8051516040516001600160a01b0391821660248201527f00000000000000000000000000000000000000000000000000000000000000009091166044820152606090606401613831565b606060008360800151806020019051810190613a129190615d84565b61010084015160e08501516040516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116602483015292831660448201529116606482015281516084820152602082015160a482015290915060c40160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f060fa2160000000000000000000000000000000000000000000000000000000017905291505092915050565b613ae081613d76565b6040517f99a88ec40000000000000000000000000000000000000000000000000000000081526001600160a01b03838116600483015282811660248301528416906399a88ec49060440161320e565b8051613b3a90613d76565b6136348160200151613d76565b6000816001600160a01b03166335e80ab36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129b8573d6000803e3d6000fd5b6000613b9288614476565b9050613ba8856020015182856101400151613ad7565b506000613bb4886144b6565b6001600160a01b038089166101008301526101608501511660c08201526040860151909150613c0f576040517fefc878f200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408501516020820152600060001963ffffffff881601613cd3576000613c358a612e42565b90506000613c428b612e82565b9050613cca8760a001518860c00151613cbf8f613c848d51604080516001600160a01b0390921660208084019190915281518084039091018152918101905290565b6040518060400160405280601781526020017f5065726d697373696f6e65644469737075746547616d65000000000000000000815250612dcc565b610948888787612ec2565b92505050613d5b565b613d588560e00151866101000151613d4f8d613d148b51604080516001600160a01b0390921660208084019190915281518084039091018152918101905290565b6040518060400160405280601981526020017f5065726d697373696f6e6c6573734469737075746547616d6500000000000000815250612dcc565b61094886613145565b90505b613d6a836060015188836131bf565b50505050505050505050565b806001600160a01b03163b600003613634576040517f86bb51b80000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602401612374565b606082518210613de457506040805160208101909152600081526129dc565b612a6c8383848651613df69190615965565b614849565b613e226040518060600160405280600060ff16815260200160608152602001606081525090565b600282511080613e8c575081600081518110613e4057613e40615321565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167ffe0000000000000000000000000000000000000000000000000000000000000014155b80613ef1575081600181518110613ea557613ea5615321565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f710000000000000000000000000000000000000000000000000000000000000014155b15613f28576040517f31f56e1f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600283600281518110613f3f57613f3f615321565b602001015160f81c60f81b60fc60f81b1660f81c60ff16901c9050600083600281518110613f6f57613f6f615321565b60209101015160f81c60039081169150819003613fb8576040517fb214675a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060ff8216156140a45760008260ff1667ffffffffffffffff811115613fe157613fe1614ac4565b6040519080825280601f01601f19166020018201604052801561400b576020820181803683370190505b50905060005b8360ff168110156140965786614028826003615990565b8151811061403857614038615321565b602001015160f81c60f81b82828151811061405557614055615321565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508061408e816153ba565b915050614011565b506140a081614a03565b9150505b60008167ffffffffffffffff8111156140bf576140bf614ac4565b6040519080825280601f01601f1916602001820160405280156140e9576020820181803683370190505b50905060ff83161561418e576000614102846003615dd3565b60ff16905060005b8381101561418b578761411d8284615990565b8151811061412d5761412d615321565b602001015160f81c60f81b83828151811061414a5761414a615321565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080614183816153ba565b91505061410a565b50505b60008261419c856003615dd3565b60ff166141a99190615990565b905060008188516141ba9190615965565b9050806000036141f6576040517f028512d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff81111561421157614211614ac4565b6040519080825280601f01601f19166020018201604052801561423b576020820181803683370190505b50905060008360208b0101602083018481868460045afa925050508061428d576040517ff7046f3000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180606001604052808960ff1681526020018681526020018381525098505050505050505050919050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091526040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091526143a16040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152506040805160c0810182526301312d008152600a6020820152600891810191909152633b9aca006060820152620f424060808201526fffffffffffffffffffffffffffffffff60a082015290565b91506040518060c001604052808460c001516001600160a01b0316815260200184604001516001600160a01b031681526020018460a001516001600160a01b031681526020018461010001516001600160a01b031681526020018460e001516001600160a01b0316815260200184608001516001600160a01b0316815250905061442e8160000151613d76565b61443b8160200151613d76565b6144488160400151613d76565b6144558160600151613d76565b6144628160800151613d76565b61446f8160a00151613d76565b9250929050565b6000816001600160a01b0316633fc8cef36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129b8573d6000803e3d6000fd5b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081018290526101208101919091526000604051806101400160405280846001600160a01b031663bbdc02db6040518163ffffffff1660e01b8152600401602060405180830381865afa158015614553573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614577919061582b565b63ffffffff168152602001846001600160a01b0316638d450a956040518163ffffffff1660e01b8152600401602060405180830381865afa1580156145c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145e49190615922565b8152602001846001600160a01b031663fa315aa96040518163ffffffff1660e01b8152600401602060405180830381865afa158015614627573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061464b9190615922565b8152602001846001600160a01b031663ec5e63086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561468e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146b29190615922565b8152602001846001600160a01b0316636b6716c06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156146f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147199190615df8565b67ffffffffffffffff168152602001846001600160a01b031663dabd396d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015614766573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061478a9190615df8565b67ffffffffffffffff168152602001846001600160a01b0316633a7684636040518163ffffffff1660e01b8152600401602060405180830381865afa1580156147d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147fb9190615387565b6001600160a01b0316815260200161481285614476565b6001600160a01b0316815260200161482985612e02565b6001600160a01b0316815260200161484085612a73565b90529392505050565b60608182601f0110156148b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401612374565b828284011015614924576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401612374565b81830184511015614991576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e64730000000000000000000000000000006044820152606401612374565b6060821580156149b057604051915060008252602082016040526149fa565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156149e95780518352602092830192016149d1565b5050858452601f01601f1916604052505b50949350505050565b6000602082511115614a41576040517f5623dc1c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805b8351811015614abd57614a59816001615990565b8451614a659190615965565b614a70906008615e15565b614a7b906002615f18565b848281518110614a8d57614a8d615321565b0160200151614a9f919060f81c615e15565b614aa99083615990565b915080614ab5816153ba565b915050614a45565b5092915050565b634e487b7160e01b600052604160045260246000fd5b6040516101a0810167ffffffffffffffff81118282101715614afe57614afe614ac4565b60405290565b6040516060810167ffffffffffffffff81118282101715614afe57614afe614ac4565b604051610120810167ffffffffffffffff81118282101715614afe57614afe614ac4565b604051610180810167ffffffffffffffff81118282101715614afe57614afe614ac4565b604051601f8201601f1916810167ffffffffffffffff81118282101715614b9857614b98614ac4565b604052919050565b600067ffffffffffffffff821115614bba57614bba614ac4565b5060051b60200190565b600082601f830112614bd557600080fd5b813567ffffffffffffffff811115614bef57614bef614ac4565b614c026020601f19601f84011601614b6f565b818152846020838601011115614c1757600080fd5b816020850160208301376000918101602001919091529392505050565b6001600160a01b038116811461363457600080fd5b8035614c5481614c34565b919050565b63ffffffff8116811461363457600080fd5b8035614c5481614c59565b67ffffffffffffffff8116811461363457600080fd5b8035614c5481614c76565b80358015158114614c5457600080fd5b60006020808385031215614cba57600080fd5b823567ffffffffffffffff80821115614cd257600080fd5b818501915085601f830112614ce657600080fd5b8135614cf9614cf482614ba0565b614b6f565b81815260059190911b83018401908481019088831115614d1857600080fd5b8585015b83811015614e4757803585811115614d345760008081fd5b86016101a0818c03601f1901811315614d4d5760008081fd5b614d55614ada565b8983013588811115614d675760008081fd5b614d758e8c83870101614bc4565b8252506040614d85818501614c49565b8b8301526060614d96818601614c49565b8284015260809150614da9828601614c49565b9083015260a0614dba858201614c6b565b8284015260c0915081850135818401525060e080850135828401526101009150818501358184015250610120614df1818601614c8c565b828401526101409150614e05828601614c8c565b818401525061016080850135828401526101809150614e25828601614c49565b90830152614e34848401614c97565b9082015285525050918601918601614d1c565b5098975050505050505050565b602080825282518282018190526000919060409081850190868401855b82811015614ea357815180516001600160a01b0390811686529087015116868501529284019290850190600101614e71565b5091979650505050505050565b81516001600160a01b0316815261018081016020830151614edc60208401826001600160a01b03169052565b506040830151614ef760408401826001600160a01b03169052565b506060830151614f1260608401826001600160a01b03169052565b506080830151614f2d60808401826001600160a01b03169052565b5060a0830151614f4860a08401826001600160a01b03169052565b5060c0830151614f6360c08401826001600160a01b03169052565b5060e0830151614f7e60e08401826001600160a01b03169052565b50610100838101516001600160a01b039081169184019190915261012080850151821690840152610140808501518216908401526101608085015191821681850152905b505092915050565b600060208284031215614fdc57600080fd5b5035919050565b60005b83811015614ffe578181015183820152602001614fe6565b838111156128a65750506000910152565b60008151808452615027816020860160208601614fe3565b601f01601f19169290920160200192915050565b602081526000612a6c602083018461500f565b60006020828403121561506057600080fd5b813567ffffffffffffffff81111561507757600080fd5b82016102408185031215612a6c57600080fd5b81516001600160a01b031681526101c0810160208301516150b660208401826001600160a01b03169052565b5060408301516150d160408401826001600160a01b03169052565b5060608301516150ec60608401826001600160a01b03169052565b50608083015161510760808401826001600160a01b03169052565b5060a083015161512260a08401826001600160a01b03169052565b5060c083015161513d60c08401826001600160a01b03169052565b5060e083015161515860e08401826001600160a01b03169052565b50610100838101516001600160a01b0390811691840191909152610120808501518216908401526101408085015182169084015261016080850151821690840152610180808501518216908401526101a0808501519182168185015290614fc2565b6000602082840312156151cc57600080fd5b612a6c82614c97565b81516001600160a01b03908116825260208084015182169083015260408084015182169083015260608084015182169083015260808084015182169083015260a08084015182169083015260c08084015182169083015260e0808401518216908301526101008084015191821681840152610120830191614fc2565b6000602080838503121561526457600080fd5b823567ffffffffffffffff81111561527b57600080fd5b8301601f8101851361528c57600080fd5b803561529a614cf482614ba0565b818152606091820283018401918482019190888411156152b957600080fd5b938501935b838510156153155780858a0312156152d65760008081fd5b6152de614b04565b85356152e981614c34565b8152858701356152f881614c34565b8188015260408681013590820152835293840193918501916152be565b50979650505050505050565b634e487b7160e01b600052603260045260246000fd5b7f44656c61796564574554482d000000000000000000000000000000000000000081526000825161536f81600c850160208701614fe3565b91909101600c0192915050565b8051614c5481614c34565b60006020828403121561539957600080fd5b8151612a6c81614c34565b634e487b7160e01b600052601160045260246000fd5b600060001982036153cd576153cd6153a4565b5060010190565b6000815160208301517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008082169350601483101561541c5780818460140360031b1b83161693505b505050919050565b600181811c9082168061543857607f821691505b60208210810361545857634e487b7160e01b600052602260045260246000fd5b50919050565b600080835481600182811c91508083168061547a57607f831692505b6020808410820361549957634e487b7160e01b86526022600452602486fd5b8180156154ad57600181146154e05761550d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008616895284151585028901965061550d565b60008a81526020902060005b868110156155055781548b8201529085019083016154ec565b505084890196505b50505050505061553c817f2d726300000000000000000000000000000000000000000000000000000000009052565b6003019392505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261557b57600080fd5b83018035915067ffffffffffffffff82111561559657600080fd5b60200191503681900382131561446f57600080fd5b6001600160a01b038316815260408101600383106155d957634e487b7160e01b600052602160045260246000fd5b8260208301529392505050565b6001600160a01b0383168152604060208201526000612c0c604083018461500f565b60006020828403121561561a57600080fd5b8135612a6c81614c59565b60006020828403121561563757600080fd5b8135612a6c81614c76565b60006020828403121561565457600080fd5b8135612a6c81614c34565b600060c0828403121561567157600080fd5b60405160c0810181811067ffffffffffffffff8211171561569457615694614ac4565b60405290508082356156a581614c34565b815260208301356156b581614c34565b602082015260408301356156c881614c34565b604082015260608301356156db81614c34565b606082015260808301356156ee81614c34565b608082015260a083013561570181614c34565b60a0919091015292915050565b6000610240823603121561572157600080fd5b615729614ada565b615733368461565f565b815261574160c08401614c6b565b602082015261575260e08401614c6b565b60408201526101008084013560608301526101208085013567ffffffffffffffff8082111561578057600080fd5b61578c36838901614bc4565b6080860152610140915081870135818111156157a757600080fd5b6157b336828a01614bc4565b60a087015250506101606157c8818801614c8c565b60c08601526101806157db818901614c6b565b60e08701526101a0880135858701526101c0880135848701526101e08801358387015261580b6102008901614c8c565b8287015261581c6102208901614c8c565b90860152509295945050505050565b60006020828403121561583d57600080fd5b8151612a6c81614c59565b6000806040838503121561585b57600080fd5b505080516020909101519092909150565b6000610120828403121561587f57600080fd5b615887614b27565b6158908361537c565b815261589e6020840161537c565b60208201526158af6040840161537c565b60408201526158c06060840161537c565b60608201526158d16080840161537c565b60808201526158e260a0840161537c565b60a08201526158f360c0840161537c565b60c082015261590460e0840161537c565b60e082015261010061591781850161537c565b908201529392505050565b60006020828403121561593457600080fd5b5051919050565b634e487b7160e01b600052601260045260246000fd5b6000826159605761596061593b565b500490565b600082821015615977576159776153a4565b500390565b60008261598b5761598b61593b565b500690565b600082198211156159a3576159a36153a4565b500190565b600061018082840312156159bb57600080fd5b6159c3614b4b565b6159cc8361537c565b81526159da6020840161537c565b60208201526159eb6040840161537c565b60408201526159fc6060840161537c565b6060820152615a0d6080840161537c565b6080820152615a1e60a0840161537c565b60a0820152615a2f60c0840161537c565b60c0820152615a4060e0840161537c565b60e0820152610100615a5381850161537c565b90820152610120615a6584820161537c565b90820152610140615a7784820161537c565b9082015261016061591784820161537c565b60006001600160a01b03808616835280851660208401525060606040830152612f40606083018461500f565b838152606060208201526000615ace606083018561500f565b8281036040840152612c54818561500f565b805163ffffffff1682526020810151602083015260408101516040830152606081015160608301526080810151615b23608084018267ffffffffffffffff169052565b5060a0810151615b3f60a084018267ffffffffffffffff169052565b5060c0810151615b5a60c08401826001600160a01b03169052565b5060e0810151615b7560e08401826001600160a01b03169052565b50610100818101516001600160a01b03169083015261012090810151910152565b6101808101615ba58286615ae0565b6001600160a01b0380851661014084015280841661016084015250949350505050565b60008451615bda818460208901614fe3565b845190830190615bee818360208901614fe3565b8451910190615c01818360208801614fe3565b0195945050505050565b61014081016129dc8284615ae0565b803560208310156129dc57600019602084900360031b1b1692915050565b60008351615c4a818460208801614fe3565b835190830190615c5e818360208801614fe3565b01949350505050565b6000610260820190506001600160a01b03808c16835263ffffffff808c166020850152808b16604085015289606085015267ffffffffffffffff8916608085015281881660a08501528087511660c085015260ff60208801511660e085015260ff604088015116610100850152806060880151166101208501528060808801511661014085015250506fffffffffffffffffffffffffffffffff60a086015116610160830152615d236101808301856001600160a01b03169052565b82516001600160a01b039081166101a0840152602084015181166101c0840152604084015181166101e0840152606084015181166102008401526080840151811661022084015260a0840151166102408301529a9950505050505050505050565b600060408284031215615d9657600080fd5b6040516040810181811067ffffffffffffffff82111715615db957615db9614ac4565b604052825181526020928301519281019290925250919050565b600060ff821660ff84168060ff03821115615df057615df06153a4565b019392505050565b600060208284031215615e0a57600080fd5b8151612a6c81614c76565b6000816000190483118215151615615e2f57615e2f6153a4565b500290565b600181815b80851115615e6f578160001904821115615e5557615e556153a4565b80851615615e6257918102915b93841c9390800290615e39565b509250929050565b600082615e86575060016129dc565b81615e93575060006129dc565b8160018114615ea95760028114615eb357615ecf565b60019150506129dc565b60ff841115615ec457615ec46153a4565b50506001821b6129dc565b5060208310610133831016604e8410600b8410161715615ef2575081810a6129dc565b615efc8383615e34565b8060001904821115615f1057615f106153a4565b029392505050565b6000612a6c8383615e7756fea164736f6c634300080f000a0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd000000000000000000000000b391adfb150e4143ea3b5baa1e4e90f60711f3f40000000000000000000000007015458ab484ad648bfbb0446e001ead1257cb520000000000000000000000000000000000000000000000000000000000000340000000000000000000000000765c6637a370595845f637739279c353484a26a6000000000000000000000000a643ea8ee60d92f615ec70af0248c449bbcecf4d0000000000000000000000002fa0d0f6d92061344db35132379db419bd1c56f7000000000000000000000000a5d36deaf2267b267278a4a1458defe0d65620eb0000000000000000000000007096758bdd076a4cc42255c278f2cb216d6d8ce30000000000000000000000002e5a428e3c65080d51e9c0d581dda85ce8489189000000000000000000000000c10a417e3a00b3e6cc70bbb998b6ad3689cebbb9000000000000000000000000011d2556c6b858f5f5fa69f33f0cd8d52de0e222000000000000000000000000bbcc9cdda0b1ea8058b45fa4dc56e43ba69890e10000000000000000000000004da82a327773965b8d4d85fa3db8249b387458e700000000000000000000000037e15e4d6dffa9e5e320ee1ec036922e563cb76c000000000000000000000000276d3730f219f7ec22274f7263180b8452b46d470000000000000000000000002d7e764a0d9919e16983a46595cfa81fc34fa7cd000000000000000000000000760c48c62a85045a6b69f07f4a9f22868659cbcc0000000000000000000000005493f4677a186f64805fe7317d6993ba4863988f0000000000000000000000003ea6084748ed1b2a9b5d4426181f1ad8c93f623100000000000000000000000078972e88ab8bbb517a36caea23b931bab58ad3c60000000000000000000000004bba758f006ef09402ef31724203f316ab74e4a00000000000000000000000007b465370bb7a333f99edd19599eb7fb1c2d3f8d20000000000000000000000005e40b9231b86984b5150507046e354dbfbed3d9e000000000000000000000000aa59a0777648bc75cd10364083e878c1ccd6112a00000000000000000000000071cb29979d55cbd2ce1f10f00cec38721c25cc0400000000000000000000000000000000000000000000000000000000000000136f702d636f6e7472616374732f76322e302e3000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063613e827b1161008c57806387543ef61161006657806387543ef614610340578063b51f9c2b14610367578063f179c48d14610433578063ff2dd5a11461045057600080fd5b8063613e827b146102e45780636624856a146103045780636ccdfe111461032b57600080fd5b8063318b1b80116100c8578063318b1b801461025c57806335cb2e9b1461026f57806335e80ab31461028457806354fd4d50146102ab57600080fd5b80631661a2e9146100ef5780632b96b8391461011857806330e9012c14610157575b600080fd5b6101026100fd366004614ca7565b610463565b60405161010f9190614e54565b60405180910390f35b61013f7f0000000000000000000000007015458ab484ad648bfbb0446e001ead1257cb5281565b6040516001600160a01b03909116815260200161010f565b61024f6040805161018081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810191909152506040805161018081018252600a546001600160a01b039081168252600b5481166020830152600c54811692820192909252600d5482166060820152600e5482166080820152600f54821660a0820152601054821660c0820152601154821660e082015260125482166101008201526013548216610120820152601454821661014082015260155490911661016082015290565b60405161010f9190614eb0565b61013f61026a366004614fca565b610cc4565b610277610d3f565b60405161010f919061503b565b61013f7f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd81565b60408051808201909152600581527f312e362e300000000000000000000000000000000000000000000000000000006020820152610277565b6102f76102f236600461504e565b610e03565b60405161010f919061508a565b61013f7f000000000000000000000000b391adfb150e4143ea3b5baa1e4e90f60711f3f481565b61033e6103393660046151ba565b611aa9565b005b61013f7f00000000000000000000000071cb29979d55cbd2ce1f10f00cec38721c25cc0481565b6104266040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091525060408051610120810182526001546001600160a01b039081168252600254811660208301526003548116928201929092526004548216606082015260055482166080820152600654821660a0820152600754821660c0820152600854821660e082015260095490911661010082015290565b60405161010f91906151d5565b6016546104409060ff1681565b604051901515815260200161010f565b61033e61045e366004615251565b611b3c565b60606001600160a01b037f0000000000000000000000003058396087da0ac2998a344ee9e55e0f71a7af251630036104c7576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8151600003610502576040517fea11647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000825167ffffffffffffffff81111561051e5761051e614ac4565b60405190808252806020026020018201604052801561056357816020015b604080518082019091526000808252602082015281526020019060019003908161053c5790505b50905060006105706128ac565b905060001960005b8551811015610cba57600086828151811061059557610595615321565b6020026020010151905060006105b2826080015163ffffffff1690565b63ffffffff1690508084126105f3576040517fea11647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b809350600061060f6106088460200151612978565b60016129e2565b9050600061061c82612a73565b60608501519091506001600160a01b03166107e257600061063c84612ad7565b60405160200161064c9190615337565b6040516020818303038152906040529050610671828660400151876000015184612c14565b89878151811061068357610683615321565b6020026020010151600001906001600160a01b031690816001600160a01b0316815250506107dc85604001518a88815181106106c1576106c1615321565b6020026020010151600001516106d5612c5e565b610140015188604001516001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561071c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107409190615387565b6040516001600160a01b0391821660248201527f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd909116604482015260640160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f485cc95500000000000000000000000000000000000000000000000000000000179052612d42565b50610812565b83606001518886815181106107f9576107f9615321565b60209081029190910101516001600160a01b0390911690525b60008461018001511561097e5761094d8860a001518960c001516108708589600001516040518060400160405280601781526020017f5065726d697373696f6e65644469737075746547616d65000000000000000000815250612dcc565b6109486040518061014001604052808b6080015163ffffffff1681526020018b60a0015181526020018b60c0015181526020018b60e0015181526020018b610100015167ffffffffffffffff1681526020018b610120015167ffffffffffffffff1681526020018b61016001516001600160a01b031681526020018f8d815181106108fd576108fd615321565b6020026020010151600001516001600160a01b031681526020016109208a612e02565b6001600160a01b0316815260200188905261093a89612e42565b6109438a612e82565b612ec2565b612f49565b89878151811061095f5761095f615321565b6020908102919091018101516001600160a01b03909216910152610adc565b61099561098e8660200151612978565b60006129e2565b9050610aaf8860e001518961010001516109e98589600001516040518060400160405280601981526020017f5065726d697373696f6e6c6573734469737075746547616d6500000000000000815250612dcc565b6109486040518061014001604052808b6080015163ffffffff1681526020018b60a0015181526020018b60c0015181526020018b60e0015181526020018b610100015167ffffffffffffffff1681526020018b610120015167ffffffffffffffff1681526020018b61016001516001600160a01b031681526020018f8d81518110610a7657610a76615321565b6020026020010151600001516001600160a01b03168152602001610a998a612e02565b6001600160a01b03168152602001889052613145565b898781518110610ac157610ac1615321565b6020908102919091018101516001600160a01b039092169101525b6000610aeb8660200151612978565b9050610b198187608001518c8a81518110610b0857610b08615321565b6020026020010151602001516131bf565b60808601516101408701516040517f1e33424000000000000000000000000000000000000000000000000000000000815263ffffffff909216600483015260248201526001600160a01b03821690631e33424090604401600060405180830381600087803b158015610b8a57600080fd5b505af1158015610b9e573d6000803e3d6000fd5b5050505085610180015115610c2957856080015163ffffffff16837f4b8d2d3f00ea4ebab553d99606c8aea67fd4deb9ef0abee0e7c4b246c59a0e0f8c8a81518110610bec57610bec615321565b60200260200101516020015187604051610c1c9291906001600160a01b0392831681529116602082015260400190565b60405180910390a3610ca1565b856080015163ffffffff16837f4b8d2d3f00ea4ebab553d99606c8aea67fd4deb9ef0abee0e7c4b246c59a0e0f8c8a81518110610c6857610c68615321565b60200260200101516020015185604051610c989291906001600160a01b0392831681529116602082015260400190565b60405180910390a35b5050505050508080610cb2906153ba565b915050610578565b5091949350505050565b604080516020808201849052825180830382018152828401845280519101206000606083018190527fffffffffffffffffffffffffffffffffffffff000000000000000000000000008216606184015283516054818503018152607490930190935282918190610d33906153d4565b60601c95945050505050565b60165460609060ff16610ddc5760008054610d5990615424565b80601f0160208091040260200160405190810160405280929190818152602001828054610d8590615424565b8015610dd25780601f10610da757610100808354040283529160200191610dd2565b820191906000526020600020905b815481529060010190602001808311610db557829003601f168201915b5050505050905090565b6000604051602001610dee919061545e565b6040516020818303038152906040525b905090565b604080516101c081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a0810191909152610e7d82613245565b6101008201356000610e93610140850185615546565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516101c08101825282815260208101839052908101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a0810191909152939450610f3e92505050565b60015460408051808201909152600e81527f416464726573734d616e616765720000000000000000000000000000000000006020820152610fa4916001600160a01b031690610f909086908690612dcc565b604080516000815260208101909152613637565b6001600160a01b0390811660208084019190915260035460408051808201909152600a81527f50726f787941646d696e00000000000000000000000000000000000000000000928101929092526110249216906110049086908690612dcc565b60408051306020820152015b604051602081830303815290604052613637565b6001600160a01b0390811680835260208301516040517f0652b57a0000000000000000000000000000000000000000000000000000000081529216600483015290630652b57a90602401600060405180830381600087803b15801561108857600080fd5b505af115801561109c573d6000803e3d6000fd5b505050602082015182516110b09250613771565b6110f5838260000151846040518060400160405280600e81526020017f4c31455243373231427269646765000000000000000000000000000000000000815250612c14565b6001600160a01b031660408083019190915281518151808301909252600e82527f4f7074696d69736d506f7274616c0000000000000000000000000000000000006020830152611149918591908590612c14565b6001600160a01b031660e0820152805160408051808201909152600c81527f53797374656d436f6e6669670000000000000000000000000000000000000000602082015261119a9185918590612c14565b6001600160a01b03166060820152805160408051808201909152601c81527f4f7074696d69736d4d696e7461626c654552433230466163746f72790000000060208201526111eb9185918590612c14565b6001600160a01b03166080820152805160408051808201909152601281527f4469737075746547616d65466163746f72790000000000000000000000000000602082015261123c9185918590612c14565b6001600160a01b0316610100820152805160408051808201909152601381527f416e63686f725374617465526567697374727900000000000000000000000000602082015261128e9185918590612c14565b6001600160a01b0390811661012083015260045460408051808201909152601081527f4c315374616e646172644272696467650000000000000000000000000000000060208201526113089291909116906112ec9086908690612dcc565b8351604080516001600160a01b03909216602083015201611010565b6001600160a01b0390811660a0830181905282516040517f8d52d4a0000000000000000000000000000000000000000000000000000000008152921691638d52d4a09161135a916001906004016155ab565b600060405180830381600087803b15801561137457600080fd5b505af1158015611388573d6000803e3d6000fd5b5050505060006040518060400160405280601a81526020017f4f564d5f4c3143726f7373446f6d61696e4d657373656e6765720000000000008152509050611437600160040160009054906101000a90046001600160a01b031661142286866040518060400160405280601681526020017f4c3143726f7373446f6d61696e4d657373656e67657200000000000000000000815250612dcc565b602080860151604051611010928791016155e6565b6001600160a01b0390811660c0840181905283516040517f8d52d4a0000000000000000000000000000000000000000000000000000000008152921691638d52d4a091611489916002906004016155ab565b600060405180830381600087803b1580156114a357600080fd5b505af11580156114b7573d6000803e3d6000fd5b5050835160c08501516040517f860f7cda0000000000000000000000000000000000000000000000000000000081526001600160a01b03909216935063860f7cda92506115089185906004016155e6565b600060405180830381600087803b15801561152257600080fd5b505af1158015611536573d6000803e3d6000fd5b5050505061157f848360000151856040518060400160405280601b81526020017f44656c61796564574554485065726d697373696f6e656447616d650000000000815250612c14565b6001600160a01b0390811661018084015260065460075460408051808201909152601781527f5065726d697373696f6e65644469737075746547616d6500000000000000000060208201526116ca939283169291909116906115e49088908890612dcc565b6109486040518061014001604052808c6101800160208101906116079190615608565b63ffffffff1681526101a08d013560208201526101c08d013560408201526101e08d013560608201526080016116456102208e016102008f01615625565b67ffffffffffffffff1681526020016116666102408e016102208f01615625565b67ffffffffffffffff1681526015546001600160a01b0390811660208301526101808a0151811660408301526101208a01511660608201526101008d01356080918201526116ba9060a08e01908e01615642565b61094360c08e0160a08f01615642565b6001600160a01b031661016083015260606116e4836137e9565b83516040850151600c54929350611704926001600160a01b031684612d42565b6117c1836101008101516060808301516040516001600160a01b03938416602482015290831660448201527f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd9092166064830152600160848301529060a40160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f8e819e540000000000000000000000000000000000000000000000000000000017905292915050565b835160e0850151600d549293506117e1926001600160a01b031684612d42565b6117f36117ed8861570e565b8461388f565b83516060850151600e54929350611813926001600160a01b031684612d42565b6118938360a08101516040516001600160a01b03909116602482015260609060440160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc4d66de80000000000000000000000000000000000000000000000000000000017905292915050565b83516080850151600f549293506118b3926001600160a01b031684612d42565b6118bc83613961565b835160c08501516010549293506118dc926001600160a01b031684612d42565b6118e5836137e9565b835160a0850151601154929350611905926001600160a01b031684612d42565b6119166119118861570e565b6139ac565b8351610180850151601454929350611937926001600160a01b031684612d42565b6119a660405130602482015260609060440160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc4d66de800000000000000000000000000000000000000000000000000000000179052919050565b83516101008501516012549293506119c7926001600160a01b031684612d42565b6119dd83610100015160018561016001516131bf565b6101008301516119f9906119f460208a018a615642565b613771565b611a0b611a058861570e565b846139f6565b8351610120850151601354929350611a2c926001600160a01b031684612d42565b8251611a3f906119f460208a018a615642565b336001600160a01b0316857fb40fb1137b92aa97efb20f29c17d36c5947aac681c3315ba854b0232f834954285604051602001611a7c919061508a565b60408051601f1981840301815290829052611a969161503b565b60405180910390a3509095945050505050565b336001600160a01b037f00000000000000000000000071cb29979d55cbd2ce1f10f00cec38721c25cc041614611b0b576040517f861c183d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b6001600160a01b037f0000000000000000000000003058396087da0ac2998a344ee9e55e0f71a7af25163003611b9e576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b037f00000000000000000000000071cb29979d55cbd2ce1f10f00cec38721c25cc04163003611c62576040517f6ccdfe11000000000000000000000000000000000000000000000000000000008152600060048201527f0000000000000000000000003058396087da0ac2998a344ee9e55e0f71a7af256001600160a01b031690636ccdfe1190602401600060405180830381600087803b158015611c4957600080fd5b505af1158015611c5d573d6000803e3d6000fd5b505050505b6000611c6c612c5e565b90506000611c786128ac565b82516040517f204e1c7a0000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd81166004830152929350908216917f0000000000000000000000007015458ab484ad648bfbb0446e001ead1257cb52169063204e1c7a90602401602060405180830381865afa158015611d20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d449190615387565b6001600160a01b031614611da157611da17f0000000000000000000000007015458ab484ad648bfbb0446e001ead1257cb527f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd8460000151613ad7565b60208201516040517f204e1c7a0000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000b391adfb150e4143ea3b5baa1e4e90f60711f3f481166004830152918216917f0000000000000000000000007015458ab484ad648bfbb0446e001ead1257cb52169063204e1c7a90602401602060405180830381865afa158015611e49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6d9190615387565b6001600160a01b031614611eca57611eca7f0000000000000000000000007015458ab484ad648bfbb0446e001ead1257cb527f000000000000000000000000b391adfb150e4143ea3b5baa1e4e90f60711f3f48460200151613ad7565b60005b83518110156128a657611ef8848281518110611eeb57611eeb615321565b6020026020010151613b2f565b60006040518060c00160405280868481518110611f1757611f17615321565b6020026020010151600001516001600160a01b031663a71198696040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f849190615387565b6001600160a01b03168152602001868481518110611fa457611fa4615321565b6020026020010151600001516001600160a01b031663c4e8ddfa6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611fed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120119190615387565b6001600160a01b0316815260200186848151811061203157612031615321565b6020026020010151600001516001600160a01b031663078f29cf6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561207a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209e9190615387565b6001600160a01b031681526020016120d28785815181106120c1576120c1615321565b602002602001015160000151612978565b6001600160a01b031681526020018684815181106120f2576120f2615321565b6020026020010151600001516001600160a01b0316630a49cb036040518163ffffffff1660e01b8152600401602060405180830381865afa15801561213b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215f9190615387565b6001600160a01b0316815260200186848151811061217f5761217f615321565b6020026020010151600001516001600160a01b0316639b7d7f0a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121ec9190615387565b6001600160a01b031681525090507f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd6001600160a01b03166122318260800151613b47565b6001600160a01b031614158061228557507f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd6001600160a01b03166122798260000151613b47565b6001600160a01b031614155b806122ce57507f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd6001600160a01b03166122c28260200151613b47565b6001600160a01b031614155b8061231757507f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd6001600160a01b031661230b8260400151613b47565b6001600160a01b031614155b1561237d5784828151811061232e5761232e615321565b6020908102919091010151516040517fc358e75a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024015b60405180910390fd5b6123c685838151811061239257612392615321565b6020026020010151602001518684815181106123b0576123b0615321565b6020026020010151600001518660800151613ad7565b6123f68583815181106123db576123db615321565b60200260200101516020015182600001518660c00151613ad7565b61242685838151811061240b5761240b615321565b60200260200101516020015182602001518660400151613ad7565b61245685838151811061243b5761243b615321565b60200260200101516020015182604001518660e00151613ad7565b61248785838151811061246b5761246b615321565b6020026020010151602001518260600151866101000151613ad7565b6124b785838151811061249c5761249c615321565b60200260200101516020015182608001518660600151613ad7565b6124e78583815181106124cc576124cc615321565b6020026020010151602001518260a001518660a00151613ad7565b60006124f8826060015160016129e2565b9050600061250582612a73565b905060006125ae8289878151811061251f5761251f615321565b6020026020010151602001516125738b898151811061254057612540615321565b602002602001015151604080516001600160a01b0390921660208084019190915281518084039091018152918101905290565b6040518060400160405280601381526020017f416e63686f725374617465526567697374727900000000000000000000000000815250612c14565b9050600084608001516001600160a01b0316633c9f397c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156125f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612618919061582b565b905060008061262686612e02565b6040517f7258a80700000000000000000000000000000000000000000000000000000000815263ffffffff851660048201526001600160a01b039190911690637258a807906024016040805180830381865afa15801561268a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126ae9190615848565b91509150600060405180604001604052808481526020018381525090506127b68c8a815181106126e0576126e0615321565b6020908102919091018101518101516101208e015160608c015160808d01516040516001600160a01b037f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd81166024830152928316604482015291166064820152855160848201529285015160a4840152909188919060c40160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f060fa21600000000000000000000000000000000000000000000000000000000179052612d42565b505050506127e482848360018c8a815181106127d4576127d4615321565b60200260200101518b8d8b613b87565b60006127f5856060015160006129e2565b90506001600160a01b038116156128305761283083828460008d8b8151811061282057612820615321565b60200260200101518c8e8c613b87565b306001600160a01b031689878151811061284c5761284c615321565b6020026020010151600001516001600160a01b0316847f78bc67b9bf548ef6410becd31a3e10b9ea6c255974ef6b4530728b431df3003060405160405180910390a45050505050808061289e906153ba565b915050611ecd565b50505050565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091527f0000000000000000000000003058396087da0ac2998a344ee9e55e0f71a7af256001600160a01b031663b51f9c2b6040518163ffffffff1660e01b815260040161012060405180830381865afa158015612954573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe919061586c565b6000816001600160a01b031663f2b4e6176040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129dc9190615387565b92915050565b6040517f1b685b9e00000000000000000000000000000000000000000000000000000000815263ffffffff821660048201526000906001600160a01b03841690631b685b9e90602401602060405180830381865afa158015612a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a6c9190615387565b9392505050565b6000816001600160a01b031663d6ae3cd56040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ab3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129dc9190615922565b606081600003612b1a57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612b445780612b2e816153ba565b9150612b3d9050600a83615951565b9150612b1e565b60008167ffffffffffffffff811115612b5f57612b5f614ac4565b6040519080825280601f01601f191660200182016040528015612b89576020820181803683370190505b5090505b8415612c0c57612b9e600183615965565b9150612bab600a8661597c565b612bb6906030615990565b60f81b818381518110612bcb57612bcb615321565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612c05600a86615951565b9450612b8d565b949350505050565b600080612c22868585612dcc565b9050612c54612c2f6128ac565b60200151828760405160200161101091906001600160a01b0391909116815260200190565b9695505050505050565b6040805161018081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091527f0000000000000000000000003058396087da0ac2998a344ee9e55e0f71a7af256001600160a01b03166330e9012c6040518163ffffffff1660e01b815260040161018060405180830381865afa158015612d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe91906159a8565b612d4b82613d76565b6040517f9623609d0000000000000000000000000000000000000000000000000000000081526001600160a01b03851690639623609d90612d9490869086908690600401615a89565b600060405180830381600087803b158015612dae57600080fd5b505af1158015612dc2573d6000803e3d6000fd5b5050505050505050565b6000838383604051602001612de393929190615ab5565b6040516020818303038152906040528051906020012090509392505050565b6000816001600160a01b0316635c0cba336040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129b8573d6000803e3d6000fd5b6000816001600160a01b031663a8e4fb906040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129b8573d6000803e3d6000fd5b6000816001600160a01b031663534db0e26040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129b8573d6000803e3d6000fd5b60606000848484604051602401612edb93929190615b96565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f9ecd8b34000000000000000000000000000000000000000000000000000000001790529050612f40816004613dc5565b95945050505050565b600080612f7a866001600160a01b0316803b806020016040519081016040528181526000908060200190933c613dfb565b805190915060ff1615612fc15780516040517f1a66c69200000000000000000000000000000000000000000000000000000000815260ff9091166004820152602401612374565b602081015151156130045780602001516040517f57a05835000000000000000000000000000000000000000000000000000000008152600401612374919061503b565b6000613034866001600160a01b0316803b806020016040519081016040528181526000908060200190933c613dfb565b805190915060ff161561307b5780516040517f1a66c69200000000000000000000000000000000000000000000000000000000815260ff9091166004820152602401612374565b602081015151156130be5780602001516040517f57a05835000000000000000000000000000000000000000000000000000000008152600401612374919061503b565b600082604001518260400151866040516020016130dd93929190615bc8565b6040516020818303038152906040529050858151602083016000f593506001600160a01b03841661313a576040517f3011642500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050949350505050565b606060008260405160240161315a9190615c0b565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f5599c646000000000000000000000000000000000000000000000000000000001790529050612a6c816004613dc5565b6040517f14f6b1a300000000000000000000000000000000000000000000000000000000815263ffffffff831660048201526001600160a01b0382811660248301528416906314f6b1a3906044015b600060405180830381600087803b15801561322857600080fd5b505af115801561323c573d6000803e3d6000fd5b50505050505050565b610100810135158061325b575046816101000135145b15613292576040517f7a47c9a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006132a16020830183615642565b6001600160a01b031603613311576040517fe646e04300000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f70436861696e50726f787941646d696e4f776e6572000000000000000000006044820152606401612374565b60006133236040830160208401615642565b6001600160a01b031603613393576040517fe646e04300000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f73797374656d436f6e6669674f776e65720000000000000000000000000000006044820152606401612374565b60006133a56060830160408401615642565b6001600160a01b031603613415576040517fe646e04300000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f62617463686572000000000000000000000000000000000000000000000000006044820152606401612374565b60006134276080830160608401615642565b6001600160a01b031603613497576040517fe646e04300000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f756e73616665426c6f636b5369676e65720000000000000000000000000000006044820152606401612374565b60006134a960a0830160808401615642565b6001600160a01b031603613519576040517fe646e04300000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f70726f706f7365720000000000000000000000000000000000000000000000006044820152606401612374565b600061352b60c0830160a08401615642565b6001600160a01b03160361359b576040517fe646e04300000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6368616c6c656e676572000000000000000000000000000000000000000000006044820152606401612374565b6135a9610120820182615546565b90506000036135e4576040517f89e0acdf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006135f4610120830183615546565b6135fd91615c1a565b03613634576040517f89e0acdf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600080613668856001600160a01b0316803b806020016040519081016040528181526000908060200190933c613dfb565b805190915060ff16156136af5780516040517f1a66c69200000000000000000000000000000000000000000000000000000000815260ff9091166004820152602401612374565b602081015151156136f25780602001516040517f57a05835000000000000000000000000000000000000000000000000000000008152600401612374919061503b565b600081604001518460405160200161370b929190615c38565b6040516020818303038152906040529050848151602083016000f592506001600160a01b038316613768576040517f3011642500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50509392505050565b6040517ff2fde38b0000000000000000000000000000000000000000000000000000000081526001600160a01b03828116600483015283169063f2fde38b90602401600060405180830381600087803b1580156137cd57600080fd5b505af11580156137e1573d6000803e3d6000fd5b505050505050565b60c08101516040516001600160a01b0391821660248201527f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd90911660448201526060906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f485cc9550000000000000000000000000000000000000000000000000000000017905292915050565b606060008061389e85856142ba565b91509150846000015160200151856020015186604001518760000151604001516001600160a01b031660001b8860c00151896000015160600151876138e68c60600151610cc4565b886040516024016138ff99989796959493929190615c67565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fca407f0c000000000000000000000000000000000000000000000000000000001790529250505092915050565b60e08101516040516001600160a01b037f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd811660248301529091166044820152606090606401613831565b8051516040516001600160a01b0391821660248201527f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd9091166044820152606090606401613831565b606060008360800151806020019051810190613a129190615d84565b61010084015160e08501516040516001600160a01b037f0000000000000000000000001083daf5b8970a9b868f52910f02fdfe85db4dcd8116602483015292831660448201529116606482015281516084820152602082015160a482015290915060c40160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f060fa2160000000000000000000000000000000000000000000000000000000017905291505092915050565b613ae081613d76565b6040517f99a88ec40000000000000000000000000000000000000000000000000000000081526001600160a01b03838116600483015282811660248301528416906399a88ec49060440161320e565b8051613b3a90613d76565b6136348160200151613d76565b6000816001600160a01b03166335e80ab36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129b8573d6000803e3d6000fd5b6000613b9288614476565b9050613ba8856020015182856101400151613ad7565b506000613bb4886144b6565b6001600160a01b038089166101008301526101608501511660c08201526040860151909150613c0f576040517fefc878f200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408501516020820152600060001963ffffffff881601613cd3576000613c358a612e42565b90506000613c428b612e82565b9050613cca8760a001518860c00151613cbf8f613c848d51604080516001600160a01b0390921660208084019190915281518084039091018152918101905290565b6040518060400160405280601781526020017f5065726d697373696f6e65644469737075746547616d65000000000000000000815250612dcc565b610948888787612ec2565b92505050613d5b565b613d588560e00151866101000151613d4f8d613d148b51604080516001600160a01b0390921660208084019190915281518084039091018152918101905290565b6040518060400160405280601981526020017f5065726d697373696f6e6c6573734469737075746547616d6500000000000000815250612dcc565b61094886613145565b90505b613d6a836060015188836131bf565b50505050505050505050565b806001600160a01b03163b600003613634576040517f86bb51b80000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602401612374565b606082518210613de457506040805160208101909152600081526129dc565b612a6c8383848651613df69190615965565b614849565b613e226040518060600160405280600060ff16815260200160608152602001606081525090565b600282511080613e8c575081600081518110613e4057613e40615321565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167ffe0000000000000000000000000000000000000000000000000000000000000014155b80613ef1575081600181518110613ea557613ea5615321565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f710000000000000000000000000000000000000000000000000000000000000014155b15613f28576040517f31f56e1f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600283600281518110613f3f57613f3f615321565b602001015160f81c60f81b60fc60f81b1660f81c60ff16901c9050600083600281518110613f6f57613f6f615321565b60209101015160f81c60039081169150819003613fb8576040517fb214675a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060ff8216156140a45760008260ff1667ffffffffffffffff811115613fe157613fe1614ac4565b6040519080825280601f01601f19166020018201604052801561400b576020820181803683370190505b50905060005b8360ff168110156140965786614028826003615990565b8151811061403857614038615321565b602001015160f81c60f81b82828151811061405557614055615321565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508061408e816153ba565b915050614011565b506140a081614a03565b9150505b60008167ffffffffffffffff8111156140bf576140bf614ac4565b6040519080825280601f01601f1916602001820160405280156140e9576020820181803683370190505b50905060ff83161561418e576000614102846003615dd3565b60ff16905060005b8381101561418b578761411d8284615990565b8151811061412d5761412d615321565b602001015160f81c60f81b83828151811061414a5761414a615321565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080614183816153ba565b91505061410a565b50505b60008261419c856003615dd3565b60ff166141a99190615990565b905060008188516141ba9190615965565b9050806000036141f6576040517f028512d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff81111561421157614211614ac4565b6040519080825280601f01601f19166020018201604052801561423b576020820181803683370190505b50905060008360208b0101602083018481868460045afa925050508061428d576040517ff7046f3000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180606001604052808960ff1681526020018681526020018381525098505050505050505050919050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091526040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091526143a16040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152506040805160c0810182526301312d008152600a6020820152600891810191909152633b9aca006060820152620f424060808201526fffffffffffffffffffffffffffffffff60a082015290565b91506040518060c001604052808460c001516001600160a01b0316815260200184604001516001600160a01b031681526020018460a001516001600160a01b031681526020018461010001516001600160a01b031681526020018460e001516001600160a01b0316815260200184608001516001600160a01b0316815250905061442e8160000151613d76565b61443b8160200151613d76565b6144488160400151613d76565b6144558160600151613d76565b6144628160800151613d76565b61446f8160a00151613d76565b9250929050565b6000816001600160a01b0316633fc8cef36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129b8573d6000803e3d6000fd5b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081018290526101208101919091526000604051806101400160405280846001600160a01b031663bbdc02db6040518163ffffffff1660e01b8152600401602060405180830381865afa158015614553573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614577919061582b565b63ffffffff168152602001846001600160a01b0316638d450a956040518163ffffffff1660e01b8152600401602060405180830381865afa1580156145c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145e49190615922565b8152602001846001600160a01b031663fa315aa96040518163ffffffff1660e01b8152600401602060405180830381865afa158015614627573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061464b9190615922565b8152602001846001600160a01b031663ec5e63086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561468e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146b29190615922565b8152602001846001600160a01b0316636b6716c06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156146f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147199190615df8565b67ffffffffffffffff168152602001846001600160a01b031663dabd396d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015614766573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061478a9190615df8565b67ffffffffffffffff168152602001846001600160a01b0316633a7684636040518163ffffffff1660e01b8152600401602060405180830381865afa1580156147d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147fb9190615387565b6001600160a01b0316815260200161481285614476565b6001600160a01b0316815260200161482985612e02565b6001600160a01b0316815260200161484085612a73565b90529392505050565b60608182601f0110156148b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401612374565b828284011015614924576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401612374565b81830184511015614991576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e64730000000000000000000000000000006044820152606401612374565b6060821580156149b057604051915060008252602082016040526149fa565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156149e95780518352602092830192016149d1565b5050858452601f01601f1916604052505b50949350505050565b6000602082511115614a41576040517f5623dc1c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805b8351811015614abd57614a59816001615990565b8451614a659190615965565b614a70906008615e15565b614a7b906002615f18565b848281518110614a8d57614a8d615321565b0160200151614a9f919060f81c615e15565b614aa99083615990565b915080614ab5816153ba565b915050614a45565b5092915050565b634e487b7160e01b600052604160045260246000fd5b6040516101a0810167ffffffffffffffff81118282101715614afe57614afe614ac4565b60405290565b6040516060810167ffffffffffffffff81118282101715614afe57614afe614ac4565b604051610120810167ffffffffffffffff81118282101715614afe57614afe614ac4565b604051610180810167ffffffffffffffff81118282101715614afe57614afe614ac4565b604051601f8201601f1916810167ffffffffffffffff81118282101715614b9857614b98614ac4565b604052919050565b600067ffffffffffffffff821115614bba57614bba614ac4565b5060051b60200190565b600082601f830112614bd557600080fd5b813567ffffffffffffffff811115614bef57614bef614ac4565b614c026020601f19601f84011601614b6f565b818152846020838601011115614c1757600080fd5b816020850160208301376000918101602001919091529392505050565b6001600160a01b038116811461363457600080fd5b8035614c5481614c34565b919050565b63ffffffff8116811461363457600080fd5b8035614c5481614c59565b67ffffffffffffffff8116811461363457600080fd5b8035614c5481614c76565b80358015158114614c5457600080fd5b60006020808385031215614cba57600080fd5b823567ffffffffffffffff80821115614cd257600080fd5b818501915085601f830112614ce657600080fd5b8135614cf9614cf482614ba0565b614b6f565b81815260059190911b83018401908481019088831115614d1857600080fd5b8585015b83811015614e4757803585811115614d345760008081fd5b86016101a0818c03601f1901811315614d4d5760008081fd5b614d55614ada565b8983013588811115614d675760008081fd5b614d758e8c83870101614bc4565b8252506040614d85818501614c49565b8b8301526060614d96818601614c49565b8284015260809150614da9828601614c49565b9083015260a0614dba858201614c6b565b8284015260c0915081850135818401525060e080850135828401526101009150818501358184015250610120614df1818601614c8c565b828401526101409150614e05828601614c8c565b818401525061016080850135828401526101809150614e25828601614c49565b90830152614e34848401614c97565b9082015285525050918601918601614d1c565b5098975050505050505050565b602080825282518282018190526000919060409081850190868401855b82811015614ea357815180516001600160a01b0390811686529087015116868501529284019290850190600101614e71565b5091979650505050505050565b81516001600160a01b0316815261018081016020830151614edc60208401826001600160a01b03169052565b506040830151614ef760408401826001600160a01b03169052565b506060830151614f1260608401826001600160a01b03169052565b506080830151614f2d60808401826001600160a01b03169052565b5060a0830151614f4860a08401826001600160a01b03169052565b5060c0830151614f6360c08401826001600160a01b03169052565b5060e0830151614f7e60e08401826001600160a01b03169052565b50610100838101516001600160a01b039081169184019190915261012080850151821690840152610140808501518216908401526101608085015191821681850152905b505092915050565b600060208284031215614fdc57600080fd5b5035919050565b60005b83811015614ffe578181015183820152602001614fe6565b838111156128a65750506000910152565b60008151808452615027816020860160208601614fe3565b601f01601f19169290920160200192915050565b602081526000612a6c602083018461500f565b60006020828403121561506057600080fd5b813567ffffffffffffffff81111561507757600080fd5b82016102408185031215612a6c57600080fd5b81516001600160a01b031681526101c0810160208301516150b660208401826001600160a01b03169052565b5060408301516150d160408401826001600160a01b03169052565b5060608301516150ec60608401826001600160a01b03169052565b50608083015161510760808401826001600160a01b03169052565b5060a083015161512260a08401826001600160a01b03169052565b5060c083015161513d60c08401826001600160a01b03169052565b5060e083015161515860e08401826001600160a01b03169052565b50610100838101516001600160a01b0390811691840191909152610120808501518216908401526101408085015182169084015261016080850151821690840152610180808501518216908401526101a0808501519182168185015290614fc2565b6000602082840312156151cc57600080fd5b612a6c82614c97565b81516001600160a01b03908116825260208084015182169083015260408084015182169083015260608084015182169083015260808084015182169083015260a08084015182169083015260c08084015182169083015260e0808401518216908301526101008084015191821681840152610120830191614fc2565b6000602080838503121561526457600080fd5b823567ffffffffffffffff81111561527b57600080fd5b8301601f8101851361528c57600080fd5b803561529a614cf482614ba0565b818152606091820283018401918482019190888411156152b957600080fd5b938501935b838510156153155780858a0312156152d65760008081fd5b6152de614b04565b85356152e981614c34565b8152858701356152f881614c34565b8188015260408681013590820152835293840193918501916152be565b50979650505050505050565b634e487b7160e01b600052603260045260246000fd5b7f44656c61796564574554482d000000000000000000000000000000000000000081526000825161536f81600c850160208701614fe3565b91909101600c0192915050565b8051614c5481614c34565b60006020828403121561539957600080fd5b8151612a6c81614c34565b634e487b7160e01b600052601160045260246000fd5b600060001982036153cd576153cd6153a4565b5060010190565b6000815160208301517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008082169350601483101561541c5780818460140360031b1b83161693505b505050919050565b600181811c9082168061543857607f821691505b60208210810361545857634e487b7160e01b600052602260045260246000fd5b50919050565b600080835481600182811c91508083168061547a57607f831692505b6020808410820361549957634e487b7160e01b86526022600452602486fd5b8180156154ad57600181146154e05761550d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008616895284151585028901965061550d565b60008a81526020902060005b868110156155055781548b8201529085019083016154ec565b505084890196505b50505050505061553c817f2d726300000000000000000000000000000000000000000000000000000000009052565b6003019392505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261557b57600080fd5b83018035915067ffffffffffffffff82111561559657600080fd5b60200191503681900382131561446f57600080fd5b6001600160a01b038316815260408101600383106155d957634e487b7160e01b600052602160045260246000fd5b8260208301529392505050565b6001600160a01b0383168152604060208201526000612c0c604083018461500f565b60006020828403121561561a57600080fd5b8135612a6c81614c59565b60006020828403121561563757600080fd5b8135612a6c81614c76565b60006020828403121561565457600080fd5b8135612a6c81614c34565b600060c0828403121561567157600080fd5b60405160c0810181811067ffffffffffffffff8211171561569457615694614ac4565b60405290508082356156a581614c34565b815260208301356156b581614c34565b602082015260408301356156c881614c34565b604082015260608301356156db81614c34565b606082015260808301356156ee81614c34565b608082015260a083013561570181614c34565b60a0919091015292915050565b6000610240823603121561572157600080fd5b615729614ada565b615733368461565f565b815261574160c08401614c6b565b602082015261575260e08401614c6b565b60408201526101008084013560608301526101208085013567ffffffffffffffff8082111561578057600080fd5b61578c36838901614bc4565b6080860152610140915081870135818111156157a757600080fd5b6157b336828a01614bc4565b60a087015250506101606157c8818801614c8c565b60c08601526101806157db818901614c6b565b60e08701526101a0880135858701526101c0880135848701526101e08801358387015261580b6102008901614c8c565b8287015261581c6102208901614c8c565b90860152509295945050505050565b60006020828403121561583d57600080fd5b8151612a6c81614c59565b6000806040838503121561585b57600080fd5b505080516020909101519092909150565b6000610120828403121561587f57600080fd5b615887614b27565b6158908361537c565b815261589e6020840161537c565b60208201526158af6040840161537c565b60408201526158c06060840161537c565b60608201526158d16080840161537c565b60808201526158e260a0840161537c565b60a08201526158f360c0840161537c565b60c082015261590460e0840161537c565b60e082015261010061591781850161537c565b908201529392505050565b60006020828403121561593457600080fd5b5051919050565b634e487b7160e01b600052601260045260246000fd5b6000826159605761596061593b565b500490565b600082821015615977576159776153a4565b500390565b60008261598b5761598b61593b565b500690565b600082198211156159a3576159a36153a4565b500190565b600061018082840312156159bb57600080fd5b6159c3614b4b565b6159cc8361537c565b81526159da6020840161537c565b60208201526159eb6040840161537c565b60408201526159fc6060840161537c565b6060820152615a0d6080840161537c565b6080820152615a1e60a0840161537c565b60a0820152615a2f60c0840161537c565b60c0820152615a4060e0840161537c565b60e0820152610100615a5381850161537c565b90820152610120615a6584820161537c565b90820152610140615a7784820161537c565b9082015261016061591784820161537c565b60006001600160a01b03808616835280851660208401525060606040830152612f40606083018461500f565b838152606060208201526000615ace606083018561500f565b8281036040840152612c54818561500f565b805163ffffffff1682526020810151602083015260408101516040830152606081015160608301526080810151615b23608084018267ffffffffffffffff169052565b5060a0810151615b3f60a084018267ffffffffffffffff169052565b5060c0810151615b5a60c08401826001600160a01b03169052565b5060e0810151615b7560e08401826001600160a01b03169052565b50610100818101516001600160a01b03169083015261012090810151910152565b6101808101615ba58286615ae0565b6001600160a01b0380851661014084015280841661016084015250949350505050565b60008451615bda818460208901614fe3565b845190830190615bee818360208901614fe3565b8451910190615c01818360208801614fe3565b0195945050505050565b61014081016129dc8284615ae0565b803560208310156129dc57600019602084900360031b1b1692915050565b60008351615c4a818460208801614fe3565b835190830190615c5e818360208801614fe3565b01949350505050565b6000610260820190506001600160a01b03808c16835263ffffffff808c166020850152808b16604085015289606085015267ffffffffffffffff8916608085015281881660a08501528087511660c085015260ff60208801511660e085015260ff604088015116610100850152806060880151166101208501528060808801511661014085015250506fffffffffffffffffffffffffffffffff60a086015116610160830152615d236101808301856001600160a01b03169052565b82516001600160a01b039081166101a0840152602084015181166101c0840152604084015181166101e0840152606084015181166102008401526080840151811661022084015260a0840151166102408301529a9950505050505050505050565b600060408284031215615d9657600080fd5b6040516040810181811067ffffffffffffffff82111715615db957615db9614ac4565b604052825181526020928301519281019290925250919050565b600060ff821660ff84168060ff03821115615df057615df06153a4565b019392505050565b600060208284031215615e0a57600080fd5b8151612a6c81614c76565b6000816000190483118215151615615e2f57615e2f6153a4565b500290565b600181815b80851115615e6f578160001904821115615e5557615e556153a4565b80851615615e6257918102915b93841c9390800290615e39565b509250929050565b600082615e86575060016129dc565b81615e93575060006129dc565b8160018114615ea95760028114615eb357615ecf565b60019150506129dc565b60ff841115615ec457615ec46153a4565b50506001821b6129dc565b5060208310610133831016604e8410600b8410161715615ef2575081810a6129dc565b615efc8383615e34565b8060001904821115615f1057615f106153a4565b029392505050565b6000612a6c8383615e7756fea164736f6c634300080f000a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.