Skip to content

Commit

Permalink
fix(token-escrow): prevent re-entrency
Browse files Browse the repository at this point in the history
  • Loading branch information
n1c01a5 committed Jan 21, 2019
1 parent 20b52f1 commit 01454a2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* NOTE: All functions that interact with the ERC20 token contract as UNTRUSTED.
*/

pragma solidity ^0.4.18;
pragma solidity ^0.4.24;

import "./Arbitrator.sol";

Expand Down Expand Up @@ -218,10 +218,10 @@ contract MultipleArbitrableTokenTransaction {
*/
function payArbitrationFeeByBuyer(uint _transactionID) public payable {
Transaction storage transaction = transactions[_transactionID];
uint arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);
require(transaction.status < Status.DisputeCreated, "Dispute has already been created.");
require(msg.sender == transaction.buyer, "The caller must be the buyer.");

uint arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);
transaction.buyerFee += msg.value;
// Require that the total paid to be at least the arbitration cost.
require(transaction.buyerFee >= arbitrationCost, "The buyer fee must cover arbitration costs.");
Expand All @@ -243,10 +243,10 @@ contract MultipleArbitrableTokenTransaction {
*/
function payArbitrationFeeBySeller(uint _transactionID) public payable {
Transaction storage transaction = transactions[_transactionID];
uint arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);
require(transaction.status < Status.DisputeCreated, "Dispute has already been created.");
require(msg.sender == transaction.seller, "The caller must be the seller.");

uint arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);
transaction.sellerFee += msg.value;
// Require that the total paid to be at least the arbitration cost.
require(transaction.sellerFee >= arbitrationCost, "The seller fee must cover arbitration costs.");
Expand Down

0 comments on commit 01454a2

Please sign in to comment.