-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
49 additions
and
10 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
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,20 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {Test} from 'forge-std/Test.sol'; | ||
|
||
contract MockHelper is Test { | ||
function deployMock( | ||
string memory _label, | ||
bytes memory _creationCode, | ||
bytes memory _encodedArgs | ||
) internal returns (address _deployed) { | ||
bytes memory _bytecode = abi.encodePacked(_creationCode, _encodedArgs); | ||
assembly { | ||
mstore(0x0, _creationCode) | ||
_deployed := create2(0, add(_bytecode, 0x20), mload(_bytecode), 'Wonderland') | ||
} | ||
vm.label(_deployed, _label); | ||
vm.allowCheatcodes(_deployed); | ||
} | ||
} |
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