Skip to content

Commit d7e6add

Browse files
committed
refactor: extracted evidence submission from dispute kit into a separate module
1 parent 7cce1c7 commit d7e6add

23 files changed

+1197
-595
lines changed

contracts/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,20 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
6666
#### Arbitrum Goerli
6767

6868
- [PNK](https://goerli.arbiscan.io/token/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee)
69-
- [ArbitrableExample](https://goerli.arbiscan.io/address/0x437cbF6F0A62238b392715aC55bdC5abdA148eD8)
69+
- [ArbitrableExample](https://goerli.arbiscan.io/address/0x2f3e9594cD762d270b4546dfc62ab98dB595DA59)
7070
- [BlockHashRNG](https://goerli.arbiscan.io/address/0xCea37c9A838831F6B4eE3BffbDC21b945113AD0C)
7171
- [DAI](https://goerli.arbiscan.io/address/0xB755843e26F2cD1c6A46659cEBb67CcFAE0f2EeE)
7272
- [DAIFaucet](https://goerli.arbiscan.io/address/0xCEBF1e0A5921767dd97b999ed14801A3770afAfd)
73-
- [DisputeKitClassic: proxy](https://goerli.arbiscan.io/address/0xc9aF9335327cAe0Cd45EC96ad9bDcD4304772729), [implementation](https://goerli.arbiscan.io/address/0x2757458b91faaB4240A6eAE72185C8185683a642)
74-
- [DisputeResolver](https://goerli.arbiscan.io/address/0x20433D10d3865e19af45956ed5bFe30c56536431)
73+
- [DisputeKitClassic: proxy](https://goerli.arbiscan.io/address/0x67f3b472F345119692d575E59190400E371946f6), [implementation](https://goerli.arbiscan.io/address/0x5a41ebCD0b78eD6C42E0AD23A7b7a8001c45bEC9)
74+
- [DisputeResolver](https://goerli.arbiscan.io/address/0x881319f439F65e4926c08F38303FE676488914Bd)
7575
- [DisputeTemplateRegistry: proxy](https://goerli.arbiscan.io/address/0x8d17Ed667512412D9c194d178699f68159f250A2), [implementation](https://goerli.arbiscan.io/address/0x2F4c6c23C516A9247a413186cDcA693E1C078A1D)
76-
- [KlerosCore: proxy](https://goerli.arbiscan.io/address/0x544afd5A8AbC40ba5d38BbA8d47f30502896b050), [implementation](https://goerli.arbiscan.io/address/0x241C37152D43f60a0142bCbb2D765e908dd03D9D)
76+
- [EvidenceModule: proxy](https://goerli.arbiscan.io/address/0xF679E4a92AE843fd5cD0717A7417C3A773Dfd55F), [implementation](https://goerli.arbiscan.io/address/0x5d5488ed34dC07EE547A39f6631d6f8595a7f618)
77+
- [KlerosCore: proxy](https://goerli.arbiscan.io/address/0xB88643fd1e4351dAF9eA7292db126207FDE42e45), [implementation](https://goerli.arbiscan.io/address/0x5A8f51e70b77cCa3c309f7AC0f55f3b630D46B6c)
7778
- [PNKFaucet](https://goerli.arbiscan.io/address/0x05648Ee14941630a649082e0dA5cb80D29cC9002)
7879
- [PinakionV2](https://goerli.arbiscan.io/address/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee)
7980
- [PolicyRegistry: proxy](https://goerli.arbiscan.io/address/0x37FFaF5506BB16327B4a32191Bb39d739fCE55a3), [implementation](https://goerli.arbiscan.io/address/0x3ab4C2906E3Cbc44C3e282affDb66272BCae6482)
8081
- [RandomizerRNG: proxy](https://goerli.arbiscan.io/address/0x105C019c2724F08BFA41Ff0D0bD77030E1DEA177), [implementation](https://goerli.arbiscan.io/address/0xc90d73C64997699d835a1122D47d4A231965740C)
81-
- [SortitionModule: proxy](https://goerli.arbiscan.io/address/0x5c9E4e7e85157DFD16D400dd358C541b65DaA83f), [implementation](https://goerli.arbiscan.io/address/0xec7C6C1b2FC93bBeF0fA4e301165144702c126F9)
82+
- [SortitionModule: proxy](https://goerli.arbiscan.io/address/0x45480bFF7AE062205AB16f4e014ecee942640779), [implementation](https://goerli.arbiscan.io/address/0x7FebBE9de959f83D67A89ee9e4E31Cf11bC2B258)
8283
- [WETH](https://goerli.arbiscan.io/address/0xbB5839497dE7e6d4ddaFde093F69abA9be782E07)
8384
- [WETHFaucet](https://goerli.arbiscan.io/address/0xD2d862B060986b25996aaeDB54813002AB791013)
8485

contracts/deploy/00-home-chain-arbitration.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
5454

5555
await deployUpgradable(deployments, "PolicyRegistry", { from: deployer, args: [deployer], log: true });
5656

57+
await deployUpgradable(deployments, "EvidenceModule", { from: deployer, args: [deployer], log: true });
58+
5759
const randomizer = randomizerByChain.get(Number(await getChainId())) ?? AddressZero;
5860
const rng = await deployUpgradable(deployments, "RandomizerRNG", {
5961
from: deployer,

contracts/deploy/utils/deployUpgradable.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const deployUpgradable = async (
2929
options: DeployUpgradableOptions
3030
): Promise<DeployResult> => {
3131
const { deploy } = deployments;
32-
const { newImplementation, initializer, args: initializerArgs, ...otherOptions } = options;
32+
const { newImplementation, initializer, args: initializerArgs, proxy: proxyOverrides, ...otherOptions } = options;
3333

3434
const methodName = initializer ?? "initialize";
3535
const args = initializerArgs ?? [];
@@ -52,6 +52,7 @@ export const deployUpgradable = async (
5252
proxy: {
5353
...PROXY_OPTIONS,
5454
...implementationName,
55+
...((proxyOverrides as ProxyOptions) ?? {}),
5556
execute: {
5657
init: {
5758
methodName,

contracts/deployments/arbitrumGoerliDevnet/ArbitrableExample.json

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

contracts/deployments/arbitrumGoerliDevnet/DisputeKitClassic.json

Lines changed: 19 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"address": "0xc9aF9335327cAe0Cd45EC96ad9bDcD4304772729",
2+
"address": "0x67f3b472F345119692d575E59190400E371946f6",
33
"abi": [
44
{
55
"stateMutability": "payable",
@@ -169,31 +169,6 @@
169169
"name": "DisputeCreation",
170170
"type": "event"
171171
},
172-
{
173-
"anonymous": false,
174-
"inputs": [
175-
{
176-
"indexed": true,
177-
"internalType": "uint256",
178-
"name": "_externalDisputeID",
179-
"type": "uint256"
180-
},
181-
{
182-
"indexed": true,
183-
"internalType": "address",
184-
"name": "_party",
185-
"type": "address"
186-
},
187-
{
188-
"indexed": false,
189-
"internalType": "string",
190-
"name": "_evidence",
191-
"type": "string"
192-
}
193-
],
194-
"name": "Evidence",
195-
"type": "event"
196-
},
197172
{
198173
"anonymous": false,
199174
"inputs": [
@@ -892,24 +867,6 @@
892867
"stateMutability": "view",
893868
"type": "function"
894869
},
895-
{
896-
"inputs": [
897-
{
898-
"internalType": "uint256",
899-
"name": "_externalDisputeID",
900-
"type": "uint256"
901-
},
902-
{
903-
"internalType": "string",
904-
"name": "_evidence",
905-
"type": "string"
906-
}
907-
],
908-
"name": "submitEvidence",
909-
"outputs": [],
910-
"stateMutability": "nonpayable",
911-
"type": "function"
912-
},
913870
{
914871
"inputs": [
915872
{
@@ -979,41 +936,41 @@
979936
"type": "constructor"
980937
}
981938
],
982-
"transactionHash": "0xe5afa04a2e0cb9cc02951fcabb79891325d2152c8054e262a805322ec15f5836",
939+
"transactionHash": "0xa3af8f34e0bbbc09b7bd3055284a3754afeb9a967412a84ae9089e61fde56a87",
983940
"receipt": {
984941
"to": null,
985942
"from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3",
986-
"contractAddress": "0xc9aF9335327cAe0Cd45EC96ad9bDcD4304772729",
987-
"transactionIndex": 3,
988-
"gasUsed": "177903",
989-
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000080000000000000000000000",
990-
"blockHash": "0x71d9202ae0e221529b48f8d44aee36e7847143ea2210581080614a4f13819494",
991-
"transactionHash": "0xe5afa04a2e0cb9cc02951fcabb79891325d2152c8054e262a805322ec15f5836",
943+
"contractAddress": "0x67f3b472F345119692d575E59190400E371946f6",
944+
"transactionIndex": 1,
945+
"gasUsed": "177891",
946+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
947+
"blockHash": "0xbb4752a44ebc832fe570407ae46300075e114ae43362cba2d086c08be868cfcb",
948+
"transactionHash": "0xa3af8f34e0bbbc09b7bd3055284a3754afeb9a967412a84ae9089e61fde56a87",
992949
"logs": [
993950
{
994-
"transactionIndex": 3,
995-
"blockNumber": 48886762,
996-
"transactionHash": "0xe5afa04a2e0cb9cc02951fcabb79891325d2152c8054e262a805322ec15f5836",
997-
"address": "0xc9aF9335327cAe0Cd45EC96ad9bDcD4304772729",
951+
"transactionIndex": 1,
952+
"blockNumber": 49141470,
953+
"transactionHash": "0xa3af8f34e0bbbc09b7bd3055284a3754afeb9a967412a84ae9089e61fde56a87",
954+
"address": "0x67f3b472F345119692d575E59190400E371946f6",
998955
"topics": [
999956
"0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"
1000957
],
1001958
"data": "0x0000000000000000000000000000000000000000000000000000000000000001",
1002-
"logIndex": 9,
1003-
"blockHash": "0x71d9202ae0e221529b48f8d44aee36e7847143ea2210581080614a4f13819494"
959+
"logIndex": 0,
960+
"blockHash": "0xbb4752a44ebc832fe570407ae46300075e114ae43362cba2d086c08be868cfcb"
1004961
}
1005962
],
1006-
"blockNumber": 48886762,
1007-
"cumulativeGasUsed": "542167",
963+
"blockNumber": 49141470,
964+
"cumulativeGasUsed": "177891",
1008965
"status": 1,
1009966
"byzantium": true
1010967
},
1011968
"args": [
1012-
"0x2757458b91faaB4240A6eAE72185C8185683a642",
969+
"0x5a41ebCD0b78eD6C42E0AD23A7b7a8001c45bEC9",
1013970
"0x485cc955000000000000000000000000f50e77f2a2b6138d16c6c7511562e5c33c4b15a30000000000000000000000000000000000000000000000000000000000000000"
1014971
],
1015972
"numDeployments": 1,
1016-
"solcInputHash": "df8158a139d57b3f30bf05a9c294f570",
973+
"solcInputHash": "9cc67b743e8898be8182d59861833cfc",
1017974
"metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait <[email protected]>\",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from <https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.0/contracts/proxy/ERC1967/ERC1967Proxy.sol>\\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait <[email protected]>\\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}",
1018975
"bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033",
1019976
"deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033",
@@ -1024,7 +981,7 @@
1024981
"0x0000000000000000000000000000000000000000"
1025982
]
1026983
},
1027-
"implementation": "0x2757458b91faaB4240A6eAE72185C8185683a642",
984+
"implementation": "0x5a41ebCD0b78eD6C42E0AD23A7b7a8001c45bEC9",
1028985
"devdoc": {
1029986
"author": "Simon Malatrait <[email protected]>",
1030987
"details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.",

0 commit comments

Comments
 (0)