diff --git a/src/circles/Circles.sol b/src/circles/Circles.sol index 45d2c63..dfb84ed 100644 --- a/src/circles/Circles.sol +++ b/src/circles/Circles.sol @@ -138,11 +138,12 @@ contract Circles is ERC1155, ICirclesErrors { // No issuance to claim, simply return without reverting return; } - // mint personal Circles to the human - _mintAndUpdateTotalSupply(_human, toTokenId(_human), issuance, ""); - // update the last mint time + // update the last mint time, before minting as mint time determines the check (guard for reeentrancy attack) mintTimes[_human].lastMintTime = uint96(block.timestamp); + // mint personal Circles to the human; ERC1155 mint will perform acceptance call + _mintAndUpdateTotalSupply(_human, toTokenId(_human), issuance, ""); + emit PersonalMint(_human, issuance, startPeriod, endPeriod); } diff --git a/src/hub/Hub.sol b/src/hub/Hub.sol index b99a4a9..431a3ef 100644 --- a/src/hub/Hub.sol +++ b/src/hub/Hub.sol @@ -143,7 +143,7 @@ contract Hub is Circles, TypeDefinitions, IHubErrors { * @dev Reentrancy guard for nonReentrant functions. * see https://soliditylang.org/blog/2024/01/26/transient-storage/ */ - modifier nonReentrant(uint8 _code) { + modifier nonReentrant() { assembly { if tload(0) { revert(0, 0) } tstore(0, 1) @@ -543,7 +543,7 @@ contract Hub is Circles, TypeDefinitions, IHubErrors { FlowEdge[] calldata _flow, Stream[] calldata _streams, bytes calldata _packedCoordinates - ) external nonReentrant(0) { + ) external nonReentrant { // first unpack the coordinates to array of uint16 uint16[] memory coordinates = _unpackCoordinates(_packedCoordinates, _flow.length);