Created
December 5, 2021 11:34
-
-
Save ezynda3/d626f1595db9689369389fb9bab97039 to your computer and use it in GitHub Desktop.
Deploy using CREATE2 proxy dapptools example
This file contains hidden or 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
#!/bin/sh | |
FACTORY_ADDRESS="0x4e59b44847b379578588920ca78fbf26c0b4956c" | |
SALT=$(seth --to-bytes32 $(seth --to-hex 2121)) | |
BYTECODE=$(jq -r ".contracts[\"src/Nftrade.sol\"].Nftrade.evm.bytecode.object" out/dapp.sol.json) | |
ARGS=$(seth abi-encode "constructor(address)" $ETH_FROM | cut -c 3-) | |
CONTRACT_ADDRESS=$(seth call $FACTORY_ADDRESS "$SALT$BYTECODE$ARGS") | |
seth send $FACTORY_ADDRESS $SALT$BYTECODE$ARGS --gas 1100000 | |
echo "Deployed to address: $CONTRACT_ADDRESS" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment