-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakeWeb3ContractsForPurs.sh
More file actions
executable file
·60 lines (43 loc) · 1.26 KB
/
makeWeb3ContractsForPurs.sh
File metadata and controls
executable file
·60 lines (43 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
set -e
STATUS='\033[42;30;21m'
NC='\033[0m' # No Color
log(){
echo -e "${STATUS}$1${NC}"
}
log "Cloning sv-light-contracts for ABIs"
mkdir -p _autogen/sv-light-contracts
cd _autogen/sv-light-contracts
if [ -e .git ]; then
git stash && git pull origin master
else
git clone https://github.com/secure-vote/sv-light-smart-contracts . --depth=10
fi
yarn compile-sv-light
cd ../..
rm -rf ./tmpSolDist
mkdir -p tmpSolDist
log "Coping ABIs to tmp directory for processing"
copySolFile(){
file=$(echo "$1" | sed "s/\.abi$//g").abi
echo "copying $file"
cp "./_autogen/sv-light-contracts/_solDist/$file" "./tmpSolDist/$(basename "$file" .abi).json"
}
copySolFile ENSIface
copySolFile PublicResolver
copySolFile BBFarm
# copySolFile SVDelegation
copySolFile SVDelegationV0101
copySolFile FakeErc20
copySolFile SVIndex
copySolFile SVIndexBackend
copySolFile SVPayments
rm ./src/SecureVote/Contracts/* || true
log "Running web3 generator"
# pulp run -m Generator --src-path pureWeb3Gen -- --abis tmpSolDist/ --dest src --module SecureVote.Contracts
pulp build -m Generator --src-path pureWeb3Gen --to generator.js
node generator.js --abis tmpSolDist/ --dest src --module SecureVote.Contracts
log "Cleaning up"
rm generator.js
rm -r tmpSolDist
log "Done"