Skip to content

Commit

Permalink
Merge pull request #70 from flood-protocol/revert-58-issue-32
Browse files Browse the repository at this point in the history
Revert "fix(contracts): move returndatacopy"
  • Loading branch information
fulminmaxi authored Jul 10, 2023
2 parents a54d666 + cf6e4bb commit 99b6a04
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/fulfiller/Fulfiller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,11 @@ contract Fulfiller is IFulfiller, IFulfillerWithCallback, Ownable2Step, Pausable
// Delegate swap execution to the executor.
let result := delegatecall(gas(), executor, add(swapData, 0x20), mload(swapData), 0, 0)

// Copy the returned data.
returndatacopy(0, 0, returndatasize())

if iszero(result) { revert(0, returndatasize()) }
if iszero(result) {
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
revert(0, returndatasize())
}
}

// If executor had a callback...
Expand Down Expand Up @@ -339,13 +340,12 @@ contract Fulfiller is IFulfiller, IFulfillerWithCallback, Ownable2Step, Pausable
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), executor, 0, calldatasize(), 0, 0)

// Copy the returned data.
returndatacopy(0, 0, returndatasize())

switch result
// delegatecall returns 0 on error.
case 0 {
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
revert(0, returndatasize())
}
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
Expand Down

0 comments on commit 99b6a04

Please sign in to comment.