From 0a1642ffe368b5c042432312f0a0a036aee9a6a6 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Tue, 26 Sep 2023 15:17:08 +0100 Subject: [PATCH] chore: markdown generation for upgradable contracts --- contracts/scripts/generateDeploymentsMarkdown.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/contracts/scripts/generateDeploymentsMarkdown.sh b/contracts/scripts/generateDeploymentsMarkdown.sh index e26b978db..7c73b0217 100755 --- a/contracts/scripts/generateDeploymentsMarkdown.sh +++ b/contracts/scripts/generateDeploymentsMarkdown.sh @@ -5,10 +5,16 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" function generate() { #deploymentDir #explorerUrl deploymentDir=$1 explorerUrl=$2 - for f in $(ls -1 $deploymentDir/*.json 2>/dev/null | grep -v "PNK.json\|MetaEvidence_*\|CREATE3Factory.json" | sort); do + for f in $(ls -1 $deploymentDir/*.json 2>/dev/null | grep -v "PNK.json\|MetaEvidence_*\|CREATE3Factory.json\|_Proxy.json\|_Implementation.json" | sort); do contractName=$(basename $f .json) address=$(cat $f | jq -r .address) - echo "- [$contractName]($explorerUrl$address)" + implementation=$(cat $f | jq -r .implementation) + + if [ "$implementation" != "null" ]; then + echo "- [$contractName: proxy]($explorerUrl$address), [implementation]($explorerUrl$implementation)" + else + echo "- [$contractName]($explorerUrl$address)" + fi done }