Skip to content

Commit

Permalink
Merge branch 'feat/scratch-holesky' of github.com:lidofinance/lido-da…
Browse files Browse the repository at this point in the history
…o into feat/scratch-holesky
  • Loading branch information
krogla committed Oct 4, 2023
2 parents d6972bd + 1777131 commit 1940033
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions scripts/scratch/verify-contracts-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ if [[ -z "$NETWORK" ]]; then
exit 1
fi

function jsonGet {
node -e "const fs = require('fs'); const obj = JSON.parse(fs.readFileSync('deployed-${NETWORK}.json', 'utf8')); const path='$1'; let res = path.split('.').reduce(function(o, k) {return o && o[k] }, obj); console.log(res)"
}
NETWORK_STATE_FILE="deployed-${NETWORK}.json"
if [ ! -f $NETWORK_STATE_FILE ]; then
echo "Cannot find network state file ${NETWORK_STATE_FILE}"
exit 1
fi
echo "Using network state file ${NETWORK_STATE_FILE}"

function jsonGetArray {
node -e "const fs = require('fs'); const obj = JSON.parse(fs.readFileSync('deployed-${NETWORK}.json', 'utf8')); const path='$1'; let res = path.split('.').reduce(function(o, k) {return o && o[k] }, obj); console.log(res.join(' '))"
function jsonGet {
node -e "const fs = require('fs'); const obj = JSON.parse(fs.readFileSync('${NETWORK_STATE_FILE}', 'utf8')); const path='$1'; let res = path.split('.').reduce(function(o, k) {return o && o[k] }, obj); console.log(res)"
}

function verify {
contractPath="$(jsonGet ${1}.contract)"
contractName="${contractPath##*/}"
contractName="${contractName%.*}"
echo "module.exports = $(jsonGet ${1}.constructorArgs)" > contract-args.js
argsJson=$(jsonGet ${1}.constructorArgs)
echo "module.exports = $argsJson" > contract-args.js
yarn hardhat --network $NETWORK verify --no-compile --contract "$contractPath:$contractName" --constructor-args contract-args.js $(jsonGet ${1}.address)
}

Expand Down Expand Up @@ -55,10 +59,14 @@ function verify {

# verify withdrawalQueueERC721.implementation

# ^ verified up to here

verify app:lido.proxy

# TODO: fix this verifications
verify ldo
# verify ldo
# verify app:simple-dvt.proxy
# verify app:aragon-token-manager.proxy
# verify app:lido.proxy
# verify app:oracle.proxy
# verify app:node-operators-registry.proxy
# verify app:aragon-voting.proxy
Expand Down

0 comments on commit 1940033

Please sign in to comment.