From 8f9429516a45e7dc530e66e9ff8cb9ab4acd47ec Mon Sep 17 00:00:00 2001 From: Jamshed-KS <114004194+Jamshed-KS@users.noreply.github.com> Date: Tue, 18 Apr 2023 15:32:11 +0100 Subject: [PATCH 1/2] Update Web3BountyContract.sol KS-PLW-03 & KS-PLW-04 --- .../smart-contract/contracts/Web3BountyContract.sol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/protocols/web3storage-bounty/smart-contract/contracts/Web3BountyContract.sol b/protocols/web3storage-bounty/smart-contract/contracts/Web3BountyContract.sol index 8e1ef8b..b7a7f21 100644 --- a/protocols/web3storage-bounty/smart-contract/contracts/Web3BountyContract.sol +++ b/protocols/web3storage-bounty/smart-contract/contracts/Web3BountyContract.sol @@ -128,6 +128,8 @@ contract Web3BountyContract is Ownable, ReentrancyGuard { deals[_deal_id].owner == msg.sender, "Can't cancel someone else request" ); + + if (deals[_deal_id].value > 0) { // Send back payment bool success; @@ -185,7 +187,8 @@ contract Web3BountyContract is Ownable, ReentrancyGuard { require(deals[_deal_id].timestamp_start > 0, "Deal didn't started"); require(!deals[_deal_id].claimed, "Deal claimed yet"); require(deals[_deal_id].value > 0, "Deal doesn't have value to claim"); - + //KS-PLW-04 Dealer can claim bounty when deal is cancelled + require(!deals[_deal_id].cancelled, "Deal already cancelled"); // NOTE: // _proof is maintained for compatibility purposes // contract will not use it so we suggest to send it empty From b558c0fb1c2d50939caa61e5f12fc124044bd80a Mon Sep 17 00:00:00 2001 From: Jamshed-KS <114004194+Jamshed-KS@users.noreply.github.com> Date: Tue, 18 Apr 2023 15:43:31 +0100 Subject: [PATCH 2/2] Update Web3BountyContract.sol --- .../smart-contract/contracts/Web3BountyContract.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocols/web3storage-bounty/smart-contract/contracts/Web3BountyContract.sol b/protocols/web3storage-bounty/smart-contract/contracts/Web3BountyContract.sol index b7a7f21..d6eeeb2 100644 --- a/protocols/web3storage-bounty/smart-contract/contracts/Web3BountyContract.sol +++ b/protocols/web3storage-bounty/smart-contract/contracts/Web3BountyContract.sol @@ -187,8 +187,8 @@ contract Web3BountyContract is Ownable, ReentrancyGuard { require(deals[_deal_id].timestamp_start > 0, "Deal didn't started"); require(!deals[_deal_id].claimed, "Deal claimed yet"); require(deals[_deal_id].value > 0, "Deal doesn't have value to claim"); - //KS-PLW-04 Dealer can claim bounty when deal is cancelled - require(!deals[_deal_id].cancelled, "Deal already cancelled"); + //KS-PLW-04 Dealer can claim bounty when deal is canceled + require(!deals[_deal_id].canceled, "Deal already canceled"); // NOTE: // _proof is maintained for compatibility purposes // contract will not use it so we suggest to send it empty