forked from Consensys/gpact
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenWrappers.sh
60 lines (43 loc) · 4.03 KB
/
genWrappers.sh
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
#!/usr/bin/env bash
#
# This script re-generates the Solidity wrappers in the directory:
# ./services/relayer/internal/contracts
#
# Follow the steps here to install solc and abigen:
# https://goethereumbook.org/smart-contract-compile/
# or use the script genWrappersInstallAbiGen.sh
#
set -e
#rm -rf build
HERE=./services/relayer
BUILDDIR=$HERE/build
CONTRACTSDIR=$HERE/../../contracts/contracts/src
GOFILE_OUTPUTDIR=$HERE/../../services/relayer/internal/contracts
GOFILE_APPLICATION=$GOFILE_OUTPUTDIR/application
GOFILE_FUNCTIONCALL=$GOFILE_OUTPUTDIR/functioncall
GOFILE_MESSAGING=$GOFILE_OUTPUTDIR/messaging
ABIGEN=~/go/bin/abigen
solc $CONTRACTSDIR/openzeppelin/token/ERC20/presets/ERC20PresetFixedSupply.sol --bin --abi --optimize -o $BUILDDIR --overwrite
$ABIGEN --abi $BUILDDIR/ERC20PresetFixedSupply.abi --bin $BUILDDIR/ERC20PresetFixedSupply.bin --pkg application --type ERC20FixedSupply --out $GOFILE_APPLICATION/erc20_fixed_supply.go
solc $CONTRACTSDIR/openzeppelin/token/ERC20/presets/ERC20PresetMinterPauser.sol --bin --abi --optimize -o $BUILDDIR --overwrite
$ABIGEN --abi $BUILDDIR/ERC20PresetMinterPauser.abi --bin $BUILDDIR/ERC20PresetMinterPauser.bin --pkg application --type ERC20MinterPauser --out $GOFILE_APPLICATION/erc20_minter_pauser.go
solc ./applications/gpact/erc20bridge/contracts/src/GpactERC20Bridge.sol --bin --abi --optimize -o $BUILDDIR --overwrite
$ABIGEN --abi $BUILDDIR/GpactERC20Bridge.abi --bin $BUILDDIR/GpactERC20Bridge.bin --pkg application --type GpactERC20Bridge --out $GOFILE_APPLICATION/gpact_erc20_bridge.go
solc ./applications/gpact/erc20bridge/contracts/src/presets/LockableERC20PresetFixedSupply.sol --bin --abi --optimize -o $BUILDDIR --overwrite
$ABIGEN --abi $BUILDDIR/LockableERC20PresetFixedSupply.abi --bin $BUILDDIR/LockableERC20PresetFixedSupply.bin --pkg application --type LockableERC20FixedSupply --out $GOFILE_APPLICATION/lockable_erc20_fixed_supply.go
solc ./examples/gpact/hotel-train/contracts/src/Hotel.sol --bin --abi --optimize -o $BUILDDIR --overwrite
$ABIGEN --abi $BUILDDIR/Hotel.abi --bin $BUILDDIR/Hotel.bin --pkg application --type Hotel --out $GOFILE_APPLICATION/hotel.go
solc ./examples/gpact/hotel-train/contracts/src/TravelAgency.sol --bin --abi --optimize -o $BUILDDIR --overwrite
$ABIGEN --abi $BUILDDIR/TravelAgency.abi --bin $BUILDDIR/TravelAgency.bin --pkg application --type TravelAgency --out $GOFILE_APPLICATION/travel_agency.go
solc ./applications/sfc/erc20bridge/contracts/src/SfcErc20Bridge.sol --bin --abi --optimize -o $BUILDDIR --overwrite
$ABIGEN --abi $BUILDDIR/SfcErc20Bridge.abi --bin $BUILDDIR/SfcErc20Bridge.bin --pkg application --type SfcERC20Bridge --out $GOFILE_APPLICATION/sfc_erc20_bridge.go
solc $CONTRACTSDIR/functioncall/gpact/GpactCrosschainControl.sol --bin --abi --optimize -o $BUILDDIR --overwrite
$ABIGEN --abi $BUILDDIR/GpactCrosschainControl.abi --bin $BUILDDIR/GpactCrosschainControl.bin --pkg functioncall --type Gpact --out $GOFILE_FUNCTIONCALL/gpact.go
solc $CONTRACTSDIR/functioncall/sfc/SimpleCrosschainControl.sol --bin --abi --optimize -o $BUILDDIR --overwrite
$ABIGEN --abi $BUILDDIR/SimpleCrosschainControl.abi --bin $BUILDDIR/SimpleCrosschainControl.bin --pkg functioncall --type Sfc --out $GOFILE_FUNCTIONCALL/sfc.go
solc $CONTRACTSDIR/messaging/eventattest/EventAttestationVerifier.sol --bin --abi --optimize -o $BUILDDIR --overwrite
$ABIGEN --abi $BUILDDIR/EventAttestationVerifier.abi --bin $BUILDDIR/EventAttestationVerifier.bin --pkg messaging --type EventAttestationVerifier --out $GOFILE_MESSAGING/event_attestation_verifier.go
solc $CONTRACTSDIR/messaging/common/MessagingRegistrar.sol --bin --abi --optimize -o $BUILDDIR --overwrite
$ABIGEN --abi $BUILDDIR/MessagingRegistrar.abi --bin $BUILDDIR/MessagingRegistrar.bin --pkg messaging --type Registrar --out $GOFILE_MESSAGING/registrar.go
solc $CONTRACTSDIR/messaging/eventrelay/EventRelayVerifier.sol --bin --abi --optimize -o $BUILDDIR --overwrite
$ABIGEN --abi $BUILDDIR/EventRelayVerifier.abi --bin $BUILDDIR/EventRelayVerifier.bin --pkg messaging --type SignedEventStore --out $GOFILE_MESSAGING/signed_event_store.go