Verified contractPartialUNLICENSED
PangeaDeployerV4
Address0x2bcfbfdbeeb4eb497ee35daddb7f88727219fa85
- Balance
0 ETH
- Transactions
14
- 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
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,399,266
- Creation transaction
- 0x70b08e604f…6ad3dacec8
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": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "cancun",
"remappings": [
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"@layerzerolabs/oft-evm/=lib/layerzero/oft-evm/",
"@layerzerolabs/oapp-evm/=lib/layerzero/oapp-evm/",
"@layerzerolabs/lz-evm-protocol-v2/=lib/layerzero/protocol-v2/",
"@uniswap/v4-core/=lib/uniswap-v4-core/",
"solmate/=lib/solmate/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"layerzero/=lib/layerzero/",
"uniswap-v4-core/=lib/uniswap-v4-core/src/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.