Skip to content
Verified contractExactUNLICENSED

PangeaDeployerV4

Address0x582613fdce3b9ca8e439d8811e1522aaa0e3fddc
Balance

0 ETH

 

Transactions

16

 

Compiler

solc 0.8.30

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.30+commit.73712a01
Language
solidity
Optimization
Yes, 200 runs
EVM version
cancun
Via IR
yes
License
UNLICENSED
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,401,401
Creation transaction
0x1dfe33cff3…22d79a5df0

src/v4/bridge/PangeaDeployerV4.sol

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.30;

/// @notice What a v4 infra contract reads from its deployer in its constructor (the TokenDeployerV4 pattern, §11.2.1):
///         chain-specific values stay out of the init code, so the address is the same on every EVM chain.
interface IPendingConfigV4 {
    function pending() external view returns (bytes memory);
}

/// @title PangeaDeployerV4 -- CREATE2 deployer of the shared-bridge infra (bridge, adapters, coin deployer, core)
/// @notice Itself deployed through the canonical CREATE2 deployer with a fixed salt and `initializer` (the same deploy
///         key / multisig in every config), so it has one address on every EVM chain, and so does everything it deploys
///         with the same salt and init code. Only `initializer` deploys; the per-chain config is handed over through
///         `pending()` for the duration of the constructor only.
contract PangeaDeployerV4 is IPendingConfigV4 {
    address public immutable initializer;
    bytes internal _pending;

    event Deployed(bytes32 indexed salt, address indexed at);

    error NotInitializer();
    error DeployFailed();

    constructor(address initializer_) {
        initializer = initializer_;
    }

    function pending() external view returns (bytes memory) {
        return _pending;
    }

    function predict(bytes32 salt, bytes calldata initcode) external view returns (address) {
        return address(uint160(uint256(keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, keccak256(initcode))))));
    }

    function deploy(bytes32 salt, bytes calldata initcode, bytes calldata config) external returns (address a) {
        if (msg.sender != initializer) revert NotInitializer();
        _pending = config;
        bytes memory code = initcode;
        assembly ("memory-safe") {
            a := create2(0, add(code, 0x20), mload(code), salt)
        }
        delete _pending;
        if (a == address(0)) revert DeployFailed();
        emit Deployed(salt, a);
    }
}
Compiler settingsShow
{
  "viaIR": true,
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "cancun",
  "remappings": [
    ":@layerzerolabs/lz-evm-protocol-v2/=lib/layerzero/protocol-v2/",
    ":@layerzerolabs/oapp-evm/=lib/layerzero/oapp-evm/",
    ":@layerzerolabs/oft-evm/=lib/layerzero/oft-evm/",
    ":@openzeppelin/=lib/openzeppelin-contracts/",
    ":@uniswap/v4-core/=lib/uniswap-v4-core/",
    ":ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    ":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    ":forge-std/=lib/forge-std/src/",
    ":halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    ":layerzero/=lib/layerzero/",
    ":openzeppelin-contracts/=lib/openzeppelin-contracts/",
    ":solmate/=lib/solmate/",
    ":uniswap-v4-core/=lib/uniswap-v4-core/src/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.