Verified contractExactMIT
HushDisabledBuyback
Address0xa8d4aa183400abfe7ff33d4a3c547adcfd280391
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.26
- Same code
3 more contracts
Details
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- cancun
- Via IR
- yes
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,422,695
- Creation transaction
- 0x8c13999c58…e60d948873
35 files
The source code is large: one file is shown at a time. Choose a file in the list.
- script/HushDeploy.s.solmain7.75 KB
- lib/forge-std/src/Base.sol2.25 KB
- lib/forge-std/src/Script.sol1.11 KB
- lib/forge-std/src/StdChains.sol16.05 KB
- lib/forge-std/src/StdCheats.sol39.15 KB
- lib/forge-std/src/StdConstants.sol1.88 KB
- lib/forge-std/src/StdJson.sol14.44 KB
- lib/forge-std/src/StdMath.sol2.94 KB
- lib/forge-std/src/StdStorage.sol24.6 KB
- lib/forge-std/src/StdStyle.sol17.51 KB
- lib/forge-std/src/StdUtils.sol11.98 KB
- lib/forge-std/src/Vm.sol156 KB
- lib/forge-std/src/console.sol71.04 KB
- lib/forge-std/src/console2.sol131 B
- lib/forge-std/src/interfaces/IMulticall3.sol2.14 KB
- lib/forge-std/src/safeconsole.sol408.93 KB
- src/HolderBurner.sol12.86 KB
- src/LaunchFactory.sol76.54 KB
- src/LaunchFeeHook.sol46.29 KB
- src/LaunchToken.sol2.92 KB
- src/LiquidityLocker.sol36.25 KB
- src/MntdBurnedLiquidityLocker.sol1.63 KB
- src/MntdEthRouter.sol8.58 KB
- src/MntdLaunchToken.sol1.9 KB
- src/PriceOracle.sol19.82 KB
- src/TokenScreener.sol28.07 KB
- src/interfaces/IERC20.sol880 B
- src/interfaces/IUniswapV4.sol10.19 KB
- src/libraries/AssetTransfer.sol2.78 KB
- src/libraries/BurnGuard.sol5.9 KB
- src/libraries/LiquidityAmounts.sol5.36 KB
- src/libraries/TickMath.sol9.9 KB
- src/nft/CollectionReserve.sol44.59 KB
- src/nft/FloorVault.sol8.84 KB
- src/nft/SeaportSource.sol4.25 KB
script/HushDeploy.s.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import {Script,console2} from "forge-std/Script.sol";
import {VmSafe} from "forge-std/Vm.sol";
import {LaunchFactory} from "../src/LaunchFactory.sol";
import {LaunchFeeHook,ILaunchRegistry} from "../src/LaunchFeeHook.sol";
import {MntdBurnedLiquidityLocker} from "../src/MntdBurnedLiquidityLocker.sol";
import {LiquidityLocker} from "../src/LiquidityLocker.sol";
import {TokenScreener} from "../src/TokenScreener.sol";
import {MntdLaunchToken} from "../src/MntdLaunchToken.sol";
import {MntdEthRouter} from "../src/MntdEthRouter.sol";
import {IPoolManagerV4,IPositionManagerV4,IPermit2,PoolKey,toId} from "../src/interfaces/IUniswapV4.sol";
/// @dev Disabled optional holder-buyback target. HUSH uses feesToHolders=false.
contract HushDisabledBuyback { fallback() external payable { revert("holder buybacks disabled"); } }
/// @notice HUSH launch-only unsigned preparation. Same reviewed token/hook/locker/router contracts as
/// MNTD minus the NFT treasury: the 2% hook tax routes 100% to the deployer (creator share 10000bps,
/// protocol treasury = deployer). All 15 buys are external reactive transactions after LaunchCreated.
/// run() requires real funding; rehearse() injects only fork funds and refuses broadcast/resume.
contract HushDeploy is Script {
address constant CREATE2=0x4e59b44847b379578588920cA78FbF26c0B4956C;
IPoolManagerV4 constant PM=IPoolManagerV4(0x000000000004444c5dc75cB358380D2e3dE08A90);
IPositionManagerV4 constant POSM=IPositionManagerV4(0xbD216513d74C8cf14cf4747E6AaA6420FF64ee9e);
IPermit2 constant PERMIT=IPermit2(0x000000000022D473030F116dDEE9F6B43aC78BA3);
uint256 constant SUPPLY=1_000_000_000 ether;
uint256 constant DEPLOYER_FUNDING=0.04 ether;
// 1e9 * 1.0001^-203200 = 1.49823 ETH opening market cap (tick spacing 200).
int24 constant OPENING_TICK=-203200;
function run() external { _run(); }
function rehearse() external {
require(vm.isContext(VmSafe.ForgeContext.ScriptDryRun),"rehearsal cannot broadcast or resume");
vm.deal(_owner(),DEPLOYER_FUNDING);
_run();
}
function _owner() internal view returns(address) {
return vm.parseJsonAddress(vm.readFile(_walletsFile()),".wallets[0].address");
}
// Overridable only so the synthetic-key fork test never touches the real manifest/plan.
function _walletsFile() internal view returns(string memory) {
return vm.envOr("HUSH_WALLETS",string("script/data/hush-wallets.public.json"));
}
function _run() internal {
require(block.chainid==1,"Ethereum only");
string memory wallets=vm.readFile(_walletsFile());
address owner=vm.parseJsonAddress(wallets,".wallets[0].address");
require(keccak256(bytes(vm.parseJsonString(wallets,".wallets[0].role")))==keccak256("deployer"),"wrong wallet manifest");
address keeper=vm.parseJsonAddress(wallets,".wallets[19].address");
require(keccak256(bytes(vm.parseJsonString(wallets,".wallets[19].role")))==keccak256("keeper"),"wrong keeper slot");
string memory uri=vm.envString("HUSH_METADATA_URI");
require(bytes(uri).length>8&&keccak256(bytes(vm.split(uri,":")[0]))==keccak256("https"),"https metadata URI required");
require(owner.balance>=DEPLOYER_FUNDING,"deployer funding envelope not present");
require(vm.getNonce(owner)==0,"fresh deployer nonce required; regenerate plan");
require(CREATE2.code.length!=0&&address(PM).code.length!=0,"missing venue");
vm.startBroadcast(owner);
TokenScreener screener=new TokenScreener();
HushDisabledBuyback disabledBuyback=new HushDisabledBuyback();
bytes memory hookCode=abi.encodePacked(type(LaunchFeeHook).creationCode,abi.encode(PM,owner));
bytes32 hash=keccak256(hookCode);
bytes32 hs;
address hookAddress;
for(uint256 i;;++i){
hs=keccak256(abi.encode(owner,"HUSH-HOOK",i));
hookAddress=address(uint160(uint256(keccak256(abi.encodePacked(bytes1(0xff),CREATE2,hs,hash)))));
if(uint160(hookAddress)&0x3fff==0xcc&&hookAddress.code.length==0)break;
}
(bool ok,)=CREATE2.call(abi.encodePacked(hs,hookCode));
require(ok&&hookAddress.code.length>0,"CREATE2 hook deployment failed");
LaunchFeeHook hook=LaunchFeeHook(payable(hookAddress));
address expectedFactory=vm.computeCreateAddress(owner,vm.getNonce(owner)+1);
// Treasury = deployer and creator share 10000bps: the whole tax goes to the deployer.
LiquidityLocker locker=new MntdBurnedLiquidityLocker(POSM,PM,expectedFactory,owner,10000,address(disabledBuyback),hookAddress);
LaunchFactory factory=new LaunchFactory(PM,POSM,PERMIT,hookAddress,
LaunchFactory.Config(0.0005 ether,false,owner,address(locker),address(screener)),owner);
require(address(factory)==expectedFactory,"factory nonce moved");
hook.wire(ILaunchRegistry(address(factory)),address(locker));
factory.setQuoteConfig(address(0),LaunchFactory.QuoteConfig(true,OPENING_TICK,"native"));
bytes memory tokenCode=abi.encodePacked(type(MntdLaunchToken).creationCode,
abi.encode("Hush","HUSH",SUPPLY,uri,owner,address(PM)));
bytes32 tokenSalt=keccak256("HUSH-LAUNCH-v1");
bytes32 scoped=keccak256(abi.encode(keccak256(abi.encode(owner,tokenSalt)),uint256(0)));
address expectedToken=address(uint160(uint256(keccak256(abi.encodePacked(bytes1(0xff),address(factory),scoped,keccak256(tokenCode))))));
MntdEthRouter router=new MntdEthRouter(PM,POSM,PERMIT,expectedToken,hookAddress);
PoolKey memory key=PoolKey(address(0),expectedToken,0,200,hookAddress);
hook.setFeeOverride(toId(key),200);
LaunchFactory.LaunchParams memory p=LaunchFactory.LaunchParams("Hush","HUSH",uri,address(0),0,0,0,false);
(address token,)=factory.launchFromSource{value:0.0005 ether}(tokenCode,tokenSalt,p);
require(token==expectedToken,"token address moved; stop and regenerate trigger");
require(MntdLaunchToken(token).creator()==owner,"wrong limit-removal authority");
require(hook.partnerOf(token)==address(0),"principal mirror must be off");
(uint256 initialPositionId,,,,)=locker.positionAt(token,0);
require(POSM.ownerOf(initialPositionId)==address(0xdead),"initial LP not burned");
require(POSM.getPositionLiquidity(initialPositionId)>0,"initial LP removed");
vm.stopBroadcast();
string memory obj="hush-plan";
vm.serializeAddress(obj,"deployer",owner);
vm.serializeAddress(obj,"keeper",keeper);
vm.serializeAddress(obj,"treasury",owner);
vm.serializeAddress(obj,"hook",hookAddress);
vm.serializeBytes32(obj,"hookSalt",hs);
vm.serializeAddress(obj,"factory",address(factory));
vm.serializeAddress(obj,"locker",address(locker));
vm.serializeAddress(obj,"router",address(router));
vm.serializeAddress(obj,"token",token);
vm.serializeString(obj,"metadataURI",uri);
vm.serializeInt(obj,"openingTick",OPENING_TICK);
vm.serializeUint(obj,"initialPositionId",initialPositionId);
vm.serializeAddress(obj,"initialPositionOwner",address(0xdead));
vm.serializeUint(obj,"initialBuyWei",0);
vm.serializeUint(obj,"sourceBlock",block.number);
string memory output=vm.serializeBool(obj,"simulation",vm.isContext(VmSafe.ForgeContext.ScriptDryRun));
vm.writeJson(output,vm.envOr("HUSH_PLAN_OUT",string("script/data/hush-deployment-plan.json")));
console2.log("HUSH token",token);console2.log("router",address(router));console2.log("hook",hookAddress);
}
}
Compiler settingsShow
{
"viaIR": true,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "cancun",
"remappings": [
"forge-std/=lib/forge-std/src/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.