-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update soldeer dependencies always
- Loading branch information
Showing
10 changed files
with
140 additions
and
93 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"addresses": { | ||
"groupMessagesDeployer": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", | ||
"groupMessagesImpl": "0xE72B348bCA4DAAD3d8886342557d581B50Bf3971", | ||
"groupMessagesProxy": "0x21A21fa613917600e9dDE4441920562bB6238DaE", | ||
"groupMessagesImpl": "0xf8EE3BDE4408258b5f47316c6006FC08621E20Bb", | ||
"groupMessagesProxy": "0x658DC7259527383eCA195EA2D64F96eA0A13107A", | ||
"groupMessagesProxyAdmin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" | ||
}, | ||
"deploymentBlock": 639, | ||
"latestUpgradeBlock": 639 | ||
"deploymentBlock": 768, | ||
"latestUpgradeBlock": 768 | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"addresses": { | ||
"identityUpdatesDeployer": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", | ||
"identityUpdatesImpl": "0x3eEAEf0dddbda233651dc839591b992795Ba7168", | ||
"identityUpdatesProxy": "0x346422cF9c620668089453838EDD1a30F9b1A273", | ||
"identityUpdatesImpl": "0xd26c7386260388BdB17f8114741d9aEDB25d7417", | ||
"identityUpdatesProxy": "0xcE71367f311BC4cD3460b8Bfd0Bd66A19C0837D1", | ||
"identityUpdatesProxyAdmin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" | ||
}, | ||
"deploymentBlock": 641, | ||
"latestUpgradeBlock": 641 | ||
"deploymentBlock": 770, | ||
"latestUpgradeBlock": 770 | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,32 @@ | ||
#!/bin/bash | ||
# Deploy the smart contracts to the local anvil node | ||
set -euo pipefail | ||
|
||
# Make sure the build directory exists | ||
mkdir -p ./build | ||
############################################ | ||
# Work always from the contracts directory # | ||
############################################ | ||
export source_dir="${SOURCE_DIR:-src}" | ||
export build_dir="${BUILD_DIR:-build}" | ||
export output_dir="${OUTPUT_DIR:-pkg}" | ||
export localnet_dir="${LOCALNET_DIR:-config/anvil_localnet}" | ||
|
||
# Always work from the contracts directory | ||
script_dir=$(dirname "$(realpath "$0")") | ||
repo_root=$(realpath "${script_dir}/../") | ||
cd "${repo_root}" | ||
|
||
mkdir -p "${build_dir}" \ | ||
"${output_dir}" \ | ||
"${localnet_dir}" | ||
|
||
source dev/lib/env | ||
source dev/lib/common | ||
|
||
echo -e "⧖ Cleaning old artifacts" | ||
forge clean &> forge_clean.log | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: Failed to clean old artifacts" | ||
cat forge_clean.log | ||
exit 1 | ||
fi | ||
rm forge_clean.log | ||
echo -e "✔ Old artifacts cleaned successfully\n" | ||
|
||
echo -e "⧖ Updating dependencies" | ||
forge soldeer update &> forge_soldeer_update.log | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: Failed to update dependencies" | ||
cat forge_soldeer_update.log | ||
exit 1 | ||
fi | ||
rm forge_soldeer_update.log | ||
echo -e "✔ Dependencies updated successfully\n" | ||
|
||
echo -e "⧖ Building contracts" | ||
forge build &> forge_build.log | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: Failed to build contracts" | ||
cat forge_build.log | ||
exit 1 | ||
fi | ||
rm forge_build.log | ||
echo -e "✔ Contracts built successfully\n" | ||
|
||
echo -e "⧖ Running contract tests" | ||
forge test &> forge_test.log | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: Tests failed" | ||
cat forge_test.log | ||
exit 1 | ||
fi | ||
rm forge_test.log | ||
echo -e "✔ Tests passed successfully\n" | ||
|
||
############################################ | ||
# Deploy the smart contracts to ${RPC_URL} # | ||
############################################ | ||
forge_clean | ||
forge_soldeer_update | ||
forge_build_contracts | ||
forge_test_contracts | ||
forge_deploy_script group_messages | ||
forge_deploy_script identity_updates | ||
forge_deploy_script nodes src/Nodes.sol Nodes |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,103 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
function get_chain_id() { | ||
hex_chain_id=$(curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","id":1}' ${RPC_URL} | jq -r '.result') | ||
export chain_id=$((hex_chain_id)) | ||
} | ||
|
||
function forge_deploy_script() { | ||
get_chain_id | ||
case $1 in | ||
group_messages) | ||
echo "⧖ Deploying GroupMessages contract" | ||
forge script --quiet --rpc-url "${DOCKER_RPC_URL}" --broadcast script/DeployGroupMessages.s.sol | ||
echo "⧖ Deploying GroupMessages to chainId ${chain_id} using RPC ${RPC_URL}" | ||
forge script --quiet --rpc-url "${RPC_URL}" --broadcast script/DeployGroupMessages.s.sol | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to deploy group messages contract" | ||
exit 1 | ||
fi | ||
|
||
echo -e "✔ GroupMessages contract deployed. Deployment details in contracts/config/anvil_localnet/GroupMessages.json\n" | ||
echo -e "\033[32m✔\033[0m GroupMessages deployed. Deployment details in contracts/config/anvil_localnet/GroupMessages.json\n" | ||
;; | ||
|
||
identity_updates) | ||
echo "⧖ Deploying IdentityUpdates contract" | ||
forge script --quiet --rpc-url "${DOCKER_RPC_URL}" --broadcast script/DeployIdentityUpdates.s.sol | ||
echo "⧖ Deploying IdentityUpdates to chainId ${chain_id} using RPC ${RPC_URL}" | ||
forge script --quiet --rpc-url "${RPC_URL}" --broadcast script/DeployIdentityUpdates.s.sol | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to deploy identity updates contract" | ||
exit 1 | ||
fi | ||
|
||
echo -e "✔ IdentityUpdates contract deployed. Deployment details in contracts/config/anvil_localnet/IdentityUpdates.json\n" | ||
echo -e "\033[32m✔\033[0m IdentityUpdates deployed. Deployment details in contracts/config/anvil_localnet/IdentityUpdates.json\n" | ||
;; | ||
|
||
nodes) | ||
# TODO: Migrate to forge script | ||
echo "⧖ Deploying Nodes contract" | ||
forge create --broadcast --legacy --json --rpc-url $DOCKER_RPC_URL --private-key $PRIVATE_KEY "$2:$3" > ../build/$3.json | ||
echo -e "✔ Nodes contract deployed. Deployment details in contracts/config/anvil_localnet/$3.json\n" | ||
echo "⧖ Deploying Nodes to chainId ${chain_id} using RPC ${RPC_URL}" | ||
forge create --broadcast --legacy --json --rpc-url $RPC_URL --private-key $PRIVATE_KEY "$2:$3" > build/$3.json | ||
echo -e "\033[32m✔\033[0m Nodes deployed. Deployment details in contracts/build/$3.json\n" | ||
;; | ||
|
||
*) | ||
echo "Invalid option. Use 'group_messages' or 'identity_updates'." | ||
echo "Invalid option. Use 'group_messages', 'identity_updates' or 'nodes'." | ||
exit 1 | ||
;; | ||
esac | ||
} | ||
|
||
function forge_clean() { | ||
echo -e "⧖ Cleaning old artifacts" | ||
|
||
forge clean &> .forge_clean.tmp.log | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: Failed to clean old artifacts" | ||
cat .forge_clean.tmp.log | ||
exit 1 | ||
fi | ||
rm .forge_clean.tmp.log | ||
|
||
echo -e "\033[32m✔\033[0m Old artifacts cleaned successfully\n" | ||
} | ||
|
||
function forge_soldeer_update() { | ||
echo -e "⧖ Updating dependencies" | ||
|
||
forge soldeer update &> .forge_soldeer_update.tmp.log | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: Failed to update dependencies" | ||
cat .forge_soldeer_update.tmp.log | ||
exit 1 | ||
fi | ||
rm .forge_soldeer_update.tmp.log | ||
|
||
echo -e "\033[32m✔\033[0m Dependencies updated successfully\n" | ||
} | ||
|
||
function forge_build_contracts() { | ||
echo -e "⧖ Building contracts" | ||
|
||
forge build &> .forge_build.tmp.log | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: Failed to build contracts" | ||
cat .forge_build.tmp.log | ||
exit 1 | ||
fi | ||
rm .forge_build.tmp.log | ||
|
||
echo -e "\033[32m✔\033[0m Contracts built successfully\n" | ||
} | ||
|
||
function forge_test_contracts() { | ||
echo -e "⧖ Running contract tests" | ||
|
||
forge test &> .forge_test.tmp.log | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: Tests failed" | ||
cat .forge_test.tmp.log | ||
exit 1 | ||
fi | ||
rm .forge_test.tmp.log | ||
|
||
echo -e "\033[32m✔\033[0m Tests passed successfully\n" | ||
} | ||
|
This file contains 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
This file contains 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
This file contains 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