File tree 2 files changed +38
-0
lines changed
2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,21 @@ Performs a move to either attack or defend the latest claim in the specified gam
78
78
These arguments must specify a way for ` cast ` to sign the transactions.
79
79
See ` cast send --help ` for supported options.
80
80
81
+ ### [ resolve.sh] ( scripts/resolve.sh )
82
+
83
+ ``` shell
84
+ ./scripts/resolve.sh < RPC_URL> < GAME_ADDRESS> < SIGNER_ARGS> ...
85
+ ```
86
+
87
+ Resolves a dispute game. Note that this will fail if the dispute game has already been resolved
88
+ or if the clocks have not yet expired and further moves are possible.
89
+ If the game is resolved successfully, the result is printed.
90
+
91
+ * ` RPC_URL ` - the RPC endpoint of the L1 endpoint to use (e.g. ` http://localhost:8545 ` ).
92
+ * ` GAME_ADDRESS ` - the address of the dispute game to resolve.
93
+ * ` SIGNER_ARGS ` the remaining args are past as arguments to ` cast ` when sending transactions.
94
+ These arguments must specify a way for ` cast ` to sign the transactions.
95
+ See ` cast send --help ` for supported options.
81
96
82
97
### [ list_claims.sh] ( scripts/list_claims.sh )
83
98
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -euo pipefail
3
+
4
+ RPC=${1:? Must specify RPC URL}
5
+ GAME_ADDR=${2:? Must specify game address}
6
+ SIGNER_ARGS=" ${@: 3} "
7
+
8
+ # Perform the move.
9
+ RESULT_DATA=$( cast send --rpc-url " ${RPC} " ${SIGNER_ARGS} " ${GAME_ADDR} " " resolve()" --json)
10
+ RESULT=$( echo " ${RESULT_DATA} " | jq -r ' .logs[0].topics[1]' | cast to-dec)
11
+
12
+ if [[ " ${RESULT} " == " 0" ]]
13
+ then
14
+ RESULT=" In Progress"
15
+ elif [[ " ${RESULT} " == " 1" ]]
16
+ then
17
+ RESULT=" Challenger Wins"
18
+ elif [[ " ${RESULT} " == " 2" ]]
19
+ then
20
+ RESULT=" Defender Wins"
21
+ fi
22
+
23
+ echo " Result: $RESULT "
You can’t perform that action at this time.
0 commit comments