Skip to content

Commit

Permalink
Merge pull request #74 from storyprotocol/dev
Browse files Browse the repository at this point in the history
beta rc.3
  • Loading branch information
edisonz0718 authored Feb 19, 2024
2 parents f500b2c + 83857d5 commit 674a071
Show file tree
Hide file tree
Showing 36 changed files with 1,111 additions and 720 deletions.
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ compile_contracts:
solc @erc6551/=node_modules/erc6551/ --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 @erc6551/=node_modules/erc6551/ --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 @erc6551/=node_modules/erc6551/ --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/licensing/LicensingModule.sol -o packages/core-sdk/src/abi/json/tmp/LicensingModule
solc @erc6551/=node_modules/erc6551/ --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/licensing/UMLPolicyFrameworkManager.sol -o packages/core-sdk/src/abi/json/tmp/UMLPolicyFrameworkManager
solc @erc6551/=node_modules/erc6551/ --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/licensing/PILPolicyFrameworkManager.sol -o packages/core-sdk/src/abi/json/tmp/PILPolicyFrameworkManager
solc @erc6551/=node_modules/erc6551/ --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 @erc6551/=node_modules/erc6551/ --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/IIPAssetRegistry.sol -o packages/core-sdk/src/abi/json/tmp/IIPAssetRegistry
solc @erc6551/=node_modules/erc6551/ --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
solc @erc6551/=node_modules/erc6551/ --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/ModuleRegistry.sol -o packages/core-sdk/src/abi/json/tmp/ModuleRegistry
solc @erc6551/=node_modules/erc6551/ --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/lib/Errors.sol -o packages/core-sdk/src/abi/json/tmp/Errors
cp packages/core-sdk/src/abi/json/tmp/Errors/Errors.abi packages/core-sdk/src/abi/json/Errors.json

Expand All @@ -22,12 +21,10 @@ 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/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/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/LicensingModule/LicensingModule.abi)"' as const;' > packages/core-sdk/src/abi/json/LicensingModule.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/UMLPolicyFrameworkManager/UMLPolicyFrameworkManager.abi)"' as const;' > packages/core-sdk/src/abi/json/UMLPolicyFrameworkManager.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/PILPolicyFrameworkManager/PILPolicyFrameworkManager.abi)"' as const;' > packages/core-sdk/src/abi/json/PILPolicyFrameworkManager.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/IIPAssetRegistry/IIPAssetRegistry.abi)"' as const;' > packages/core-sdk/src/abi/json/IIPAssetRegistry.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
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/ModuleRegistry/ModuleRegistry.abi)"' as const;' > packages/core-sdk/src/abi/json/ModuleRegistry.abi.ts

rm -rf packages/core-sdk/src/abi/json/tmp
rm -rf packages/core-sdk/protocol-contracts
2 changes: 1 addition & 1 deletion packages/core-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@story-protocol/core-sdk",
"version": "0.0.1-beta-rc.2",
"version": "0.0.1-beta-rc.3",
"description": "Story Protocol Core SDK",
"main": "dist/story-protocol-core-sdk.cjs.js",
"module": "dist/story-protocol-core-sdk.esm.js",
Expand Down
35 changes: 17 additions & 18 deletions packages/core-sdk/src/abi/config.ts
Original file line number Diff line number Diff line change
@@ -1,59 +1,58 @@
import { getAddress } from "viem";
import * as dotenv from "dotenv";

import IERC1155ABI from "./json/IERC1155.abi";
import AccessControllerABI from "./json/AccessController.abi";
import DisputeModuleABI from "./json/DisputeModule.abi";
import IPAccountImplABI from "./json/IPAccountImpl.abi";
import IPAssetRegistryABI from "./json/IIPAssetRegistry.abi";
import LicensingModuleABI from "./json/LicensingModule.abi";
import UMLPolicyFrameworkManagerABI from "./json/UMLPolicyFrameworkManager.abi";
import PILPolicyFrameworkManagerABI from "./json/PILPolicyFrameworkManager.abi";
import RegistrationModuleABI from "./json/RegistrationModule.abi";
import TaggingModuleABI from "./json/TaggingModule.abi";
import ErrorsABI from "./json/Errors.abi";

if (typeof process !== "undefined") {
dotenv.config();
}
import { sepolia } from "../utils/env";

export const IPAccountABI = [...IPAccountImplABI, ...ErrorsABI];

export const IPAssetRegistryConfig = {
abi: IPAssetRegistryABI,
address: getAddress("0xF2c66aAd2287F3fa00C3461862612Eaf1FAAEcDb"),
address: getAddress(sepolia.IPAssetRegistry),
};

export const AccessControllerConfig = {
abi: [...AccessControllerABI, ...ErrorsABI],
address: getAddress("0x069AD174fb6285086b692AC9a6f328DCBcB94FC3"),
address: getAddress(sepolia.AccessController),
};

export const DisputeModuleConfig = {
abi: [...DisputeModuleABI, ...ErrorsABI],
address: getAddress("0x0B935d36516267fc2B4c902449b7D5Cfc2d5102A"),
address: getAddress(sepolia.DisputeModule),
};

export const LicenseRegistryConfig = {
abi: IERC1155ABI,
address: getAddress("0x051A0441918d7c393ba796dc6754c476324dAdEC"),
address: getAddress(sepolia.LicenseRegistry),
};

export const LicensingModuleConfig = {
abi: [...LicensingModuleABI, ...ErrorsABI],
address: getAddress("0x911415eb87b732443e8FbAd8aC8890Bf73BAa8Ec"),
abi: LicensingModuleABI,
//abi: [...LicensingModuleABI, ...ErrorsABI],
address: getAddress(sepolia.LicensingModule),
};

export const RegistrationModuleConfig = {
abi: [...RegistrationModuleABI, ...ErrorsABI],
address: getAddress("0x1Ad58168Ae7914C3e8aA8c6F5068CFb23490F27F"),
abi: RegistrationModuleABI,
//abi: [...RegistrationModuleABI, ...ErrorsABI],
address: getAddress(sepolia.RegistrationModule),
};

export const TaggingModuleConfig = {
abi: [...TaggingModuleABI, ...ErrorsABI],
address: getAddress("0x333BECf0FF68C02E4387005A89c30De885b8a38F"),
address: getAddress(sepolia.TaggingModule),
};

export const UMLPolicyFrameworkManagerConfig = {
abi: [...UMLPolicyFrameworkManagerABI, ...ErrorsABI],
address: getAddress("0xae4De58808EB503E9C460C7A852c67C3152D5385"),
export const PILPolicyFrameworkManagerConfig = {
abi: PILPolicyFrameworkManagerABI,
//abi: [...PILPolicyFrameworkManagerABI, ...ErrorsABI],
address: getAddress(sepolia.PILPolicyFrameworkManager),
};
16 changes: 11 additions & 5 deletions packages/core-sdk/src/abi/json/AccessController.abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ export default [
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "ipAccountOwner",
type: "address",
},
{
indexed: true,
internalType: "address",
Expand Down Expand Up @@ -40,27 +46,27 @@ export default [
inputs: [
{
internalType: "address",
name: "ipAccount_",
name: "ipAccount",
type: "address",
},
{
internalType: "address",
name: "signer_",
name: "signer",
type: "address",
},
{
internalType: "address",
name: "to_",
name: "to",
type: "address",
},
{
internalType: "bytes4",
name: "func_",
name: "func",
type: "bytes4",
},
{
internalType: "uint8",
name: "permission_",
name: "permission",
type: "uint8",
},
],
Expand Down
116 changes: 7 additions & 109 deletions packages/core-sdk/src/abi/json/DisputeModule.abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,6 @@ export default [
name: "DisputeCancelled",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "uint256",
name: "disputeId",
type: "uint256",
},
{
indexed: false,
internalType: "bool",
name: "decision",
type: "bool",
},
{
indexed: false,
internalType: "bytes",
name: "data",
type: "bytes",
},
],
name: "DisputeJudgementSet",
type: "event",
},
{
anonymous: false,
inputs: [
Expand Down Expand Up @@ -109,12 +84,12 @@ export default [
inputs: [
{
internalType: "uint256",
name: "_disputeId",
name: "disputeId",
type: "uint256",
},
{
internalType: "bytes",
name: "_data",
name: "data",
type: "bytes",
},
],
Expand All @@ -123,39 +98,26 @@ export default [
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "name",
outputs: [
{
internalType: "string",
name: "",
type: "string",
},
],
stateMutability: "pure",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_targetIpId",
name: "targetIpId",
type: "address",
},
{
internalType: "string",
name: "_linkToDisputeEvidence",
name: "linkToDisputeEvidence",
type: "string",
},
{
internalType: "bytes32",
name: "_targetTag",
name: "targetTag",
type: "bytes32",
},
{
internalType: "bytes",
name: "_data",
name: "data",
type: "bytes",
},
],
Expand All @@ -174,7 +136,7 @@ export default [
inputs: [
{
internalType: "uint256",
name: "_disputeId",
name: "disputeId",
type: "uint256",
},
],
Expand All @@ -183,68 +145,4 @@ export default [
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",
},
] as const;
Loading

0 comments on commit 674a071

Please sign in to comment.