Skip to content

Commit

Permalink
Add back removed salt key
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJem committed Jun 15, 2024
1 parent c318459 commit 44f167f
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions script/salts/test/TestSalts.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol";
import {MockCallback} from "test/callbacks/MockCallback.sol";
import {Callbacks} from "src/lib/Callbacks.sol";
import {CappedMerkleAllowlist} from "src/callbacks/allowlists/CappedMerkleAllowlist.sol";
import {AllocatedMerkleAllowlist} from "src/callbacks/allowlists/AllocatedMerkleAllowlist.sol";
import {UniswapV2DirectToLiquidity} from "src/callbacks/liquidity/UniswapV2DTL.sol";
import {UniswapV3DirectToLiquidity} from "src/callbacks/liquidity/UniswapV3DTL.sol";
// import {BaselineAxisLaunch} from "src/callbacks/liquidity/BaselineV2/BaselineAxisLaunch.sol";
Expand All @@ -26,6 +27,7 @@ import {TestConstants} from "test/Constants.sol";
contract TestSalts is Script, WithEnvironment, Permit2User, WithSalts, TestConstants {
string internal constant _MOCK_CALLBACK = "MockCallback";
string internal constant _CAPPED_MERKLE_ALLOWLIST = "CappedMerkleAllowlist";
string internal constant _ALLOCATED_MERKLE_ALLOWLIST = "AllocatedMerkleAllowlist";

function _setUp(string calldata chain_) internal {
_loadEnv(chain_);
Expand Down Expand Up @@ -411,6 +413,45 @@ contract TestSalts is Script, WithEnvironment, Permit2User, WithSalts, TestConst
_setTestSalt(bytecodePath, "90", _CAPPED_MERKLE_ALLOWLIST, bytecodeHash);
}

function generateAllocatedMerkleAllowlist() public {
// 10001000 = 0x88
bytes memory args = abi.encode(
_AUCTION_HOUSE,
Callbacks.Permissions({
onCreate: true,
onCancel: false,
onCurate: false,
onPurchase: false,
onBid: true,
onSettle: false,
receiveQuoteTokens: false,
sendBaseTokens: false
})
);
bytes memory contractCode = type(AllocatedMerkleAllowlist).creationCode;
(string memory bytecodePath, bytes32 bytecodeHash) =
_writeBytecode(_ALLOCATED_MERKLE_ALLOWLIST, contractCode, args);
_setTestSalt(bytecodePath, "88", _ALLOCATED_MERKLE_ALLOWLIST, bytecodeHash);

// 10010000 = 0x90
args = abi.encode(
_AUCTION_HOUSE,
Callbacks.Permissions({
onCreate: true,
onCancel: false,
onCurate: false,
onPurchase: true,
onBid: false,
onSettle: false,
receiveQuoteTokens: false,
sendBaseTokens: false
})
);
(bytecodePath, bytecodeHash) =
_writeBytecode(_ALLOCATED_MERKLE_ALLOWLIST, contractCode, args);
_setTestSalt(bytecodePath, "90", _ALLOCATED_MERKLE_ALLOWLIST, bytecodeHash);
}

function generateUniswapV2Router() public {
bytes memory args = abi.encode(_UNISWAP_V2_FACTORY, address(0));
bytes memory contractCode = type(UniswapV2Router02).creationCode;
Expand Down

0 comments on commit 44f167f

Please sign in to comment.