diff --git a/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol b/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol index 7397bf8c9..11d67af58 100644 --- a/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol +++ b/packages/lsp7-contracts/contracts/LSP7DigitalAsset.sol @@ -600,11 +600,11 @@ abstract contract LSP7DigitalAsset is revert LSP7CannotSendWithAddressZero(); } - _beforeTokenTransfer(address(0), to, amount, data); + _beforeTokenTransfer(address(0), to, amount, force, data); _update(address(0), to, amount, force, data); - _afterTokenTransfer(address(0), to, amount, data); + _afterTokenTransfer(address(0), to, amount, force, data); bytes memory lsp1Data = abi.encode( msg.sender, @@ -650,11 +650,11 @@ abstract contract LSP7DigitalAsset is revert LSP7CannotSendWithAddressZero(); } - _beforeTokenTransfer(from, address(0), amount, data); + _beforeTokenTransfer(from, address(0), amount, false, data); _update(from, address(0), amount, false, data); - _afterTokenTransfer(from, address(0), amount, data); + _afterTokenTransfer(from, address(0), amount, false, data); bytes memory lsp1Data = abi.encode( msg.sender, @@ -745,11 +745,11 @@ abstract contract LSP7DigitalAsset is revert LSP7CannotSendWithAddressZero(); } - _beforeTokenTransfer(from, to, amount, data); + _beforeTokenTransfer(from, to, amount, force, data); _update(from, to, amount, force, data); - _afterTokenTransfer(from, to, amount, data); + _afterTokenTransfer(from, to, amount, force, data); bytes memory lsp1Data = abi.encode(msg.sender, from, to, amount, data); @@ -814,12 +814,14 @@ abstract contract LSP7DigitalAsset is * @param from The sender address * @param to The recipient address * @param amount The amount of token to transfer + * @param force A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. * @param data The data sent alongside the transfer */ function _beforeTokenTransfer( address from, address to, uint256 amount, + bool force, bytes memory data // solhint-disable-next-line no-empty-blocks ) internal virtual {} @@ -830,12 +832,14 @@ abstract contract LSP7DigitalAsset is * @param from The sender address * @param to The recipient address * @param amount The amount of token to transfer + * @param force A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. * @param data The data sent alongside the transfer */ function _afterTokenTransfer( address from, address to, uint256 amount, + bool force, bytes memory data // solhint-disable-next-line no-empty-blocks ) internal virtual {} diff --git a/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol b/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol index 3b301b749..2dac555f0 100644 --- a/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol +++ b/packages/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol @@ -613,11 +613,11 @@ abstract contract LSP7DigitalAssetInitAbstract is revert LSP7CannotSendWithAddressZero(); } - _beforeTokenTransfer(address(0), to, amount, data); + _beforeTokenTransfer(address(0), to, amount, force, data); _update(address(0), to, amount, force, data); - _afterTokenTransfer(address(0), to, amount, data); + _afterTokenTransfer(address(0), to, amount, force, data); bytes memory lsp1Data = abi.encode( msg.sender, @@ -663,11 +663,11 @@ abstract contract LSP7DigitalAssetInitAbstract is revert LSP7CannotSendWithAddressZero(); } - _beforeTokenTransfer(from, address(0), amount, data); + _beforeTokenTransfer(from, address(0), amount, false, data); _update(from, address(0), amount, false, data); - _afterTokenTransfer(from, address(0), amount, data); + _afterTokenTransfer(from, address(0), amount, false, data); bytes memory lsp1Data = abi.encode( msg.sender, @@ -758,11 +758,11 @@ abstract contract LSP7DigitalAssetInitAbstract is revert LSP7CannotSendWithAddressZero(); } - _beforeTokenTransfer(from, to, amount, data); + _beforeTokenTransfer(from, to, amount, force, data); _update(from, to, amount, force, data); - _afterTokenTransfer(from, to, amount, data); + _afterTokenTransfer(from, to, amount, force, data); bytes memory lsp1Data = abi.encode(msg.sender, from, to, amount, data); @@ -827,12 +827,14 @@ abstract contract LSP7DigitalAssetInitAbstract is * @param from The sender address * @param to The recipient address * @param amount The amount of token to transfer + * @param force A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. * @param data The data sent alongside the transfer */ function _beforeTokenTransfer( address from, address to, uint256 amount, + bool force, bytes memory data // solhint-disable-next-line no-empty-blocks ) internal virtual {} @@ -843,12 +845,14 @@ abstract contract LSP7DigitalAssetInitAbstract is * @param from The sender address * @param to The recipient address * @param amount The amount of token to transfer + * @param force A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. * @param data The data sent alongside the transfer */ function _afterTokenTransfer( address from, address to, uint256 amount, + bool force, bytes memory data // solhint-disable-next-line no-empty-blocks ) internal virtual {}