Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contracts/Unicrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ contract Unicrow is ReentrancyGuard, IUnicrow, Context {
// Get current escrow id from the incremental counter
uint256 escrowId = escrowIdCounter.current();

// If the buyer was set to zero address in the input, set buyer to msg.sender
address buyer = input.buyer == address(0) ? msg.sender : input.buyer;
// Ensure a buyer address was set
address buyer = input.buyer;

// Amount of the payment in ERC20 tokens
uint amount = input.amount;
Expand Down Expand Up @@ -154,7 +154,7 @@ contract Unicrow is ReentrancyGuard, IUnicrow, Context {
// If the payment was made in ERC20 and not ETH, execute the transfer
SafeERC20.safeTransferFrom(
IERC20(input.currency),
msg.sender,
buyer,
address(this),
amount
);
Expand Down
2 changes: 1 addition & 1 deletion contracts/UnicrowTypes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct Escrow {

/// @dev Escrow parameters to be sent along with the deposit
struct EscrowInput {
/// @dev who's the buyer, i.e. who can release the payment or whom should a refund be sent to. Normally this would be msg.sender but if Unicrow.pay() is called is called via another contract it should be set explicitly to user's EOA. If set to address(0), it defaults to msg.sender
/// @dev who's the buyer, i.e. who can release the payment or whom should a refund be sent to. It should be set explicitly to user's EOA in case Unicrow.pay() is called via another contract
address buyer;

/// @dev who should receive the payment
Expand Down