arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
hermez-node/eth/contracts/update.sh
eth/contracts/update.shRaw
 1#!/bin/sh
 2
 3set -e
 4
 5gen() {
 6    local name=$1
 7    local pkg=$2
 8    local folder=$3
 9    if [ -z "$3" ]; then
10        folder=$name
11    fi
12
13    jq .abi "${CONTRACTS}/artifacts/${pkg}.json" > /tmp/${name}.abi
14    abigen --abi /tmp/${name}.abi --pkg=${pkg} --out=${folder}/${pkg}.go
15}
16
17if [ "$1" = "" ]; then
18    echo "Usage: $0 CONTRACTS_REPO_PATH"
19    exit 1
20fi
21
22CONTRACTS="$1"
23
24gen hermez Hermez
25gen auction HermezAuctionProtocol
26gen withdrawdelayer WithdrawalDelayer
27gen HEZ HEZ tokenHEZ