MUD is a framework for building ambitious onchain applications
MIT License
Bot releases are visible (Hide)
Published by github-actions[bot] about 1 year ago
1d60930d
, b9e562d8
, 51914d65
, 2ca75f9b
, 5e71e1cb
]:
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
1d60930d
, b9e562d8
, 51914d65
, 2ca75f9b
, 5e71e1cb
, 5e71e1cb
]:
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
#1399 c4d5eb4e
Thanks @alvrs! - - The onSetRecord
hook is split into onBeforeSetRecord
and onAfterSetRecord
and the onDeleteRecord
hook is split into onBeforeDeleteRecord
and onAfterDeleteRecord
.
The purpose of this change is to allow more fine-grained control over the point in the lifecycle at which hooks are executed.
The previous hooks were executed before modifying data, so they can be replaced with the respective onBefore
hooks.
- function onSetRecord(
+ function onBeforeSetRecord(
bytes32 table,
bytes32[] memory key,
bytes memory data,
Schema valueSchema
) public;
- function onDeleteRecord(
+ function onBeforeDeleteRecord(
bytes32 table,
bytes32[] memory key,
Schema valueSchema
) public;
It is now possible to specify which methods of a hook contract should be called when registering a hook. The purpose of this change is to save gas by avoiding to call no-op hook methods.
function registerStoreHook(
bytes32 tableId,
- IStoreHook hookAddress
+ IStoreHook hookAddress,
+ uint8 enabledHooksBitmap
) public;
function registerSystemHook(
bytes32 systemId,
- ISystemHook hookAddress
+ ISystemHook hookAddress,
+ uint8 enabledHooksBitmap
) public;
There are StoreHookLib
and SystemHookLib
with helper functions to encode the bitmap of enabled hooks.
import { StoreHookLib } from "@latticexyz/store/src/StoreHook.sol";
uint8 storeHookBitmap = StoreBookLib.encodeBitmap({
onBeforeSetRecord: true,
onAfterSetRecord: true,
onBeforeSetField: true,
onAfterSetField: true,
onBeforeDeleteRecord: true,
onAfterDeleteRecord: true
});
import { SystemHookLib } from "@latticexyz/world/src/SystemHook.sol";
uint8 systemHookBitmap = SystemHookLib.encodeBitmap({
onBeforeCallSystem: true,
onAfterCallSystem: true
});
The onSetRecord
hook call for emitEphemeralRecord
has been removed to save gas and to more clearly distinguish ephemeral tables as offchain tables.
#1407 18d3aea5
Thanks @alvrs! - Allow callFrom
with the own address as delegator
without requiring an explicit delegation
Updated dependencies [c4d5eb4e
]:
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
c4d5eb4e
, 18d3aea5
]:
Published by github-actions[bot] about 1 year ago
c4d5eb4e
]:
Published by github-actions[bot] about 1 year ago
#1399 c4d5eb4e
Thanks @alvrs! - - The onSetRecord
hook is split into onBeforeSetRecord
and onAfterSetRecord
and the onDeleteRecord
hook is split into onBeforeDeleteRecord
and onAfterDeleteRecord
.
The purpose of this change is to allow more fine-grained control over the point in the lifecycle at which hooks are executed.
The previous hooks were executed before modifying data, so they can be replaced with the respective onBefore
hooks.
- function onSetRecord(
+ function onBeforeSetRecord(
bytes32 table,
bytes32[] memory key,
bytes memory data,
Schema valueSchema
) public;
- function onDeleteRecord(
+ function onBeforeDeleteRecord(
bytes32 table,
bytes32[] memory key,
Schema valueSchema
) public;
It is now possible to specify which methods of a hook contract should be called when registering a hook. The purpose of this change is to save gas by avoiding to call no-op hook methods.
function registerStoreHook(
bytes32 tableId,
- IStoreHook hookAddress
+ IStoreHook hookAddress,
+ uint8 enabledHooksBitmap
) public;
function registerSystemHook(
bytes32 systemId,
- ISystemHook hookAddress
+ ISystemHook hookAddress,
+ uint8 enabledHooksBitmap
) public;
There are StoreHookLib
and SystemHookLib
with helper functions to encode the bitmap of enabled hooks.
import { StoreHookLib } from "@latticexyz/store/src/StoreHook.sol";
uint8 storeHookBitmap = StoreBookLib.encodeBitmap({
onBeforeSetRecord: true,
onAfterSetRecord: true,
onBeforeSetField: true,
onAfterSetField: true,
onBeforeDeleteRecord: true,
onAfterDeleteRecord: true
});
import { SystemHookLib } from "@latticexyz/world/src/SystemHook.sol";
uint8 systemHookBitmap = SystemHookLib.encodeBitmap({
onBeforeCallSystem: true,
onAfterCallSystem: true
});
The onSetRecord
hook call for emitEphemeralRecord
has been removed to save gas and to more clearly distinguish ephemeral tables as offchain tables.
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
c4d5eb4e
]:
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago