Verified contractExactLGPL-3.0-only
SeriesCodeFactory
Address0xeab8a19feada0ddba2fde324715ebbb6234b5616
- Balance
0 ETH
- Transactions
10
- Compiler
solc 0.8.28
- Same code
Only this contract
Details
- Compiler
- solc 0.8.28+commit.7893614a
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- paris
- License
- LGPL-3.0-only
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,107,602
- Creation transaction
- 0x4911b06b5e…1b98720894
72 files
The source code is large: one file is shown at a time. Choose a file in the list.
- src/factories/SeriesCodeFactory.solmain4.6 KB
- dependencies/solady-0.1.26/src/auth/Ownable.sol12.55 KB
- dependencies/solady-0.1.26/src/tokens/ERC2981.sol6.87 KB
- dependencies/solady-0.1.26/src/tokens/ERC721.sol40 KB
- dependencies/solady-0.1.26/src/utils/Initializable.sol8.48 KB
- dependencies/solady-0.1.26/src/utils/LibBytes.sol38.18 KB
- dependencies/solady-0.1.26/src/utils/LibClone.sol156.44 KB
- dependencies/solady-0.1.26/src/utils/LibString.sol44.25 KB
- dependencies/solady-0.1.26/src/utils/Multicallable.sol5.73 KB
- dependencies/solady-0.1.26/src/utils/SSTORE2.sol12.63 KB
- src/core/AbxBeaconCore.sol2.45 KB
- src/core/AbxErc721Base.sol7.78 KB
- src/extensions/code-custody/AbxCodeDelegate.sol2.57 KB
- src/extensions/configurable-params/ConfigurableParams.sol14.83 KB
- src/extensions/configurable-params/IAbxConfigurableParams.sol6.8 KB
- src/extensions/configurable-params/IAbxParamHooks.sol8.8 KB
- src/extensions/creator-token/CreatorToken.sol14.38 KB
- src/extensions/creator-token/ITransferValidator.sol658 B
- src/extensions/creator-token/ITransferValidatorSetTokenType.sol909 B
- src/extensions/dependencies/Dependencies.sol4.61 KB
- src/extensions/dependencies/IAbxDependencies.sol2.07 KB
- src/extensions/external-minter/ExternalMinter.sol3.75 KB
- src/extensions/external-minter/IAbxExternalMinter.sol1.59 KB
- src/extensions/max-invocations/IAbxMaxInvocations.sol1.13 KB
- src/extensions/max-invocations/MaxInvocations.sol4.92 KB
- src/extensions/onchain-metadata/IAbxOnChainMetadata.sol3.15 KB
- src/extensions/onchain-metadata/OnChainMetadata.sol10.65 KB
- src/extensions/onchain-script/IAbxOnChainScript.sol1.33 KB
- src/extensions/onchain-script/OnChainScript.sol4.18 KB
- src/extensions/params/IAbxParams.sol4.85 KB
- src/extensions/params/Params.sol12.1 KB
- src/extensions/paused/IAbxPaused.sol1.08 KB
- src/extensions/paused/Paused.sol2.82 KB
- src/extensions/primary-payee/IAbxPrimaryPayee.sol942 B
- src/extensions/primary-payee/PrimaryPayee.sol2.79 KB
- src/extensions/royalty/IAbxRoyalty.sol2.09 KB
- src/extensions/royalty/RoyaltyExtension.sol6.67 KB
- src/extensions/seed-source/IAbxSeedSourceConfig.sol1.48 KB
- src/extensions/seed-source/SeedSourceExtension.sol3.67 KB
- src/interfaces/IAbxBeacon.sol1.27 KB
- src/interfaces/IAbxSeedSource.sol973 B
- src/interfaces/IAbxSequentialMint.sol1.71 KB
- src/interfaces/ICreatorToken.sol1.83 KB
- src/interfaces/IDelegateRegistry.sol962 B
- src/interfaces/IERC4906.sol497 B
- src/interfaces/IERC7572.sol612 B
- src/libraries/AbxCodeLib.sol8.32 KB
- src/libraries/AbxMetadataLib.sol9 KB
- src/libraries/AbxParamsLib.sol53.82 KB
- src/libraries/AbxVersion.sol1.12 KB
- src/libraries/BeaconStorage.sol1.02 KB
- src/libraries/CollectionMetadataLib.sol1.26 KB
- src/libraries/ConfigurableParamsStorage.sol3.43 KB
- src/libraries/ContractURIStorage.sol1.74 KB
- src/libraries/DependenciesStorage.sol1.57 KB
- src/libraries/ExternalMinterStorage.sol1.11 KB
- src/libraries/MaxInvocationsStorage.sol1.11 KB
- src/libraries/OnChainMetadataStorage.sol1.89 KB
- src/libraries/OnChainScriptStorage.sol1.21 KB
- src/libraries/ParamsStorage.sol4.31 KB
- src/libraries/PausedStorage.sol1.03 KB
- src/libraries/PrimaryPayeeStorage.sol1.01 KB
- src/libraries/RoyaltyStorage.sol1.73 KB
- src/libraries/SeedSourceStorage.sol1.03 KB
- src/libraries/SeriesMintStorage.sol1.19 KB
- src/libraries/SupplyStorage.sol2 KB
- src/libraries/TokenURIStorage.sol1.99 KB
- src/libraries/TransferValidatorStorage.sol1.36 KB
- src/tokens/SeriesCode.sol18.25 KB
- src/uri/IAbxMetadataRenderer.sol1.78 KB
- src/uri/contract/ContractURI.sol4.99 KB
- src/uri/token/TokenURI.sol7.24 KB
src/factories/SeriesCodeFactory.sol
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.8.28;
import {LibClone} from "solady/utils/LibClone.sol";
import {SeriesCode} from "../tokens/SeriesCode.sol";
/// @title SeriesCodeFactory — canonical clone factory & trust anchor for code projects
/// @notice Deploys {SeriesCode} as immutable EIP-1167 clones of a single, factory-owned
/// implementation. The factory is *ownerless* — no admin keys, cannot upgrade or alter
/// any clone — so there is nothing to rug. The exact sibling of {SeriesImageFactory};
/// each token class is its own trust root (one implementation each), allowlisted by
/// platforms via the factory address.
///
/// @dev Trust model: identical to {SeriesImageFactory} — trust the factory address once;
/// EIP-1167 guarantees every clone runs the fixed canonical implementation; `isAbxClone`
/// (this factory the only writer) is the membership check. The `AbxDeployed` beacon is
/// spoofable — discovery, never trust. A new core version ships as a new implementation +
/// new factory; old clones stay frozen on their version.
contract SeriesCodeFactory {
/// @notice The canonical implementation every clone delegates to (immutable).
address public immutable implementation;
/// @notice True for addresses this factory deployed.
mapping(address => bool) public isAbxClone;
/// @notice A canonical clone was deployed and initialized.
event Deployed(address indexed clone, address indexed implementation, address indexed owner);
/// @notice A salt reserved an address to a specific deployer, and the caller isn't it.
error SaltSenderMismatch();
constructor() {
// Deploy the one implementation; its constructor disables initializers,
// so the master copy can never be initialized or hijacked.
implementation = address(new SeriesCode());
}
/// @notice Deploy a new code-project NFT.
function deploy(SeriesCode.InitParams calldata params) external returns (address clone) {
clone = LibClone.clone(implementation);
_initAndRegister(clone, params);
}
/// @notice Deploy at a deterministic, pre-computable address.
/// @dev The clone address is a pure function of (this factory, `salt`) — *not* the caller —
/// so it can be predicted and its on-chain URIs baked before anyone signs. Front-running
/// is governed by the salt's leading bytes; see {_guardSalt}. Re-using a salt reverts.
function deployDeterministic(SeriesCode.InitParams calldata params, bytes32 salt)
external
returns (address clone)
{
_guardSalt(salt);
clone = LibClone.cloneDeterministic(implementation, salt);
_initAndRegister(clone, params);
}
/// @notice Address {deployDeterministic} would produce for `salt` (caller-independent).
function predictDeterministicAddress(bytes32 salt) external view returns (address) {
return LibClone.predictDeterministicAddress(implementation, salt, address(this));
}
function _initAndRegister(address clone, SeriesCode.InitParams calldata params) internal {
// Register AFTER `initialize` returns. Initialization makes one external call — to the
// owner-supplied transfer validator — and during that callback the clone would otherwise
// already read as canonical to any integration that treats `isAbxClone` as "fully set up",
// while deploy-time mints and `Deployed` have not happened yet. No present invariant break
// was found (caps are written before the callback, and the validator is owner-chosen), but
// the ordering costs nothing and removes the window.
SeriesCode(clone).initialize(params);
isAbxClone[clone] = true;
emit Deployed(clone, implementation, params.owner);
}
/// @dev The salt's leading 20 bytes are an access guard (the 0age / CreateX convention):
/// all-zero ⇒ permissionless; non-zero ⇒ must equal `msg.sender`, so only the reserver
/// can land their params there — front-running protection for a pre-computed address.
/// Account-type agnostic (EOA, ERC-4337, Safe all present as `msg.sender`).
function _guardSalt(bytes32 salt) internal view {
// taking the leading 20 bytes as the guard address is the intended truncation.
// forge-lint: disable-next-line(unsafe-typecast)
address guard = address(bytes20(salt));
if (guard != address(0) && guard != msg.sender) revert SaltSenderMismatch();
}
}
Compiler settingsShow
{
"viaIR": false,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "paris",
"remappings": [
"solady/=dependencies/solady-0.1.26/src/",
"forge-std/=dependencies/forge-std-1.16.1/src/",
"forge-std-1.16.1/=dependencies/forge-std-1.16.1/src/",
"solady-0.1.26/=dependencies/solady-0.1.26/src/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.