Skip to content

Instantly share code, notes, and snippets.

@ezynda3
Created December 5, 2021 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezynda3/d626f1595db9689369389fb9bab97039 to your computer and use it in GitHub Desktop.
Save ezynda3/d626f1595db9689369389fb9bab97039 to your computer and use it in GitHub Desktop.
Deploy using CREATE2 proxy dapptools example
#!/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