Navigate to directory: script/network
./create_keystore.sh <keystore_name> [private_key]For example:
# create by private key
./create_keystore.sh test_account 0x...
or
# create a new one
./create_keystore.sh test_accountAfter executing this command, you will be prompted to enter a password to encrypt the keystore file. Remember this password as you will need to enter it during deployment.
The keystore file will be saved in the ~/.foundry/keystores/ directory.
Navigate to script/network/<network> and update the .account file accordingly.
KEYSTORE_ACCOUNT=<keystore_name>
ACCOUNT_ADDRESS=<sender_address>for example:
KEYSTORE_ACCOUNT=test_account
ACCOUNT_ADDRESS=0x...Now you can use the regular deployment commands to deploy:
Navigate to directory: script/deploy
source 00_init.sh <network>
source 01_deploy_weth.sh
source 02_deploy_uniswapV2Factory.sh
source 0301_deploy_LOVE20_StepByStep.sh
source 0302_initialize_LOVE20_StepByStep.sh
source 0303_verify_LOVE20_StepByStep.shAll deployed contract addresses can be found in script/network/<network>/address.params.
Check if the contract initialization parameters are abnormal
Navigate to directory: script/cast
source 000_init.sh <network>
source 999_check.sh# get private key
cast wallet decrypt-keystore ~/.foundry/keystores/test_account | grep -o '0x[a-fA-F0-9]\{64\}'
# get account address
cast wallet address $(cast wallet decrypt-keystore ~/.foundry/keystores/test_account | grep -o '0x[a-fA-F0-9]\{64\}')