Skip to content

Commit

Permalink
fix: adding expirationBlock to fulfillForDeleaget on Transfer cond.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaitor committed Aug 11, 2023
1 parent a07d1b3 commit 7b77052
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions contracts/conditions/NFTs/TransferNFTCondition.sol
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ contract TransferNFTCondition is Condition, ITransferNFT, ReentrancyGuardUpgrade
* @param _lockCondition lock condition identifier
* @param _nftContractAddress NFT contract to use
* @param _transfer Indicates if the NFT will be transferred (true) or minted (false)
* @param _expirationBlock Block in which the token expires. If zero means no expiration
* @return bytes32 hash of all these values
*/
function hashValues(
Expand Down Expand Up @@ -185,6 +186,7 @@ contract TransferNFTCondition is Condition, ITransferNFT, ReentrancyGuardUpgrade
* @param _lockPaymentCondition lock payment condition identifier
* @param _nftContractAddress the NFT contract to use
* @param _transfer if yes it does a transfer if false it mints the NFT
* @param _expirationBlock Block in which the token expires. If zero means no expiration
* @return the encoded parameters
*/
function encodeParams(
Expand Down Expand Up @@ -273,7 +275,7 @@ contract TransferNFTCondition is Condition, ITransferNFT, ReentrancyGuardUpgrade
* @param _lockPaymentCondition lock payment condition identifier
* @param _nftContractAddress NFT contract to use
* @param _transfer Indicates if the NFT will be transferred (true) or minted (false)
* @param _expirationBlock expiration of subscription
* @param _expirationBlock Block in which the token expires. If zero means no expiration
* @return condition state (Fulfilled/Aborted)
*/
function fulfill(
Expand Down Expand Up @@ -378,7 +380,7 @@ contract TransferNFTCondition is Condition, ITransferNFT, ReentrancyGuardUpgrade

returns (ConditionStoreLibrary.ConditionState)
{
return fulfillForDelegate(_agreementId, _did, _nftHolder, _nftReceiver, _nftAmount, _lockPaymentCondition, address(erc1155), _transfer);
return fulfillForDelegate(_agreementId, _did, _nftHolder, _nftReceiver, _nftAmount, _lockPaymentCondition, address(erc1155), _transfer, 0);
}


Expand All @@ -395,6 +397,7 @@ contract TransferNFTCondition is Condition, ITransferNFT, ReentrancyGuardUpgrade
* @param _nftHolder is the address of the account to receive the NFT
* @param _nftContractAddress the address of the ERC-1155 NFT contract
* @param _transfer if yes it does a transfer if false it mints the NFT
* @param _expirationBlock Block in which the token expires. If zero means no expiration
* @return condition state (Fulfilled/Aborted)
*/
function fulfillForDelegate(
Expand All @@ -405,7 +408,8 @@ contract TransferNFTCondition is Condition, ITransferNFT, ReentrancyGuardUpgrade
uint256 _nftAmount,
bytes32 _lockPaymentCondition,
address _nftContractAddress,
bool _transfer
bool _transfer,
uint256 _expirationBlock
)
public

Expand All @@ -415,7 +419,7 @@ contract TransferNFTCondition is Condition, ITransferNFT, ReentrancyGuardUpgrade
|| NFT1155Upgradeable(_nftContractAddress).isApprovedForAll(_nftHolder, _msgSender())
|| didRegistry.isDIDProviderOrOwner(_did, _msgSender())
, 'Only Market role or approvedForAll');
return fulfillInternal(_nftHolder, _agreementId, _did, _nftReceiver, _nftAmount, _lockPaymentCondition, _nftContractAddress, _transfer, 0);
return fulfillInternal(_nftHolder, _agreementId, _did, _nftReceiver, _nftAmount, _lockPaymentCondition, _nftContractAddress, _transfer, _expirationBlock);
}

function _msgSender() internal override(CommonOwnable,ContextUpgradeable) virtual view returns (address ret) {
Expand Down

0 comments on commit 7b77052

Please sign in to comment.