Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dispute client #55

Merged
merged 12 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ on:
RPC_PROVIDER_URL:
required: true
WALLET_PRIVATE_KEY:
required: true
DISPUTE_MODULE:
required: true

jobs:
build:
Expand All @@ -41,6 +44,7 @@ jobs:
NEXT_PUBLIC_IP_ACCOUNT_REGISTRY: ${{ secrets.IP_ACCOUNT_REGISTRY }}
NEXT_PUBLIC_REGISTRATION_MODULE: ${{ secrets.REGISTRATION_MODULE }}
NEXT_PUBLIC_TAGGING_MODULE: ${{ secrets.TAGGING_MODULE }}
NEXT_PUBLIC_DISPUTE_MODULE: ${{ secrets.DISPUTE_MODULE }}
NEXT_PUBLIC_LICENSE_REGISTRY: ${{ secrets.LICENSE_REGISTRY }}
NEXT_PUBLIC_ACCESS_CONTROLLER: ${{ secrets.ACCESS_CONTROLLER }}
RPC_PROVIDER_URL: ${{ secrets.RPC_PROVIDER_URL }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/internal-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
IP_ACCOUNT_REGISTRY: ${{ secrets.IP_ACCOUNT_REGISTRY }}
REGISTRATION_MODULE: ${{ secrets.REGISTRATION_MODULE }}
TAGGING_MODULE: ${{ secrets.TAGGING_MODULE }}
DISPUTE_MODULE: ${{ secrets.DISPUTE_MODULE }}
LICENSE_REGISTRY: ${{ secrets.LICENSE_REGISTRY }}
ACCESS_CONTROLLER: ${{ secrets.ACCESS_CONTROLLER }}
API_BASE_URL: ${{ secrets.API_BASE_URL }}
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "packages/core-sdk/protocol-contracts"]
path = packages/core-sdk/protocol-contracts
url = https://github.com/storyprotocol/protocol-core
branch = beta-rc1
branch = beta-rc2
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
compile_contracts:
git submodule add -b beta-rc1 --force https://github.com/storyprotocol/protocol-core packages/core-sdk/protocol-contracts
git submodule add -b beta-rc2 --force https://github.com/storyprotocol/protocol-core packages/core-sdk/protocol-contracts
git submodule update --remote --merge
cd packages/core-sdk/protocol-contracts && npm i --force && forge install

solc --pretty-json --base-path packages/core-sdk/protocol-contracts --include-path packages/core-sdk/protocol-contracts/node_modules/ --abi packages/core-sdk/protocol-contracts/contracts/IPAccountImpl.sol -o packages/core-sdk/src/abi/json/tmp/IPAccountImpl
solc --pretty-json --base-path packages/core-sdk/protocol-contracts --include-path packages/core-sdk/protocol-contracts/node_modules/ --abi packages/core-sdk/protocol-contracts/contracts/AccessController.sol -o packages/core-sdk/src/abi/json/tmp/AccessController
solc --pretty-json --base-path packages/core-sdk/protocol-contracts --include-path packages/core-sdk/protocol-contracts/node_modules/ --abi packages/core-sdk/protocol-contracts/contracts/modules/RegistrationModule.sol -o packages/core-sdk/src/abi/json/tmp/RegistrationModule
solc --pretty-json --base-path packages/core-sdk/protocol-contracts --include-path packages/core-sdk/protocol-contracts/node_modules/ --abi packages/core-sdk/protocol-contracts/contracts/modules/tagging/TaggingModule.sol -o packages/core-sdk/src/abi/json/tmp/TaggingModule
solc --pretty-json --base-path packages/core-sdk/protocol-contracts --include-path packages/core-sdk/protocol-contracts/node_modules/ --abi packages/core-sdk/protocol-contracts/contracts/modules/dispute-module/DisputeModule.sol -o packages/core-sdk/src/abi/json/tmp/DisputeModule
solc --pretty-json --base-path packages/core-sdk/protocol-contracts --include-path packages/core-sdk/protocol-contracts/node_modules/ --abi packages/core-sdk/protocol-contracts/contracts/interfaces/registries/IIPAccountRegistry.sol -o packages/core-sdk/src/abi/json/tmp/IIPAccountRegistry
solc --pretty-json --base-path packages/core-sdk/protocol-contracts --include-path packages/core-sdk/protocol-contracts/node_modules/ --abi packages/core-sdk/protocol-contracts/contracts/registries/IPRecordRegistry.sol -o packages/core-sdk/src/abi/json/tmp/IPRecordRegistry
solc --pretty-json --base-path packages/core-sdk/protocol-contracts --include-path packages/core-sdk/protocol-contracts/node_modules/ --abi packages/core-sdk/protocol-contracts/contracts/registries/LicenseRegistry.sol -o packages/core-sdk/src/abi/json/tmp/LicenseRegistry
Expand All @@ -19,6 +20,7 @@ compile_contracts:
echo 'export default '"$$(jq --argjson entities "$$(jq -c '.' packages/core-sdk/src/abi/sdkEntities.json)" 'map(select(.name as $$name | $$entities | if type == "array" then index($$name) else false end))' packages/core-sdk/src/abi/json/tmp/AccessController/AccessController.abi)"' as const;' > packages/core-sdk/src/abi/json/AccessController.abi.ts
echo 'export default '"$$(jq --argjson entities "$$(jq -c '.' packages/core-sdk/src/abi/sdkEntities.json)" 'map(select(.name as $$name | $$entities | if type == "array" then index($$name) else false end))' packages/core-sdk/src/abi/json/tmp/RegistrationModule/RegistrationModule.abi)"' as const;' > packages/core-sdk/src/abi/json/RegistrationModule.abi.ts
echo 'export default '"$$(jq --argjson entities "$$(jq -c '.' packages/core-sdk/src/abi/sdkEntities.json)" 'map(select(.name as $$name | $$entities | if type == "array" then index($$name) else false end))' packages/core-sdk/src/abi/json/tmp/TaggingModule/TaggingModule.abi)"' as const;' > packages/core-sdk/src/abi/json/TaggingModule.abi.ts
echo 'export default '"$$(jq --argjson entities "$$(jq -c '.' packages/core-sdk/src/abi/sdkEntities.json)" 'map(select(.name as $$name | $$entities | if type == "array" then index($$name) else false end))' packages/core-sdk/src/abi/json/tmp/DisputeModule/DisputeModule.abi)"' as const;' > packages/core-sdk/src/abi/json/DisputeModule.abi.ts
echo 'export default '"$$(jq --argjson entities "$$(jq -c '.' packages/core-sdk/src/abi/sdkEntities.json)" 'map(select(.name as $$name | $$entities | if type == "array" then index($$name) else false end))' packages/core-sdk/src/abi/json/tmp/IIPAccountRegistry/IIPAccountRegistry.abi)"' as const;' > packages/core-sdk/src/abi/json/IIPAccountRegistry.abi.ts
echo 'export default '"$$(jq --argjson entities "$$(jq -c '.' packages/core-sdk/src/abi/sdkEntities.json)" 'map(select(.name as $$name | $$entities | if type == "array" then index($$name) else false end))' packages/core-sdk/src/abi/json/tmp/IPRecordRegistry/IPRecordRegistry.abi)"' as const;' > packages/core-sdk/src/abi/json/IPRecordRegistry.abi.ts
echo 'export default '"$$(jq --argjson entities "$$(jq -c '.' packages/core-sdk/src/abi/sdkEntities.json)" 'map(select(.name as $$name | $$entities | if type == "array" then index($$name) else false end))' packages/core-sdk/src/abi/json/tmp/LicenseRegistry/LicenseRegistry.abi)"' as const;' > packages/core-sdk/src/abi/json/LicenseRegistry.abi.ts
Expand Down
12 changes: 12 additions & 0 deletions packages/core-sdk/src/abi/disputeModule.abi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { formatAbi } from "abitype";
import { getAddress } from "viem";

import DisputeModuleABI from "./json/DisputeModule.abi";

export const DisputeModuleRaw = DisputeModuleABI;
export const DisputeModuleReadable = formatAbi(DisputeModuleRaw);

export const DisputeModuleConfig = {
abi: DisputeModuleRaw,
address: getAddress(process.env.DISPUTE_MODULE || process.env.NEXT_PUBLIC_DISPUTE_MODULE || ""),
};
123 changes: 123 additions & 0 deletions packages/core-sdk/src/abi/json/DisputeModule.abi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
export default [
{
inputs: [
{
internalType: "address",
name: "_targetIpId",
type: "address",
},
{
internalType: "address",
name: "_arbitrationPolicy",
type: "address",
},
{
internalType: "string",
name: "_linkToDisputeEvidence",
type: "string",
},
{
internalType: "bytes32",
name: "_targetTag",
type: "bytes32",
},
{
internalType: "bytes",
name: "_data",
type: "bytes",
},
],
name: "raiseDispute",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_disputeId",
type: "uint256",
},
{
internalType: "bool",
name: "_decision",
type: "bool",
},
{
internalType: "bytes",
name: "_data",
type: "bytes",
},
],
name: "setDisputeJudgement",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_arbitrationPolicy",
type: "address",
},
{
internalType: "bool",
name: "_allowed",
type: "bool",
},
],
name: "whitelistArbitrationPolicy",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_arbitrationPolicy",
type: "address",
},
{
internalType: "address",
name: "_arbPolicyRelayer",
type: "address",
},
{
internalType: "bool",
name: "_allowed",
type: "bool",
},
],
name: "whitelistArbitrationRelayer",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "_tag",
type: "bytes32",
},
{
internalType: "bool",
name: "_allowed",
type: "bool",
},
],
name: "whitelistDisputeTags",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
] as const;
113 changes: 110 additions & 3 deletions packages/core-sdk/src/abi/json/Errors.abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,36 @@ export default [
name: "ArbitrationPolicySP__ZeroPaymentToken",
type: "error",
},
{
inputs: [],
name: "BaseParamVerifier__Unauthorized",
type: "error",
},
{
inputs: [],
name: "DerivativesParamVerifier__InvalidDerivativesConfig",
type: "error",
},
{
inputs: [],
name: "DerivativesParamVerifier__ZeroShare",
type: "error",
},
{
inputs: [],
name: "DisputeModule__NotAbleToResolve",
type: "error",
},
{
inputs: [],
name: "DisputeModule__NotDisputeInitiator",
type: "error",
},
{
inputs: [],
name: "DisputeModule__NotInDisputeState",
type: "error",
},
{
inputs: [],
name: "DisputeModule__NotWhitelistedArbitrationPolicy",
Expand Down Expand Up @@ -76,7 +101,58 @@ export default [
},
{
inputs: [],
name: "DisputeModule__ZeroLinkToDisputeSummary",
name: "DisputeModule__ZeroLinkToDisputeEvidence",
type: "error",
},
{
inputs: [],
name: "Governance__InconsistentState",
type: "error",
},
{
inputs: [],
name: "Governance__NewStateIsTheSameWithOldState",
type: "error",
},
{
inputs: [],
name: "Governance__OnlyProtocolAdmin",
type: "error",
},
{
inputs: [],
name: "Governance__ProtocolPaused",
type: "error",
},
{
inputs: [
{
internalType: "string",
name: "interfaceName",
type: "string",
},
],
name: "Governance__UnsupportedInterface",
type: "error",
},
{
inputs: [],
name: "Governance__ZeroAddress",
type: "error",
},
{
inputs: [],
name: "IPAccount__ExpiredSignature",
type: "error",
},
{
inputs: [],
name: "IPAccount__InvalidSignature",
type: "error",
},
{
inputs: [],
name: "IPAccount__InvalidSigner",
type: "error",
},
{
Expand Down Expand Up @@ -124,6 +200,11 @@ export default [
name: "LicenseRegistry__FrameworkNotFound",
type: "error",
},
{
inputs: [],
name: "LicenseRegistry__InvalidLicensor",
type: "error",
},
{
inputs: [],
name: "LicenseRegistry__InvalidParamVerifierType",
Expand All @@ -141,12 +222,28 @@ export default [
},
{
inputs: [],
name: "LicenseRegistry__MintParamFailed",
name: "LicenseRegistry__NotLicensee",
type: "error",
},
{
inputs: [],
name: "LicenseRegistry__NotLicensee",
name: "LicenseRegistry__ParamVerifierAlreadySet",
type: "error",
},
{
inputs: [
{
internalType: "uint8",
name: "verifierType",
type: "uint8",
},
{
internalType: "address",
name: "verifier",
type: "address",
},
],
name: "LicenseRegistry__ParamVerifierFailed",
type: "error",
},
{
Expand All @@ -159,6 +256,11 @@ export default [
name: "LicenseRegistry__ParentIdEqualThanChild",
type: "error",
},
{
inputs: [],
name: "LicenseRegistry__PolicyAlreadyAdded",
type: "error",
},
{
inputs: [],
name: "LicenseRegistry__PolicyAlreadySetForIpId",
Expand All @@ -169,6 +271,11 @@ export default [
name: "LicenseRegistry__PolicyNotFound",
type: "error",
},
{
inputs: [],
name: "MetadataProvider_Unauthorized",
type: "error",
},
{
inputs: [],
name: "ModuleRegistry__ModuleAddressNotContract",
Expand Down
Loading
Loading