0

There is an escrow smart contact which at the end needs to send the escrow balance back to both seller and buyer. Here is the contract (without all the details)

pragme ^0.7.0;

interface ERC20Token {...};

contract MyEscrow { address payable seller; address payable buyer; uint256 sellerRefund; uint256 buyerRefund; address addressToken;

function depositEscrow(uint256 _amount) external returns (bool) { ERC20Token(addressToken).transferFrom(msg.sender, address(this), _amount); //<<==msg.sender approved before calling depositEscrow() //do something else }

function refundEscrow() sellerOnly external returns (bool) { ERC20Token(addressToken).transfer(seller, sellerRefund); ERC20Token(addressToken).transfer(buyer, buyerRefund); //do something }

}

Before putting the code into test, is the refundEscrow going to work as expected? Here is the example online which only sends refund to msg.sender. In the code above, the difference is that refund is sent to 2 recipients instead.

user938363
  • 669
  • 1
  • 6
  • 23

0 Answers0