-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(Adapter): add ReentrancyGuard to
settle()
- Loading branch information
Showing
3 changed files
with
74 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {Adapter} from "../Adapter.sol"; | ||
import {IPAM} from "../interfaces/IPAM.sol"; | ||
import {IAdapter} from "../interfaces/IAdapter.sol"; | ||
import {IPReceiver} from "../interfaces/IPReceiver.sol"; | ||
|
||
contract DataReceiverReentrancy is IPReceiver { | ||
event DataReceived(bytes userdata); | ||
function receiveUserData(bytes calldata userdata) external { | ||
( | ||
IAdapter.Operation memory operation, | ||
IPAM.Metadata memory metadata | ||
) = abi.decode(userdata, (IAdapter.Operation, IPAM.Metadata)); | ||
|
||
Adapter(msg.sender).settle(operation, metadata); | ||
|
||
emit DataReceived(userdata); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters