Skip to content

Commit

Permalink
Add deployment stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenioclrc committed Feb 19, 2024
1 parent d6d131d commit 6de62db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,27 @@ contract HuffDeployScript is Script {

bytes32 constant MERKLE_ROOT = 0x51496785f4dd04d525b568df7fa6f1057799bc21f7e76c26ee77d2f569b40601;
string baseUrl = "ipfs://bafybeieqnhc5kxnaypnmypaga7r7oxbsh2bhac7ugrsk264yr3o5o7raxq/";
string contractURI = "ipfs://.../collection.json";
string contractURI = "https://buttplug-homepage.vercel.app/contract-metadata.json";

address constant owner = 0xC0FFEc688113B2C5f503dFEAF43548E73C7eCCB3;
bytes32 constant _saltDeploy = 0xeb732dab20d493614785447e7c20a4fb61eb3c8f9a34bbe8c54706ae559c32e1;

function run() public returns (address _huffplug) {
require(tx.origin == owner, "deployer should be 0xC0FFE");
vm.startBroadcast();

bytes32 _saltDeploy = 0xeb732dab20d493614785447e7c20a4fb61eb3c8f9a34bbe8c54706ae559c32e1;

uint256 timestamp = 1708108000;
bytes memory bytecode = bytes.concat(vm.compile(MERKLE_ROOT), abi.encode(owner));
// send owner to the constructor

_saltDeploy = 0xcfbbb05e4e07ccd909806657fd780c32d4c4c76931df8394e91d2aa76fc351d1;

(bool success, bytes memory ret) = CREATE2_FACTORY.call(bytes.concat(_saltDeploy, bytecode));
require(success, "deploy failed");
address deployedAddress;
assembly {
deployedAddress := mload(add(ret, 20))
}

// @todo on deploy require(address(huffplug) == deployedAddress, "deployed address mismatch");
require(0x0000420538CD5AbfBC7Db219B6A1d125f5892Ab0 == deployedAddress, "deployed address mismatch");
huffplug = IHuffplug(deployedAddress);

huffplug.setUri(baseUrl);
Expand Down
2 changes: 1 addition & 1 deletion test/Huffplug.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract ButtplugTest is Test {
address public owner = makeAddr("owner");

string baseUrl = "ipfs://bafybeieqnhc5kxnaypnmypaga7r7oxbsh2bhac7ugrsk264yr3o5o7raxq/";
string contractURI = "ipfs://contract/collection.json";
string contractURI = "https://buttplug-homepage.vercel.app/contract-metadata.json";

uint256 constant COLLECTION_START = 1708108000;
bytes32 constant MERKLE_HASH = 0x51496785f4dd04d525b568df7fa6f1057799bc21f7e76c26ee77d2f569b40601;
Expand Down

0 comments on commit 6de62db

Please sign in to comment.