Проверенный контрактТочноеMIT
ConfigSetSystem
Адрес0xd4035ceaf2695d99b2bed0c9e01c1952be39efec
- Баланс
0 ETH
- Транзакций
0
- Компилятор
solc 0.8.24
- Тот же код
Только этот контракт
Подробности
- Компилятор
- solc 0.8.24+commit.e11b9ed9
- Язык
- solidity
- Оптимизация
- Да, 3 000 прогонов
- Версия EVM
- cancun
- Через IR
- да
- Лицензия
- MIT
- Совпадение
- Точноекод создания: да, код в сети: да
- Проверен на Sourcify
- Создан в блоке
- 25 481 290
- Транзакция создания
- 0x530946fe3a…40b5774ab0
74 файла
Исходный код большой: показывается один файл. Выберите файл в списке.
- src/namespaces/app/ConfigSetSystem.solглавный2,33 КБ
- node_modules/@latticexyz/schema-type/src/solidity/SchemaType.sol3,72 КБ
- node_modules/@latticexyz/store/src/Bytes.sol35,98 КБ
- node_modules/@latticexyz/store/src/EncodedLengths.sol9,33 КБ
- node_modules/@latticexyz/store/src/FieldLayout.sol8,62 КБ
- node_modules/@latticexyz/store/src/Hook.sol3,97 КБ
- node_modules/@latticexyz/store/src/IERC165.sol576 Б
- node_modules/@latticexyz/store/src/IEncodedLengthsErrors.sol737 Б
- node_modules/@latticexyz/store/src/IFieldLayoutErrors.sol2,26 КБ
- node_modules/@latticexyz/store/src/ISchemaErrors.sol834 Б
- node_modules/@latticexyz/store/src/ISliceErrors.sol894 Б
- node_modules/@latticexyz/store/src/IStore.sol321 Б
- node_modules/@latticexyz/store/src/IStoreErrors.sol4,12 КБ
- node_modules/@latticexyz/store/src/IStoreEvents.sol2,91 КБ
- node_modules/@latticexyz/store/src/IStoreHook.sol6,12 КБ
- node_modules/@latticexyz/store/src/IStoreKernel.sol988 Б
- node_modules/@latticexyz/store/src/IStoreRead.sol3,95 КБ
- node_modules/@latticexyz/store/src/IStoreRegistration.sol1,12 КБ
- node_modules/@latticexyz/store/src/IStoreWrite.sol2,36 КБ
- node_modules/@latticexyz/store/src/Memory.sol2,06 КБ
- node_modules/@latticexyz/store/src/ResourceId.sol2,21 КБ
- node_modules/@latticexyz/store/src/Schema.sol7,69 КБ
- node_modules/@latticexyz/store/src/Slice.sol4,49 КБ
- node_modules/@latticexyz/store/src/Storage.sol9,76 КБ
- node_modules/@latticexyz/store/src/StoreCore.sol54,25 КБ
- node_modules/@latticexyz/store/src/StoreSwitch.sol22,54 КБ
- node_modules/@latticexyz/store/src/codegen/index.sol320 Б
- node_modules/@latticexyz/store/src/codegen/tables/Hooks.sol15,66 КБ
- node_modules/@latticexyz/store/src/codegen/tables/ResourceIds.sol7,18 КБ
- node_modules/@latticexyz/store/src/codegen/tables/StoreHooks.sol15,06 КБ
- node_modules/@latticexyz/store/src/codegen/tables/Tables.sol26,58 КБ
- node_modules/@latticexyz/store/src/constants.sol1,73 КБ
- node_modules/@latticexyz/store/src/rightMask.sol838 Б
- node_modules/@latticexyz/store/src/storeHookTypes.sol1,78 КБ
- node_modules/@latticexyz/store/src/storeResourceTypes.sol515 Б
- node_modules/@latticexyz/store/src/tightcoder/DecodeSlice.sol46,44 КБ
- node_modules/@latticexyz/store/src/tightcoder/EncodeArray.sol46,1 КБ
- node_modules/@latticexyz/store/src/tightcoder/TightCoder.sol3,81 КБ
- node_modules/@latticexyz/store/src/version.sol348 Б
- node_modules/@latticexyz/world/src/IERC165.sol813 Б
- node_modules/@latticexyz/world/src/IWorldContextConsumer.sol1,54 КБ
- node_modules/@latticexyz/world/src/System.sol570 Б
- node_modules/@latticexyz/world/src/WorldContext.sol9,21 КБ
- node_modules/@latticexyz/world/src/revertWithBytes.sol566 Б
- node_modules/solady/src/utils/DynamicArrayLib.sol37,21 КБ
- node_modules/solady/src/utils/LibBytes.sol38,18 КБ
- node_modules/solady/src/utils/LibPRNG.sol22,51 КБ
- node_modules/solady/src/utils/LibString.sol44,25 КБ
- node_modules/solady/src/utils/SafeTransferLib.sol32,86 КБ
- src/codegen/common.sol527 Б
- src/namespaces/app/codegen/tables/Account.sol12,37 КБ
- src/namespaces/app/codegen/tables/AccountStatus.sol14,02 КБ
- src/namespaces/app/codegen/tables/ActiveTaruchi.sol6,3 КБ
- src/namespaces/app/codegen/tables/AuthRoles.sol6,89 КБ
- src/namespaces/app/codegen/tables/Config.sol6,52 КБ
- src/namespaces/app/codegen/tables/Data.sol7,97 КБ
- src/namespaces/app/codegen/tables/TaruchiCore.sol11,99 КБ
- src/namespaces/app/codegen/tables/TaruchiName.sol6,62 КБ
- src/namespaces/app/codegen/tables/TaruchiStatus.sol18,6 КБ
- src/namespaces/app/codegen/tables/TaruchiTourney.sol6,34 КБ
- src/namespaces/app/codegen/tables/TraitNames.sol6,62 КБ
- src/namespaces/app/codegen/tables/TraitsRegistry.sol14,86 КБ
- src/namespaces/app/libraries/LibOnyx.sol29,47 КБ
- src/namespaces/app/libraries/Taruchi.sol18,48 КБ
- src/namespaces/app/libraries/Traits.sol14,6 КБ
- src/namespaces/app/libraries/utils/LibAuthRoles.sol1,06 КБ
- src/namespaces/app/libraries/utils/LibConfig.sol3,81 КБ
- src/namespaces/app/libraries/utils/LibData.sol2,49 КБ
- src/namespaces/app/libraries/utils/LibPack.sol7,13 КБ
- src/namespaces/app/libraries/utils/LibProgression.sol2,32 КБ
- src/namespaces/app/libraries/utils/LibRandom.sol6,96 КБ
- src/namespaces/app/libraries/utils/LibSpec.sol7,33 КБ
- src/namespaces/app/libraries/utils/LibStats.sol3,34 КБ
- src/namespaces/app/libraries/utils/LibXP.sol6,92 КБ
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"
);
}
}
Настройки компилятораПоказать
{
"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/"
]
}Исходный код и метаданные: Sourcify.
Исходный код принадлежит авторам контракта.