Verified contractExactMIT
ConfigSetSystem
Address0xd4035ceaf2695d99b2bed0c9e01c1952be39efec
- Balance
0 ETH
- Transactions
0
- Compiler
solc 0.8.24
- Same code
Only this contract
Details
- Compiler
- solc 0.8.24+commit.e11b9ed9
- Language
- solidity
- Optimization
- Yes, 3,000 runs
- EVM version
- cancun
- Via IR
- yes
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 25,481,290
- Creation transaction
- 0x530946fe3a…40b5774ab0
74 files
The source code is large: one file is shown at a time. Choose a file in the list.
- src/namespaces/app/ConfigSetSystem.solmain2.33 KB
- node_modules/@latticexyz/schema-type/src/solidity/SchemaType.sol3.72 KB
- node_modules/@latticexyz/store/src/Bytes.sol35.98 KB
- node_modules/@latticexyz/store/src/EncodedLengths.sol9.33 KB
- node_modules/@latticexyz/store/src/FieldLayout.sol8.62 KB
- node_modules/@latticexyz/store/src/Hook.sol3.97 KB
- node_modules/@latticexyz/store/src/IERC165.sol576 B
- node_modules/@latticexyz/store/src/IEncodedLengthsErrors.sol737 B
- node_modules/@latticexyz/store/src/IFieldLayoutErrors.sol2.26 KB
- node_modules/@latticexyz/store/src/ISchemaErrors.sol834 B
- node_modules/@latticexyz/store/src/ISliceErrors.sol894 B
- node_modules/@latticexyz/store/src/IStore.sol321 B
- node_modules/@latticexyz/store/src/IStoreErrors.sol4.12 KB
- node_modules/@latticexyz/store/src/IStoreEvents.sol2.91 KB
- node_modules/@latticexyz/store/src/IStoreHook.sol6.12 KB
- node_modules/@latticexyz/store/src/IStoreKernel.sol988 B
- node_modules/@latticexyz/store/src/IStoreRead.sol3.95 KB
- node_modules/@latticexyz/store/src/IStoreRegistration.sol1.12 KB
- node_modules/@latticexyz/store/src/IStoreWrite.sol2.36 KB
- node_modules/@latticexyz/store/src/Memory.sol2.06 KB
- node_modules/@latticexyz/store/src/ResourceId.sol2.21 KB
- node_modules/@latticexyz/store/src/Schema.sol7.69 KB
- node_modules/@latticexyz/store/src/Slice.sol4.49 KB
- node_modules/@latticexyz/store/src/Storage.sol9.76 KB
- node_modules/@latticexyz/store/src/StoreCore.sol54.25 KB
- node_modules/@latticexyz/store/src/StoreSwitch.sol22.54 KB
- node_modules/@latticexyz/store/src/codegen/index.sol320 B
- node_modules/@latticexyz/store/src/codegen/tables/Hooks.sol15.66 KB
- node_modules/@latticexyz/store/src/codegen/tables/ResourceIds.sol7.18 KB
- node_modules/@latticexyz/store/src/codegen/tables/StoreHooks.sol15.06 KB
- node_modules/@latticexyz/store/src/codegen/tables/Tables.sol26.58 KB
- node_modules/@latticexyz/store/src/constants.sol1.73 KB
- node_modules/@latticexyz/store/src/rightMask.sol838 B
- node_modules/@latticexyz/store/src/storeHookTypes.sol1.78 KB
- node_modules/@latticexyz/store/src/storeResourceTypes.sol515 B
- node_modules/@latticexyz/store/src/tightcoder/DecodeSlice.sol46.44 KB
- node_modules/@latticexyz/store/src/tightcoder/EncodeArray.sol46.1 KB
- node_modules/@latticexyz/store/src/tightcoder/TightCoder.sol3.81 KB
- node_modules/@latticexyz/store/src/version.sol348 B
- node_modules/@latticexyz/world/src/IERC165.sol813 B
- node_modules/@latticexyz/world/src/IWorldContextConsumer.sol1.54 KB
- node_modules/@latticexyz/world/src/System.sol570 B
- node_modules/@latticexyz/world/src/WorldContext.sol9.21 KB
- node_modules/@latticexyz/world/src/revertWithBytes.sol566 B
- node_modules/solady/src/utils/DynamicArrayLib.sol37.21 KB
- node_modules/solady/src/utils/LibBytes.sol38.18 KB
- node_modules/solady/src/utils/LibPRNG.sol22.51 KB
- node_modules/solady/src/utils/LibString.sol44.25 KB
- node_modules/solady/src/utils/SafeTransferLib.sol32.86 KB
- src/codegen/common.sol527 B
- src/namespaces/app/codegen/tables/Account.sol12.37 KB
- src/namespaces/app/codegen/tables/AccountStatus.sol14.02 KB
- src/namespaces/app/codegen/tables/ActiveTaruchi.sol6.3 KB
- src/namespaces/app/codegen/tables/AuthRoles.sol6.89 KB
- src/namespaces/app/codegen/tables/Config.sol6.52 KB
- src/namespaces/app/codegen/tables/Data.sol7.97 KB
- src/namespaces/app/codegen/tables/TaruchiCore.sol11.99 KB
- src/namespaces/app/codegen/tables/TaruchiName.sol6.62 KB
- src/namespaces/app/codegen/tables/TaruchiStatus.sol18.6 KB
- src/namespaces/app/codegen/tables/TaruchiTourney.sol6.34 KB
- src/namespaces/app/codegen/tables/TraitNames.sol6.62 KB
- src/namespaces/app/codegen/tables/TraitsRegistry.sol14.86 KB
- src/namespaces/app/libraries/LibOnyx.sol29.47 KB
- src/namespaces/app/libraries/Taruchi.sol18.48 KB
- src/namespaces/app/libraries/Traits.sol14.6 KB
- src/namespaces/app/libraries/utils/LibAuthRoles.sol1.06 KB
- src/namespaces/app/libraries/utils/LibConfig.sol3.81 KB
- src/namespaces/app/libraries/utils/LibData.sol2.49 KB
- src/namespaces/app/libraries/utils/LibPack.sol7.13 KB
- src/namespaces/app/libraries/utils/LibProgression.sol2.32 KB
- src/namespaces/app/libraries/utils/LibRandom.sol6.96 KB
- src/namespaces/app/libraries/utils/LibSpec.sol7.33 KB
- src/namespaces/app/libraries/utils/LibStats.sol3.34 KB
- src/namespaces/app/libraries/utils/LibXP.sol6.92 KB
src/namespaces/app/ConfigSetSystem.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.24;
import { System } from "@latticexyz/world/src/System.sol";
import { LibConfig } from "libraries/utils/LibConfig.sol";
import { LibAuthRoles, Role } from "libraries/utils/LibAuthRoles.sol";
import { LibOnyx } from "libraries/LibOnyx.sol";
/// @notice System for setting global config values (admin-only)
contract ConfigSetSystem is System {
//////////////////
// BASIC SETTERS
/// @notice Set a uint256 config value
function setConfig(string memory field, uint256 value) public {
LibAuthRoles.verifyRole(_msgSender(), Role.ADMIN);
_requireNotTeamWallet(field);
LibConfig.set(field, value);
}
/// @notice Set an address config value
function setConfigAddress(string memory field, address value) public {
LibAuthRoles.verifyRole(_msgSender(), Role.ADMIN);
_requireNotTeamWallet(field);
LibConfig.setAddress(field, value);
}
/// @notice Set a bool config value
function setConfigBool(string memory field, bool value) public {
LibAuthRoles.verifyRole(_msgSender(), Role.ADMIN);
_requireNotTeamWallet(field);
LibConfig.setBool(field, value);
}
/// @notice Set a string config value (max 31 characters)
function setConfigString(string memory field, string memory value) public {
LibAuthRoles.verifyRole(_msgSender(), Role.ADMIN);
_requireNotTeamWallet(field);
LibConfig.setString(field, value);
}
/// @notice Set an array config value (uint32[8])
function setConfigArray(string memory field, uint32[8] memory values) public {
LibAuthRoles.verifyRole(_msgSender(), Role.ADMIN);
_requireNotTeamWallet(field);
LibConfig.setArray(field, values);
}
/// @dev onyx.teamWallet is a fund-routing address: every generic setter here writes the same
/// Config slot (LibConfig keys all setters by nameToKey(field)), so all of them must refuse
/// it. It moves only through OnyxAdminSystem.setTeamWallet (non-zero guard + TeamWalletUpdated
/// event), so monitoring can rely on the event and the slot can't be zeroed/mistyped.
function _requireNotTeamWallet(string memory field) private pure {
require(
LibConfig.nameToKey(field) != LibOnyx.HASH_TEAM_WALLET,
"ConfigSetSystem: set onyx.teamWallet via OnyxAdminSystem.setTeamWallet"
);
}
}
Compiler settingsShow
{
"viaIR": true,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"optimizer": {
"runs": 3000,
"enabled": true
},
"evmVersion": "cancun",
"remappings": [
"forge-std/=node_modules/forge-std/src/",
"@latticexyz/=node_modules/@latticexyz/",
"@openzeppelin/=node_modules/@openzeppelin/",
"solady/=node_modules/solady/src/",
"libraries/=src/namespaces/app/libraries/",
"tables/=src/namespaces/app/codegen/tables/",
"common/=src/codegen/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.