Verified contractExactUNLICENSED
FactoryAdmin
Address0xe74574e3db9f91478e62ea4f219bcff5c9d1d8b2
- Balance
0 ETH
- Transactions
0
- Compiler
solc 0.8.35
- Same code
2 more contracts
Details
- Compiler
- solc 0.8.35+commit.47b9dedd
- Language
- solidity
- Optimization
- Yes, 100 runs
- EVM version
- cancun
- Via IR
- yes
- License
- UNLICENSED
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,396,600
- Creation transaction
- 0x45420e7b34…8b2adae987
- Libraries
- src/core/mm/MMRouterLib.sol:MMRouterLib0xa474…d2b4e5src/core/flamm/FLAMMLane.sol:FLAMMLane0x0988…d22e98src/core/flamm/FLAMMRoute.sol:FLAMMRoute0x312e…0fdaa9src/periphery/FLAMMMaxima.sol:FLAMMMaxima0x4a99…d6259csrc/core/flamm/FLAMMLawLib.sol:FLAMMLawLib0x5d47…27cc62src/core/flamm/FLAMMOpsLib.sol:FLAMMOpsLib0x0bfe…043753src/core/mm/AaveV3ReadsLib.sol:AaveV3ReadsLib0xd53f…ed5983src/core/flamm/FLAMMFlowLib.sol:FLAMMFlowLib0x2577…4e3473src/core/flamm/FLAMMGateLib.sol:FLAMMGateLib0xf0be…2b9555src/core/flamm/FLAMMKeptLib.sol:FLAMMKeptLib0x7a11…58517bsrc/core/mm/CTokenMarketLib.sol:CTokenMarketLib0x18c5…b2071csrc/core/flamm/FLAMMAdmitLib.sol:FLAMMAdmitLib0xa6db…bdcbcbsrc/core/flamm/FLAMMBlindLib.sol:FLAMMBlindLib0x0b8d…2e7e5csrc/core/flamm/FLAMMClaimLib.sol:FLAMMClaimLib0x02b4…731ccesrc/core/flamm/FLAMMFenceLib.sol:FLAMMFenceLib0xa16d…a201e8src/core/flamm/FLAMMFloatLib.sol:FLAMMFloatLib0x539e…a79737src/core/flamm/FLAMMQuoteLib.sol:FLAMMQuoteLib0xa4d3…d5ce2esrc/core/flamm/FLAMMTopUpLib.sol:FLAMMTopUpLib0x7c55…d233dfsrc/core/mm/CTokenRewardsLib.sol:CTokenRewardsLib0xcda6…a4dcf7src/core/mm/MMRouterAdminLib.sol:MMRouterAdminLib0x8423…7adc96src/core/flamm/FLAMMPolicyLib.sol:FLAMMPolicyLib0xa6b4…0c67f9src/core/flamm/FLAMMSettleLib.sol:FLAMMSettleLib0xb489…d3c7cbsrc/core/flamm/FLAMMSharedLib.sol:FLAMMSharedLib0xfaae…2511basrc/periphery/FLAMMExitMaxima.sol:FLAMMExitMaxima0x480f…4e0a81src/hooks/everlong/LeverageLib.sol:LeverageLib0x1b1d…40ad11src/core/flamm/FLAMMMaintainLib.sol:FLAMMMaintainLib0x9499…409cc2src/core/flamm/FLAMMPairQuoteLib.sol:FLAMMPairQuoteLib0x0775…d94cbesrc/hooks/everlong/EverlongOpsLib.sol:EverlongOpsLib0xabe4…7426f7
2 files
src/propamm/FactoryAdmin.sol
// SPDX-License-Identifier: UNLICENSED
// Copyright (c) 2025-2026 Everlong Labs Limited
pragma solidity ^0.8.26;
import {IFactoryCancels, IPropAMMFrontGovernance} from "src/interfaces/propamm/IPropAMMGovernance.sol";
/// @notice What `FactoryAdmin` reaches on the factory's Router.
interface IRouterPause {
/// @notice Sets or clears the Router's global pause (`IMMRouter.setGlobalPaused`).
function setGlobalPaused(bool paused) external;
}
/// @notice `FLAMMFactory`'s `PROTOCOL_SAFE` and its Router's `protocolSafe` as deployed, the protocol owner's address
/// on chain: a forwarder through which the protocol owner, its multisig `SAFE`, makes any call; the protocol
/// guardian only the cancel of a change the factory has scheduled (`FLAMMFactory.cancel`), each a protocol-wide
/// control; and the pauser only the Router's global pause, which only the protocol owner lifts. Fees and
/// rewards sent to this contract sit here until the protocol owner moves them with `execute`.
/// @dev The roles behind it:
/// - The guardian is whoever the front names as `protocolGuardian()` at the call, so the front's timelocked
/// rotation moves it here too; with no front, on a chain no PropAMM front runs on, the cancel is the protocol
/// owner's alone.
/// - The pauser is whoever the protocol owner names last (`setPauser`), at once, any key, the front's guardian
/// included. Neither changes a setting.
/// - The factory's `PROTOCOL_SAFE` is immutable, and so are `SAFE`, `FACTORY` and `FRONT`; the pauser is this
/// contract's one setting, the protocol owner's alone.
/// - The factory starts with this contract as its `protocolFeeReceiver`, and its Router with this contract as its
/// `protocolSafe`: the protocol owner names the factory's receiver through `execute`, and only the protocol
/// owner's calls move what this contract holds.
contract FactoryAdmin {
/// @notice The protocol owner's multisig, the only caller of `execute` and `setPauser`.
address public immutable SAFE;
/// @notice The factory whose `PROTOCOL_SAFE` this contract is.
IFactoryCancels public immutable FACTORY;
/// @notice The PropAMM front that names the protocol guardian; zero on a chain no front runs on.
IPropAMMFrontGovernance public immutable FRONT;
/// @notice The key the protocol owner named to set the Router's global pause, which it may only set; zero for none.
address public pauser;
/// @notice The protocol owner named `pauser`, zero for none.
event PauserSet(address indexed pauser);
/// @notice A construction with no protocol owner or no factory.
error ZeroAddress();
/// @notice The caller is not the protocol owner.
error NotProtocolSafe();
/// @notice A cancel from neither the protocol owner nor the front's protocol guardian.
error NotSafeOrGuardian();
/// @notice A pause of the Router from neither the protocol owner nor the pauser.
error NotSafeOrPauser();
/// @param safe The protocol owner's multisig, never zero.
/// @param factory The factory, never zero.
/// @param front The PropAMM front. Zero on a chain no front runs on: the guardian's cancel is then the protocol
/// owner's alone.
constructor(address safe, address factory, address front) {
if (safe == address(0) || factory == address(0)) revert ZeroAddress();
SAFE = safe;
FACTORY = IFactoryCancels(factory);
FRONT = IPropAMMFrontGovernance(front);
}
/// @notice The protocol owner's call to `target` with `value` wei, from what it sends and what this contract
/// holds; reverts with the target's revert data.
function execute(address target, uint256 value, bytes calldata data)
external
payable
returns (bytes memory result)
{
if (msg.sender != SAFE) revert NotProtocolSafe();
bool ok;
(ok, result) = target.call{value: value}(data);
if (!ok) {
assembly ("memory-safe") {
revert(add(result, 32), mload(result))
}
}
}
// ------------------------------------------------------------------ the guardian's or protocol owner's cancel
/// @notice Cancels a change the factory has scheduled, by its id (`FLAMMFactory.pendingChange`): the protocol
/// owner or the protocol guardian (`NotSafeOrGuardian`).
function cancel(bytes32 id) external {
_onlySafeOrGuardian();
FACTORY.cancel(id);
}
// ------------------------------------------------------------------ the Router's pause
/// @notice Names the pauser, at once, replacing the last one: the protocol owner's alone (`NotProtocolSafe`). Zero
/// names none, and the protocol owner alone pauses.
function setPauser(address pauser_) external {
if (msg.sender != SAFE) revert NotProtocolSafe();
pauser = pauser_;
emit PauserSet(pauser_);
}
/// @notice Sets the global pause of the factory's Router, whose `protocolSafe` this contract is: the protocol owner
/// or the pauser (`NotSafeOrPauser`), whatever the front answers. Only the protocol owner clears it,
/// through `execute`.
function pauseRouter() external {
if (msg.sender != SAFE) {
address p = pauser;
if (p == address(0) || msg.sender != p) revert NotSafeOrPauser();
}
IRouterPause(FACTORY.ROUTER()).setGlobalPaused(true);
}
/// @dev The protocol owner is checked first, so it never depends on the front answering; with no front, only the
/// protocol owner passes.
function _onlySafeOrGuardian() internal view {
if (msg.sender != SAFE && (address(FRONT) == address(0) || msg.sender != FRONT.protocolGuardian())) {
revert NotSafeOrGuardian();
}
}
}
src/interfaces/propamm/IPropAMMGovernance.sol
// SPDX-License-Identifier: UNLICENSED
// Copyright (c) 2025-2026 Everlong Labs Limited
pragma solidity ^0.8.26;
/// @notice What the front's governance contracts need of the front: an ERC-1967 proxy whose owner is its timelock.
interface IPropAMMFrontGovernance {
/// @notice The protocol guardian, whose every power only stops: at the front it pauses every fill (`pauseAll`),
/// ends a listing's lease or every listing's (`cutLease`) and cancels a registry move (`cancelRegistry`),
/// and it cuts `PythLane`'s pin (`cutPin`); it holds no role in any operator's pool.
/// `GuardianCanceller` and `FactoryAdmin` read it on every call to a cancel.
function protocolGuardian() external view returns (address);
/// @notice The owner (the timelock) only: replaces the protocol guardian.
/// @param guardian The new protocol guardian.
function setProtocolGuardian(address guardian) external;
}
/// @notice What `FactoryAdmin` reaches on a `FLAMMFactory`: for the protocol guardian, its one cancel of a scheduled
/// change; for the pauser, its Router, to pause. `FactoryAdmin` is the factory's `PROTOCOL_SAFE`.
interface IFactoryCancels {
/// @notice Cancels the change scheduled under `id`, the factory's `PROTOCOL_SAFE`'s alone.
/// @param id The change's id (`FLAMMFactory.pendingChange`).
function cancel(bytes32 id) external;
/// @notice The factory's Router.
function ROUTER() external view returns (address);
}
Compiler settingsShow
{
"viaIR": true,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"libraries": {
"src/core/mm/MMRouterLib.sol": {
"MMRouterLib": "0xA4749766934833DfBeaF4Fc0d79c150A1Dd2B4E5"
},
"src/core/flamm/FLAMMLane.sol": {
"FLAMMLane": "0x0988077AB06F1efd8cFa3f08FC60CAf3e6d22e98"
},
"src/core/flamm/FLAMMRoute.sol": {
"FLAMMRoute": "0x312ee92ecd113F925dD513d450b062C8740fDaA9"
},
"src/periphery/FLAMMMaxima.sol": {
"FLAMMMaxima": "0x4A997343D91c981BF63274fc222AA96D32d6259c"
},
"src/core/flamm/FLAMMLawLib.sol": {
"FLAMMLawLib": "0x5D473B15E032756Cd81fc66B8F1e9BE2f427cc62"
},
"src/core/flamm/FLAMMOpsLib.sol": {
"FLAMMOpsLib": "0x0BFe60fB1f5223F1A2b7B02Ef18f5C33fb043753"
},
"src/core/mm/AaveV3ReadsLib.sol": {
"AaveV3ReadsLib": "0xD53F6170226A74D453e84414Ffc2FFcE5ded5983"
},
"src/core/flamm/FLAMMFlowLib.sol": {
"FLAMMFlowLib": "0x2577D707D41209489b2EF53101a4f6baDd4E3473"
},
"src/core/flamm/FLAMMGateLib.sol": {
"FLAMMGateLib": "0xF0BE115A2D6F27274F2e9EE50B89Ed42db2B9555"
},
"src/core/flamm/FLAMMKeptLib.sol": {
"FLAMMKeptLib": "0x7a11899232dd9F17c28bF062Ec2ee2267158517b"
},
"src/core/mm/CTokenMarketLib.sol": {
"CTokenMarketLib": "0x18c53F2aCAbcDEEdb575A136f49fa4C43EB2071c"
},
"src/core/flamm/FLAMMAdmitLib.sol": {
"FLAMMAdmitLib": "0xA6dBD8cD5Cd10F8a5857cbeD54a28405ffbDcBCb"
},
"src/core/flamm/FLAMMBlindLib.sol": {
"FLAMMBlindLib": "0x0b8d436F1a7AE25C5d16955ed4CDa781E42e7E5C"
},
"src/core/flamm/FLAMMClaimLib.sol": {
"FLAMMClaimLib": "0x02b4354a56630ab165A880B1198a603E62731cCE"
},
"src/core/flamm/FLAMMFenceLib.sol": {
"FLAMMFenceLib": "0xA16ddA83f47a42F875f141b6954595D584a201e8"
},
"src/core/flamm/FLAMMFloatLib.sol": {
"FLAMMFloatLib": "0x539EfC2b17cF0fdF254AAaB925b3A7c360A79737"
},
"src/core/flamm/FLAMMQuoteLib.sol": {
"FLAMMQuoteLib": "0xa4D34f4882a529574840881e755BCFae2bd5ce2e"
},
"src/core/flamm/FLAMMTopUpLib.sol": {
"FLAMMTopUpLib": "0x7C55a535Ce298b1e5e6d00F645088F777ad233DF"
},
"src/core/mm/CTokenRewardsLib.sol": {
"CTokenRewardsLib": "0xcda63d7eCCF838F2732Bff676706BDE5abA4DcF7"
},
"src/core/mm/MMRouterAdminLib.sol": {
"MMRouterAdminLib": "0x8423744b3F304ED0B43043d7ad4E7d8A247aDc96"
},
"src/core/flamm/FLAMMPolicyLib.sol": {
"FLAMMPolicyLib": "0xa6B495B2BdcDcf4F327844d9aaA0eD4C550c67F9"
},
"src/core/flamm/FLAMMSettleLib.sol": {
"FLAMMSettleLib": "0xB4890a27205505BDAA05717B6c3aB38b2dd3C7Cb"
},
"src/core/flamm/FLAMMSharedLib.sol": {
"FLAMMSharedLib": "0xFaAEd38962aEb6c282Ac36E0cdE9313AbA2511ba"
},
"src/periphery/FLAMMExitMaxima.sol": {
"FLAMMExitMaxima": "0x480f51866554e92649c9d3502bA31AA4234e0a81"
},
"src/hooks/everlong/LeverageLib.sol": {
"LeverageLib": "0x1B1D1C42d26c169dB59D8681d0FD4C9a2840Ad11"
},
"src/core/flamm/FLAMMMaintainLib.sol": {
"FLAMMMaintainLib": "0x94998f13fc5d5D2271c90b835c6a805dad409cC2"
},
"src/core/flamm/FLAMMPairQuoteLib.sol": {
"FLAMMPairQuoteLib": "0x077523D1427aE408105fe8592F907ECDa0D94cbE"
},
"src/hooks/everlong/EverlongOpsLib.sol": {
"EverlongOpsLib": "0xAbe4447C954E3C7a405f8E75116BF9f5787426F7"
}
},
"optimizer": {
"runs": 100,
"enabled": true
},
"viaSSACFG": false,
"evmVersion": "cancun",
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts-compat/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable-compat/contracts/",
"solady/=lib/solady/src/",
"forge-std/=lib/forge-std/src/"
],
"experimental": false
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.