From af9a593a481036a8bca90f4e7b3749b1afd487d4 Mon Sep 17 00:00:00 2001 From: Spablob Date: Mon, 25 Nov 2024 10:55:26 +0000 Subject: [PATCH 1/4] propagate dispute tags with parent arbitration policy --- contracts/modules/dispute/DisputeModule.sol | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/contracts/modules/dispute/DisputeModule.sol b/contracts/modules/dispute/DisputeModule.sol index 8f6023fb..6674fe18 100644 --- a/contracts/modules/dispute/DisputeModule.sol +++ b/contracts/modules/dispute/DisputeModule.sol @@ -290,17 +290,14 @@ contract DisputeModule is Dispute memory parentDispute = $.disputes[parentDisputeId]; if (parentDispute.targetIpId != parentIpId) revert Errors.DisputeModule__ParentIpIdMismatch(); - // a dispute current tag prior to being resolved can be in 3 states: + // a dispute current tag can be in 3 states: // IN_DISPUTE, 0, or a tag (ie. "IMPROPER_REGISTRATION") - // by restricting IN_DISPUTE and 0 - it is ensured the parent has been tagged before resolving dispute + // by restricting IN_DISPUTE and 0 - it is ensured the parent has been tagged before tagging the derivative if (parentDispute.currentTag == IN_DISPUTE || parentDispute.currentTag == bytes32(0)) revert Errors.DisputeModule__ParentNotTagged(); if (!LICENSE_REGISTRY.isParentIp(parentIpId, derivativeIpId)) revert Errors.DisputeModule__NotDerivative(); - address arbitrationPolicy = $.arbitrationPolicies[derivativeIpId]; - if (!$.isWhitelistedArbitrationPolicy[arbitrationPolicy]) arbitrationPolicy = $.baseArbitrationPolicy; - uint256 disputeId = ++$.disputeCounter; uint256 disputeTimestamp = block.timestamp; @@ -308,7 +305,7 @@ contract DisputeModule is targetIpId: derivativeIpId, disputeInitiator: msg.sender, disputeTimestamp: disputeTimestamp, - arbitrationPolicy: arbitrationPolicy, + arbitrationPolicy: parentDispute.arbitrationPolicy, disputeEvidenceHash: "", targetTag: parentDispute.currentTag, currentTag: parentDispute.currentTag, From a21c826badbaa1abf2c34d544ad699cf3a41944d Mon Sep 17 00:00:00 2001 From: Spablob Date: Tue, 26 Nov 2024 10:09:24 +0000 Subject: [PATCH 2/4] change to fork odyssey --- .../modules/dispute/policies/UMA/ArbitrationPolicyUMA.t.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/foundry/modules/dispute/policies/UMA/ArbitrationPolicyUMA.t.sol b/test/foundry/modules/dispute/policies/UMA/ArbitrationPolicyUMA.t.sol index c8364662..4407af98 100644 --- a/test/foundry/modules/dispute/policies/UMA/ArbitrationPolicyUMA.t.sol +++ b/test/foundry/modules/dispute/policies/UMA/ArbitrationPolicyUMA.t.sol @@ -42,13 +42,13 @@ contract ArbitrationPolicyUMATest is BaseTest { function setUp() public virtual override { // Fork the desired network where UMA contracts are deployed - uint256 forkId = vm.createFork("https://testnet.storyrpc.io"); + uint256 forkId = vm.createFork("https://odyssey.storyrpc.io/"); vm.selectFork(forkId); - // Illiad chain 1513 + // Odyssey testnet newOOV3 = 0x3CA11702f7c0F28e0b4e03C31F7492969862C569; mockAncillary = 0x3baD7AD0728f9917d1Bf08af5782dCbD516cDd96; - susd = 0x91f6F05B08c16769d3c85867548615d270C42fC7; + susd = 0xC0F6E387aC0B324Ec18EAcf22EE7271207dCE3d5; // deploy mock ip asset registry mockIpAssetRegistry = new MockIpAssetRegistry(); From 66ec405b07b706c86ab8eb61aa84dcdbb5ce07a1 Mon Sep 17 00:00:00 2001 From: Spablob Date: Tue, 26 Nov 2024 10:46:29 +0000 Subject: [PATCH 3/4] minor unit test fix --- test/foundry/modules/dispute/DisputeModule.t.sol | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/foundry/modules/dispute/DisputeModule.t.sol b/test/foundry/modules/dispute/DisputeModule.t.sol index c0c50dd0..852eee9a 100644 --- a/test/foundry/modules/dispute/DisputeModule.t.sol +++ b/test/foundry/modules/dispute/DisputeModule.t.sol @@ -564,6 +564,14 @@ contract DisputeModuleTest is BaseTest { assertEq(licenseRegistry.isParentIp(ipAddr, ipAddr2), true); + // child ip changes arbitration policy + vm.startPrank(address(1)); + disputeModule.setArbitrationPolicy(ipAddr2, address(mockArbitrationPolicy2)); + vm.warp(block.timestamp + disputeModule.arbitrationPolicyCooldown() + 1); + disputeModule.updateActiveArbitrationPolicy(ipAddr2); + assertEq(disputeModule.arbitrationPolicies(ipAddr2), address(mockArbitrationPolicy2)); + vm.stopPrank(); + // tag child ip vm.startPrank(address(1)); vm.expectEmit(true, true, true, true, address(disputeModule)); From 7d4a687bf35a5f395b3abebb79d42094e8e5ee7b Mon Sep 17 00:00:00 2001 From: Spablob Date: Tue, 26 Nov 2024 11:00:39 +0000 Subject: [PATCH 4/4] minor unit test fix --- test/foundry/modules/dispute/DisputeModule.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/foundry/modules/dispute/DisputeModule.t.sol b/test/foundry/modules/dispute/DisputeModule.t.sol index 852eee9a..cb6042f4 100644 --- a/test/foundry/modules/dispute/DisputeModule.t.sol +++ b/test/foundry/modules/dispute/DisputeModule.t.sol @@ -565,7 +565,7 @@ contract DisputeModuleTest is BaseTest { assertEq(licenseRegistry.isParentIp(ipAddr, ipAddr2), true); // child ip changes arbitration policy - vm.startPrank(address(1)); + vm.startPrank(address(ipAddr2)); disputeModule.setArbitrationPolicy(ipAddr2, address(mockArbitrationPolicy2)); vm.warp(block.timestamp + disputeModule.arbitrationPolicyCooldown() + 1); disputeModule.updateActiveArbitrationPolicy(ipAddr2);