Skip to content

Commit 0165b1d

Browse files
committed
Merge branch 'dev' into feat(web)/commit-reveal
2 parents e64ea3d + f0e01ec commit 0165b1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1699
-116
lines changed

contracts/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Smart contracts for Kleros v2
44

55
## Deployments
66

7-
Refresh the list of deployed contracts by running `./scripts/generateDeploymentsMarkdown.sh`.
7+
Refresh the list of deployed contracts by running `./scripts/generateDeploymentsMarkdown.sh` or `./scripts/populateReadme.sh`.
88

99
### Official Testnet
1010

@@ -57,7 +57,7 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
5757
- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x9426F127116C3652A262AE1eA48391AC8F44D35b), [implementation](https://sepolia.arbiscan.io/address/0x692CC78F2570181FFB99297965FeAA8352ab12E8)
5858
- [DisputeResolver](https://sepolia.arbiscan.io/address/0xB8B36CC43f852f9F0484f53Eb38CaBBA28a81bF6)
5959
- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0x596D3B09E684D62217682216e9b7a0De75933391), [implementation](https://sepolia.arbiscan.io/address/0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6)
60-
- [Escrow](https://sepolia.arbiscan.io/address/0xdaf749DABE7be6C6894950AE69af35c20a00ABd9)
60+
- [Escrow](https://sepolia.arbiscan.io/address/0x10f7A6f42Af606553883415bc8862643A6e63fdA)
6161
- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0x57fd453FB0d16f8ca174E7386102D7170E17Be09), [implementation](https://sepolia.arbiscan.io/address/0x05AD81f245209b7f91885fd96e57c9da90554824)
6262
- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0xA54e7A16d7460e38a8F324eF46782FB520d58CE8), [implementation](https://sepolia.arbiscan.io/address/0x91a373BBdE0532F86410682F362e2Cf685e95085)
6363
- [PNKFaucet](https://sepolia.arbiscan.io/address/0x7EFE468003Ad6A858b5350CDE0A67bBED58739dD)

contracts/deployments/arbitrumSepoliaDevnet/Escrow.json

Lines changed: 76 additions & 49 deletions
Large diffs are not rendered by default.

contracts/scripts/populateReadme.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
4+
5+
if [ ! -x "$(command -v envsubst)" ]; then
6+
echo >&2 "error: envsubst not installed"
7+
exit 1
8+
fi
9+
10+
deployments="$($SCRIPT_DIR/generateDeploymentsMarkdown.sh)" \
11+
envsubst '$deployments' \
12+
< README.md.template \
13+
> README.md

contracts/src/arbitration/arbitrables/Escrow.sol

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,20 @@ contract Escrow is IArbitrableV2 {
8484

8585
/// @dev Emitted when a transaction is created.
8686
/// @param _transactionID The index of the transaction.
87+
/// @param _transactionUri The IPFS Uri Hash of the transaction.
8788
/// @param _buyer The address of the buyer.
8889
/// @param _seller The address of the seller.
8990
/// @param _amount The initial amount in the transaction.
91+
/// @param _asset The asset used ("native" for native chain token).
92+
/// @param _deadline The deadline of the transaction.
9093
event TransactionCreated(
9194
uint256 indexed _transactionID,
95+
string _transactionUri,
9296
address indexed _buyer,
9397
address indexed _seller,
94-
uint256 _amount
98+
uint256 _amount,
99+
string _asset,
100+
uint256 _deadline
95101
);
96102

97103
/// @dev To be emitted when a transaction is resolved, either by its
@@ -166,12 +172,14 @@ contract Escrow is IArbitrableV2 {
166172

167173
/// @dev Create a transaction.
168174
/// @param _timeoutPayment Time after which a party can automatically execute the arbitrable transaction.
175+
/// @param _transactionUri The IPFS Uri Hash of the transaction.
169176
/// @param _seller The recipient of the transaction.
170177
/// @param _templateData The dispute template data.
171178
/// @param _templateDataMappings The dispute template data mappings.
172179
/// @return transactionID The index of the transaction.
173180
function createTransaction(
174181
uint256 _timeoutPayment,
182+
string memory _transactionUri,
175183
address payable _seller,
176184
string memory _templateData,
177185
string memory _templateDataMappings
@@ -186,7 +194,15 @@ contract Escrow is IArbitrableV2 {
186194

187195
transactionID = transactions.length - 1;
188196

189-
emit TransactionCreated(transactionID, msg.sender, _seller, msg.value);
197+
emit TransactionCreated(
198+
transactionID,
199+
_transactionUri,
200+
msg.sender,
201+
_seller,
202+
msg.value,
203+
"native",
204+
transaction.deadline
205+
);
190206
}
191207

192208
/// @dev Pay seller. To be called if the good or service is provided.

web/src/app.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import Cases from "./pages/Cases";
1414
import Dashboard from "./pages/Dashboard";
1515
import Courts from "./pages/Courts";
1616
import DisputeTemplateView from "./pages/DisputeTemplateView";
17+
import DisputeResolver from "./pages/Resolver";
18+
import { NewDisputeProvider } from "./context/NewDisputeContext";
1719

1820
const App: React.FC = () => {
1921
return (
@@ -22,16 +24,19 @@ const App: React.FC = () => {
2224
<RefetchOnBlock />
2325
<Web3Provider>
2426
<IsListProvider>
25-
<SentryRoutes>
26-
<Route path="/" element={<Layout />}>
27-
<Route index element={<Home />} />
28-
<Route path="cases/*" element={<Cases />} />
29-
<Route path="courts/*" element={<Courts />} />
30-
<Route path="dashboard/:page/:order/:filter" element={<Dashboard />} />
31-
<Route path="disputeTemplate" element={<DisputeTemplateView />} />
32-
<Route path="*" element={<h1>Justice not found here ¯\_( ͡° ͜ʖ ͡°)_/¯</h1>} />
33-
</Route>
34-
</SentryRoutes>
27+
<NewDisputeProvider>
28+
<SentryRoutes>
29+
<Route path="/" element={<Layout />}>
30+
<Route index element={<Home />} />
31+
<Route path="cases/*" element={<Cases />} />
32+
<Route path="courts/*" element={<Courts />} />
33+
<Route path="dashboard/:page/:order/:filter" element={<Dashboard />} />
34+
<Route path="disputeTemplate" element={<DisputeTemplateView />} />
35+
<Route path="resolver/*" element={<DisputeResolver />} />
36+
<Route path="*" element={<h1>Justice not found here ¯\_( ͡° ͜ʖ ͡°)_/¯</h1>} />
37+
</Route>
38+
</SentryRoutes>
39+
</NewDisputeProvider>
3540
</IsListProvider>
3641
</Web3Provider>
3742
</QueryClientProvider>

web/src/assets/svgs/icons/dispute.svg

Lines changed: 11 additions & 0 deletions
Loading

web/src/assets/svgs/icons/ellipse.svg

Lines changed: 3 additions & 0 deletions
Loading

web/src/assets/svgs/icons/minus.svg

Lines changed: 3 additions & 0 deletions
Loading

web/src/assets/svgs/icons/plus.svg

Lines changed: 10 additions & 0 deletions
Loading

web/src/components/ConnectWallet/AccountDisplay.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { landscapeStyle } from "styles/landscapeStyle";
44
import { useAccount, useNetwork, useEnsAvatar, useEnsName } from "wagmi";
55
import Identicon from "react-identicons";
66
import { shortenAddress } from "utils/shortenAddress";
7+
import { isAddress } from "viem";
78

89
const Container = styled.div`
910
display: flex;
@@ -134,7 +135,7 @@ export const AddressOrName: React.FC<IAddressOrName> = ({ address: propAddress }
134135
chainId: 1,
135136
});
136137

137-
return <label>{data ?? (address && shortenAddress(address))}</label>;
138+
return <label>{data ?? (isAddress(address) ? shortenAddress(address) : address)}</label>;
138139
};
139140

140141
export const ChainDisplay: React.FC = () => {

0 commit comments

Comments
 (0)