From 9ac52d8fb73d25da050ae66f7744b8201488bc06 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Tue, 10 Dec 2024 15:13:11 +0000 Subject: [PATCH 01/35] refactor AccessAdmin events to improve parameter order and indexing (#787) --- contracts/authorization/AccessAdmin.sol | 18 ++++++++++-------- contracts/authorization/IAccessAdmin.sol | 17 +++++++++-------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/contracts/authorization/AccessAdmin.sol b/contracts/authorization/AccessAdmin.sol index c208b5361..f28d61c35 100644 --- a/contracts/authorization/AccessAdmin.sol +++ b/contracts/authorization/AccessAdmin.sol @@ -367,7 +367,7 @@ contract AccessAdmin is // add role to list of roles _roleIds.push(roleId); - emit LogAccessAdminRoleCreated(_adminName, roleId, info.targetType, info.adminRoleId, info.name.toString()); + emit LogAccessAdminRoleCreated(roleId, info.adminRoleId, info.targetType, info.name.toString(), _adminName); } @@ -387,7 +387,7 @@ contract AccessAdmin is Blocknumber lastUpdateIn = _roleInfo[roleId].lastUpdateIn; _roleInfo[roleId].lastUpdateIn = BlocknumberLib.current(); - emit LogAccessAdminRoleActivatedSet(_adminName, roleId, active, lastUpdateIn); + emit LogAccessAdminRoleActivatedSet(roleId, active, _adminName, lastUpdateIn); } @@ -418,9 +418,9 @@ contract AccessAdmin is 0); emit LogAccessAdminRoleGranted( - _adminName, account, - AccessAdminLib.getRoleName(this, roleId)); + AccessAdminLib.getRoleName(this, roleId), + _adminName); } @@ -441,7 +441,7 @@ contract AccessAdmin is RoleId.unwrap(roleId), account); - emit LogAccessAdminRoleRevoked(_adminName, account, _roleInfo[roleId].name.toString()); + emit LogAccessAdminRoleRevoked(account, _roleInfo[roleId].name.toString(), _adminName); } @@ -557,7 +557,7 @@ contract AccessAdmin is // grant contract role to target _grantRoleToAccount(targetRoleId, target); - emit LogAccessAdminTargetCreated(_adminName, targetName, managed, target, targetRoleId); + emit LogAccessAdminTargetCreated(target, targetRoleId, managed, targetName, _adminName); } @@ -571,7 +571,7 @@ contract AccessAdmin is Blocknumber lastUpdateIn = _targetInfo[target].lastUpdateIn; _targetInfo[target].lastUpdateIn = BlocknumberLib.current(); - emit LogAccessAdminTargetLockedSet(_adminName, target, locked, lastUpdateIn); + emit LogAccessAdminTargetLockedSet(target, locked, _adminName, lastUpdateIn); } @@ -652,9 +652,11 @@ contract AccessAdmin is // logging emit LogAccessAdminFunctionGranted( - _adminName, target, + selector, + roleId, AccessAdminLib.toFunctionGrantingString(this, func.name, roleId), + _adminName, lastUpdateIn); } } \ No newline at end of file diff --git a/contracts/authorization/IAccessAdmin.sol b/contracts/authorization/IAccessAdmin.sol index d6a58ef43..f5f9b0217 100644 --- a/contracts/authorization/IAccessAdmin.sol +++ b/contracts/authorization/IAccessAdmin.sol @@ -12,6 +12,7 @@ import {Blocknumber} from "../type/Blocknumber.sol"; import {NftId} from "../type/NftId.sol"; import {ObjectType} from "../type/ObjectType.sol"; import {RoleId} from "../type/RoleId.sol"; +import {Selector} from "../type/Selector.sol"; import {Str} from "../type/String.sol"; import {VersionPart} from "../type/Version.sol"; @@ -24,14 +25,14 @@ interface IAccessAdmin is { // roles, targets and functions - event LogAccessAdminRoleCreated(string admin, RoleId roleId, TargetType targetType, RoleId roleAdminId, string name); - event LogAccessAdminTargetCreated(string admin, string name, bool managed, address target, RoleId roleId); - - event LogAccessAdminRoleActivatedSet(string admin, RoleId roleId, bool active, Blocknumber lastUpdateIn); - event LogAccessAdminRoleGranted(string admin, address account, string roleName); - event LogAccessAdminRoleRevoked(string admin, address account, string roleName); - event LogAccessAdminTargetLockedSet(string admin, address target, bool locked, Blocknumber lastUpdateIn); - event LogAccessAdminFunctionGranted(string admin, address target, string func, Blocknumber lastUpdateIn); + event LogAccessAdminRoleCreated(RoleId indexed roleId, RoleId indexed roleAdminId, TargetType indexed targetType, string name, string admin); + event LogAccessAdminTargetCreated(address indexed target, RoleId indexed roleId, bool indexed managed, string name, string admin); + + event LogAccessAdminRoleActivatedSet(RoleId indexed roleId, bool indexed active, string admin, Blocknumber indexed lastUpdateIn); + event LogAccessAdminRoleGranted(address indexed account, string roleName, string admin); + event LogAccessAdminRoleRevoked(address indexed account, string roleName, string admin); + event LogAccessAdminTargetLockedSet(address indexed target, bool indexed locked, string admin, Blocknumber indexed lastUpdateIn); + event LogAccessAdminFunctionGranted(address indexed target, Selector indexed selector, RoleId indexed roleId, string func, string admin, Blocknumber lastUpdateIn); // only deployer modifier error ErrorAccessAdminNotDeployer(); From e9973125d8b08b0c09c13fbb8620f25860b1b6a9 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Tue, 10 Dec 2024 15:24:02 +0000 Subject: [PATCH 02/35] refactor DistributionService events to improve parameter indexing and order (#787) --- .../distribution/DistributionService.sol | 41 ++++++++++--------- .../distribution/IDistributionService.sol | 16 ++++---- test/TestFees.t.sol | 8 ++-- 3 files changed, 34 insertions(+), 31 deletions(-) diff --git a/contracts/distribution/DistributionService.sol b/contracts/distribution/DistributionService.sol index bed43c1dd..075372369 100644 --- a/contracts/distribution/DistributionService.sol +++ b/contracts/distribution/DistributionService.sol @@ -98,21 +98,24 @@ contract DistributionService is } distributorType = DistributorTypeLib.toDistributorType(distributionNftId, name); - IDistribution.DistributorTypeInfo memory info = IDistribution.DistributorTypeInfo({ - name: name, - distributionNftId: distributionNftId, - minDiscountPercentage: minDiscountPercentage, - maxDiscountPercentage: maxDiscountPercentage, - commissionPercentage: commissionPercentage, - maxReferralCount: maxReferralCount, - maxReferralLifetime: maxReferralLifetime, - allowSelfReferrals: allowSelfReferrals, - allowRenewals: allowRenewals, - data: data}); - - instance.getInstanceStore().createDistributorType(distributorType, info); + + { + IDistribution.DistributorTypeInfo memory info = IDistribution.DistributorTypeInfo({ + name: name, + distributionNftId: distributionNftId, + minDiscountPercentage: minDiscountPercentage, + maxDiscountPercentage: maxDiscountPercentage, + commissionPercentage: commissionPercentage, + maxReferralCount: maxReferralCount, + maxReferralLifetime: maxReferralLifetime, + allowSelfReferrals: allowSelfReferrals, + allowRenewals: allowRenewals, + data: data}); + + instance.getInstanceStore().createDistributorType(distributorType, info); + } - emit LogDistributionServiceDistributorTypeCreated(distributionNftId, name, commissionPercentage); + emit LogDistributionServiceDistributorTypeCreated(distributionNftId, distributorType, name, commissionPercentage); } @@ -148,7 +151,7 @@ contract DistributionService is instance.getInstanceStore().createDistributor(distributorNftId, info); - emit LogDistributionServiceDistributorCreated(distributionNftId, distributorNftId, distributorType, distributor); + emit LogDistributionServiceDistributorCreated(distributionNftId, distributorNftId, distributor, distributorType); } function changeDistributorType( @@ -236,7 +239,7 @@ contract DistributionService is instance.getInstanceStore().createReferral(referralId, info); - emit LogDistributionServiceReferralCreated(distributionNftId, distributorNftId, referralId, code, discountPercentage, maxReferrals, expiryAt); + emit LogDistributionServiceReferralCreated(distributorNftId, referralId, code, discountPercentage, maxReferrals, expiryAt); } } @@ -258,7 +261,7 @@ contract DistributionService is referralInfo.usedReferrals += 1; instance.getInstanceStore().updateReferral(referralId, referralInfo, KEEP_STATE()); - emit LogDistributionServiceReferralProcessed(distributionNftId, referralInfo.distributorNftId, referralId, referralInfo.usedReferrals); + emit LogDistributionServiceReferralProcessed(referralInfo.distributorNftId, referralId, referralInfo.usedReferrals); } } @@ -299,7 +302,7 @@ contract DistributionService is } else { // increase distribution balance by distribution owner fee _accountingService.increaseDistributionBalance(store, distributionNftId, AmountLib.zero(), distributionOwnerFee); - emit LogDistributionServiceSaleProcessed(distributionNftId, referralId, premium.premiumAmount, distributionOwnerFee); + emit LogDistributionServiceSaleProcessed(distributionNftId, premium.premiumAmount, distributionOwnerFee); } @@ -343,7 +346,7 @@ contract DistributionService is // transfer amount to distributor { address distributor = getRegistry().ownerOf(distributorNftId); - emit LogDistributionServiceCommissionWithdrawn(distributorNftId, distributor, address(distributionInfo.tokenHandler.TOKEN()), withdrawnAmount); + emit LogDistributionServiceCommissionWithdrawn(distributorNftId, distributor, withdrawnAmount, address(distributionInfo.tokenHandler.TOKEN())); distributionInfo.tokenHandler.pushToken(distributor, withdrawnAmount); } } diff --git a/contracts/distribution/IDistributionService.sol b/contracts/distribution/IDistributionService.sol index b507675e0..e99eb64bb 100644 --- a/contracts/distribution/IDistributionService.sol +++ b/contracts/distribution/IDistributionService.sol @@ -39,14 +39,14 @@ interface IDistributionService is IService { error ErrorDistributionServiceInvalidFeeTransferred(Amount transferredDistributionFeeAmount, Amount expectedDistributionFeeAmount); error ErrorDistributionServiceReferralDistributionMismatch(ReferralId referralId, NftId referralDistributionNft, NftId distributionNftId); - event LogDistributionServiceCommissionWithdrawn(NftId distributorNftId, address recipient, address tokenAddress, Amount amount); - event LogDistributionServiceDistributorTypeCreated(NftId distributionNftId, string name, UFixed commissionPercentage); - event LogDistributionServiceDistributorCreated(NftId distributionNftId, NftId distributorNftId, DistributorType distributorType, address distributor); - event LogDistributionServiceDistributorTypeChanged(NftId distributorNftId, DistributorType oldDistributorType, DistributorType newDistributorType); - event LogDistributionServiceReferralCreated(NftId distributionNftId, NftId distributorNftId, ReferralId referralId, string code, UFixed discountPercentage, uint32 maxReferrals, Timestamp expiryAt); - event LogDistributionServiceReferralProcessed(NftId distributionNftId, NftId distributorNftId, ReferralId referralId, uint32 usedReferrals); - event LogDistributionServiceSaleProcessed(NftId distributionNftId, ReferralId referralId, Amount premium, Amount distributionOwnerFee); - event LogDistributionServiceSaleProcessedWithReferral(NftId distributionNftId, NftId distributorNftId, ReferralId referralId, uint32 numPoliciesSold, Amount premium, Amount distributionOwnerFee, Amount commissionAmount); + event LogDistributionServiceCommissionWithdrawn(NftId indexed distributorNftId, address indexed recipient, Amount indexed amount, address tokenAddress); + event LogDistributionServiceDistributorTypeCreated(NftId indexed distributionNftId, DistributorType indexed distributorType, string name, UFixed indexed commissionPercentage); + event LogDistributionServiceDistributorCreated(NftId indexed distributionNftId, NftId indexed distributorNftId, address indexed distributor, DistributorType distributorType); + event LogDistributionServiceDistributorTypeChanged(NftId indexed distributorNftId, DistributorType indexed oldDistributorType, DistributorType indexed newDistributorType); + event LogDistributionServiceReferralCreated(NftId indexed distributorNftId, ReferralId indexed referralId, string code, UFixed indexed discountPercentage, uint32 maxReferrals, Timestamp expiryAt); + event LogDistributionServiceReferralProcessed(NftId indexed distributorNftId, ReferralId indexed referralId, uint32 indexed usedReferrals); + event LogDistributionServiceSaleProcessed(NftId indexed distributionNftId, Amount indexed premium, Amount indexed distributionOwnerFee); + event LogDistributionServiceSaleProcessedWithReferral(NftId indexed distributionNftId, NftId indexed distributorNftId, ReferralId indexed referralId, uint32 numPoliciesSold, Amount premium, Amount distributionOwnerFee, Amount commissionAmount); function createDistributorType( string memory name, diff --git a/test/TestFees.t.sol b/test/TestFees.t.sol index 472cf6076..d8bd7aa6b 100644 --- a/test/TestFees.t.sol +++ b/test/TestFees.t.sol @@ -306,8 +306,8 @@ contract TestFees is GifTest { emit IDistributionService.LogDistributionServiceCommissionWithdrawn( distributorNftId, distributor, - address(token), - withdrawAmount + withdrawAmount, + address(token) ); // WHEN - the distributor withdraws part of his commission @@ -372,8 +372,8 @@ contract TestFees is GifTest { emit IDistributionService.LogDistributionServiceCommissionWithdrawn( distributorNftId, distributor, - address(token), - expectedWithdrawnAmount + expectedWithdrawnAmount, + address(token) ); // WHEN - the distributor withdraws part of his commission From c7996de7396e9ea543d4248f634777267e942036 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Tue, 10 Dec 2024 15:48:46 +0000 Subject: [PATCH 03/35] refactor event parameters to improve indexing and enhance event logging (#787) --- contracts/instance/BundleSet.sol | 12 ++++++------ contracts/instance/IInstance.sol | 14 +++++++------- contracts/instance/IInstanceService.sol | 11 ++++++----- contracts/instance/InstanceService.sol | 4 ++++ test/instance/InstanceReader.t.sol | 5 +++-- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/contracts/instance/BundleSet.sol b/contracts/instance/BundleSet.sol index cab38a570..f232ba443 100644 --- a/contracts/instance/BundleSet.sol +++ b/contracts/instance/BundleSet.sol @@ -14,13 +14,13 @@ contract BundleSet is { using LibNftIdSet for LibNftIdSet.Set; - event LogBundleSetPolicyLinked(NftId bundleNftId, NftId policyNftId); - event LogBundleSetPolicyUnlinked(NftId bundleNftId, NftId policyNftId); + event LogBundleSetPolicyLinked(NftId indexed bundleNftId, NftId indexed policyNftId); + event LogBundleSetPolicyUnlinked(NftId indexed bundleNftId, NftId indexed policyNftId); - event LogBundleSetBundleAdded(NftId poolNftId, NftId bundleNftId); - event LogBundleSetBundleUnlocked(NftId poolNftId, NftId bundleNftId); - event LogBundleSetBundleLocked(NftId poolNftId, NftId bundleNftId); - event LogBundleSetBundleClosed(NftId poolNftId, NftId bundleNftId); + event LogBundleSetBundleAdded(NftId indexed poolNftId, NftId indexed bundleNftId); + event LogBundleSetBundleUnlocked(NftId indexed poolNftId, NftId indexed bundleNftId); + event LogBundleSetBundleLocked(NftId indexed poolNftId, NftId indexed bundleNftId); + event LogBundleSetBundleClosed(NftId indexed poolNftId, NftId indexed bundleNftId); error ErrorBundleSetPolicyAlreadyActivated(NftId policyNftId); error ErrorBundleSetBundleLocked(NftId bundleNftId, NftId policyNftId); diff --git a/contracts/instance/IInstance.sol b/contracts/instance/IInstance.sol index 981d646b0..a30a6bfa2 100644 --- a/contracts/instance/IInstance.sol +++ b/contracts/instance/IInstance.sol @@ -22,15 +22,15 @@ interface IInstance is IRegisterable { // role handling - event LogInstanceCustomRoleCreated(RoleId roleId, string roleName, RoleId adminRoleId, uint32 maxMemberCount); - event LogInstanceCustomRoleActiveSet(RoleId roleId, bool active, address caller); - event LogInstanceCustomRoleGranted(RoleId roleId, address account, address caller); - event LogInstanceCustomRoleRevoked(RoleId roleId, address account, address caller); + event LogInstanceCustomRoleCreated(RoleId indexed roleId, string indexed roleName, RoleId indexed adminRoleId, uint32 maxMemberCount); + event LogInstanceCustomRoleActiveSet(RoleId indexed roleId, bool indexed active, address indexed caller); + event LogInstanceCustomRoleGranted(RoleId indexed roleId, address indexed account, address indexed caller); + event LogInstanceCustomRoleRevoked(RoleId indexed roleId, address indexed account, address indexed caller); // target handling - event LogInstanceCustomTargetCreated(address target, RoleId targetRoleId, string name); - event LogInstanceTargetLocked(address target, bool locked); - event LogInstanceCustomTargetFunctionRoleSet(address target, bytes4[] selectors, RoleId roleId); + event LogInstanceCustomTargetCreated(address indexed target, RoleId indexed targetRoleId, string indexed name); + event LogInstanceTargetLocked(address indexed target, bool indexed locked); + event LogInstanceCustomTargetFunctionRoleSet(address indexed target, bytes4[] indexed selectors, RoleId indexed roleId); // modifier is onlyRoleAdmin error ErrorInstanceNotCustomRole(RoleId roleId); diff --git a/contracts/instance/IInstanceService.sol b/contracts/instance/IInstanceService.sol index 7b40d0110..cc0701036 100644 --- a/contracts/instance/IInstanceService.sol +++ b/contracts/instance/IInstanceService.sol @@ -60,12 +60,13 @@ interface IInstanceService is IService { error ErrorInstanceServiceInstanceComponentMismatch(NftId instanceNftId, NftId componentNftId); error ErrorInstanceServiceInvalidComponentType(address componentAddress, ObjectType expectedType, ObjectType componentType); - event LogInstanceServiceInstanceLocked(NftId instanceNftId, bool locked); - event LogInstanceServiceInstanceCreated(NftId instanceNftId, address instance); - event LogInstanceServiceMasterInstanceRegistered(NftId masterInstanceNftId, address masterInstance, address masterInstanceAdmin, address masterAccessManager, + + event LogInstanceServiceInstanceLocked(NftId indexed instanceNftId, bool indexed locked); + event LogInstanceServiceInstanceCreated(NftId indexed instanceNftId, address indexed instance); + event LogInstanceServiceMasterInstanceRegistered(NftId indexed masterInstanceNftId, address indexed masterInstance, address indexed masterInstanceAdmin, address masterAccessManager, address masterInstanceReader, address masterInstanceBundleSet, address masterInstanceRiskSet, address masterInstanceRequestSet, address masterInstanceStore, address masterProductStore); - event LogInstanceServiceMasterInstanceReaderUpgraded(NftId instanceNfId, address newInstanceReader); - event LogInstanceServiceInstanceReaderUpgraded(NftId instanceNfId, address newInstanceReader); + event LogInstanceServiceMasterInstanceReaderUpgraded(NftId indexed instanceNfId, address indexed oldInstanceReader, address indexed newInstanceReader); + event LogInstanceServiceInstanceReaderUpgraded(NftId indexed instanceNfId, address indexed oldInstanceReader, address indexed newInstanceReader); /// @dev Creates a new custom role for the calling instance. function createRole(string memory roleName, RoleId adminRoleId, uint32 maxMemberCount) external returns (RoleId roleId); diff --git a/contracts/instance/InstanceService.sol b/contracts/instance/InstanceService.sol index 3cf179c03..bd1387c4c 100644 --- a/contracts/instance/InstanceService.sol +++ b/contracts/instance/InstanceService.sol @@ -306,11 +306,13 @@ contract InstanceService is InstanceReader upgradedInstanceReaderClone = InstanceReader( Clones.clone(address(_masterInstanceReader))); + address oldInstanceReaderAddress = address(instance.getInstanceReader()); upgradedInstanceReaderClone.initializeWithInstance(instanceAddress); instance.setInstanceReader(upgradedInstanceReaderClone); emit LogInstanceServiceInstanceReaderUpgraded( getRegistry().getNftIdForAddress(instanceAddress), + oldInstanceReaderAddress, address(upgradedInstanceReaderClone)); } @@ -415,10 +417,12 @@ contract InstanceService is InstanceReader instanceReader = InstanceReader(instanceReaderAddress); if(instanceReader.getInstance() != IInstance(_masterInstance)) { revert ErrorInstanceServiceInstanceReaderInstanceMismatch(); } + address oldMasterInstanceReaderAddress = _masterInstanceReader; _masterInstanceReader = instanceReaderAddress; emit LogInstanceServiceMasterInstanceReaderUpgraded( getRegistry().getNftIdForAddress(_masterInstance), + oldMasterInstanceReaderAddress, instanceReaderAddress); } diff --git a/test/instance/InstanceReader.t.sol b/test/instance/InstanceReader.t.sol index a51519cb8..84deb4c4c 100644 --- a/test/instance/InstanceReader.t.sol +++ b/test/instance/InstanceReader.t.sol @@ -21,11 +21,12 @@ contract InstanceReaderTest is GifTest { function test_instanceReaderUpgradeMasterInstanceReader() public { // GIVEN vm.startPrank(registryOwner); + address oldMasterInstanceReaderAddress = address(masterInstanceReader); InstanceReader newMasterInstanceReader = _createNewMasterInstanceReader(); // address newMasterInstanceReaderAddress = address(newMasterInstanceReader); vm.expectEmit(); - emit IInstanceService.LogInstanceServiceMasterInstanceReaderUpgraded(masterInstanceNftId, address(newMasterInstanceReader)); + emit IInstanceService.LogInstanceServiceMasterInstanceReaderUpgraded(masterInstanceNftId, oldMasterInstanceReaderAddress, address(newMasterInstanceReader)); // WHEN instanceService.upgradeMasterInstanceReader(address(newMasterInstanceReader)); @@ -78,7 +79,7 @@ contract InstanceReaderTest is GifTest { vm.startPrank(instanceOwner); vm.expectEmit(true, false, false, false); - emit IInstanceService.LogInstanceServiceInstanceReaderUpgraded(instanceNftId, address(newMasterInstanceReader)); + emit IInstanceService.LogInstanceServiceInstanceReaderUpgraded(instanceNftId, oldInstanceReaderAddress, address(newMasterInstanceReader)); instance.upgradeInstanceReader(); vm.stopPrank(); From 280c7d64c76897c5940e77625f2f8fd20cbc6da8 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Tue, 10 Dec 2024 16:12:42 +0000 Subject: [PATCH 04/35] refactor event parameters in InstanceStore and ProductStore to improve indexing and enhance event logging (#787) --- contracts/instance/InstanceStore.sol | 28 ++++++++++++++-------------- contracts/instance/ProductStore.sol | 28 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/contracts/instance/InstanceStore.sol b/contracts/instance/InstanceStore.sol index d82862a3a..9e00ffde3 100644 --- a/contracts/instance/InstanceStore.sol +++ b/contracts/instance/InstanceStore.sol @@ -34,20 +34,20 @@ contract InstanceStore is BaseStore { - event LogProductStoreComponentInfoCreated(NftId componentNftId, StateId state, address createdby, address txOrigin); - event LogProductStoreComponentInfoUpdated(NftId componentNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); - event LogProductStorePoolInfoCreated(NftId poolNftId, StateId state, address createdBy, address txOrigin); - event LogProductStorePoolInfoUpdated(NftId poolNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); - event LogProductStoreDistributorTypeInfoCreated(DistributorType distributorType, StateId state, address createdBy, address txOrigin); - event LogProductStoreDistributorTypeInfoUpdated(DistributorType distributorType, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); - event LogProductStoreDistributorInfoCreated(NftId distributorNftId, StateId state, address createdBy, address txOrigin); - event LogProductStoreDistributorInfoUpdated(NftId distributorNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); - event LogProductStoreReferralInfoCreated(ReferralId referralId, StateId state, address createdBy, address txOrigin); - event LogProductStoreReferralInfoUpdated(ReferralId referralId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); - event LogProductStoreBundleInfoCreated(NftId bundleNftId, StateId state, address createdBy, address txOrigin); - event LogProductStoreBundleInfoUpdated(NftId bundleNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); - event LogProductStoreRequestInfoCreated(RequestId requestId, StateId state, address createdBy, address txOrigin); - event LogProductStoreRequestInfoUpdated(RequestId requestId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); + event LogProductStoreComponentInfoCreated(NftId indexed componentNftId, StateId indexed state, address indexed createdby, address txOrigin); + event LogProductStoreComponentInfoUpdated(NftId indexed componentNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); + event LogProductStorePoolInfoCreated(NftId indexed poolNftId, StateId indexed state, address indexed createdBy, address txOrigin); + event LogProductStorePoolInfoUpdated(NftId indexed poolNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); + event LogProductStoreDistributorTypeInfoCreated(DistributorType indexed distributorType, StateId indexed state, address indexed createdBy, address txOrigin); + event LogProductStoreDistributorTypeInfoUpdated(DistributorType indexed distributorType, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); + event LogProductStoreDistributorInfoCreated(NftId indexed distributorNftId, StateId indexed state, address indexed createdBy, address txOrigin); + event LogProductStoreDistributorInfoUpdated(NftId indexed distributorNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); + event LogProductStoreReferralInfoCreated(ReferralId indexed referralId, StateId indexed state, address indexed createdBy, address txOrigin); + event LogProductStoreReferralInfoUpdated(ReferralId indexed referralId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); + event LogProductStoreBundleInfoCreated(NftId indexed bundleNftId, StateId indexed state, address indexed createdBy, address txOrigin); + event LogProductStoreBundleInfoUpdated(NftId indexed bundleNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); + event LogProductStoreRequestInfoCreated(RequestId indexed requestId, StateId indexed state, address indexed createdBy, address txOrigin); + event LogProductStoreRequestInfoUpdated(RequestId indexed requestId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); mapping(Key32 => IComponents.ComponentInfo) private _components; diff --git a/contracts/instance/ProductStore.sol b/contracts/instance/ProductStore.sol index 271f8f0c8..4cbe92f63 100644 --- a/contracts/instance/ProductStore.sol +++ b/contracts/instance/ProductStore.sol @@ -29,20 +29,20 @@ contract ProductStore is ObjectCounter, ObjectLifecycle { - event LogProductStoreProductInfoCreated(NftId productNftId, StateId state, address createdBy, address txOrigin); - event LogProductStoreProductInfoUpdated(NftId productNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); - event LogProductStoreFeeInfoCreated(NftId productNftId, StateId state, address createdBy, address txOrigin); - event LogProductStoreFeeInfoUpdated(NftId productNftId, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); - event LogProductStoreRiskInfoCreated(RiskId riskId, StateId state, address createdBy, address txOrigin); - event LogProductStoreRiskInfoUpdated(RiskId riskId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); - event LogProductStorePolicyInfoCreated(NftId policyNftId, StateId state, address createdBy, address txOrigin); - event LogProductStorePolicyInfoUpdated(NftId policyNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); - event LogProductStorePremiumInfoCreated(NftId policyNftId, StateId state, address createdBy, address txOrigin); - event LogProductStorePremiumInfoUpdated(NftId policyNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); - event LogProductStoreClaimInfoCreated(NftId policyNftId, ClaimId claimId, StateId state, address createdBy, address txOrigin); - event LogProductStoreClaimInfoUpdated(NftId policyNftId, ClaimId claimId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); - event LogProductStorePayoutInfoCreated(NftId policyNftId, PayoutId payoutId, StateId state, address createdBy, address txOrigin); - event LogProductStorePayoutInfoUpdated(NftId policyNftId, PayoutId payoutId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); + event LogProductStoreProductInfoCreated(NftId indexed productNftId, StateId indexed state, address indexed createdBy, address txOrigin); + event LogProductStoreProductInfoUpdated(NftId indexed productNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); + event LogProductStoreFeeInfoCreated(NftId indexed productNftId, StateId indexed state, address indexed createdBy, address txOrigin); + event LogProductStoreFeeInfoUpdated(NftId indexed productNftId, address indexed updatedBy, address indexed txOrigin, Blocknumber lastUpdatedIn); + event LogProductStoreRiskInfoCreated(RiskId indexed riskId, StateId indexed state, address indexed createdBy, address txOrigin); + event LogProductStoreRiskInfoUpdated(RiskId indexed riskId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); + event LogProductStorePolicyInfoCreated(NftId indexed policyNftId, StateId indexed state, address indexed createdBy, address txOrigin); + event LogProductStorePolicyInfoUpdated(NftId indexed policyNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); + event LogProductStorePremiumInfoCreated(NftId indexed policyNftId, StateId indexed state, address indexed createdBy, address txOrigin); + event LogProductStorePremiumInfoUpdated(NftId indexed policyNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); + event LogProductStoreClaimInfoCreated(NftId indexed policyNftId, ClaimId indexed claimId, StateId indexed state, address createdBy, address txOrigin); + event LogProductStoreClaimInfoUpdated(NftId indexed policyNftId, ClaimId indexed claimId, StateId indexed oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); + event LogProductStorePayoutInfoCreated(NftId indexed policyNftId, PayoutId indexed payoutId, StateId indexed state, address createdBy, address txOrigin); + event LogProductStorePayoutInfoUpdated(NftId indexed policyNftId, PayoutId indexed payoutId, StateId indexed oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn); mapping(Key32 key32 => IComponents.ProductInfo) private _products; mapping(Key32 key32 => IComponents.FeeInfo) private _fees; From f55115c522c5ad1b1c20b9bd742062be2e8c65ab Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 08:31:48 +0000 Subject: [PATCH 05/35] refactor RiskSet events to improve parameter indexing and naming consistency (#787) --- contracts/instance/RiskSet.sol | 12 ++-- docs_manual/events.md | 107 ++++++--------------------------- 2 files changed, 23 insertions(+), 96 deletions(-) diff --git a/contracts/instance/RiskSet.sol b/contracts/instance/RiskSet.sol index 34b739eef..430fe163e 100644 --- a/contracts/instance/RiskSet.sol +++ b/contracts/instance/RiskSet.sol @@ -13,12 +13,12 @@ contract RiskSet is ObjectSet { - event LogRiskSetPolicyLinked(RiskId riskId, NftId policyNftId); - event LogRiskSetPolicyUnlinked(RiskId riskId, NftId policyNftId); + event LogRiskSetPolicyLinked(RiskId indexed riskId, NftId indexed policyNftId); + event LogRiskSetPolicyUnlinked(RiskId indexed riskId, NftId indexed policyNftId); - event LogRiskSetRiskAdded(NftId productNftId, RiskId riskId); - event LogRiskSetRiskActive(NftId poolNftId, RiskId riskId); - event LogRiskSetRiskPaused(NftId poolNftId, RiskId riskId); + event LogRiskSetRiskAdded(NftId indexed productNftId, RiskId indexed riskId); + event LogRiskSetRiskActivated(NftId indexed poolNftId, RiskId indexed riskId); + event LogRiskSetRiskPaused(NftId indexed poolNftId, RiskId indexed riskId); error ErrorRiskSetRiskLocked(RiskId riskId, NftId policyNftId); error ErrorRiskSetRiskUnknown(RiskId riskId); @@ -68,7 +68,7 @@ contract RiskSet is function activate(RiskId riskId) external restricted() { NftId productNftId = ObjectSetHelperLib.getProductNftId(_instanceAddress, riskId); _activate(productNftId, riskId.toKey32()); - emit LogRiskSetRiskActive(productNftId, riskId); + emit LogRiskSetRiskActivated(productNftId, riskId); } /// @dev Applications linked to paused/archived risks may not be underwritten diff --git a/docs_manual/events.md b/docs_manual/events.md index 92ca60e27..43d5541e7 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -1,97 +1,24 @@ # Log events ``` + +=============== + +=============== + +=============== + +=============== + +=============== + +=============== + +=============== + +=============== + =============== -contracts/accounting/IAccountingService.sol: LogAccountingServiceBalanceChanged(NftId indexed nftId, Amount indexed amount, Amount indexed feeAmount, bool increase, ObjectType objectType) - -=============== -contracts/authorization/AccessManagerCloneable.sol: LogAccessManagerLocked(address indexed accessManager, bool indexed locked) - -=============== -contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleCreated(RoleId indexed roleId, RoleId indexed roleAdminId, TargetType indexed targetType, string name, string admin) -contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleActivatedSet(RoleId indexed roleId, bool indexed active, string admin, Blocknumber lastUpdateIn) -contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleGranted(address indexed account, RoleId indexed roleId, string roleName, string admin) -contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleRevoked(address indexed account, RoleId indexed roleId, string roleName, string admin) -contracts/authorization/IAccessAdmin.sol: LogAccessAdminTargetCreated(address indexed target, RoleId indexed roleId, bool indexed managed, string name, string admin) -contracts/authorization/IAccessAdmin.sol: LogAccessAdminTargetLockedSet(address indexed target, bool indexed locked, string admin, Blocknumber lastUpdateIn) -contracts/authorization/IAccessAdmin.sol: LogAccessAdminFunctionGranted(address indexed target, Selector indexed selector, RoleId indexed roleId, string func, string admin, Blocknumber lastUpdateIn) - -=============== -contracts/distribution/IDistributionService.sol: LogDistributionServiceCommissionWithdrawn(NftId indexed distributorNftId, address indexed recipient, Amount indexed amount, address tokenAddress) -contracts/distribution/IDistributionService.sol: LogDistributionServiceDistributorTypeCreated(NftId indexed distributionNftId, DistributorType distributorType, string indexed name, UFixed indexed commissionPercentage) -contracts/distribution/IDistributionService.sol: LogDistributionServiceDistributorCreated(NftId indexed distributionNftId, NftId indexed distributorNftId, address indexed distributor, DistributorType distributorType) -contracts/distribution/IDistributionService.sol: LogDistributionServiceDistributorTypeChanged(NftId indexed distributorNftId, DistributorType indexed oldDistributorType, DistributorType indexed newDistributorType) -contracts/distribution/IDistributionService.sol: LogDistributionServiceReferralCreated(NftId indexed distributorNftId, ReferralId indexed referralId, string code, UFixed discountPercentage, uint32 maxReferrals, Timestamp expiryAt) -contracts/distribution/IDistributionService.sol: LogDistributionServiceReferralProcessed(NftId indexed distributorNftId, ReferralId indexed referralId, uint32 usedReferrals) -contracts/distribution/IDistributionService.sol: LogDistributionServiceSaleProcessed(NftId indexed distributionNftId, Amount indexed premium, Amount indexed distributionOwnerFee) -contracts/distribution/IDistributionService.sol: LogDistributionServiceSaleProcessedWithReferral(NftId indexed distributionNftId, NftId indexed distributorNftId, ReferralId indexed referralId, uint32 numPoliciesSold, Amount premium, Amount distributionOwnerFee, Amount commissionAmount) - -=============== -contracts/instance/BundleSet.sol: LogBundleSetPolicyLinked(NftId indexed bundleNftId, NftId indexed policyNftId) -contracts/instance/BundleSet.sol: LogBundleSetPolicyUnlinked(NftId indexed bundleNftId, NftId indexed policyNftId) -contracts/instance/BundleSet.sol: LogBundleSetBundleAdded(NftId indexed poolNftId, NftId indexed bundleNftId) -contracts/instance/BundleSet.sol: LogBundleSetBundleUnlocked(NftId indexed poolNftId, NftId indexed bundleNftId) -contracts/instance/BundleSet.sol: LogBundleSetBundleLocked(NftId indexed poolNftId, NftId indexed bundleNftId) -contracts/instance/BundleSet.sol: LogBundleSetBundleClosed(NftId indexed poolNftId, NftId indexed bundleNftId) - -=============== -contracts/instance/IBaseStore.sol: LogBaseStoreMetadataCreated(Key32 indexed key, ObjectType indexed objectType, StateId indexed state) -contracts/instance/IBaseStore.sol: LogBaseStoreMetadataUpdated(Key32 indexed key, StateId indexed oldState, StateId indexed newState) - -=============== -contracts/instance/IInstance.sol: LogInstanceCustomRoleCreated(RoleId indexed roleId, string indexed roleName, RoleId indexed adminRoleId, uint32 maxMemberCount) -contracts/instance/IInstance.sol: LogInstanceCustomRoleActiveSet(RoleId indexed roleId, bool indexed active, address indexed caller) -contracts/instance/IInstance.sol: LogInstanceCustomRoleGranted(RoleId indexed roleId, address indexed account, address indexed caller) -contracts/instance/IInstance.sol: LogInstanceCustomRoleRevoked(RoleId indexed roleId, address indexed account, address indexed caller) -contracts/instance/IInstance.sol: LogInstanceCustomTargetCreated(address indexed target, RoleId indexed targetRoleId, string indexed name) -contracts/instance/IInstance.sol: LogInstanceTargetLocked(address indexed target, bool indexed locked) -contracts/instance/IInstance.sol: LogInstanceCustomTargetFunctionRoleSet(address indexed target, bytes4[] indexed selectors, RoleId indexed roleId) - -=============== -contracts/instance/IInstanceService.sol: LogInstanceServiceInstanceLocked(NftId indexed instanceNftId, bool indexed locked) -contracts/instance/IInstanceService.sol: LogInstanceServiceInstanceCreated(NftId indexed instanceNftId, address indexed instance) -contracts/instance/IInstanceService.sol: LogInstanceServiceMasterInstanceRegistered(NftId indexed masterInstanceNftId, address indexed masterInstance, address indexed masterInstanceAdmin, address masterAccessManager, address masterInstanceReader, address masterInstanceBundleSet, address masterInstanceRiskSet, address masterInstanceStore, address masterProductStore) -contracts/instance/IInstanceService.sol: LogInstanceServiceMasterInstanceReaderUpgraded(NftId indexed instanceNfId, address indexed oldInstanceReader, address indexed newInstanceReader) -contracts/instance/IInstanceService.sol: LogInstanceServiceInstanceReaderUpgraded(NftId indexed instanceNfId, address indexed oldInstanceReader, address indexed newInstanceReader) - -=============== -contracts/instance/InstanceStore.sol: LogProductStoreComponentInfoCreated(NftId indexed componentNftId, StateId indexed state, address indexed createdby, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStoreComponentInfoUpdated(NftId indexed componentNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/InstanceStore.sol: LogProductStorePoolInfoCreated(NftId indexed poolNftId, StateId indexed state, address indexed createdBy, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStorePoolInfoUpdated(NftId indexed poolNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/InstanceStore.sol: LogProductStoreDistributorTypeInfoCreated(DistributorType indexed distributorType, StateId indexed state, address indexed createdBy, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStoreDistributorTypeInfoUpdated(DistributorType indexed distributorType, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/InstanceStore.sol: LogProductStoreDistributorInfoCreated(NftId indexed distributorNftId, StateId indexed state, address indexed createdBy, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStoreDistributorInfoUpdated(NftId indexed distributorNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/InstanceStore.sol: LogProductStoreReferralInfoCreated(ReferralId indexed referralId, StateId indexed state, address indexed createdBy, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStoreReferralInfoUpdated(ReferralId indexed referralId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/InstanceStore.sol: LogProductStoreBundleInfoCreated(NftId indexed bundleNftId, StateId indexed state, address indexed createdBy, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStoreBundleInfoUpdated(NftId indexed bundleNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/InstanceStore.sol: LogProductStoreRequestInfoCreated(RequestId indexed requestId, StateId indexed state, address indexed createdBy, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStoreRequestInfoUpdated(RequestId indexed requestId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) - -=============== -contracts/instance/ProductStore.sol: LogProductStoreProductInfoCreated(NftId indexed productNftId, StateId indexed state, address indexed createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStoreProductInfoUpdated(NftId indexed productNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/ProductStore.sol: LogProductStoreFeeInfoCreated(NftId indexed productNftId, StateId indexed state, address indexed createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStoreFeeInfoUpdated(NftId indexed productNftId, address indexed updatedBy, address indexed txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/ProductStore.sol: LogProductStoreRiskInfoCreated(RiskId indexed riskId, StateId indexed state, address indexed createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStoreRiskInfoUpdated(RiskId indexed riskId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/ProductStore.sol: LogProductStorePolicyInfoCreated(NftId indexed policyNftId, StateId indexed state, address indexed createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStorePolicyInfoUpdated(NftId indexed policyNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/ProductStore.sol: LogProductStorePremiumInfoCreated(NftId indexed policyNftId, StateId indexed state, address indexed createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStorePremiumInfoUpdated(NftId indexed policyNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/ProductStore.sol: LogProductStoreClaimInfoCreated(NftId indexed policyNftId, ClaimId indexed claimId, StateId indexed state, address createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStoreClaimInfoUpdated(NftId indexed policyNftId, ClaimId indexed claimId, StateId indexed oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/ProductStore.sol: LogProductStorePayoutInfoCreated(NftId indexed policyNftId, PayoutId indexed payoutId, StateId indexed state, address createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStorePayoutInfoUpdated(NftId indexed policyNftId, PayoutId indexed payoutId, StateId indexed oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) - -=============== -contracts/instance/RiskSet.sol: LogRiskSetPolicyLinked(RiskId indexed riskId, NftId indexed policyNftId) -contracts/instance/RiskSet.sol: LogRiskSetPolicyUnlinked(RiskId indexed riskId, NftId indexed policyNftId) -contracts/instance/RiskSet.sol: LogRiskSetRiskAdded(NftId indexed productNftId, RiskId indexed riskId) -contracts/instance/RiskSet.sol: LogRiskSetRiskActivated(NftId indexed poolNftId, RiskId indexed riskId) -contracts/instance/RiskSet.sol: LogRiskSetRiskPaused(NftId indexed poolNftId, RiskId indexed riskId) =============== contracts/oracle/IOracleService.sol: LogOracleServiceRequestCreated(RequestId indexed requestId, NftId indexed requesterNftId, NftId indexed oracleNftId, Timestamp expiryAt) From 1e653d2a16c9fdb34bfe017de808f48c0048f0fd Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 08:44:22 +0000 Subject: [PATCH 06/35] refactor IOracleService events to improve parameter indexing and enhance event logging (#787) --- contracts/oracle/IOracleService.sol | 10 +++++----- contracts/oracle/OracleService.sol | 2 +- docs_manual/events.md | 25 ------------------------- test/component/oracle/Oracle.t.sol | 14 +++++--------- 4 files changed, 11 insertions(+), 40 deletions(-) diff --git a/contracts/oracle/IOracleService.sol b/contracts/oracle/IOracleService.sol index 96f04c28b..ba98a4963 100644 --- a/contracts/oracle/IOracleService.sol +++ b/contracts/oracle/IOracleService.sol @@ -11,11 +11,11 @@ import {Timestamp} from "../type/Timestamp.sol"; interface IOracleService is IService { - event LogOracleServiceRequestCreated(RequestId requestId, NftId requesterNftId, NftId oracleNftId, Timestamp expiryAt); - event LogOracleServiceResponseProcessed(RequestId requestId, NftId oracleNftId); - event LogOracleServiceDeliveryFailed(RequestId requestId, address requesterAddress, string functionSignature); - event LogOracleServiceResponseResent(RequestId requestId, NftId requesterNftId); - event LogOracleServiceRequestCancelled(RequestId requestId, NftId requesterNftId); + event LogOracleServiceRequestCreated(RequestId indexed requestId, NftId indexed requesterNftId, NftId indexed oracleNftId, Timestamp expiryAt); + event LogOracleServiceResponseProcessed(RequestId indexed requestId, NftId indexed requesterNftId, NftId indexed oracleNftId); + event LogOracleServiceDeliveryFailed(RequestId indexed requestId, address indexed requesterAddress, string indexed functionSignature); + event LogOracleServiceResponseResent(RequestId indexed requestId, NftId indexed requesterNftId); + event LogOracleServiceRequestCancelled(RequestId indexed requestId, NftId indexed requesterNftId); // create request error ErrorOracleServiceProductMismatch(ObjectType callerObjectType, NftId productNft, NftId oracleParentNftId); diff --git a/contracts/oracle/OracleService.sol b/contracts/oracle/OracleService.sol index 5422ed6b0..ed956b6ec 100644 --- a/contracts/oracle/OracleService.sol +++ b/contracts/oracle/OracleService.sol @@ -147,7 +147,7 @@ contract OracleService is emit LogOracleServiceDeliveryFailed(requestId, requesterInfo.objectAddress, functionSignature); } - emit LogOracleServiceResponseProcessed(requestId, oracleNftId); + emit LogOracleServiceResponseProcessed(requestId, request.requesterNftId, oracleNftId); } diff --git a/docs_manual/events.md b/docs_manual/events.md index 43d5541e7..99951d957 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -2,31 +2,6 @@ ``` -=============== - -=============== - -=============== - -=============== - -=============== - -=============== - -=============== - -=============== - -=============== - -=============== -contracts/oracle/IOracleService.sol: LogOracleServiceRequestCreated(RequestId indexed requestId, NftId indexed requesterNftId, NftId indexed oracleNftId, Timestamp expiryAt) -contracts/oracle/IOracleService.sol: LogOracleServiceResponseProcessed(RequestId indexed requestId, NftId indexed requesterNftId, NftId indexed oracleNftId) -contracts/oracle/IOracleService.sol: LogOracleServiceDeliveryFailed(RequestId indexed requestId, NftId indexed requesterNftId, string indexed functionSignature) -contracts/oracle/IOracleService.sol: LogOracleServiceResponseResent(RequestId indexed requestId, NftId indexed requesterNftId) -contracts/oracle/IOracleService.sol: LogOracleServiceRequestCancelled(RequestId indexed requestId, NftId indexed requesterNftId) - =============== contracts/pool/IBundleService.sol: LogBundleServiceBundleCreated(NftId indexed bundleNftId, NftId indexed poolNftId, Seconds indexed lifetime, Amount fixedFee, UFixed fractionalFee) contracts/pool/IBundleService.sol: LogBundleServiceBundleClosed(NftId indexed bundleNftId) diff --git a/test/component/oracle/Oracle.t.sol b/test/component/oracle/Oracle.t.sol index 2d30c1cbe..b0e8eedfa 100644 --- a/test/component/oracle/Oracle.t.sol +++ b/test/component/oracle/Oracle.t.sol @@ -40,11 +40,6 @@ contract TestOracle is GifTest { event LogSimpleProductRequestAsyncFulfilled(RequestId requestId, string responseText, uint256 responseDataLength); event LogSimpleProductRequestSyncFulfilled(RequestId requestId, string responseText, uint256 responseDataLength); - // from IOracleService - event LogOracleServiceResponseProcessed(RequestId requestId, NftId oracleNftId); - event LogOracleServiceDeliveryFailed(RequestId requestId, address requesterAddress, string functionSignature); - event LogOracleServiceResponseResent(RequestId requestId, NftId requesterNftId); - function setUp() public override { super.setUp(); @@ -303,15 +298,16 @@ contract TestOracle is GifTest { // check product fulfillOracleRequestAsync has been called Timestamp revertUntil = TimestampLib.max(); vm.expectEmit(address(oracleService)); - emit LogOracleServiceDeliveryFailed( + emit IOracleService.LogOracleServiceDeliveryFailed( requestId, address(product), "fulfillOracleRequestAsync(uint64,bytes)"); // check that oracle component has received oracle request vm.expectEmit(address(oracleService)); - emit LogOracleServiceResponseProcessed( - requestId, + emit IOracleService.LogOracleServiceResponseProcessed( + requestId, + productNftId, oracleNftId); // WHEN @@ -385,7 +381,7 @@ contract TestOracle is GifTest { bytes(responseText).length); vm.expectEmit(address(oracleService)); - emit LogOracleServiceResponseResent( + emit IOracleService.LogOracleServiceResponseResent( requestId, productNftId); From 609177a9a13485565f4b456aa94dd01e3afd977f Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 08:49:26 +0000 Subject: [PATCH 07/35] refactor IBundleService events to improve parameter indexing for better event filtering (#787) --- contracts/pool/IBundleService.sol | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/contracts/pool/IBundleService.sol b/contracts/pool/IBundleService.sol index ac03b9e3f..c465ce2d5 100644 --- a/contracts/pool/IBundleService.sol +++ b/contracts/pool/IBundleService.sol @@ -30,16 +30,16 @@ interface IBundleService is IService { error ErrorBundleServiceExtensionLifetimeIsZero(); - event LogBundleServiceBundleCreated(NftId bundleNftId, NftId poolNftId, Seconds lifetime, Amount fixedFee, UFixed fractionalFee); - event LogBundleServiceBundleClosed(NftId bundleNftId); - event LogBundleServiceBundleLocked(NftId bundleNftId); - event LogBundleServiceBundleUnlocked(NftId bundleNftId); - event LogBundleServiceBundleExtended(NftId bundleNftId, Seconds lifetimeExtension, Timestamp extendedExpiredAt); - event LogBundleServiceBundleFeeUpdated(NftId bundleNftId, Amount fixedFee, UFixed fractionalFee); - event LogBundleServiceCollateralLocked(NftId bundleNftId, NftId policyNftId, Amount collateralAmount); - event LogBundleServiceCollateralReleased(NftId bundleNftId, NftId policyNftId, Amount collateralAmount); - event LogBundleServiceBundleStaked(NftId bundleNftId, Amount amount); - event LogBundleServiceBundleUnstaked(NftId bundleNftId, Amount amount); + event LogBundleServiceBundleCreated(NftId indexed bundleNftId, NftId indexed poolNftId, Seconds indexed lifetime, Amount fixedFee, UFixed fractionalFee); + event LogBundleServiceBundleClosed(NftId indexed bundleNftId); + event LogBundleServiceBundleLocked(NftId indexed bundleNftId); + event LogBundleServiceBundleUnlocked(NftId indexed bundleNftId); + event LogBundleServiceBundleExtended(NftId indexed bundleNftId, Seconds indexed lifetimeExtension, Timestamp indexed extendedExpiredAt); + event LogBundleServiceBundleFeeUpdated(NftId indexed bundleNftId, Amount indexed fixedFee, UFixed indexed fractionalFee); + event LogBundleServiceCollateralLocked(NftId indexed bundleNftId, NftId indexed policyNftId, Amount indexed collateralAmount); + event LogBundleServiceCollateralReleased(NftId indexed bundleNftId, NftId indexed policyNftId, Amount indexed collateralAmount); + event LogBundleServiceBundleStaked(NftId indexed bundleNftId, Amount indexed amount); + event LogBundleServiceBundleUnstaked(NftId indexed bundleNftId, Amount indexed amount); /// @dev Create a new bundle for the specified attributes. function create( From bd1f6a04d21b4e7e55799572a2a9968f6355a83e Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 09:13:28 +0000 Subject: [PATCH 08/35] refactor IPoolComponent and IPoolService events to improve parameter indexing for enhanced event filtering and logging (#787) --- contracts/pool/IPoolComponent.sol | 2 +- contracts/pool/IPoolService.sol | 28 ++++++++++++++-------------- contracts/pool/PoolService.sol | 2 +- docs_manual/events.md | 31 +------------------------------ test/TestFees.t.sol | 12 ++++++------ 5 files changed, 23 insertions(+), 52 deletions(-) diff --git a/contracts/pool/IPoolComponent.sol b/contracts/pool/IPoolComponent.sol index 57d2d05f6..fad4d089a 100644 --- a/contracts/pool/IPoolComponent.sol +++ b/contracts/pool/IPoolComponent.sol @@ -19,7 +19,7 @@ interface IPoolComponent is IInstanceLinkedComponent { error ErrorPoolNotPoolService(address caller); error ErrorPoolApplicationBundleMismatch(NftId applicationNftId); - event LogPoolVerifiedByPool(address pool, NftId applicationNftId, Amount collateralizationAmount); + event LogPoolVerifiedByPool(address indexed pool, NftId indexed applicationNftId, Amount indexed collateralizationAmount); /// @dev This is a callback function that is called by the product service when underwriting a policy. /// The pool has the option to check the details and object to underwriting by reverting. diff --git a/contracts/pool/IPoolService.sol b/contracts/pool/IPoolService.sol index 69c8c11ad..1b8b04a06 100644 --- a/contracts/pool/IPoolService.sol +++ b/contracts/pool/IPoolService.sol @@ -14,25 +14,25 @@ import {PayoutId} from "../type/PayoutId.sol"; interface IPoolService is IService { - event LogPoolServiceMaxBalanceAmountUpdated(NftId poolNftId, Amount previousMaxCapitalAmount, Amount currentMaxCapitalAmount); - event LogPoolServiceWalletFunded(NftId poolNftId, address poolOwner, Amount amount); - event LogPoolServiceWalletDefunded(NftId poolNftId, address poolOwner, Amount amount); + event LogPoolServiceMaxBalanceAmountUpdated(NftId indexed poolNftId, Amount indexed previousMaxCapitalAmount, Amount indexed currentMaxCapitalAmount); + event LogPoolServiceWalletFunded(NftId indexed poolNftId, address indexed poolOwner, Amount indexed amount); + event LogPoolServiceWalletDefunded(NftId indexed poolNftId, address indexed poolOwner, Amount indexed amount); - event LogPoolServiceBundleCreated(NftId instanceNftId, NftId poolNftId, NftId bundleNftId); - event LogPoolServiceBundleClosed(NftId instanceNftId, NftId poolNftId, NftId bundleNftId, Amount balanceAmount, Amount feeAmount); + event LogPoolServiceBundleCreated(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId); + event LogPoolServiceBundleClosed(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId, Amount balanceAmount, Amount feeAmount); - event LogPoolServiceBundleStaked(NftId instanceNftId, NftId poolNftId, NftId bundleNftId, Amount amount, Amount netAmount); - event LogPoolServiceBundleUnstaked(NftId instanceNftId, NftId poolNftId, NftId bundleNftId, Amount amount, Amount netAmount); + event LogPoolServiceBundleStaked(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId, Amount amount, Amount netAmount); + event LogPoolServiceBundleUnstaked(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId, Amount amount, Amount netAmount); - event LogPoolServiceFeesWithdrawn(NftId bundleNftId, address recipient, address tokenAddress, Amount amount); + event LogPoolServiceFeesWithdrawn(NftId indexed bundleNftId, address indexed recipient, Amount indexed amount, address tokenAddress); - event LogPoolServiceProcessFundedClaim(NftId policyNftId, ClaimId claimId, Amount availableAmount); + event LogPoolServiceProcessFundedClaim(NftId indexed policyNftId, ClaimId indexed claimId, Amount indexed availableAmount); - event LogPoolServiceApplicationVerified(NftId poolNftId, NftId bundleNftId, NftId applicationNftId, Amount totalCollateralAmount); - event LogPoolServiceCollateralLocked(NftId poolNftId, NftId bundleNftId, NftId applicationNftId, Amount totalCollateralAmount, Amount lockedCollateralAmount); - event LogPoolServiceCollateralReleased(NftId bundleNftId, NftId policyNftId, Amount remainingCollateralAmount); - event LogPoolServiceSaleProcessed(NftId poolNftId, NftId bundleNftId, Amount bundleNetAmount, Amount bundleFeeAmount, Amount poolFeeAmount); - event LogPoolServicePayoutProcessed(NftId poolNftId, NftId bundleNftId, NftId policyNftId, PayoutId payoutId, Amount netPayoutAmount, Amount processingFeeAmount, address payoutBeneficiary); + event LogPoolServiceApplicationVerified(NftId indexed poolNftId, NftId indexed bundleNftId, NftId indexed applicationNftId, Amount totalCollateralAmount); + event LogPoolServiceCollateralLocked(NftId indexed poolNftId, NftId indexed bundleNftId, NftId indexed applicationNftId, Amount totalCollateralAmount, Amount lockedCollateralAmount); + event LogPoolServiceCollateralReleased(NftId indexed bundleNftId, NftId indexed policyNftId, Amount indexed releasedCollateralAmount); + event LogPoolServiceSaleProcessed(NftId indexed poolNftId, NftId indexed bundleNftId, Amount indexed bundleNetAmount, Amount bundleFeeAmount, Amount poolFeeAmount); + event LogPoolServicePayoutProcessed(NftId indexed poolNftId, NftId indexed bundleNftId, NftId indexed policyNftId, PayoutId payoutId, Amount netPayoutAmount, Amount processingFeeAmount, address payoutBeneficiary); error ErrorPoolServicePoolNotExternallyManaged(NftId poolNftId); error ErrorPoolServicePolicyPoolMismatch(NftId policyNftId, NftId productNftId, NftId expectedProductNftId); diff --git a/contracts/pool/PoolService.sol b/contracts/pool/PoolService.sol index 126eb17d4..623dd21a8 100644 --- a/contracts/pool/PoolService.sol +++ b/contracts/pool/PoolService.sol @@ -553,7 +553,7 @@ contract PoolService is address bundleOwner = getRegistry().ownerOf(bundleNftId); TokenHandler tokenHandler = reader.getTokenHandler(poolNftId); address token = address(tokenHandler.TOKEN()); - emit LogPoolServiceFeesWithdrawn(bundleNftId, bundleOwner, token, withdrawnAmount); + emit LogPoolServiceFeesWithdrawn(bundleNftId, bundleOwner, withdrawnAmount, token); tokenHandler.pushToken(bundleOwner, withdrawnAmount); } diff --git a/docs_manual/events.md b/docs_manual/events.md index 99951d957..f2b445505 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -2,36 +2,7 @@ ``` -=============== -contracts/pool/IBundleService.sol: LogBundleServiceBundleCreated(NftId indexed bundleNftId, NftId indexed poolNftId, Seconds indexed lifetime, Amount fixedFee, UFixed fractionalFee) -contracts/pool/IBundleService.sol: LogBundleServiceBundleClosed(NftId indexed bundleNftId) -contracts/pool/IBundleService.sol: LogBundleServiceBundleLocked(NftId indexed bundleNftId) -contracts/pool/IBundleService.sol: LogBundleServiceBundleUnlocked(NftId indexed bundleNftId) -contracts/pool/IBundleService.sol: LogBundleServiceBundleExtended(NftId indexed bundleNftId, Seconds indexed lifetimeExtension, Timestamp indexed extendedExpiredAt) -contracts/pool/IBundleService.sol: LogBundleServiceBundleFeeUpdated(NftId indexed bundleNftId, Amount indexed fixedFee, UFixed indexed fractionalFee) -contracts/pool/IBundleService.sol: LogBundleServiceCollateralLocked(NftId indexed bundleNftId, NftId indexed policyNftId, Amount indexed collateralAmount) -contracts/pool/IBundleService.sol: LogBundleServiceCollateralReleased(NftId indexed bundleNftId, NftId indexed policyNftId, Amount indexed collateralAmount) -contracts/pool/IBundleService.sol: LogBundleServiceBundleStaked(NftId indexed bundleNftId, Amount indexed amount) -contracts/pool/IBundleService.sol: LogBundleServiceBundleUnstaked(NftId indexed bundleNftId, Amount indexed amount) - -=============== -contracts/pool/IPoolComponent.sol: LogPoolVerifiedByPool(NftId indexed poolNftId, NftId indexed applicationNftId, Amount indexed collateralizationAmount) - -=============== -contracts/pool/IPoolService.sol: LogPoolServiceMaxBalanceAmountUpdated(NftId indexed poolNftId, Amount indexed previousMaxCapitalAmount, Amount indexed currentMaxCapitalAmount) -contracts/pool/IPoolService.sol: LogPoolServiceWalletFunded(NftId indexed poolNftId, address indexed poolOwner, Amount indexed amount) -contracts/pool/IPoolService.sol: LogPoolServiceWalletDefunded(NftId indexed poolNftId, address indexed poolOwner, Amount indexed amount) -contracts/pool/IPoolService.sol: LogPoolServiceBundleCreated(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId) -contracts/pool/IPoolService.sol: LogPoolServiceBundleClosed(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId, Amount balanceAmount, Amount feeAmount) -contracts/pool/IPoolService.sol: LogPoolServiceBundleStaked(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId, Amount amount, Amount netAmount) -contracts/pool/IPoolService.sol: LogPoolServiceBundleUnstaked(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId, Amount amount, Amount netAmount) -contracts/pool/IPoolService.sol: LogPoolServiceFeesWithdrawn(NftId indexed bundleNftId, address indexed recipient, Amount indexed amount, address tokenAddress) -contracts/pool/IPoolService.sol: LogPoolServiceProcessFundedClaim(NftId indexed policyNftId, ClaimId indexed claimId, Amount indexed availableAmount) -contracts/pool/IPoolService.sol: LogPoolServiceApplicationVerified(NftId indexed poolNftId, NftId indexed bundleNftId, NftId indexed applicationNftId, Amount totalCollateralAmount) -contracts/pool/IPoolService.sol: LogPoolServiceCollateralLocked(NftId indexed poolNftId, NftId indexed bundleNftId, NftId indexed applicationNftId, Amount totalCollateralAmount, Amount lockedCollateralAmount) -contracts/pool/IPoolService.sol: LogPoolServiceCollateralReleased(NftId indexed bundleNftId, NftId indexed policyNftId, Amount indexed releasedCollateralAmount) -contracts/pool/IPoolService.sol: LogPoolServiceSaleProcessed(NftId indexed poolNftId, NftId indexed bundleNftId, Amount indexed bundleNetAmount, Amount bundleFeeAmount, Amount poolFeeAmount) -contracts/pool/IPoolService.sol: LogPoolServicePayoutProcessed(NftId indexed poolNftId, NftId indexed bundleNftId, NftId indexed policyNftId, PayoutId payoutId, Amount netPayoutAmount, Amount processingFeeAmount, address payoutBeneficiary) + =============== contracts/product/IApplicationService.sol: LogApplicationServiceApplicationCreated(NftId indexed applicationNftId, NftId indexed productNftId, NftId indexed bundleNftId, RiskId riskId, ReferralId referralId, address applicationOwner, Amount sumInsuredAmount, Amount premiumAmount, Seconds lifetime) diff --git a/test/TestFees.t.sol b/test/TestFees.t.sol index d8bd7aa6b..143c44fe8 100644 --- a/test/TestFees.t.sol +++ b/test/TestFees.t.sol @@ -478,8 +478,8 @@ contract TestFees is GifTest { emit IPoolService.LogPoolServiceFeesWithdrawn( bundleNftId, investor, - address(token), - withdrawAmount + withdrawAmount, + address(token) ); // WHEN - the investor withdraws part of the bundle fee @@ -520,8 +520,8 @@ contract TestFees is GifTest { emit IPoolService.LogPoolServiceFeesWithdrawn( bundleNftId, investor, - address(token), - withdrawAmount + withdrawAmount, + address(token) ); // WHEN - the investor withdraws part of his bundle fee from the locked bundle @@ -576,8 +576,8 @@ contract TestFees is GifTest { emit IPoolService.LogPoolServiceFeesWithdrawn( bundleNftId, investor, - address(token), - bundleFeeBefore + bundleFeeBefore, + address(token) ); // WHEN - the investor withdraws the maximum available bundle fee amount From 4e95c2584ecea2747a02f770bb2762ab4b1323b3 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 09:45:31 +0000 Subject: [PATCH 09/35] refactor ClaimService and related events to improve parameter indexing for enhanced event filtering and logging (#787) --- contracts/product/ClaimService.sol | 2 +- contracts/product/IApplicationService.sol | 16 ++++++++-------- contracts/product/IClaimService.sol | 18 +++++++++--------- docs_manual/events.md | 15 --------------- test/component/product/ProductClaim.t.sol | 14 ++++++++++---- test/component/product/ProductPayout.t.sol | 10 +++++++--- 6 files changed, 35 insertions(+), 40 deletions(-) diff --git a/contracts/product/ClaimService.sol b/contracts/product/ClaimService.sol index 7cfa40f8f..28fd6d815 100644 --- a/contracts/product/ClaimService.sol +++ b/contracts/product/ClaimService.sol @@ -496,7 +496,7 @@ contract ClaimService is claimInfo.openPayoutsCount += 1; instanceContracts.productStore.updateClaim(policyNftId, claimId, claimInfo, KEEP_STATE()); - emit LogClaimServicePayoutCreated(policyNftId, payoutId, amount, beneficiary); + emit LogClaimServicePayoutCreated(policyNftId, claimId, payoutId, amount, beneficiary); } /// @dev Verifies the caller is a product and the policy is active. diff --git a/contracts/product/IApplicationService.sol b/contracts/product/IApplicationService.sol index 889caf017..01a5ff672 100644 --- a/contracts/product/IApplicationService.sol +++ b/contracts/product/IApplicationService.sol @@ -15,24 +15,24 @@ import {Seconds} from "../type/Seconds.sol"; interface IApplicationService is IService { event LogApplicationServiceApplicationCreated( - NftId applicationNftId, - NftId productNftId, - NftId bundleNftId, + NftId indexed applicationNftId, + NftId indexed productNftId, + NftId indexed bundleNftId, RiskId riskId, ReferralId referralId, address applicationOwner, Amount sumInsuredAmount, Amount premiumAmount, Seconds lifetime); - event LogApplicationServiceApplicationRenewed(NftId policyNftId, NftId bundleNftId); + event LogApplicationServiceApplicationRenewed(NftId indexed policyNftId, NftId indexed bundleNftId); event LogApplicationServiceApplicationAdjusted( - NftId applicationNftId, - NftId bundleNftId, - RiskId riskId, + NftId indexed applicationNftId, + NftId indexed bundleNftId, + RiskId indexed riskId, ReferralId referralId, Amount sumInsuredAmount, Seconds lifetime); - event LogApplicationServiceApplicationRevoked(NftId applicationNftId); + event LogApplicationServiceApplicationRevoked(NftId indexed applicationNftId); // _checkLinkedApplicationParameters error ErrorApplicationServiceRiskProductMismatch(RiskId riskId, NftId riskProductNftId, NftId productNftId); diff --git a/contracts/product/IClaimService.sol b/contracts/product/IClaimService.sol index d15c25b40..bc8e313d9 100644 --- a/contracts/product/IClaimService.sol +++ b/contracts/product/IClaimService.sol @@ -19,15 +19,15 @@ import {Fee} from "../type/Fee.sol"; interface IClaimService is IService { - event LogClaimServiceClaimSubmitted(NftId policyNftId, ClaimId claimId, Amount claimAmount); - event LogClaimServiceClaimConfirmed(NftId policyNftId, ClaimId claimId, Amount confirmedAmount); - event LogClaimServiceClaimDeclined(NftId policyNftId, ClaimId claimId); - event LogClaimServiceClaimRevoked(NftId policyNftId, ClaimId claimId); - event LogClaimServiceClaimCancelled(NftId policyNftId, ClaimId claimId); - - event LogClaimServicePayoutCreated(NftId policyNftId, PayoutId payoutId, Amount amount, address beneficiary); - event LogClaimServicePayoutProcessed(NftId policyNftId, PayoutId payoutId, Amount amount); - event LogClaimServicePayoutCancelled(NftId policyNftId, PayoutId payoutId); + event LogClaimServiceClaimSubmitted(NftId indexed policyNftId, ClaimId indexed claimId, Amount indexed claimAmount); + event LogClaimServiceClaimConfirmed(NftId indexed policyNftId, ClaimId indexed claimId, Amount indexed confirmedAmount); + event LogClaimServiceClaimDeclined(NftId indexed policyNftId, ClaimId indexed claimId); + event LogClaimServiceClaimRevoked(NftId indexed policyNftId, ClaimId indexed claimId); + event LogClaimServiceClaimCancelled(NftId indexed policyNftId, ClaimId indexed claimId); + + event LogClaimServicePayoutCreated(NftId indexed policyNftId, ClaimId indexed claimId, PayoutId indexed payoutId, Amount amount, address beneficiary); + event LogClaimServicePayoutProcessed(NftId indexed policyNftId, PayoutId indexed payoutId, Amount indexed amount); + event LogClaimServicePayoutCancelled(NftId indexed policyNftId, PayoutId indexed payoutId); error ErrorClaimServiceBeneficiarySet(NftId policyNftId, PayoutId payoutId, address beneficiary); diff --git a/docs_manual/events.md b/docs_manual/events.md index f2b445505..29db7c6ff 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -4,21 +4,6 @@ -=============== -contracts/product/IApplicationService.sol: LogApplicationServiceApplicationCreated(NftId indexed applicationNftId, NftId indexed productNftId, NftId indexed bundleNftId, RiskId riskId, ReferralId referralId, address applicationOwner, Amount sumInsuredAmount, Amount premiumAmount, Seconds lifetime) -contracts/product/IApplicationService.sol: LogApplicationServiceApplicationRenewed(NftId indexed policyNftId, NftId indexed bundleNftId) -contracts/product/IApplicationService.sol: LogApplicationServiceApplicationAdjusted(NftId indexed applicationNftId, NftId indexed bundleNftId, RiskId indexed riskId, ReferralId referralId, Amount sumInsuredAmount, Seconds lifetime) -contracts/product/IApplicationService.sol: LogApplicationServiceApplicationRevoked(NftId indexed applicationNftId) - -=============== -contracts/product/IClaimService.sol: LogClaimServiceClaimSubmitted(NftId indexed policyNftId, ClaimId indexed claimId, Amount indexed claimAmount) -contracts/product/IClaimService.sol: LogClaimServiceClaimConfirmed(NftId indexed policyNftId, ClaimId indexed claimId, Amount indexed confirmedAmount) -contracts/product/IClaimService.sol: LogClaimServiceClaimDeclined(NftId indexed policyNftId, ClaimId indexed claimId) -contracts/product/IClaimService.sol: LogClaimServiceClaimRevoked(NftId indexed policyNftId, ClaimId indexed claimId) -contracts/product/IClaimService.sol: LogClaimServiceClaimCancelled(NftId indexed policyNftId, ClaimId indexed claimId) -contracts/product/IClaimService.sol: LogClaimServicePayoutCreated(NftId indexed policyNftId, ClaimId indexed claimId, PayoutId indexed payoutId, Amount indexed amount, address beneficiary) -contracts/product/IClaimService.sol: LogClaimServicePayoutProcessed(NftId indexed policyNftId, PayoutId indexed payoutId, Amount indexed amount) -contracts/product/IClaimService.sol: LogClaimServicePayoutCancelled(NftId indexed policyNftId, PayoutId indexed payoutId) =============== contracts/product/IPolicyService.sol: LogPolicyServicePolicyCreated(NftId indexed policyNftId, Amount indexed premiumAmount, Timestamp indexed activatedAt) diff --git a/test/component/product/ProductClaim.t.sol b/test/component/product/ProductClaim.t.sol index 61dbfd66a..7b53cb433 100644 --- a/test/component/product/ProductClaim.t.sol +++ b/test/component/product/ProductClaim.t.sol @@ -78,7 +78,9 @@ contract TestProductClaim is GifTest { assertEq(entries.length, 5, "unexpected number of logs"); assertEq(entries[4].emitter, address(claimService), "unexpected emitter"); assertEq(entries[4].topics[0], keccak256("LogClaimServiceClaimSubmitted(uint96,uint16,uint96)"), "unexpected log signature"); - (uint96 nftIdInt ,uint24 claimIdInt, uint96 claimAmountInt) = abi.decode(entries[4].data, (uint96,uint16,uint96)); + uint96 nftIdInt = uint96(uint256(entries[4].topics[1])); + uint24 claimIdInt = uint24(uint256(entries[4].topics[2])); + uint96 claimAmountInt = uint96(uint256(entries[4].topics[3])); assertEq(nftIdInt, policyNftId.toInt(), "unexpected policy nft id"); assertEq(claimIdInt, claimId.toInt(), "unexpected claim id"); assertEq(claimAmountInt, claimAmount.toInt(), "unexpected claim amount"); @@ -209,7 +211,9 @@ contract TestProductClaim is GifTest { assertEq(entries.length, 5, "unexpected number of logs"); assertEq(entries[4].emitter, address(claimService), "unexpected emitter"); assertEq(entries[4].topics[0], keccak256("LogClaimServiceClaimConfirmed(uint96,uint16,uint96)"), "unexpected log signature"); - (uint96 nftIdInt,uint24 claimIdInt, uint96 amountInt ) = abi.decode(entries[4].data, (uint96,uint16,uint96)); + uint96 nftIdInt = uint96(uint256(entries[4].topics[1])); + uint16 claimIdInt = uint16(uint256(entries[4].topics[2])); + uint96 amountInt = uint96(uint256(entries[4].topics[3])); assertEq(nftIdInt, policyNftId.toInt(), "unexpected policy nft id"); assertEq(claimIdInt, claimId.toInt(), "unexpected claim id"); assertEq(amountInt, confirmedAmount.toInt(), "unexpected amount"); @@ -254,7 +258,8 @@ contract TestProductClaim is GifTest { assertEq(entries.length, 5, "unexpected number of logs"); assertEq(entries[4].emitter, address(claimService), "unexpected emitter"); assertEq(entries[4].topics[0], keccak256("LogClaimServiceClaimRevoked(uint96,uint16)"), "unexpected log signature"); - (uint96 nftIdInt ,uint24 claimIdInt) = abi.decode(entries[4].data, (uint96,uint16)); + uint96 nftIdInt = uint96(uint256(entries[4].topics[1])); + uint16 claimIdInt = uint16(uint256(entries[4].topics[2])); assertEq(nftIdInt, policyNftId.toInt(), "unexpected policy nft id"); assertEq(claimIdInt, claimId.toInt(), "unexpected claim id"); @@ -300,7 +305,8 @@ contract TestProductClaim is GifTest { assertEq(entries.length, 5, "unexpected number of logs"); assertEq(entries[4].emitter, address(claimService), "unexpected emitter"); assertEq(entries[4].topics[0], keccak256("LogClaimServiceClaimDeclined(uint96,uint16)"), "unexpected log signature"); - (uint96 nftIdInt ,uint24 claimIdInt) = abi.decode(entries[4].data, (uint96,uint16)); + uint96 nftIdInt = uint96(uint256(entries[4].topics[1])); + uint16 claimIdInt = uint16(uint256(entries[4].topics[2])); assertEq(nftIdInt, policyNftId.toInt(), "unexpected policy nft id"); assertEq(claimIdInt, claimId.toInt(), "unexpected claim id"); diff --git a/test/component/product/ProductPayout.t.sol b/test/component/product/ProductPayout.t.sol index 299fc5586..8e036e30c 100644 --- a/test/component/product/ProductPayout.t.sol +++ b/test/component/product/ProductPayout.t.sol @@ -86,10 +86,14 @@ contract TestProductClaim is GifTest { // checking last of 4 logs assertEq(entries.length, 5, "unexpected number of logs"); assertEq(entries[4].emitter, address(claimService), "unexpected emitter"); - assertEq(entries[4].topics[0], keccak256("LogClaimServicePayoutCreated(uint96,uint40,uint96,address)"), "unexpected log signature"); - (uint96 nftIdInt ,uint40 payoutIdInt, uint96 payoutAmountInt, address beneficiary) = abi.decode(entries[4].data, (uint96,uint40,uint96, address)); - + assertEq(entries[4].topics[0], keccak256("LogClaimServicePayoutCreated(uint96,uint16,uint40,uint96,address)"), "unexpected log signature (1)"); + (uint96 payoutAmountInt, address beneficiary) = abi.decode(entries[4].data, (uint96,address)); + uint96 nftIdInt = uint96(uint256(entries[4].topics[1])); + uint16 claimIdInt = uint16(uint256(entries[4].topics[2])); + uint40 payoutIdInt = uint40(uint256(entries[4].topics[3])); + assertEq(nftIdInt, policyNftId.toInt(), "unexpected policy nft id"); + assertEq(claimIdInt, claimId.toInt(), "unexpected claim id"); assertEq(payoutIdInt, payoutId.toInt(), "unexpected payout id"); assertEq(payoutAmountInt, payoutAmount.toInt(), "unexpected payout amount"); assertEq(beneficiary, customer, "unexpected beneficiary"); From 8b4f6f15f4a55d5594bab8f9502ec5c3c6e16788 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 09:49:15 +0000 Subject: [PATCH 10/35] refactor IPolicyService events to improve parameter indexing for enhanced event filtering and logging (#787) --- contracts/product/IPolicyService.sol | 14 +++++++------- docs_manual/events.md | 9 --------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/contracts/product/IPolicyService.sol b/contracts/product/IPolicyService.sol index 61f5e6a2c..d80c4077f 100644 --- a/contracts/product/IPolicyService.sol +++ b/contracts/product/IPolicyService.sol @@ -11,13 +11,13 @@ import {Timestamp} from "../type/Timestamp.sol"; interface IPolicyService is IService { - event LogPolicyServicePolicyCreated(NftId policyNftId, Amount premiumAmount, Timestamp activatedAt); - event LogPolicyServicePolicyDeclined(NftId policyNftId); - event LogPolicyServicePolicyPremiumCollected(NftId policyNftId, NftId productNftId, Amount premiumAmount, Timestamp activateAt); - event LogPolicyServicePolicyActivated(NftId policyNftId, Timestamp activatedAt); - event LogPolicyServicePolicyActivatedUpdated(NftId policyNftId, Timestamp activatedAt); - event LogPolicyServicePolicyExpirationUpdated(NftId policyNftId, Timestamp expiredAt); - event LogPolicyServicePolicyClosed(NftId policyNftId); + event LogPolicyServicePolicyCreated(NftId indexed policyNftId, Amount indexed premiumAmount, Timestamp indexed activatedAt); + event LogPolicyServicePolicyDeclined(NftId indexed policyNftId); + event LogPolicyServicePolicyPremiumCollected(NftId indexed policyNftId, NftId indexed productNftId, Amount indexed premiumAmount, Timestamp activateAt); + event LogPolicyServicePolicyActivated(NftId indexed policyNftId, Timestamp indexed activatedAt); + event LogPolicyServicePolicyActivatedUpdated(NftId indexed policyNftId, Timestamp indexed activatedAt); + event LogPolicyServicePolicyExpirationUpdated(NftId indexed policyNftId, Timestamp indexed expiredAt); + event LogPolicyServicePolicyClosed(NftId indexed policyNftId); error LogPolicyServiceMaxPremiumAmountExceeded(NftId policyNftId, Amount maxPremiumAmount, Amount premiumAmount); error ErrorPolicyServicePolicyProductMismatch(NftId applicationNftId, NftId expectedProductNftId, NftId actualProductNftId); diff --git a/docs_manual/events.md b/docs_manual/events.md index 29db7c6ff..8a9d937fb 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -5,15 +5,6 @@ -=============== -contracts/product/IPolicyService.sol: LogPolicyServicePolicyCreated(NftId indexed policyNftId, Amount indexed premiumAmount, Timestamp indexed activatedAt) -contracts/product/IPolicyService.sol: LogPolicyServicePolicyDeclined(NftId indexed policyNftId) -contracts/product/IPolicyService.sol: LogPolicyServicePolicyPremiumCollected(NftId indexed policyNftId, NftId indexed productNftId, Amount indexed premiumAmount, Timestamp activateAt) -contracts/product/IPolicyService.sol: LogPolicyServicePolicyActivated(NftId indexed policyNftId, Timestamp indexed activatedAt) -contracts/product/IPolicyService.sol: LogPolicyServicePolicyActivationUpdated(NftId indexed policyNftId, Timestamp indexed activatedAt) -contracts/product/IPolicyService.sol: LogPolicyServicePolicyExpirationUpdated(NftId indexed policyNftId, Timestamp indexed expiredAt) -contracts/product/IPolicyService.sol: LogPolicyServicePolicyClosed(NftId indexed policyNftId) - =============== contracts/product/IRiskService.sol: LogRiskServiceRiskCreated(NftId indexed productNftId, RiskId indexed riskId) contracts/product/IRiskService.sol: LogRiskServiceRiskUpdated(NftId indexed productNftId, RiskId indexed riskId) From 4b27a1a15addebed5d27c45a4bcada11d4653201 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 09:51:03 +0000 Subject: [PATCH 11/35] refactor IRiskService events to improve parameter indexing for enhanced event filtering and logging (#787) --- contracts/product/IRiskService.sol | 10 +++++----- docs_manual/events.md | 9 --------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/contracts/product/IRiskService.sol b/contracts/product/IRiskService.sol index 118e197ad..3ae53a3c9 100644 --- a/contracts/product/IRiskService.sol +++ b/contracts/product/IRiskService.sol @@ -9,11 +9,11 @@ import {StateId} from "../type/StateId.sol"; interface IRiskService is IService { - event LogRiskServiceRiskCreated(NftId productNftId, RiskId riskId); - event LogRiskServiceRiskUpdated(NftId productNftId, RiskId riskId); - event LogRiskServiceRiskLocked(NftId productNftId, RiskId riskId); - event LogRiskServiceRiskUnlocked(NftId productNftId, RiskId riskId); - event LogRiskServiceRiskClosed(NftId productNftId, RiskId riskId); + event LogRiskServiceRiskCreated(NftId indexed productNftId, RiskId indexed riskId); + event LogRiskServiceRiskUpdated(NftId indexed productNftId, RiskId indexed riskId); + event LogRiskServiceRiskLocked(NftId indexed productNftId, RiskId indexed riskId); + event LogRiskServiceRiskUnlocked(NftId indexed productNftId, RiskId indexed riskId); + event LogRiskServiceRiskClosed(NftId indexed productNftId, RiskId indexed riskId); error ErrorRiskServiceRiskProductMismatch(RiskId riskId, NftId riskProductNftId, NftId productNftId); error ErrorRiskServiceRiskNotActive(NftId productNftId, RiskId riskId); diff --git a/docs_manual/events.md b/docs_manual/events.md index 8a9d937fb..0e693197b 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -3,15 +3,6 @@ ``` - - -=============== -contracts/product/IRiskService.sol: LogRiskServiceRiskCreated(NftId indexed productNftId, RiskId indexed riskId) -contracts/product/IRiskService.sol: LogRiskServiceRiskUpdated(NftId indexed productNftId, RiskId indexed riskId) -contracts/product/IRiskService.sol: LogRiskServiceRiskLocked(NftId indexed productNftId, RiskId indexed riskId) -contracts/product/IRiskService.sol: LogRiskServiceRiskUnlocked(NftId indexed productNftId, RiskId indexed riskId) -contracts/product/IRiskService.sol: LogRiskServiceRiskClosed(NftId indexed productNftId, RiskId indexed riskId) - =============== contracts/registry/ChainNft.sol: LogChainNftInterceptorAddress(uint256 indexed tokenId, address indexed interceptor) From 1ee90203b859f05c990d808804226728cf3ea81c Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 10:14:19 +0000 Subject: [PATCH 12/35] refactor events in ChainNft and IRegistry contracts to improve parameter indexing for enhanced event filtering (#787) --- contracts/registry/ChainNft.sol | 2 +- contracts/registry/IRegistry.sol | 6 +++--- docs_manual/events.md | 7 ------- test/registry/ChainNft.t.sol | 8 +++----- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/contracts/registry/ChainNft.sol b/contracts/registry/ChainNft.sol index a2a0b5c31..a4f034ab2 100644 --- a/contracts/registry/ChainNft.sol +++ b/contracts/registry/ChainNft.sol @@ -8,7 +8,7 @@ import {ITransferInterceptor} from "./ITransferInterceptor.sol"; contract ChainNft is ERC721Enumerable { - event LogTokenInterceptorAddress(uint256 tokenId, address interceptor); + event LogTokenInterceptorAddress(uint256 indexed tokenId, address indexed interceptor); // constants string public constant NAME = "Decentralized Insurance Protocol NFT"; diff --git a/contracts/registry/IRegistry.sol b/contracts/registry/IRegistry.sol index b25b74df4..66726a564 100644 --- a/contracts/registry/IRegistry.sol +++ b/contracts/registry/IRegistry.sol @@ -19,9 +19,9 @@ interface IRegistry is IERC165 { - event LogRegistryObjectRegistered(NftId nftId, NftId parentNftId, ObjectType objectType, bool isInterceptor, address objectAddress, address initialOwner); - event LogRegistryServiceRegistered(NftId nftId, VersionPart majorVersion, ObjectType domain); - event LogRegistryChainRegistryRegistered(NftId nftId, uint256 chainId, address chainRegistryAddress); + event LogRegistryObjectRegistered(NftId indexed nftId, NftId indexed parentNftId, ObjectType indexed objectType, bool isInterceptor, address objectAddress, address initialOwner); + event LogRegistryServiceRegistered(NftId indexed nftId, VersionPart indexed majorVersion, ObjectType indexed domain); + event LogRegistryChainRegistryRegistered(NftId indexed nftId, uint256 indexed chainId, address indexed chainRegistryAddress); // initialize error ErrorRegistryCallerNotDeployer(); diff --git a/docs_manual/events.md b/docs_manual/events.md index 0e693197b..c493a4aaf 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -3,13 +3,6 @@ ``` -=============== -contracts/registry/ChainNft.sol: LogChainNftInterceptorAddress(uint256 indexed tokenId, address indexed interceptor) - -=============== -contracts/registry/IRegistry.sol: LogRegistryObjectRegistered(NftId indexed nftId, NftId indexed parentNftId, ObjectType indexed objectType, bool isInterceptor, address objectAddress, address initialOwner) -contracts/registry/IRegistry.sol: LogRegistryServiceRegistered(NftId indexed nftId, VersionPart indexed majorVersion, ObjectType indexed domain) -contracts/registry/IRegistry.sol: LogRegistryChainRegistryRegistered(NftId indexed nftId, uint256 indexed chainId, address indexed chainRegistryAddress) =============== contracts/registry/ReleaseAdmin.sol: LogReleaseAdminReleaseLocked(VersionPart indexed release, bool indexed locked) diff --git a/test/registry/ChainNft.t.sol b/test/registry/ChainNft.t.sol index a30a2599a..33ee0dbe8 100644 --- a/test/registry/ChainNft.t.sol +++ b/test/registry/ChainNft.t.sol @@ -160,7 +160,7 @@ contract ChainNftTest is Test { function test_chainNftMintHappyCase() public { string memory uri = "ipfs://someHash"; - uint expectedTokenId = 43133705; + uint256 expectedTokenId = 43133705; assertEq(chainNft.totalMinted(), 0, "minted > 0 after contract deploy"); assertEq(chainNft.balanceOf(outsider), 0, "unexpected nft balance for outsider"); @@ -169,7 +169,7 @@ contract ChainNftTest is Test { emit Transfer(address(0), outsider, expectedTokenId); vm.expectEmit(address(chainNft)); - emit LogTokenInterceptorAddress(expectedTokenId, address(0)); + emit ChainNft.LogTokenInterceptorAddress(expectedTokenId, address(0)); vm.recordLogs(); @@ -260,8 +260,6 @@ contract ChainNftTest is Test { chainNft.mint(outsider, address(interceptor), uri); } - // keep identical to ChainNft events - event LogTokenInterceptorAddress(uint256 tokenId, address interceptor); // keep identical to IERC721 events event Transfer(address indexed from, address indexed to, uint256 indexed value); @@ -277,7 +275,7 @@ contract ChainNftTest is Test { emit Transfer(address(0), outsider, expectedTokenId); vm.expectEmit(address(chainNft)); - emit LogTokenInterceptorAddress(expectedTokenId, address(interceptor)); + emit ChainNft.LogTokenInterceptorAddress(expectedTokenId, address(interceptor)); vm.recordLogs(); From 1d0fa4797c44064fe15e6ef1add4e7e1ccba23a5 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 10:21:18 +0000 Subject: [PATCH 13/35] refactor ReleaseAdmin and ReleaseRegistry events to improve parameter indexing for enhanced event filtering (#787) --- contracts/registry/ReleaseAdmin.sol | 8 ++++---- contracts/registry/ReleaseRegistry.sol | 12 ++++++------ docs_manual/events.md | 11 ----------- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/contracts/registry/ReleaseAdmin.sol b/contracts/registry/ReleaseAdmin.sol index 6dd4d934a..1b04201ec 100644 --- a/contracts/registry/ReleaseAdmin.sol +++ b/contracts/registry/ReleaseAdmin.sol @@ -21,8 +21,8 @@ import {VersionPart} from "../type/Version.sol"; contract ReleaseAdmin is AccessAdmin { - event LogReleaseAdminReleaseLockChanged(VersionPart release, bool locked); - event LogReleaseAdminServiceLockChanged(VersionPart release, address service, bool locked); + event LogReleaseAdminReleaseLocked(VersionPart indexed release, bool indexed locked); + event LogReleaseAdminServiceLocked(VersionPart indexed release, address indexed service, bool indexed locked); error ErrorReleaseAdminCallerNotReleaseRegistry(address caller); error ErrorReleaseAdminNotService(address notService); @@ -137,7 +137,7 @@ contract ReleaseAdmin is // effects accessManager.setLocked(locked); - emit LogReleaseAdminReleaseLockChanged(getRelease(), locked); + emit LogReleaseAdminReleaseLocked(getRelease(), locked); } @@ -155,7 +155,7 @@ contract ReleaseAdmin is _setTargetLocked(address(service), locked); - emit LogReleaseAdminServiceLockChanged(service.getRelease(), address(service), locked); + emit LogReleaseAdminServiceLocked(service.getRelease(), address(service), locked); } //--- private functions -------------------------------------------------// diff --git a/contracts/registry/ReleaseRegistry.sol b/contracts/registry/ReleaseRegistry.sol index 94bd50ab5..cd28006ba 100644 --- a/contracts/registry/ReleaseRegistry.sol +++ b/contracts/registry/ReleaseRegistry.sol @@ -38,10 +38,10 @@ contract ReleaseRegistry is { uint256 public constant INITIAL_GIF_VERSION = 3;// first active release version - event LogReleaseCreation(IAccessAdmin admin, VersionPart release, bytes32 salt); - event LogReleaseActivation(VersionPart release); - event LogReleaseDisabled(VersionPart release); - event LogReleaseEnabled(VersionPart release); + event LogReleaseCreated(IAccessAdmin indexed admin, VersionPart indexed release, bytes32 indexed salt); + event LogReleaseActivated(VersionPart indexed release); + event LogReleaseDisabled(VersionPart indexed release); + event LogReleaseEnabled(VersionPart indexed release); // constructor error ErrorReleaseRegistryNotRegistry(Registry registry); @@ -168,7 +168,7 @@ contract ReleaseRegistry is _releaseInfo[releaseVersion].auth = serviceAuthorization; _releaseInfo[releaseVersion].releaseAdmin = address(releaseAdmin); - emit LogReleaseCreation(releaseAdmin, releaseVersion, releaseSalt); + emit LogReleaseCreated(releaseAdmin, releaseVersion, releaseSalt); } function registerService(IService service) @@ -270,7 +270,7 @@ contract ReleaseRegistry is _setReleaseLocked(release, false); - emit LogReleaseActivation(release); + emit LogReleaseActivated(release); } /// @dev stop/resume operations with restricted functions diff --git a/docs_manual/events.md b/docs_manual/events.md index c493a4aaf..101aa5d69 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -3,17 +3,6 @@ ``` - -=============== -contracts/registry/ReleaseAdmin.sol: LogReleaseAdminReleaseLocked(VersionPart indexed release, bool indexed locked) -contracts/registry/ReleaseAdmin.sol: LogReleaseAdminServiceLocked(VersionPart indexed release, address indexed service, bool indexed locked) - -=============== -contracts/registry/ReleaseRegistry.sol: LogReleaseCreation(IAccessAdmin indexed admin, VersionPart indexed release, bytes32 indexed salt) -contracts/registry/ReleaseRegistry.sol: LogReleaseActivation(VersionPart indexed release) -contracts/registry/ReleaseRegistry.sol: LogReleaseDisabled(VersionPart indexed release) -contracts/registry/ReleaseRegistry.sol: LogReleaseEnabled(VersionPart indexed release) - =============== contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenRegistered(ChainId indexed chainId, address indexed token, string indexed symbol, uint256 decimals) contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenGlobalStateSet(ChainId indexed chainId, address indexed token, bool indexed active) From 9588a19b59715b6635c78d127b09b218d0877997 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 10:31:42 +0000 Subject: [PATCH 14/35] refactor TokenRegistry events to improve parameter indexing for enhanced event filtering (#787) --- contracts/registry/TokenRegistry.sol | 6 +++--- docs_manual/events.md | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/contracts/registry/TokenRegistry.sol b/contracts/registry/TokenRegistry.sol index 258e5a6b6..3c721d046 100644 --- a/contracts/registry/TokenRegistry.sol +++ b/contracts/registry/TokenRegistry.sol @@ -18,9 +18,9 @@ contract TokenRegistry is AccessManaged, IRegistryLinked { - event LogTokenRegistryTokenRegistered(ChainId chainId, address token, uint256 decimals, string symbol); - event LogTokenRegistryTokenGlobalStateSet(ChainId chainId, address token, bool active); - event LogTokenRegistryTokenStateSet(ChainId chainId, address token, VersionPart release, bool active); + event LogTokenRegistryTokenRegistered(ChainId indexed chainId, address indexed token, uint256 indexed decimals, string symbol); + event LogTokenRegistryTokenGlobalStateSet(ChainId indexed chainId, address indexed token, bool indexed active); + event LogTokenRegistryTokenStateSet(ChainId indexed chainId, address indexed token, VersionPart indexed release, bool active); error ErrorTokenRegistryChainIdZero(); error ErrorTokenRegistryTokenAddressZero(); diff --git a/docs_manual/events.md b/docs_manual/events.md index 101aa5d69..b53468838 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -3,10 +3,6 @@ ``` -=============== -contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenRegistered(ChainId indexed chainId, address indexed token, string indexed symbol, uint256 decimals) -contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenGlobalStateSet(ChainId indexed chainId, address indexed token, bool indexed active) -contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenStateSet(ChainId indexed chainId, address indexed token, bool indexed active, VersionPart release) =============== contracts/shared/IComponentService.sol: LogComponentServiceComponentLocked(address component, bool locked) From 536d73549e421a8e3c43ee7d11fed9a68e64e0c2 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 10:40:03 +0000 Subject: [PATCH 15/35] refactor IComponentService events to improve parameter indexing for enhanced event filtering (#787) --- contracts/shared/ComponentService.sol | 4 ++-- contracts/shared/IComponentService.sol | 20 ++++++++++---------- docs_manual/events.md | 9 --------- test/TestFees.t.sol | 4 ++-- 4 files changed, 14 insertions(+), 23 deletions(-) diff --git a/contracts/shared/ComponentService.sol b/contracts/shared/ComponentService.sol index 932d53273..1115ab845 100644 --- a/contracts/shared/ComponentService.sol +++ b/contracts/shared/ComponentService.sol @@ -189,8 +189,8 @@ contract ComponentService is emit LogComponentServiceComponentFeesWithdrawn( componentNftId, componentOwner, - address(tokenHandler.TOKEN()), - withdrawnAmount); + withdrawnAmount, + address(tokenHandler.TOKEN())); // interactions // transfer amount to component owner diff --git a/contracts/shared/IComponentService.sol b/contracts/shared/IComponentService.sol index 194895780..461529251 100644 --- a/contracts/shared/IComponentService.sol +++ b/contracts/shared/IComponentService.sol @@ -45,20 +45,20 @@ interface IComponentService is error ErrorComponentServiceWithdrawAmountExceedsLimit(Amount withdrawnAmount, Amount withdrawLimit); error ErrorComponentServiceWalletAllowanceTooSmall(address wallet, address spender, uint256 allowance, uint256 amount); - event LogComponentServiceComponentLocked(address component, bool locked); - event LogComponentServiceTokenHandlerDeployed(NftId componentNftId, address tokenHandler, address token); - event LogComponentServiceRegistered(NftId instanceNftId, NftId componentNftId, ObjectType componentType, address component, address token, address initialOwner); - event LogComponentServiceComponentFeesWithdrawn(NftId componentNftId, address recipient, address token, Amount withdrawnAmount); - event LogComponentServiceProductFeesUpdated(NftId productNftId); - event LogComponentServiceDistributionFeesUpdated(NftId distributionNftId); - event LogComponentServicePoolFeesUpdated(NftId poolNftId); + event LogComponentServiceComponentLocked(address indexed component, bool indexed locked); + event LogComponentServiceTokenHandlerDeployed(NftId indexed componentNftId, address indexed tokenHandler, address indexed token); + event LogComponentServiceRegistered(NftId indexed instanceNftId, NftId indexed componentNftId, ObjectType indexed componentType, address component, address token, address initialOwner); + event LogComponentServiceComponentFeesWithdrawn(NftId indexed componentNftId, address indexed recipient, Amount indexed withdrawnAmount, address token); + event LogComponentServiceProductFeesUpdated(NftId indexed productNftId); + event LogComponentServiceDistributionFeesUpdated(NftId indexed distributionNftId); + event LogComponentServicePoolFeesUpdated(NftId indexed poolNftId); event LogComponentServiceUpdateFee( - NftId nftId, + NftId indexed nftId, string feeName, UFixed previousFractionalFee, Amount previousFixedFee, - UFixed newFractionalFee, - Amount newFixedFee + UFixed indexed newFractionalFee, + Amount indexed newFixedFee ); event LogComponentServiceProductCreated( NftId indexed productNftId, address indexed productAddress, bool indexed hasDistribution, uint8 expectedNumberOfOracles); diff --git a/docs_manual/events.md b/docs_manual/events.md index b53468838..29ab913c1 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -4,15 +4,6 @@ -=============== -contracts/shared/IComponentService.sol: LogComponentServiceComponentLocked(address component, bool locked) -contracts/shared/IComponentService.sol: LogComponentServiceTokenHandlerDeployed(NftId componentNftId, address tokenHandler, address token) -contracts/shared/IComponentService.sol: LogComponentServiceComponentRegistered(NftId instanceNftId, NftId componentNftId, ObjectType componentType, address component, address token, address initialOwner) -contracts/shared/IComponentService.sol: LogComponentServiceComponentFeesWithdrawn(NftId componentNftId, address recipient, address token, Amount withdrawnAmount) -contracts/shared/IComponentService.sol: LogComponentServiceProductFeesUpdated(NftId productNftId) -contracts/shared/IComponentService.sol: LogComponentServiceDistributionFeesUpdated(NftId distributionNftId) -contracts/shared/IComponentService.sol: LogComponentServicePoolFeesUpdated(NftId poolNftId) -contracts/shared/IComponentService.sol: LogComponentServiceUpdateFee(NftId nftId, string feeName, UFixed previousFractionalFee, Amount previousFixedFee, UFixed newFractionalFee, Amount newFixedFee) =============== contracts/shared/INftOwnable.sol: LogNftOwnableNftLinkedToAddress(NftId nftId, address owner) diff --git a/test/TestFees.t.sol b/test/TestFees.t.sol index 143c44fe8..9b04be56a 100644 --- a/test/TestFees.t.sol +++ b/test/TestFees.t.sol @@ -51,8 +51,8 @@ contract TestFees is GifTest { emit IComponentService.LogComponentServiceComponentFeesWithdrawn( distributionNftId, distributionOwner, - address(token), - withdrawAmount + withdrawAmount, + address(token) ); // WHEN From ea278607795870ea23df70c2773f451dfc54457f Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 10:42:59 +0000 Subject: [PATCH 16/35] refactor events in INftOwnable and TokenHandler contracts to improve parameter indexing for enhanced event filtering (#787) --- contracts/shared/INftOwnable.sol | 2 +- contracts/shared/TokenHandler.sol | 10 +++++----- docs_manual/events.md | 11 ----------- test/shared/TokenHandler.t.sol | 8 ++++---- 4 files changed, 10 insertions(+), 21 deletions(-) diff --git a/contracts/shared/INftOwnable.sol b/contracts/shared/INftOwnable.sol index bf21377b2..7aabd2045 100644 --- a/contracts/shared/INftOwnable.sol +++ b/contracts/shared/INftOwnable.sol @@ -11,7 +11,7 @@ interface INftOwnable is IERC165, IRegistryLinked { - event LogNftOwnableNftLinkedToAddress(NftId nftId, address owner); + event LogNftOwnableNftLinkedToAddress(NftId indexed nftId, address indexed owner); error ErrorNftOwnableInitialOwnerZero(); error ErrorNftOwnableNotOwner(address account); diff --git a/contracts/shared/TokenHandler.sol b/contracts/shared/TokenHandler.sol index e4944c48c..3bd92ac8b 100644 --- a/contracts/shared/TokenHandler.sol +++ b/contracts/shared/TokenHandler.sol @@ -19,14 +19,14 @@ import {SERVICE} from "../type/ObjectType.sol"; contract TokenHandlerBase { // _setWallet - event LogTokenHandlerWalletAddressChanged(NftId componentNftId, address oldWallet, address newWallet); - event LogTokenHandlerWalletTokensTransferred(NftId componentNftId, address oldWallet, address newWallet, Amount amount); + event LogTokenHandlerWalletAddressChanged(NftId indexed componentNftId, address indexed oldWallet, address indexed newWallet); + event LogTokenHandlerWalletTokensTransferred(NftId indexed componentNftId, address indexed oldWallet, address indexed newWallet, Amount amount); // _approveTokenHandler - event LogTokenHandlerTokenApproved(NftId nftId, address tokenHandler, address token, Amount amount, bool isMaxAmount); + event LogTokenHandlerTokenApproved(NftId indexed nftId, address indexed tokenHandler, address indexed token, Amount amount, bool isMaxAmount); // _transfer - event LogTokenHandlerTokenTransfer(address token, address from, address to, Amount amount); + event LogTokenHandlerTokenTransferred(address indexed token, address indexed from, address indexed to, Amount amount); // constructor error ErrorTokenHandlerNotRegistry(address registry); @@ -204,7 +204,7 @@ contract TokenHandlerBase { } // transfer the tokens - emit LogTokenHandlerTokenTransfer(address(TOKEN), from, to, amount); + emit LogTokenHandlerTokenTransferred(address(TOKEN), from, to, amount); SafeERC20.safeTransferFrom( TOKEN, diff --git a/docs_manual/events.md b/docs_manual/events.md index 29ab913c1..eef142297 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -3,17 +3,6 @@ ``` - - -=============== -contracts/shared/INftOwnable.sol: LogNftOwnableNftLinkedToAddress(NftId nftId, address owner) - -=============== -contracts/shared/TokenHandler.sol: LogTokenHandlerWalletAddressChanged(NftId componentNftId, address oldWallet, address newWallet) -contracts/shared/TokenHandler.sol: LogTokenHandlerWalletTokensTransferred(NftId componentNftId, address oldWallet, address newWallet, Amount amount) -contracts/shared/TokenHandler.sol: LogTokenHandlerTokenApproved(NftId nftId, address tokenHandler, address token, Amount amount, bool isMaxAmount) -contracts/shared/TokenHandler.sol: LogTokenHandlerTokenTransfer(address token, address from, address to, Amount amount) - =============== contracts/staking/IStaking.sol: LogStakingTokenHandlerDeployed(NftId componentNftId, address tokenHandler, address token) contracts/staking/IStaking.sol: LogStakingStakingRateSet(ChainId chainId, address token, UFixed oldStakingRate, UFixed newStakingRate, Blocknumber lastUpdateIn) diff --git a/test/shared/TokenHandler.t.sol b/test/shared/TokenHandler.t.sol index 751d370e7..381ecab6e 100644 --- a/test/shared/TokenHandler.t.sol +++ b/test/shared/TokenHandler.t.sol @@ -78,7 +78,7 @@ contract TokenHandlerTest is GifTest { // THEN vm.expectEmit(); - emit TokenHandlerBase.LogTokenHandlerTokenTransfer( + emit TokenHandlerBase.LogTokenHandlerTokenTransferred( address(dip), sender, tokenHandlerWallet, @@ -102,7 +102,7 @@ contract TokenHandlerTest is GifTest { // THEN vm.expectEmit(); - emit TokenHandlerBase.LogTokenHandlerTokenTransfer(address(dip), sender, tokenHandlerWallet, amount); + emit TokenHandlerBase.LogTokenHandlerTokenTransferred(address(dip), sender, tokenHandlerWallet, amount); // WHEN tokenHandlerEx.pullToken(sender, amount); @@ -123,7 +123,7 @@ contract TokenHandlerTest is GifTest { // THEN vm.expectEmit(); - emit TokenHandlerBase.LogTokenHandlerTokenTransfer(address(dip), sender, tokenHandlerWallet, amount); + emit TokenHandlerBase.LogTokenHandlerTokenTransferred(address(dip), sender, tokenHandlerWallet, amount); // WHEN tokenHandlerEx.pullToken(sender, amount); @@ -241,7 +241,7 @@ contract TokenHandlerTest is GifTest { // THEN vm.expectEmit(); - emit TokenHandlerBase.LogTokenHandlerTokenTransfer(address(dip), sender, recipient, amount); + emit TokenHandlerBase.LogTokenHandlerTokenTransferred(address(dip), sender, recipient, amount); // WHEN tokenHandlerEx.pushToken(recipient, amount); From 0f2da6d166d14aaa430460a786c0cb205612e92d Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 12:31:09 +0000 Subject: [PATCH 17/35] refactor event parameter order in Staking contracts for consistency and clarity (#787) --- contracts/staking/IStaking.sol | 64 ++++++++++++------------ contracts/staking/Staking.sol | 8 +-- contracts/staking/StakingStore.sol | 6 +-- docs_manual/events.md | 31 ------------ test/staking/StakingOwner.t.sol | 2 +- test/staking/StakingRateManagement.t.sol | 15 ++---- 6 files changed, 44 insertions(+), 82 deletions(-) diff --git a/contracts/staking/IStaking.sol b/contracts/staking/IStaking.sol index 4bea30143..2938e1f71 100644 --- a/contracts/staking/IStaking.sol +++ b/contracts/staking/IStaking.sol @@ -25,28 +25,28 @@ interface IStaking is IVersionable { - event LogStakingTokenHandlerDeployed(NftId componentNftId, address tokenHandler, address token); + event LogStakingTokenHandlerDeployed(NftId indexed componentNftId, address indexed tokenHandler, address indexed token); // owner functions - event LogStakingStakingRateSet(ChainId chainId, address token, UFixed newStakingRate, UFixed oldStakingRate, Blocknumber lastUpdateIn); - event LogStakingStakingServiceSet(address stakingService, VersionPart release, address oldStakingService); - event LogStakingStakingReaderSet(address stakingReader, address oldStakingReader); - event LogStakingTargetHandlerSet(address targetManager, address oldTargetHandler); - event LogStakingTokenHandlerApproved(address token, Amount approvalAmount, Amount oldApprovalAmount); + event LogStakingStakingRateSet(ChainId indexed chainId, address indexed token, UFixed indexed oldStakingRate, UFixed newStakingRate, Blocknumber lastUpdateIn); + event LogStakingStakingServiceSet(address indexed oldStakingService, address indexed stakingService, VersionPart indexed release); + event LogStakingStakingReaderSet(address indexed oldStakingReader, address indexed stakingReader); + event LogStakingTargetHandlerSet(address indexed oldTargetHandler, address indexed targetManager); + event LogStakingTokenHandlerApproved(Amount indexed oldApprovalAmount, Amount indexed approvalAmount, address indexed token); // token - event LogStakingTokenAdded(ChainId chainId, address token); - event LogStakingTargetTokenAdded(NftId targetNftId, ChainId chainId, address token); + event LogStakingTokenAdded(ChainId indexed chainId, address indexed token); + event LogStakingTargetTokenAdded(NftId indexed targetNftId, address indexed token); // total value locked - event LogStakingTvlIncreased(NftId targetNftId, address token, Amount amount, Amount newBalance, Blocknumber lastUpdateIn); - event LogStakingTvlDecreased(NftId targetNftId, address token, Amount amount, Amount newBalance, Blocknumber lastUpdateIn); + event LogStakingTvlIncreased(NftId indexed targetNftId, address indexed token, Amount indexed amount, Amount newBalance, Blocknumber lastUpdateIn); + event LogStakingTvlDecreased(NftId indexed targetNftId, address indexed token, Amount indexed amount, Amount newBalance, Blocknumber lastUpdateIn); // targets event LogStakingSupportInfoSet( - ObjectType objectType, - bool isSupported, - bool allowNewTargets, + ObjectType indexed objectType, + bool indexed isSupported, + bool indexed allowNewTargets, bool allowCrossChain, Amount minStakingAmount, Amount maxStakingAmount, @@ -56,31 +56,31 @@ interface IStaking is UFixed maxRewardRate, Blocknumber lastUpdateIn); - event LogStakingTargetCreated(NftId targetNftId, ObjectType objectType, Seconds lockingPeriod, UFixed rewardRate); - event LogStakingLimitsSet(NftId targetNftId, Amount marginAmount, Amount hardLimitAmount, Blocknumber lastUpdateIn); - event LogStakingTargetLimitsUpdated(NftId targetNftId, Amount marginAmount, Amount hardLimitAmount, Blocknumber lastUpdateIn); - event LogStakingTargetLimitUpdated(NftId targetNftId, Amount limitAmount, Amount hardLimitAmount, Amount requiredStakeAmount, Amount actualStakeAmount, Blocknumber lastUpdateIn); + event LogStakingTargetCreated(NftId indexed targetNftId, ObjectType indexed objectType, Seconds indexed lockingPeriod, UFixed rewardRate); + event LogStakingLimitsSet(NftId indexed targetNftId, Amount indexed marginAmount, Amount indexed hardLimitAmount, Blocknumber lastUpdateIn); + event LogStakingTargetLimitsUpdated(NftId indexed targetNftId, Amount indexed marginAmount, Amount indexed hardLimitAmount, Blocknumber lastUpdateIn); + event LogStakingTargetLimitUpdated(NftId indexed targetNftId, Amount indexed limitAmount, Amount indexed hardLimitAmount, Amount requiredStakeAmount, Amount actualStakeAmount, Blocknumber lastUpdateIn); // target parameters - event LogStakingTargetLockingPeriodSet(NftId targetNftId, Seconds oldLockingPeriod, Seconds lockingPeriod, Blocknumber lastUpdateIn); - event LogStakingTargetRewardRateSet(NftId targetNftId, UFixed rewardRate, UFixed oldRewardRate, Blocknumber lastUpdateIn); - event LogStakingTargetMaxStakedAmountSet(NftId targetNftId, Amount stakeLimitAmount, Blocknumber lastUpdateIn); - event LogStakingTargetLimitsSet(NftId targetNftId, Amount stakeLimitAmount, Amount marginAmount, Amount limitAmount); + event LogStakingTargetLockingPeriodSet(NftId indexed targetNftId, Seconds indexed oldLockingPeriod, Seconds indexed lockingPeriod, Blocknumber lastUpdateIn); + event LogStakingTargetRewardRateSet(NftId indexed targetNftId, UFixed indexed oldRewardRate, UFixed indexed rewardRate, Blocknumber lastUpdateIn); + event LogStakingTargetMaxStakedAmountSet(NftId indexed targetNftId, Amount indexed stakeLimitAmount, Blocknumber indexed lastUpdateIn); + event LogStakingTargetLimitsSet(NftId indexed targetNftId, Amount indexed stakeLimitAmount, Amount indexed marginAmount, Amount limitAmount); // reward reserves - event LogStakingRewardReservesRefilled(NftId targetNftId, Amount dipAmount, address targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn); - event LogStakingRewardReservesWithdrawn(NftId targetNftId, Amount dipAmount, address targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn); - event LogStakingRewardReservesSpent(NftId targetNftId, Amount dipAmount, Amount reserveBalance, Blocknumber lastUpdateIn); + event LogStakingRewardReservesRefilled(NftId indexed targetNftId, Amount indexed dipAmount, address indexed targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn); + event LogStakingRewardReservesWithdrawn(NftId indexed targetNftId, Amount indexed dipAmount, address indexed targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn); + event LogStakingRewardReservesSpent(NftId indexed targetNftId, Amount indexed dipAmount, Amount indexed reserveBalance, Blocknumber lastUpdateIn); // stakes - event LogStakingStakeCreated(NftId stakeNftId, NftId targetNftId, Amount stakeAmount, Timestamp lockedUntil, address stakeOwner); - event LogStakingStakeRewardsUpdated(NftId stakeNftId, Amount rewardIncrementAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); - event LogStakingRewardsRestaked(NftId stakeNftId, Amount restakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); - event LogStakingStaked(NftId stakeNftId, Amount stakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); - event LogStakingUnstaked(NftId stakeNftId, Amount unstakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); - event LogStakingRewardsClaimed(NftId stakeNftId, Amount claimedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); - - event LogStakingStakeRestaked(NftId stakeNftId, NftId targetNftId, Amount stakeAmount, address owner, NftId oldStakeNftId); + event LogStakingStakeCreated(NftId indexed stakeNftId, NftId indexed targetNftId, Amount indexed stakeAmount, Timestamp lockedUntil, address stakeOwner); + event LogStakingStakeRewardsUpdated(NftId indexed stakeNftId, Amount indexed rewardIncrementAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); + event LogStakingRewardsRestaked(NftId indexed stakeNftId, Amount indexed restakedAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); + event LogStakingStaked(NftId indexed stakeNftId, Amount indexed stakedAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); + event LogStakingUnstaked(NftId indexed stakeNftId, Amount indexed unstakedAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); + event LogStakingRewardsClaimed(NftId indexed stakeNftId, Amount indexed claimedAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); + + event LogStakingStakeRestaked(NftId indexed stakeNftId, NftId indexed targetNftId, Amount indexed stakeAmount, address owner, NftId oldStakeNftId); // modifiers error ErrorStakingNotStake(NftId stakeNftId); diff --git a/contracts/staking/Staking.sol b/contracts/staking/Staking.sol index b27a409b7..9d13248a0 100644 --- a/contracts/staking/Staking.sol +++ b/contracts/staking/Staking.sol @@ -177,7 +177,7 @@ contract Staking is Blocknumber lastUpdateIn ) = _getStakingStorage()._store.setStakingRate(chainId, token, stakingRate); - emit LogStakingStakingRateSet(chainId, token, stakingRate, oldStakingRate, lastUpdateIn); + emit LogStakingStakingRateSet(chainId, token, oldStakingRate, stakingRate, lastUpdateIn); } @@ -193,7 +193,7 @@ contract Staking is address oldStakingService = address($._stakingService); $._stakingService = StakingLib.checkAndGetStakingService(getRegistry(), release); - emit LogStakingStakingServiceSet(address($._stakingService), release, oldStakingService); + emit LogStakingStakingServiceSet(oldStakingService, address($._stakingService), release); } @@ -250,7 +250,7 @@ contract Staking is token, amount); - emit LogStakingTokenHandlerApproved(address(token), amount, oldAllowanceAmount); + emit LogStakingTokenHandlerApproved(oldAllowanceAmount, amount, address(token)); } //--- target management -------------------------------------------------// @@ -422,7 +422,7 @@ contract Staking is $._store.addTargetToken(targetNftId, token); // TODO move logging to store - emit LogStakingTargetTokenAdded(targetNftId, chainId, token); + emit LogStakingTargetTokenAdded(targetNftId, token); } diff --git a/contracts/staking/StakingStore.sol b/contracts/staking/StakingStore.sol index 73daee594..cd7ea9444 100644 --- a/contracts/staking/StakingStore.sol +++ b/contracts/staking/StakingStore.sol @@ -151,7 +151,7 @@ contract StakingStore is address oldReader = address(_reader); _reader = StakingReader(reader); - emit IStaking.LogStakingStakingReaderSet(reader, oldReader); + emit IStaking.LogStakingStakingReaderSet(oldReader, reader); } @@ -162,7 +162,7 @@ contract StakingStore is address oldTargetHandler = address(_targetLimitHandler); _targetLimitHandler = ITargetLimitHandler(targetLimitHandler ); - emit IStaking.LogStakingTargetHandlerSet(targetLimitHandler , oldTargetHandler); + emit IStaking.LogStakingTargetHandlerSet(oldTargetHandler, targetLimitHandler); } //--- target support management -----------------------------------------// @@ -387,7 +387,7 @@ contract StakingStore is targetInfo.lastUpdateIn = BlocknumberLib.current(); // logging - emit IStaking.LogStakingTargetRewardRateSet(targetNftId, rewardRate, oldRewardRate, lastUpdateIn); + emit IStaking.LogStakingTargetRewardRateSet(targetNftId, oldRewardRate, rewardRate, lastUpdateIn); } diff --git a/docs_manual/events.md b/docs_manual/events.md index eef142297..fbec47193 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -3,37 +3,6 @@ ``` -=============== -contracts/staking/IStaking.sol: LogStakingTokenHandlerDeployed(NftId componentNftId, address tokenHandler, address token) -contracts/staking/IStaking.sol: LogStakingStakingRateSet(ChainId chainId, address token, UFixed oldStakingRate, UFixed newStakingRate, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingStakingServiceSet(address stakingService, VersionPart release, address oldStakingService) -contracts/staking/IStaking.sol: LogStakingStakingReaderSet(address stakingReader, address oldStakingReader) -contracts/staking/IStaking.sol: LogStakingTargetHandlerSet(address targetManager, address oldTargetHandler) -contracts/staking/IStaking.sol: LogStakingTokenHandlerApproved(address token, Amount approvalAmount, Amount oldApprovalAmount) -contracts/staking/IStaking.sol: LogStakingTokenAdded(ChainId chainId, address token) -contracts/staking/IStaking.sol: LogStakingTargetTokenAdded(NftId targetNftId, address token) -contracts/staking/IStaking.sol: LogStakingTvlIncreased(NftId targetNftId, address token, Amount amount, Amount newBalance, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTvlDecreased(NftId targetNftId, address token, Amount amount, Amount newBalance, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingSupportInfoSet(ObjectType objectType, bool isSupported, bool allowNewTargets, bool allowCrossChain, Amount minStakingAmount, Amount maxStakingAmount, Seconds minLockingPeriod, Seconds maxLockingPeriod, UFixed minRewardRate, UFixed maxRewardRate, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetCreated(NftId targetNftId, ObjectType objectType, Seconds lockingPeriod, UFixed rewardRate) -contracts/staking/IStaking.sol: LogStakingLimitsSet(NftId targetNftId, Amount marginAmount, Amount hardLimitAmount, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetLimitsUpdated(NftId targetNftId, Amount marginAmount, Amount hardLimitAmount, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetLimitUpdated(NftId targetNftId, Amount limitAmount, Amount hardLimitAmount, Amount requiredStakeAmount, Amount actualStakeAmount, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetLockingPeriodSet(NftId targetNftId, Seconds oldLockingPeriod, Seconds newLockingPeriod, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetRewardRateSet(NftId targetNftId, UFixed oldRewardRate, UFixed newRewardRate, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetMaxStakedAmountSet(NftId targetNftId, Amount stakeLimitAmount, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetLimitsSet(NftId targetNftId, Amount stakeLimitAmount, Amount marginAmount, Amount limitAmount) -contracts/staking/IStaking.sol: LogStakingRewardReservesRefilled(NftId targetNftId, Amount dipAmount, address targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingRewardReservesWithdrawn(NftId targetNftId, Amount dipAmount, address targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingRewardReservesSpent(NftId targetNftId, Amount dipAmount, Amount reserveBalance, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingStakeCreated(NftId stakeNftId, NftId targetNftId, Amount stakeAmount, Timestamp lockedUntil, address stakeOwner) -contracts/staking/IStaking.sol: LogStakingStakeRewardsUpdated(NftId stakeNftId, Amount rewardIncrementAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingRewardsRestaked(NftId stakeNftId, Amount restakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingStaked(NftId stakeNftId, Amount stakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingUnstaked(NftId stakeNftId, Amount unstakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingRewardsClaimed(NftId stakeNftId, Amount claimedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingStakeRestaked(NftId stakeNftId, NftId targetNftId, Amount stakeAmount, address owner, NftId oldStakeNftId) - =============== contracts/staking/IStakingService.sol: LogStakingServiceProtocolTargetRegistered(NftId protocolNftId) contracts/staking/IStakingService.sol: LogStakingServiceInstanceTargetRegistered(NftId instanceNftId, Seconds initialLockingPeriod, UFixed initialRewardRate) diff --git a/test/staking/StakingOwner.t.sol b/test/staking/StakingOwner.t.sol index add045e41..1c3d33d5a 100644 --- a/test/staking/StakingOwner.t.sol +++ b/test/staking/StakingOwner.t.sol @@ -190,8 +190,8 @@ contract StakingOwnerTest is GifTest { vm.expectEmit(address(staking.getStakingStore())); emit IStaking.LogStakingTargetRewardRateSet( protocolNftId, - newProtocolRewardRate, protocolRewardRate, + newProtocolRewardRate, currentBlock); vm.startPrank(stakingOwner); diff --git a/test/staking/StakingRateManagement.t.sol b/test/staking/StakingRateManagement.t.sol index 561268244..e0d0c503f 100644 --- a/test/staking/StakingRateManagement.t.sol +++ b/test/staking/StakingRateManagement.t.sol @@ -18,19 +18,12 @@ import {Seconds, SecondsLib} from "../../contracts/type/Seconds.sol"; import {StakingLib} from "../../contracts/staking/StakingLib.sol"; import {TargetManagerLib} from "../../contracts/staking/TargetManagerLib.sol"; import {Timestamp, TimestampLib} from "../../contracts/type/Timestamp.sol"; -import {UFixed, UFixedLib} from "../../contracts/type/UFixed.sol";import {VersionPart} from "../../contracts/type/Version.sol"; +import {UFixed, UFixedLib} from "../../contracts/type/UFixed.sol"; +import {VersionPart} from "../../contracts/type/Version.sol"; contract StakingRateManagement is GifTest { - // TODO find better solution than copying event from IStaking - event LogStakingProtocolLockingPeriodSet(NftId targetNftId, Seconds newLockingPeriod, Seconds oldLockingPeriod, Blocknumber lastUpdatedIn); - event LogStakingProtocolRewardRateSet(NftId targetNftId, UFixed newRewardRate, UFixed oldRewardRate, Blocknumber lastUpdatedIn); - event LogStakingStakingRateSet(ChainId chainId, address token, UFixed newStakingRate, UFixed oldStakingRate, Blocknumber lastUpdatedIn); - event LogStakingStakingServiceSet(address stakingService, VersionPart release, address oldStakingService); - event LogStakingStakingReaderSet(address stakingReader, address oldStakingReader); - event LogStakingTokenHandlerApproved(address token, Amount approvalAmount, Amount oldApprovalAmount); - address public tokenAddress; address public stakingStoreAddress; UFixed public tokenStakingRate; @@ -85,11 +78,11 @@ contract StakingRateManagement is GifTest { ChainId currentChainId = ChainIdLib.current(); Blocknumber currentBlock = BlocknumberLib.current(); vm.expectEmit(address(staking)); - emit LogStakingStakingRateSet( + emit IStaking.LogStakingStakingRateSet( currentChainId, tokenAddress, - newStakingRate, // new staking rate tokenStakingRate, // old stakig rate + newStakingRate, // new staking rate currentBlock); vm.startPrank(registryOwner); From 4990568d9e70d2599efb4b1f44c079eb5889b763 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 12:35:17 +0000 Subject: [PATCH 18/35] refactor IStakingService events to improve parameter indexing for enhanced event filtering (#787) --- contracts/staking/IStakingService.sol | 10 +++++----- contracts/staking/StakingService.sol | 4 ++-- docs_manual/events.md | 7 ------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/contracts/staking/IStakingService.sol b/contracts/staking/IStakingService.sol index 78d5f807d..7d164afea 100644 --- a/contracts/staking/IStakingService.sol +++ b/contracts/staking/IStakingService.sol @@ -16,13 +16,13 @@ import {UFixed} from "../type/UFixed.sol"; interface IStakingService is IService { - event LogStakingServiceProtocolTargetRegistered(NftId protocolNftId); - event LogStakingServiceInstanceTargetRegistered(NftId instanceNftId, uint256 chainId, Seconds initialLockingPeriod, UFixed initialRewardRate); + event LogStakingServiceProtocolTargetRegistered(NftId indexed protocolNftId); + event LogStakingServiceInstanceTargetRegistered(NftId indexed instanceNftId, Seconds indexed initialLockingPeriod, UFixed indexed initialRewardRate); - event LogStakingServiceRewardReservesIncreased(NftId targetNftId, address rewardProvider, Amount dipAmount, Amount newBalance); - event LogStakingServiceRewardReservesDecreased(NftId targetNftId, address targetOwner, Amount dipAmount, Amount newBalance); + event LogStakingServiceRewardReservesIncreased(NftId indexed targetNftId, address indexed rewardProvider, Amount indexed dipAmount, Amount newBalance); + event LogStakingServiceRewardReservesDecreased(NftId indexed targetNftId, address indexed targetOwner, Amount indexed dipAmount, Amount newBalance); - event LogStakingServiceStakeObjectCreated(NftId stakeNftId, NftId targetNftId, address stakeOwner); + event LogStakingServiceStakeCreated(NftId indexed stakeNftId, NftId indexed targetNftId, address indexed stakeOwner); // modifiers error ErrorStakingServiceNotStakingOwner(address account); diff --git a/contracts/staking/StakingService.sol b/contracts/staking/StakingService.sol index d3be563d5..40aa2f39c 100644 --- a/contracts/staking/StakingService.sol +++ b/contracts/staking/StakingService.sol @@ -59,7 +59,7 @@ contract StakingService is initialLockingPeriod, initialRewardRate); - emit LogStakingServiceInstanceTargetRegistered(targetNftId, chainId, initialLockingPeriod, initialRewardRate); + emit LogStakingServiceInstanceTargetRegistered(targetNftId, initialLockingPeriod, initialRewardRate); } @@ -164,7 +164,7 @@ contract StakingService is data: "" })); - emit LogStakingServiceStakeObjectCreated(stakeNftId, targetNftId, stakeOwner); + emit LogStakingServiceStakeCreated(stakeNftId, targetNftId, stakeOwner); } diff --git a/docs_manual/events.md b/docs_manual/events.md index fbec47193..f96d18c02 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -3,13 +3,6 @@ ``` -=============== -contracts/staking/IStakingService.sol: LogStakingServiceProtocolTargetRegistered(NftId protocolNftId) -contracts/staking/IStakingService.sol: LogStakingServiceInstanceTargetRegistered(NftId instanceNftId, Seconds initialLockingPeriod, UFixed initialRewardRate) -contracts/staking/IStakingService.sol: LogStakingServiceRewardReservesIncreased(NftId targetNftId, address rewardProvider, Amount dipAmount, Amount newBalance) -contracts/staking/IStakingService.sol: LogStakingServiceRewardReservesDecreased(NftId targetNftId, address targetOwner, Amount dipAmount, Amount newBalance) -contracts/staking/IStakingService.sol: LogStakingServiceStakeCreated(NftId stakeNftId, NftId targetNftId, address stakeOwner) - =============== contracts/staking/TargetHandler.sol: LogTargetHandlerUpdateTriggersSet(uint16 tvlUpdatesTrigger, UFixed minTvlRatioTrigger, Blocknumber lastUpdateIn) From 2c297c1fb15721374edd1bfa18e524ddaeb32a95 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 12:38:59 +0000 Subject: [PATCH 19/35] refactor events in TargetHandler and ProxyManager contracts to improve parameter indexing for enhanced event filtering (#787) --- contracts/staking/TargetHandler.sol | 2 +- contracts/upgradeability/ProxyManager.sol | 4 ++-- docs_manual/events.md | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/contracts/staking/TargetHandler.sol b/contracts/staking/TargetHandler.sol index 70c1e887a..94ed986ad 100644 --- a/contracts/staking/TargetHandler.sol +++ b/contracts/staking/TargetHandler.sol @@ -20,7 +20,7 @@ contract TargetHandler is ITargetLimitHandler { - event LogTargetHandlerUpdateTriggersSet(uint16 tvlUpdatesTrigger, UFixed minTvlRatioTrigger, Blocknumber lastUpdateIn); + event LogTargetHandlerUpdateTriggersSet(uint16 indexed tvlUpdatesTrigger, UFixed indexed minTvlRatioTrigger, Blocknumber indexed lastUpdateIn); IRegistry private _registry; StakingStore private _store; diff --git a/contracts/upgradeability/ProxyManager.sol b/contracts/upgradeability/ProxyManager.sol index 14db35272..f5781b39e 100644 --- a/contracts/upgradeability/ProxyManager.sol +++ b/contracts/upgradeability/ProxyManager.sol @@ -27,8 +27,8 @@ contract ProxyManager is address activatedBy; } - event LogProxyManagerVersionableDeployed(address indexed proxy, address initialImplementation); - event LogProxyManagerVersionableUpgraded(address indexed proxy, address upgradedImplementation); + event LogProxyManagerVersionableDeployed(address indexed proxy, address indexed initialImplementation); + event LogProxyManagerVersionableUpgraded(address indexed proxy, address indexed upgradedImplementation); error ErrorProxyManagerAlreadyDeployed(); error ErrorProxyManagerNotYetDeployed(); diff --git a/docs_manual/events.md b/docs_manual/events.md index f96d18c02..872b89772 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -3,8 +3,6 @@ ``` -=============== -contracts/staking/TargetHandler.sol: LogTargetHandlerUpdateTriggersSet(uint16 tvlUpdatesTrigger, UFixed minTvlRatioTrigger, Blocknumber lastUpdateIn) =============== contracts/upgradeability/ProxyManager.sol: LogProxyManagerVersionableDeployed(address proxy, address initialImplementation) From 7bcc0065b83fc1a2560249435c3903132abd62ee Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 12:39:03 +0000 Subject: [PATCH 20/35] update events.md --- docs_manual/events.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs_manual/events.md b/docs_manual/events.md index 872b89772..1ea4cc964 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -2,12 +2,6 @@ ``` - - -=============== -contracts/upgradeability/ProxyManager.sol: LogProxyManagerVersionableDeployed(address proxy, address initialImplementation) -contracts/upgradeability/ProxyManager.sol: LogProxyManagerVersionableUpgraded(address proxy, address upgradedImplementation) - =============== contracts/examples/flight/FlightLib.sol: LogFlightProductErrorUnprocessableStatus(RequestId requestId, RiskId riskId, bytes1 status) contracts/examples/flight/FlightLib.sol: LogFlightProductErrorUnexpectedStatus(RequestId requestId, RiskId riskId, bytes1 status, int256 delayMinutes) From 952385df1fd2e113658a710329c42a2e66fad960 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 12:49:03 +0000 Subject: [PATCH 21/35] refactor events in BalanceStore and ObjectSet contracts to improve parameter indexing for enhanced event filtering (#787) --- contracts/instance/base/BalanceStore.sol | 14 +++++++------- contracts/instance/base/ObjectSet.sol | 2 +- docs_manual/events.md | 11 ----------- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/contracts/instance/base/BalanceStore.sol b/contracts/instance/base/BalanceStore.sol index 8e63f44f1..108de71ec 100644 --- a/contracts/instance/base/BalanceStore.sol +++ b/contracts/instance/base/BalanceStore.sol @@ -10,16 +10,16 @@ contract BalanceStore { error ErrorBalanceStoreTargetAlreadyRegistered(NftId targetNftId); error ErrorBalanceStoreTargetNotRegistered(NftId targetNftId); - event LogBalanceStoreTargetRegistered(NftId targetNftId); + event LogBalanceStoreTargetRegistered(NftId indexed targetNftId); - event LogBalanceStoreFeesIncreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn); - event LogBalanceStoreFeesDecreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn); + event LogBalanceStoreFeesIncreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn); + event LogBalanceStoreFeesDecreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn); - event LogBalanceStoreLockedIncreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn); - event LogBalanceStoreLockedDecreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn); + event LogBalanceStoreLockedIncreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn); + event LogBalanceStoreLockedDecreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn); - event LogBalanceStoreBalanceIncreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn); - event LogBalanceStoreBalanceDecreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn); + event LogBalanceStoreBalanceIncreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn); + event LogBalanceStoreBalanceDecreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn); mapping(NftId nftId => Amount balance) private _balanceAmount; mapping(NftId nftId => Amount locked) private _lockedAmount; diff --git a/contracts/instance/base/ObjectSet.sol b/contracts/instance/base/ObjectSet.sol index 95d1a366d..31ea67d8f 100644 --- a/contracts/instance/base/ObjectSet.sol +++ b/contracts/instance/base/ObjectSet.sol @@ -12,7 +12,7 @@ contract ObjectSet is { using LibKey32Set for LibKey32Set.Set; - event LogObjectSetInitialized(address instance); + event LogObjectSetInitialized(address indexed instance); error ErrorObjectSetNftIdInvalid(NftId instanceNftId); diff --git a/docs_manual/events.md b/docs_manual/events.md index 1ea4cc964..6ad294273 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -38,15 +38,4 @@ contracts/examples/unpermissioned/SimpleOracle.sol: LogSimpleOracleSyncResponseS contracts/examples/unpermissioned/SimpleProduct.sol: LogSimpleProductRequestAsyncFulfilled(RequestId requestId, string responseText, uint256 responseDataLength) contracts/examples/unpermissioned/SimpleProduct.sol: LogSimpleProductRequestSyncFulfilled(RequestId requestId, string responseText, uint256 responseDataLength) -=============== -contracts/instance/base/BalanceStore.sol: LogBalanceStoreTargetRegistered(NftId targetNftId) -contracts/instance/base/BalanceStore.sol: LogBalanceStoreFeesIncreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) -contracts/instance/base/BalanceStore.sol: LogBalanceStoreFeesDecreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) -contracts/instance/base/BalanceStore.sol: LogBalanceStoreLockedIncreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) -contracts/instance/base/BalanceStore.sol: LogBalanceStoreLockedDecreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) -contracts/instance/base/BalanceStore.sol: LogBalanceStoreBalanceIncreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) -contracts/instance/base/BalanceStore.sol: LogBalanceStoreBalanceDecreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) - -=============== -contracts/instance/base/ObjectSet.sol: LogObjectSetInitialized(address instance) ``` From 02d39d17105906062f6a43f0377f6e93110fd565 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 12:54:07 +0000 Subject: [PATCH 22/35] refactor release log retrieval to use updated event name for consistency (#787) --- scripts/libs/release.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/libs/release.ts b/scripts/libs/release.ts index cfbe4c410..df1bcc47f 100644 --- a/scripts/libs/release.ts +++ b/scripts/libs/release.ts @@ -208,12 +208,12 @@ export async function createRelease(owner: Signer, registry: RegistryAddresses, "releaseRegistry.prepareNextRelease", [releaseRegistry.interface]); - let logCreationInfo = getFieldFromTxRcptLogs(rcpt!, registry.releaseRegistry.interface, "LogReleaseCreation", "admin"); - const releaseAdminAddress = (logCreationInfo as AddressLike); - logCreationInfo = getFieldFromTxRcptLogs(rcpt!, registry.releaseRegistry.interface, "LogReleaseCreation", "version"); - const releaseVersion = (logCreationInfo as BigNumberish); - logCreationInfo = getFieldFromTxRcptLogs(rcpt!, registry.releaseRegistry.interface, "LogReleaseCreation", "salt"); - const releaseSalt = (logCreationInfo as BytesLike); + let logCreationInfo = getFieldFromTxRcptLogs(rcpt!, registry.releaseRegistry.interface, "LogReleaseCreated", "admin"); + const releaseAdminAddress = logCreationInfo as AddressLike; + logCreationInfo = getFieldFromTxRcptLogs(rcpt!, registry.releaseRegistry.interface, "LogReleaseCreated", "version"); + const releaseVersion = logCreationInfo as BigNumberish; + logCreationInfo = getFieldFromTxRcptLogs(rcpt!, registry.releaseRegistry.interface, "LogReleaseCreated", "salt"); + const releaseSalt = logCreationInfo as BytesLike; const releaseAdminBasecontract = await ethers.getContractAt("ReleaseAdmin", releaseAdminAddress, owner); const releaseAdmin = releaseAdminBasecontract as ReleaseAdmin; From e003584780d3394e6b4547362a348c4ca3da2a2a Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 12:57:35 +0000 Subject: [PATCH 23/35] update events --- docs_manual/events.md | 266 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 266 insertions(+) diff --git a/docs_manual/events.md b/docs_manual/events.md index 6ad294273..cdc44d755 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -1,6 +1,261 @@ # Log events ``` +=============== +contracts/accounting/IAccountingService.sol: LogAccountingServiceBalanceChanged(NftId nftId, Amount amount, Amount feeAmount, bool increase, ObjectType objectType) + +=============== +contracts/authorization/AccessManagerCloneable.sol: LogAccessManagerLocked(address accessManager, bool locked) + +=============== +contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleCreated(RoleId roleId, RoleId roleAdminId, TargetType targetType, string name, string admin) +contracts/authorization/IAccessAdmin.sol: LogAccessAdminTargetCreated(address target, RoleId roleId, bool managed, string name, string admin) +contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleActivatedSet(RoleId roleId, bool active, string admin, Blocknumber lastUpdateIn) +contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleGranted(address account, string roleName, string admin) +contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleRevoked(address account, string roleName, string admin) +contracts/authorization/IAccessAdmin.sol: LogAccessAdminTargetLockedSet(address target, bool locked, string admin, Blocknumber lastUpdateIn) +contracts/authorization/IAccessAdmin.sol: LogAccessAdminFunctionGranted(address target, Selector selector, RoleId roleId, string func, string admin, Blocknumber lastUpdateIn) + +=============== +contracts/distribution/IDistributionService.sol: LogDistributionServiceCommissionWithdrawn(NftId distributorNftId, address recipient, Amount amount, address tokenAddress) +contracts/distribution/IDistributionService.sol: LogDistributionServiceDistributorTypeCreated(NftId distributionNftId, DistributorType distributorType, string name, UFixed commissionPercentage) +contracts/distribution/IDistributionService.sol: LogDistributionServiceDistributorCreated(NftId distributionNftId, NftId distributorNftId, address distributor, DistributorType distributorType) +contracts/distribution/IDistributionService.sol: LogDistributionServiceDistributorTypeChanged(NftId distributorNftId, DistributorType oldDistributorType, DistributorType newDistributorType) +contracts/distribution/IDistributionService.sol: LogDistributionServiceReferralCreated(NftId distributorNftId, ReferralId referralId, string code, UFixed discountPercentage, uint32 maxReferrals, Timestamp expiryAt) +contracts/distribution/IDistributionService.sol: LogDistributionServiceReferralProcessed(NftId distributorNftId, ReferralId referralId, uint32 usedReferrals) +contracts/distribution/IDistributionService.sol: LogDistributionServiceSaleProcessed(NftId distributionNftId, Amount premium, Amount distributionOwnerFee) +contracts/distribution/IDistributionService.sol: LogDistributionServiceSaleProcessedWithReferral(NftId distributionNftId, NftId distributorNftId, ReferralId referralId, uint32 numPoliciesSold, Amount premium, Amount distributionOwnerFee, Amount commissionAmount) + +=============== +contracts/instance/BundleSet.sol: LogBundleSetPolicyLinked(NftId bundleNftId, NftId policyNftId) +contracts/instance/BundleSet.sol: LogBundleSetPolicyUnlinked(NftId bundleNftId, NftId policyNftId) +contracts/instance/BundleSet.sol: LogBundleSetBundleAdded(NftId poolNftId, NftId bundleNftId) +contracts/instance/BundleSet.sol: LogBundleSetBundleUnlocked(NftId poolNftId, NftId bundleNftId) +contracts/instance/BundleSet.sol: LogBundleSetBundleLocked(NftId poolNftId, NftId bundleNftId) +contracts/instance/BundleSet.sol: LogBundleSetBundleClosed(NftId poolNftId, NftId bundleNftId) + +=============== +contracts/instance/IBaseStore.sol: LogBaseStoreMetadataCreated(Key32 key, ObjectType objectType, StateId state) +contracts/instance/IBaseStore.sol: LogBaseStoreMetadataUpdated(Key32 key, StateId oldState, StateId newState) + +=============== +contracts/instance/IInstance.sol: LogInstanceCustomRoleCreated(RoleId roleId, string roleName, RoleId adminRoleId, uint32 maxMemberCount) +contracts/instance/IInstance.sol: LogInstanceCustomRoleActiveSet(RoleId roleId, bool active, address caller) +contracts/instance/IInstance.sol: LogInstanceCustomRoleGranted(RoleId roleId, address account, address caller) +contracts/instance/IInstance.sol: LogInstanceCustomRoleRevoked(RoleId roleId, address account, address caller) +contracts/instance/IInstance.sol: LogInstanceCustomTargetCreated(address target, RoleId targetRoleId, string name) +contracts/instance/IInstance.sol: LogInstanceTargetLocked(address target, bool locked) +contracts/instance/IInstance.sol: LogInstanceCustomTargetFunctionRoleSet(address target, bytes4[] selectors, RoleId roleId) + +=============== +contracts/instance/IInstanceService.sol: LogInstanceServiceInstanceLocked(NftId instanceNftId, bool locked) +contracts/instance/IInstanceService.sol: LogInstanceServiceInstanceCreated(NftId instanceNftId, address instance) +contracts/instance/IInstanceService.sol: LogInstanceServiceMasterInstanceRegistered(NftId masterInstanceNftId, address masterInstance, address masterInstanceAdmin, address masterAccessManager, address masterInstanceReader, address masterInstanceBundleSet, address masterInstanceRiskSet, address masterInstanceStore, address masterProductStore) +contracts/instance/IInstanceService.sol: LogInstanceServiceMasterInstanceReaderUpgraded(NftId instanceNfId, address oldInstanceReader, address newInstanceReader) +contracts/instance/IInstanceService.sol: LogInstanceServiceInstanceReaderUpgraded(NftId instanceNfId, address oldInstanceReader, address newInstanceReader) + +=============== +contracts/instance/InstanceStore.sol: LogProductStoreComponentInfoCreated(NftId componentNftId, StateId state, address createdby, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStoreComponentInfoUpdated(NftId componentNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/InstanceStore.sol: LogProductStorePoolInfoCreated(NftId poolNftId, StateId state, address createdBy, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStorePoolInfoUpdated(NftId poolNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/InstanceStore.sol: LogProductStoreDistributorTypeInfoCreated(DistributorType distributorType, StateId state, address createdBy, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStoreDistributorTypeInfoUpdated(DistributorType distributorType, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/InstanceStore.sol: LogProductStoreDistributorInfoCreated(NftId distributorNftId, StateId state, address createdBy, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStoreDistributorInfoUpdated(NftId distributorNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/InstanceStore.sol: LogProductStoreReferralInfoCreated(ReferralId referralId, StateId state, address createdBy, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStoreReferralInfoUpdated(ReferralId referralId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/InstanceStore.sol: LogProductStoreBundleInfoCreated(NftId bundleNftId, StateId state, address createdBy, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStoreBundleInfoUpdated(NftId bundleNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/InstanceStore.sol: LogProductStoreRequestInfoCreated(RequestId requestId, StateId state, address createdBy, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStoreRequestInfoUpdated(RequestId requestId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) + +=============== +contracts/instance/ProductStore.sol: LogProductStoreProductInfoCreated(NftId productNftId, StateId state, address createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStoreProductInfoUpdated(NftId productNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/ProductStore.sol: LogProductStoreFeeInfoCreated(NftId productNftId, StateId state, address createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStoreFeeInfoUpdated(NftId productNftId, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/ProductStore.sol: LogProductStoreRiskInfoCreated(RiskId riskId, StateId state, address createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStoreRiskInfoUpdated(RiskId riskId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/ProductStore.sol: LogProductStorePolicyInfoCreated(NftId policyNftId, StateId state, address createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStorePolicyInfoUpdated(NftId policyNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/ProductStore.sol: LogProductStorePremiumInfoCreated(NftId policyNftId, StateId state, address createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStorePremiumInfoUpdated(NftId policyNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/ProductStore.sol: LogProductStoreClaimInfoCreated(NftId policyNftId, ClaimId claimId, StateId state, address createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStoreClaimInfoUpdated(NftId policyNftId, ClaimId claimId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/ProductStore.sol: LogProductStorePayoutInfoCreated(NftId policyNftId, PayoutId payoutId, StateId state, address createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStorePayoutInfoUpdated(NftId policyNftId, PayoutId payoutId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) + +=============== +contracts/instance/RiskSet.sol: LogRiskSetPolicyLinked(RiskId riskId, NftId policyNftId) +contracts/instance/RiskSet.sol: LogRiskSetPolicyUnlinked(RiskId riskId, NftId policyNftId) +contracts/instance/RiskSet.sol: LogRiskSetRiskAdded(NftId productNftId, RiskId riskId) +contracts/instance/RiskSet.sol: LogRiskSetRiskActivated(NftId poolNftId, RiskId riskId) +contracts/instance/RiskSet.sol: LogRiskSetRiskPaused(NftId poolNftId, RiskId riskId) + +=============== +contracts/oracle/IOracleService.sol: LogOracleServiceRequestCreated(RequestId requestId, NftId requesterNftId, NftId oracleNftId, Timestamp expiryAt) +contracts/oracle/IOracleService.sol: LogOracleServiceResponseProcessed(RequestId requestId, NftId requesterNftId, NftId oracleNftId) +contracts/oracle/IOracleService.sol: LogOracleServiceDeliveryFailed(RequestId requestId, address requesterAddress, string functionSignature) +contracts/oracle/IOracleService.sol: LogOracleServiceResponseResent(RequestId requestId, NftId requesterNftId) +contracts/oracle/IOracleService.sol: LogOracleServiceRequestCancelled(RequestId requestId, NftId requesterNftId) + +=============== +contracts/pool/IBundleService.sol: LogBundleServiceBundleCreated(NftId bundleNftId, NftId poolNftId, Seconds lifetime, Amount fixedFee, UFixed fractionalFee) +contracts/pool/IBundleService.sol: LogBundleServiceBundleClosed(NftId bundleNftId) +contracts/pool/IBundleService.sol: LogBundleServiceBundleLocked(NftId bundleNftId) +contracts/pool/IBundleService.sol: LogBundleServiceBundleUnlocked(NftId bundleNftId) +contracts/pool/IBundleService.sol: LogBundleServiceBundleExtended(NftId bundleNftId, Seconds lifetimeExtension, Timestamp extendedExpiredAt) +contracts/pool/IBundleService.sol: LogBundleServiceBundleFeeUpdated(NftId bundleNftId, Amount fixedFee, UFixed fractionalFee) +contracts/pool/IBundleService.sol: LogBundleServiceCollateralLocked(NftId bundleNftId, NftId policyNftId, Amount collateralAmount) +contracts/pool/IBundleService.sol: LogBundleServiceCollateralReleased(NftId bundleNftId, NftId policyNftId, Amount collateralAmount) +contracts/pool/IBundleService.sol: LogBundleServiceBundleStaked(NftId bundleNftId, Amount amount) +contracts/pool/IBundleService.sol: LogBundleServiceBundleUnstaked(NftId bundleNftId, Amount amount) + +=============== +contracts/pool/IPoolComponent.sol: LogPoolVerifiedByPool(address pool, NftId applicationNftId, Amount collateralizationAmount) + +=============== +contracts/pool/IPoolService.sol: LogPoolServiceMaxBalanceAmountUpdated(NftId poolNftId, Amount previousMaxCapitalAmount, Amount currentMaxCapitalAmount) +contracts/pool/IPoolService.sol: LogPoolServiceWalletFunded(NftId poolNftId, address poolOwner, Amount amount) +contracts/pool/IPoolService.sol: LogPoolServiceWalletDefunded(NftId poolNftId, address poolOwner, Amount amount) +contracts/pool/IPoolService.sol: LogPoolServiceBundleCreated(NftId instanceNftId, NftId poolNftId, NftId bundleNftId) +contracts/pool/IPoolService.sol: LogPoolServiceBundleClosed(NftId instanceNftId, NftId poolNftId, NftId bundleNftId, Amount balanceAmount, Amount feeAmount) +contracts/pool/IPoolService.sol: LogPoolServiceBundleStaked(NftId instanceNftId, NftId poolNftId, NftId bundleNftId, Amount amount, Amount netAmount) +contracts/pool/IPoolService.sol: LogPoolServiceBundleUnstaked(NftId instanceNftId, NftId poolNftId, NftId bundleNftId, Amount amount, Amount netAmount) +contracts/pool/IPoolService.sol: LogPoolServiceFeesWithdrawn(NftId bundleNftId, address recipient, Amount amount, address tokenAddress) +contracts/pool/IPoolService.sol: LogPoolServiceProcessFundedClaim(NftId policyNftId, ClaimId claimId, Amount availableAmount) +contracts/pool/IPoolService.sol: LogPoolServiceApplicationVerified(NftId poolNftId, NftId bundleNftId, NftId applicationNftId, Amount totalCollateralAmount) +contracts/pool/IPoolService.sol: LogPoolServiceCollateralLocked(NftId poolNftId, NftId bundleNftId, NftId applicationNftId, Amount totalCollateralAmount, Amount lockedCollateralAmount) +contracts/pool/IPoolService.sol: LogPoolServiceCollateralReleased(NftId bundleNftId, NftId policyNftId, Amount releasedCollateralAmount) +contracts/pool/IPoolService.sol: LogPoolServiceSaleProcessed(NftId poolNftId, NftId bundleNftId, Amount bundleNetAmount, Amount bundleFeeAmount, Amount poolFeeAmount) +contracts/pool/IPoolService.sol: LogPoolServicePayoutProcessed(NftId poolNftId, NftId bundleNftId, NftId policyNftId, PayoutId payoutId, Amount netPayoutAmount, Amount processingFeeAmount, address payoutBeneficiary) + +=============== +contracts/product/IApplicationService.sol: LogApplicationServiceApplicationCreated(NftId applicationNftId, NftId productNftId, NftId bundleNftId, RiskId riskId, ReferralId referralId, address applicationOwner, Amount sumInsuredAmount, Amount premiumAmount, Seconds lifetime) +contracts/product/IApplicationService.sol: LogApplicationServiceApplicationRenewed(NftId policyNftId, NftId bundleNftId) +contracts/product/IApplicationService.sol: LogApplicationServiceApplicationAdjusted(NftId applicationNftId, NftId bundleNftId, RiskId riskId, ReferralId referralId, Amount sumInsuredAmount, Seconds lifetime) +contracts/product/IApplicationService.sol: LogApplicationServiceApplicationRevoked(NftId applicationNftId) + +=============== +contracts/product/IClaimService.sol: LogClaimServiceClaimSubmitted(NftId policyNftId, ClaimId claimId, Amount claimAmount) +contracts/product/IClaimService.sol: LogClaimServiceClaimConfirmed(NftId policyNftId, ClaimId claimId, Amount confirmedAmount) +contracts/product/IClaimService.sol: LogClaimServiceClaimDeclined(NftId policyNftId, ClaimId claimId) +contracts/product/IClaimService.sol: LogClaimServiceClaimRevoked(NftId policyNftId, ClaimId claimId) +contracts/product/IClaimService.sol: LogClaimServiceClaimCancelled(NftId policyNftId, ClaimId claimId) +contracts/product/IClaimService.sol: LogClaimServicePayoutCreated(NftId policyNftId, ClaimId claimId, PayoutId payoutId, Amount amount, address beneficiary) +contracts/product/IClaimService.sol: LogClaimServicePayoutProcessed(NftId policyNftId, PayoutId payoutId, Amount amount) +contracts/product/IClaimService.sol: LogClaimServicePayoutCancelled(NftId policyNftId, PayoutId payoutId) + +=============== +contracts/product/IPolicyService.sol: LogPolicyServicePolicyCreated(NftId policyNftId, Amount premiumAmount, Timestamp activatedAt) +contracts/product/IPolicyService.sol: LogPolicyServicePolicyDeclined(NftId policyNftId) +contracts/product/IPolicyService.sol: LogPolicyServicePolicyPremiumCollected(NftId policyNftId, NftId productNftId, Amount premiumAmount, Timestamp activateAt) +contracts/product/IPolicyService.sol: LogPolicyServicePolicyActivated(NftId policyNftId, Timestamp activatedAt) +contracts/product/IPolicyService.sol: LogPolicyServicePolicyActivatedUpdated(NftId policyNftId, Timestamp activatedAt) +contracts/product/IPolicyService.sol: LogPolicyServicePolicyExpirationUpdated(NftId policyNftId, Timestamp expiredAt) +contracts/product/IPolicyService.sol: LogPolicyServicePolicyClosed(NftId policyNftId) + +=============== +contracts/product/IRiskService.sol: LogRiskServiceRiskCreated(NftId productNftId, RiskId riskId) +contracts/product/IRiskService.sol: LogRiskServiceRiskUpdated(NftId productNftId, RiskId riskId) +contracts/product/IRiskService.sol: LogRiskServiceRiskLocked(NftId productNftId, RiskId riskId) +contracts/product/IRiskService.sol: LogRiskServiceRiskUnlocked(NftId productNftId, RiskId riskId) +contracts/product/IRiskService.sol: LogRiskServiceRiskClosed(NftId productNftId, RiskId riskId) + +=============== +contracts/registry/ChainNft.sol: LogTokenInterceptorAddress(uint256 tokenId, address interceptor) + +=============== +contracts/registry/IRegistry.sol: LogRegistryObjectRegistered(NftId nftId, NftId parentNftId, ObjectType objectType, bool isInterceptor, address objectAddress, address initialOwner) +contracts/registry/IRegistry.sol: LogRegistryServiceRegistered(NftId nftId, VersionPart majorVersion, ObjectType domain) +contracts/registry/IRegistry.sol: LogRegistryChainRegistryRegistered(NftId nftId, uint256 chainId, address chainRegistryAddress) + +=============== +contracts/registry/ReleaseAdmin.sol: LogReleaseAdminReleaseLocked(VersionPart release, bool locked) +contracts/registry/ReleaseAdmin.sol: LogReleaseAdminServiceLocked(VersionPart release, address service, bool locked) + +=============== +contracts/registry/ReleaseRegistry.sol: LogReleaseCreated(IAccessAdmin admin, VersionPart release, bytes32 salt) +contracts/registry/ReleaseRegistry.sol: LogReleaseActivated(VersionPart release) +contracts/registry/ReleaseRegistry.sol: LogReleaseDisabled(VersionPart release) +contracts/registry/ReleaseRegistry.sol: LogReleaseEnabled(VersionPart release) + +=============== +contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenRegistered(ChainId chainId, address token, uint256 decimals, string symbol) +contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenGlobalStateSet(ChainId chainId, address token, bool active) +contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenStateSet(ChainId chainId, address token, VersionPart release, bool active) + +=============== +contracts/shared/IComponentService.sol: LogComponentServiceComponentLocked(address component, bool locked) +contracts/shared/IComponentService.sol: LogComponentServiceTokenHandlerDeployed(NftId componentNftId, address tokenHandler, address token) +contracts/shared/IComponentService.sol: LogComponentServiceRegistered(NftId instanceNftId, NftId componentNftId, ObjectType componentType, address component, address token, address initialOwner) +contracts/shared/IComponentService.sol: LogComponentServiceComponentFeesWithdrawn(NftId componentNftId, address recipient, Amount withdrawnAmount, address token) +contracts/shared/IComponentService.sol: LogComponentServiceProductFeesUpdated(NftId productNftId) +contracts/shared/IComponentService.sol: LogComponentServiceDistributionFeesUpdated(NftId distributionNftId) +contracts/shared/IComponentService.sol: LogComponentServicePoolFeesUpdated(NftId poolNftId) +contracts/shared/IComponentService.sol: LogComponentServiceUpdateFee(NftId nftId, string feeName, UFixed previousFractionalFee, Amount previousFixedFee, UFixed newFractionalFee, Amount newFixedFee) +contracts/shared/IComponentService.sol: LogComponentServiceProductCreated(NftId productNftId, address productAddress, bool hasDistribution, uint8 expectedNumberOfOracles) +contracts/shared/IComponentService.sol: LogComponentServiceProductInitialProductFeesSet(NftId productNftId, Amount productFeeFixed, UFixed productFeeFractional, Amount processingFeeFixed, UFixed processingFeeFractional) +contracts/shared/IComponentService.sol: LogComponentServiceProductInitialDistributionFeesSet(NftId productNftId, Amount distributionFeeFixed, UFixed distributionFeeFractional, Amount minDistributionOwnerFeeFixed, UFixed minDistributionOwnerFeeFractional) +contracts/shared/IComponentService.sol: LogComponentServiceProductInitialPoolFeesSet(NftId productNftId, Amount poolFeeFixed, UFixed poolFeeFractional, Amount stakingFeeFixed, UFixed stakingFeeFractional, Amount performanceFeeFixed, UFixed performanceFeeFractional) +contracts/shared/IComponentService.sol: LogComponentServicePoolCreated(NftId poolNftId, NftId productNftId, address componentAddress, Amount maxBalanceAmount, UFixed collateralizationLevel, UFixed retentionLevel, bool isExternallyManaged, bool isVerifyingApplications) +contracts/shared/IComponentService.sol: LogComponentServiceDistributionCreated(NftId distributionNftId, NftId productNftId) +contracts/shared/IComponentService.sol: LogComponentServiceOracleCreated(NftId oracleNftId, NftId productNftId) + +=============== +contracts/shared/INftOwnable.sol: LogNftOwnableNftLinkedToAddress(NftId nftId, address owner) + +=============== +contracts/shared/TokenHandler.sol: LogTokenHandlerWalletAddressChanged(NftId componentNftId, address oldWallet, address newWallet) +contracts/shared/TokenHandler.sol: LogTokenHandlerWalletTokensTransferred(NftId componentNftId, address oldWallet, address newWallet, Amount amount) +contracts/shared/TokenHandler.sol: LogTokenHandlerTokenApproved(NftId nftId, address tokenHandler, address token, Amount amount, bool isMaxAmount) +contracts/shared/TokenHandler.sol: LogTokenHandlerTokenTransferred(address token, address from, address to, Amount amount) + +=============== +contracts/staking/IStaking.sol: LogStakingTokenHandlerDeployed(NftId componentNftId, address tokenHandler, address token) +contracts/staking/IStaking.sol: LogStakingStakingRateSet(ChainId chainId, address token, UFixed oldStakingRate, UFixed newStakingRate, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingStakingServiceSet(address oldStakingService, address stakingService, VersionPart release) +contracts/staking/IStaking.sol: LogStakingStakingReaderSet(address oldStakingReader, address stakingReader) +contracts/staking/IStaking.sol: LogStakingTargetHandlerSet(address oldTargetHandler, address targetManager) +contracts/staking/IStaking.sol: LogStakingTokenHandlerApproved(Amount oldApprovalAmount, Amount approvalAmount, address token) +contracts/staking/IStaking.sol: LogStakingTokenAdded(ChainId chainId, address token) +contracts/staking/IStaking.sol: LogStakingTargetTokenAdded(NftId targetNftId, address token) +contracts/staking/IStaking.sol: LogStakingTvlIncreased(NftId targetNftId, address token, Amount amount, Amount newBalance, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTvlDecreased(NftId targetNftId, address token, Amount amount, Amount newBalance, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingSupportInfoSet(ObjectType objectType, bool isSupported, bool allowNewTargets, bool allowCrossChain, Amount minStakingAmount, Amount maxStakingAmount, Seconds minLockingPeriod, Seconds maxLockingPeriod, UFixed minRewardRate, UFixed maxRewardRate, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetCreated(NftId targetNftId, ObjectType objectType, Seconds lockingPeriod, UFixed rewardRate) +contracts/staking/IStaking.sol: LogStakingLimitsSet(NftId targetNftId, Amount marginAmount, Amount hardLimitAmount, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetLimitsUpdated(NftId targetNftId, Amount marginAmount, Amount hardLimitAmount, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetLimitUpdated(NftId targetNftId, Amount limitAmount, Amount hardLimitAmount, Amount requiredStakeAmount, Amount actualStakeAmount, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetLockingPeriodSet(NftId targetNftId, Seconds oldLockingPeriod, Seconds lockingPeriod, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetRewardRateSet(NftId targetNftId, UFixed oldRewardRate, UFixed rewardRate, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetMaxStakedAmountSet(NftId targetNftId, Amount stakeLimitAmount, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetLimitsSet(NftId targetNftId, Amount stakeLimitAmount, Amount marginAmount, Amount limitAmount) +contracts/staking/IStaking.sol: LogStakingRewardReservesRefilled(NftId targetNftId, Amount dipAmount, address targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingRewardReservesWithdrawn(NftId targetNftId, Amount dipAmount, address targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingRewardReservesSpent(NftId targetNftId, Amount dipAmount, Amount reserveBalance, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingStakeCreated(NftId stakeNftId, NftId targetNftId, Amount stakeAmount, Timestamp lockedUntil, address stakeOwner) +contracts/staking/IStaking.sol: LogStakingStakeRewardsUpdated(NftId stakeNftId, Amount rewardIncrementAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingRewardsRestaked(NftId stakeNftId, Amount restakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingStaked(NftId stakeNftId, Amount stakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingUnstaked(NftId stakeNftId, Amount unstakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingRewardsClaimed(NftId stakeNftId, Amount claimedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingStakeRestaked(NftId stakeNftId, NftId targetNftId, Amount stakeAmount, address owner, NftId oldStakeNftId) + +=============== +contracts/staking/IStakingService.sol: LogStakingServiceProtocolTargetRegistered(NftId protocolNftId) +contracts/staking/IStakingService.sol: LogStakingServiceInstanceTargetRegistered(NftId instanceNftId, Seconds initialLockingPeriod, UFixed initialRewardRate) +contracts/staking/IStakingService.sol: LogStakingServiceRewardReservesIncreased(NftId targetNftId, address rewardProvider, Amount dipAmount, Amount newBalance) +contracts/staking/IStakingService.sol: LogStakingServiceRewardReservesDecreased(NftId targetNftId, address targetOwner, Amount dipAmount, Amount newBalance) +contracts/staking/IStakingService.sol: LogStakingServiceStakeCreated(NftId stakeNftId, NftId targetNftId, address stakeOwner) + +=============== +contracts/staking/TargetHandler.sol: LogTargetHandlerUpdateTriggersSet(uint16 tvlUpdatesTrigger, UFixed minTvlRatioTrigger, Blocknumber lastUpdateIn) + +=============== +contracts/upgradeability/ProxyManager.sol: LogProxyManagerVersionableDeployed(address proxy, address initialImplementation) +contracts/upgradeability/ProxyManager.sol: LogProxyManagerVersionableUpgraded(address proxy, address upgradedImplementation) =============== contracts/examples/flight/FlightLib.sol: LogFlightProductErrorUnprocessableStatus(RequestId requestId, RiskId riskId, bytes1 status) @@ -38,4 +293,15 @@ contracts/examples/unpermissioned/SimpleOracle.sol: LogSimpleOracleSyncResponseS contracts/examples/unpermissioned/SimpleProduct.sol: LogSimpleProductRequestAsyncFulfilled(RequestId requestId, string responseText, uint256 responseDataLength) contracts/examples/unpermissioned/SimpleProduct.sol: LogSimpleProductRequestSyncFulfilled(RequestId requestId, string responseText, uint256 responseDataLength) +=============== +contracts/instance/base/BalanceStore.sol: LogBalanceStoreTargetRegistered(NftId targetNftId) +contracts/instance/base/BalanceStore.sol: LogBalanceStoreFeesIncreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) +contracts/instance/base/BalanceStore.sol: LogBalanceStoreFeesDecreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) +contracts/instance/base/BalanceStore.sol: LogBalanceStoreLockedIncreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) +contracts/instance/base/BalanceStore.sol: LogBalanceStoreLockedDecreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) +contracts/instance/base/BalanceStore.sol: LogBalanceStoreBalanceIncreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) +contracts/instance/base/BalanceStore.sol: LogBalanceStoreBalanceDecreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) + +=============== +contracts/instance/base/ObjectSet.sol: LogObjectSetInitialized(address instance) ``` From 4127957edc508f1b5593eb6def43fd8e7a3ee50b Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 13:08:00 +0000 Subject: [PATCH 24/35] update event find script to extract indexed as well (#787) --- docs_manual/events.md | 476 ++++++++++++++++++++--------------------- scripts/find_events.ts | 11 +- 2 files changed, 247 insertions(+), 240 deletions(-) diff --git a/docs_manual/events.md b/docs_manual/events.md index cdc44d755..255d92055 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -2,260 +2,260 @@ ``` =============== -contracts/accounting/IAccountingService.sol: LogAccountingServiceBalanceChanged(NftId nftId, Amount amount, Amount feeAmount, bool increase, ObjectType objectType) - -=============== -contracts/authorization/AccessManagerCloneable.sol: LogAccessManagerLocked(address accessManager, bool locked) - -=============== -contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleCreated(RoleId roleId, RoleId roleAdminId, TargetType targetType, string name, string admin) -contracts/authorization/IAccessAdmin.sol: LogAccessAdminTargetCreated(address target, RoleId roleId, bool managed, string name, string admin) -contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleActivatedSet(RoleId roleId, bool active, string admin, Blocknumber lastUpdateIn) -contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleGranted(address account, string roleName, string admin) -contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleRevoked(address account, string roleName, string admin) -contracts/authorization/IAccessAdmin.sol: LogAccessAdminTargetLockedSet(address target, bool locked, string admin, Blocknumber lastUpdateIn) -contracts/authorization/IAccessAdmin.sol: LogAccessAdminFunctionGranted(address target, Selector selector, RoleId roleId, string func, string admin, Blocknumber lastUpdateIn) +contracts/accounting/IAccountingService.sol: LogAccountingServiceBalanceChanged(NftId indexed nftId, Amount indexed amount, Amount indexed feeAmount, bool increase, ObjectType objectType) + +=============== +contracts/authorization/AccessManagerCloneable.sol: LogAccessManagerLocked(address indexed accessManager, bool indexed locked) + +=============== +contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleCreated(RoleId indexed roleId, RoleId indexed roleAdminId, TargetType indexed targetType, string name, string admin) +contracts/authorization/IAccessAdmin.sol: LogAccessAdminTargetCreated(address indexed target, RoleId indexed roleId, bool indexed managed, string name, string admin) +contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleActivatedSet(RoleId indexed roleId, bool indexed active, string admin, Blocknumber indexed lastUpdateIn) +contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleGranted(address indexed account, string roleName, string admin) +contracts/authorization/IAccessAdmin.sol: LogAccessAdminRoleRevoked(address indexed account, string roleName, string admin) +contracts/authorization/IAccessAdmin.sol: LogAccessAdminTargetLockedSet(address indexed target, bool indexed locked, string admin, Blocknumber indexed lastUpdateIn) +contracts/authorization/IAccessAdmin.sol: LogAccessAdminFunctionGranted(address indexed target, Selector indexed selector, RoleId indexed roleId, string func, string admin, Blocknumber lastUpdateIn) =============== -contracts/distribution/IDistributionService.sol: LogDistributionServiceCommissionWithdrawn(NftId distributorNftId, address recipient, Amount amount, address tokenAddress) -contracts/distribution/IDistributionService.sol: LogDistributionServiceDistributorTypeCreated(NftId distributionNftId, DistributorType distributorType, string name, UFixed commissionPercentage) -contracts/distribution/IDistributionService.sol: LogDistributionServiceDistributorCreated(NftId distributionNftId, NftId distributorNftId, address distributor, DistributorType distributorType) -contracts/distribution/IDistributionService.sol: LogDistributionServiceDistributorTypeChanged(NftId distributorNftId, DistributorType oldDistributorType, DistributorType newDistributorType) -contracts/distribution/IDistributionService.sol: LogDistributionServiceReferralCreated(NftId distributorNftId, ReferralId referralId, string code, UFixed discountPercentage, uint32 maxReferrals, Timestamp expiryAt) -contracts/distribution/IDistributionService.sol: LogDistributionServiceReferralProcessed(NftId distributorNftId, ReferralId referralId, uint32 usedReferrals) -contracts/distribution/IDistributionService.sol: LogDistributionServiceSaleProcessed(NftId distributionNftId, Amount premium, Amount distributionOwnerFee) -contracts/distribution/IDistributionService.sol: LogDistributionServiceSaleProcessedWithReferral(NftId distributionNftId, NftId distributorNftId, ReferralId referralId, uint32 numPoliciesSold, Amount premium, Amount distributionOwnerFee, Amount commissionAmount) - -=============== -contracts/instance/BundleSet.sol: LogBundleSetPolicyLinked(NftId bundleNftId, NftId policyNftId) -contracts/instance/BundleSet.sol: LogBundleSetPolicyUnlinked(NftId bundleNftId, NftId policyNftId) -contracts/instance/BundleSet.sol: LogBundleSetBundleAdded(NftId poolNftId, NftId bundleNftId) -contracts/instance/BundleSet.sol: LogBundleSetBundleUnlocked(NftId poolNftId, NftId bundleNftId) -contracts/instance/BundleSet.sol: LogBundleSetBundleLocked(NftId poolNftId, NftId bundleNftId) -contracts/instance/BundleSet.sol: LogBundleSetBundleClosed(NftId poolNftId, NftId bundleNftId) - -=============== -contracts/instance/IBaseStore.sol: LogBaseStoreMetadataCreated(Key32 key, ObjectType objectType, StateId state) -contracts/instance/IBaseStore.sol: LogBaseStoreMetadataUpdated(Key32 key, StateId oldState, StateId newState) - -=============== -contracts/instance/IInstance.sol: LogInstanceCustomRoleCreated(RoleId roleId, string roleName, RoleId adminRoleId, uint32 maxMemberCount) -contracts/instance/IInstance.sol: LogInstanceCustomRoleActiveSet(RoleId roleId, bool active, address caller) -contracts/instance/IInstance.sol: LogInstanceCustomRoleGranted(RoleId roleId, address account, address caller) -contracts/instance/IInstance.sol: LogInstanceCustomRoleRevoked(RoleId roleId, address account, address caller) -contracts/instance/IInstance.sol: LogInstanceCustomTargetCreated(address target, RoleId targetRoleId, string name) -contracts/instance/IInstance.sol: LogInstanceTargetLocked(address target, bool locked) -contracts/instance/IInstance.sol: LogInstanceCustomTargetFunctionRoleSet(address target, bytes4[] selectors, RoleId roleId) - -=============== -contracts/instance/IInstanceService.sol: LogInstanceServiceInstanceLocked(NftId instanceNftId, bool locked) -contracts/instance/IInstanceService.sol: LogInstanceServiceInstanceCreated(NftId instanceNftId, address instance) -contracts/instance/IInstanceService.sol: LogInstanceServiceMasterInstanceRegistered(NftId masterInstanceNftId, address masterInstance, address masterInstanceAdmin, address masterAccessManager, address masterInstanceReader, address masterInstanceBundleSet, address masterInstanceRiskSet, address masterInstanceStore, address masterProductStore) -contracts/instance/IInstanceService.sol: LogInstanceServiceMasterInstanceReaderUpgraded(NftId instanceNfId, address oldInstanceReader, address newInstanceReader) -contracts/instance/IInstanceService.sol: LogInstanceServiceInstanceReaderUpgraded(NftId instanceNfId, address oldInstanceReader, address newInstanceReader) - -=============== -contracts/instance/InstanceStore.sol: LogProductStoreComponentInfoCreated(NftId componentNftId, StateId state, address createdby, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStoreComponentInfoUpdated(NftId componentNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/InstanceStore.sol: LogProductStorePoolInfoCreated(NftId poolNftId, StateId state, address createdBy, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStorePoolInfoUpdated(NftId poolNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/InstanceStore.sol: LogProductStoreDistributorTypeInfoCreated(DistributorType distributorType, StateId state, address createdBy, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStoreDistributorTypeInfoUpdated(DistributorType distributorType, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/InstanceStore.sol: LogProductStoreDistributorInfoCreated(NftId distributorNftId, StateId state, address createdBy, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStoreDistributorInfoUpdated(NftId distributorNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/InstanceStore.sol: LogProductStoreReferralInfoCreated(ReferralId referralId, StateId state, address createdBy, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStoreReferralInfoUpdated(ReferralId referralId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/InstanceStore.sol: LogProductStoreBundleInfoCreated(NftId bundleNftId, StateId state, address createdBy, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStoreBundleInfoUpdated(NftId bundleNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/InstanceStore.sol: LogProductStoreRequestInfoCreated(RequestId requestId, StateId state, address createdBy, address txOrigin) -contracts/instance/InstanceStore.sol: LogProductStoreRequestInfoUpdated(RequestId requestId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) - -=============== -contracts/instance/ProductStore.sol: LogProductStoreProductInfoCreated(NftId productNftId, StateId state, address createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStoreProductInfoUpdated(NftId productNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/ProductStore.sol: LogProductStoreFeeInfoCreated(NftId productNftId, StateId state, address createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStoreFeeInfoUpdated(NftId productNftId, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/ProductStore.sol: LogProductStoreRiskInfoCreated(RiskId riskId, StateId state, address createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStoreRiskInfoUpdated(RiskId riskId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/ProductStore.sol: LogProductStorePolicyInfoCreated(NftId policyNftId, StateId state, address createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStorePolicyInfoUpdated(NftId policyNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/ProductStore.sol: LogProductStorePremiumInfoCreated(NftId policyNftId, StateId state, address createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStorePremiumInfoUpdated(NftId policyNftId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/ProductStore.sol: LogProductStoreClaimInfoCreated(NftId policyNftId, ClaimId claimId, StateId state, address createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStoreClaimInfoUpdated(NftId policyNftId, ClaimId claimId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) -contracts/instance/ProductStore.sol: LogProductStorePayoutInfoCreated(NftId policyNftId, PayoutId payoutId, StateId state, address createdBy, address txOrigin) -contracts/instance/ProductStore.sol: LogProductStorePayoutInfoUpdated(NftId policyNftId, PayoutId payoutId, StateId oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/distribution/IDistributionService.sol: LogDistributionServiceCommissionWithdrawn(NftId indexed distributorNftId, address indexed recipient, Amount indexed amount, address tokenAddress) +contracts/distribution/IDistributionService.sol: LogDistributionServiceDistributorTypeCreated(NftId indexed distributionNftId, DistributorType indexed distributorType, string name, UFixed indexed commissionPercentage) +contracts/distribution/IDistributionService.sol: LogDistributionServiceDistributorCreated(NftId indexed distributionNftId, NftId indexed distributorNftId, address indexed distributor, DistributorType distributorType) +contracts/distribution/IDistributionService.sol: LogDistributionServiceDistributorTypeChanged(NftId indexed distributorNftId, DistributorType indexed oldDistributorType, DistributorType indexed newDistributorType) +contracts/distribution/IDistributionService.sol: LogDistributionServiceReferralCreated(NftId indexed distributorNftId, ReferralId indexed referralId, string code, UFixed indexed discountPercentage, uint32 maxReferrals, Timestamp expiryAt) +contracts/distribution/IDistributionService.sol: LogDistributionServiceReferralProcessed(NftId indexed distributorNftId, ReferralId indexed referralId, uint32 indexed usedReferrals) +contracts/distribution/IDistributionService.sol: LogDistributionServiceSaleProcessed(NftId indexed distributionNftId, Amount indexed premium, Amount indexed distributionOwnerFee) +contracts/distribution/IDistributionService.sol: LogDistributionServiceSaleProcessedWithReferral(NftId indexed distributionNftId, NftId indexed distributorNftId, ReferralId indexed referralId, uint32 numPoliciesSold, Amount premium, Amount distributionOwnerFee, Amount commissionAmount) + +=============== +contracts/instance/BundleSet.sol: LogBundleSetPolicyLinked(NftId indexed bundleNftId, NftId indexed policyNftId) +contracts/instance/BundleSet.sol: LogBundleSetPolicyUnlinked(NftId indexed bundleNftId, NftId indexed policyNftId) +contracts/instance/BundleSet.sol: LogBundleSetBundleAdded(NftId indexed poolNftId, NftId indexed bundleNftId) +contracts/instance/BundleSet.sol: LogBundleSetBundleUnlocked(NftId indexed poolNftId, NftId indexed bundleNftId) +contracts/instance/BundleSet.sol: LogBundleSetBundleLocked(NftId indexed poolNftId, NftId indexed bundleNftId) +contracts/instance/BundleSet.sol: LogBundleSetBundleClosed(NftId indexed poolNftId, NftId indexed bundleNftId) + +=============== +contracts/instance/IBaseStore.sol: LogBaseStoreMetadataCreated(Key32 indexed key, ObjectType indexed objectType, StateId indexed state) +contracts/instance/IBaseStore.sol: LogBaseStoreMetadataUpdated(Key32 indexed key, StateId indexed oldState, StateId indexed newState) + +=============== +contracts/instance/IInstance.sol: LogInstanceCustomRoleCreated(RoleId indexed roleId, string indexed roleName, RoleId indexed adminRoleId, uint32 maxMemberCount) +contracts/instance/IInstance.sol: LogInstanceCustomRoleActiveSet(RoleId indexed roleId, bool indexed active, address indexed caller) +contracts/instance/IInstance.sol: LogInstanceCustomRoleGranted(RoleId indexed roleId, address indexed account, address indexed caller) +contracts/instance/IInstance.sol: LogInstanceCustomRoleRevoked(RoleId indexed roleId, address indexed account, address indexed caller) +contracts/instance/IInstance.sol: LogInstanceCustomTargetCreated(address indexed target, RoleId indexed targetRoleId, string indexed name) +contracts/instance/IInstance.sol: LogInstanceTargetLocked(address indexed target, bool indexed locked) +contracts/instance/IInstance.sol: LogInstanceCustomTargetFunctionRoleSet(address indexed target, bytes4[] indexed selectors, RoleId indexed roleId) + +=============== +contracts/instance/IInstanceService.sol: LogInstanceServiceInstanceLocked(NftId indexed instanceNftId, bool indexed locked) +contracts/instance/IInstanceService.sol: LogInstanceServiceInstanceCreated(NftId indexed instanceNftId, address indexed instance) +contracts/instance/IInstanceService.sol: LogInstanceServiceMasterInstanceRegistered(NftId indexed masterInstanceNftId, address indexed masterInstance, address indexed masterInstanceAdmin, address masterAccessManager, address masterInstanceReader, address masterInstanceBundleSet, address masterInstanceRiskSet, address masterInstanceStore, address masterProductStore) +contracts/instance/IInstanceService.sol: LogInstanceServiceMasterInstanceReaderUpgraded(NftId indexed instanceNfId, address indexed oldInstanceReader, address indexed newInstanceReader) +contracts/instance/IInstanceService.sol: LogInstanceServiceInstanceReaderUpgraded(NftId indexed instanceNfId, address indexed oldInstanceReader, address indexed newInstanceReader) + +=============== +contracts/instance/InstanceStore.sol: LogProductStoreComponentInfoCreated(NftId indexed componentNftId, StateId indexed state, address indexed createdby, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStoreComponentInfoUpdated(NftId indexed componentNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/InstanceStore.sol: LogProductStorePoolInfoCreated(NftId indexed poolNftId, StateId indexed state, address indexed createdBy, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStorePoolInfoUpdated(NftId indexed poolNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/InstanceStore.sol: LogProductStoreDistributorTypeInfoCreated(DistributorType indexed distributorType, StateId indexed state, address indexed createdBy, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStoreDistributorTypeInfoUpdated(DistributorType indexed distributorType, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/InstanceStore.sol: LogProductStoreDistributorInfoCreated(NftId indexed distributorNftId, StateId indexed state, address indexed createdBy, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStoreDistributorInfoUpdated(NftId indexed distributorNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/InstanceStore.sol: LogProductStoreReferralInfoCreated(ReferralId indexed referralId, StateId indexed state, address indexed createdBy, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStoreReferralInfoUpdated(ReferralId indexed referralId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/InstanceStore.sol: LogProductStoreBundleInfoCreated(NftId indexed bundleNftId, StateId indexed state, address indexed createdBy, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStoreBundleInfoUpdated(NftId indexed bundleNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/InstanceStore.sol: LogProductStoreRequestInfoCreated(RequestId indexed requestId, StateId indexed state, address indexed createdBy, address txOrigin) +contracts/instance/InstanceStore.sol: LogProductStoreRequestInfoUpdated(RequestId indexed requestId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) + +=============== +contracts/instance/ProductStore.sol: LogProductStoreProductInfoCreated(NftId indexed productNftId, StateId indexed state, address indexed createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStoreProductInfoUpdated(NftId indexed productNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/ProductStore.sol: LogProductStoreFeeInfoCreated(NftId indexed productNftId, StateId indexed state, address indexed createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStoreFeeInfoUpdated(NftId indexed productNftId, address indexed updatedBy, address indexed txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/ProductStore.sol: LogProductStoreRiskInfoCreated(RiskId indexed riskId, StateId indexed state, address indexed createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStoreRiskInfoUpdated(RiskId indexed riskId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/ProductStore.sol: LogProductStorePolicyInfoCreated(NftId indexed policyNftId, StateId indexed state, address indexed createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStorePolicyInfoUpdated(NftId indexed policyNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/ProductStore.sol: LogProductStorePremiumInfoCreated(NftId indexed policyNftId, StateId indexed state, address indexed createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStorePremiumInfoUpdated(NftId indexed policyNftId, StateId indexed oldState, StateId indexed newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/ProductStore.sol: LogProductStoreClaimInfoCreated(NftId indexed policyNftId, ClaimId indexed claimId, StateId indexed state, address createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStoreClaimInfoUpdated(NftId indexed policyNftId, ClaimId indexed claimId, StateId indexed oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) +contracts/instance/ProductStore.sol: LogProductStorePayoutInfoCreated(NftId indexed policyNftId, PayoutId indexed payoutId, StateId indexed state, address createdBy, address txOrigin) +contracts/instance/ProductStore.sol: LogProductStorePayoutInfoUpdated(NftId indexed policyNftId, PayoutId indexed payoutId, StateId indexed oldState, StateId newState, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn) =============== -contracts/instance/RiskSet.sol: LogRiskSetPolicyLinked(RiskId riskId, NftId policyNftId) -contracts/instance/RiskSet.sol: LogRiskSetPolicyUnlinked(RiskId riskId, NftId policyNftId) -contracts/instance/RiskSet.sol: LogRiskSetRiskAdded(NftId productNftId, RiskId riskId) -contracts/instance/RiskSet.sol: LogRiskSetRiskActivated(NftId poolNftId, RiskId riskId) -contracts/instance/RiskSet.sol: LogRiskSetRiskPaused(NftId poolNftId, RiskId riskId) +contracts/instance/RiskSet.sol: LogRiskSetPolicyLinked(RiskId indexed riskId, NftId indexed policyNftId) +contracts/instance/RiskSet.sol: LogRiskSetPolicyUnlinked(RiskId indexed riskId, NftId indexed policyNftId) +contracts/instance/RiskSet.sol: LogRiskSetRiskAdded(NftId indexed productNftId, RiskId indexed riskId) +contracts/instance/RiskSet.sol: LogRiskSetRiskActivated(NftId indexed poolNftId, RiskId indexed riskId) +contracts/instance/RiskSet.sol: LogRiskSetRiskPaused(NftId indexed poolNftId, RiskId indexed riskId) =============== -contracts/oracle/IOracleService.sol: LogOracleServiceRequestCreated(RequestId requestId, NftId requesterNftId, NftId oracleNftId, Timestamp expiryAt) -contracts/oracle/IOracleService.sol: LogOracleServiceResponseProcessed(RequestId requestId, NftId requesterNftId, NftId oracleNftId) -contracts/oracle/IOracleService.sol: LogOracleServiceDeliveryFailed(RequestId requestId, address requesterAddress, string functionSignature) -contracts/oracle/IOracleService.sol: LogOracleServiceResponseResent(RequestId requestId, NftId requesterNftId) -contracts/oracle/IOracleService.sol: LogOracleServiceRequestCancelled(RequestId requestId, NftId requesterNftId) - -=============== -contracts/pool/IBundleService.sol: LogBundleServiceBundleCreated(NftId bundleNftId, NftId poolNftId, Seconds lifetime, Amount fixedFee, UFixed fractionalFee) -contracts/pool/IBundleService.sol: LogBundleServiceBundleClosed(NftId bundleNftId) -contracts/pool/IBundleService.sol: LogBundleServiceBundleLocked(NftId bundleNftId) -contracts/pool/IBundleService.sol: LogBundleServiceBundleUnlocked(NftId bundleNftId) -contracts/pool/IBundleService.sol: LogBundleServiceBundleExtended(NftId bundleNftId, Seconds lifetimeExtension, Timestamp extendedExpiredAt) -contracts/pool/IBundleService.sol: LogBundleServiceBundleFeeUpdated(NftId bundleNftId, Amount fixedFee, UFixed fractionalFee) -contracts/pool/IBundleService.sol: LogBundleServiceCollateralLocked(NftId bundleNftId, NftId policyNftId, Amount collateralAmount) -contracts/pool/IBundleService.sol: LogBundleServiceCollateralReleased(NftId bundleNftId, NftId policyNftId, Amount collateralAmount) -contracts/pool/IBundleService.sol: LogBundleServiceBundleStaked(NftId bundleNftId, Amount amount) -contracts/pool/IBundleService.sol: LogBundleServiceBundleUnstaked(NftId bundleNftId, Amount amount) - +contracts/oracle/IOracleService.sol: LogOracleServiceRequestCreated(RequestId indexed requestId, NftId indexed requesterNftId, NftId indexed oracleNftId, Timestamp expiryAt) +contracts/oracle/IOracleService.sol: LogOracleServiceResponseProcessed(RequestId indexed requestId, NftId indexed requesterNftId, NftId indexed oracleNftId) +contracts/oracle/IOracleService.sol: LogOracleServiceDeliveryFailed(RequestId indexed requestId, address indexed requesterAddress, string indexed functionSignature) +contracts/oracle/IOracleService.sol: LogOracleServiceResponseResent(RequestId indexed requestId, NftId indexed requesterNftId) +contracts/oracle/IOracleService.sol: LogOracleServiceRequestCancelled(RequestId indexed requestId, NftId indexed requesterNftId) + +=============== +contracts/pool/IBundleService.sol: LogBundleServiceBundleCreated(NftId indexed bundleNftId, NftId indexed poolNftId, Seconds indexed lifetime, Amount fixedFee, UFixed fractionalFee) +contracts/pool/IBundleService.sol: LogBundleServiceBundleClosed(NftId indexed bundleNftId) +contracts/pool/IBundleService.sol: LogBundleServiceBundleLocked(NftId indexed bundleNftId) +contracts/pool/IBundleService.sol: LogBundleServiceBundleUnlocked(NftId indexed bundleNftId) +contracts/pool/IBundleService.sol: LogBundleServiceBundleExtended(NftId indexed bundleNftId, Seconds indexed lifetimeExtension, Timestamp indexed extendedExpiredAt) +contracts/pool/IBundleService.sol: LogBundleServiceBundleFeeUpdated(NftId indexed bundleNftId, Amount indexed fixedFee, UFixed indexed fractionalFee) +contracts/pool/IBundleService.sol: LogBundleServiceCollateralLocked(NftId indexed bundleNftId, NftId indexed policyNftId, Amount indexed collateralAmount) +contracts/pool/IBundleService.sol: LogBundleServiceCollateralReleased(NftId indexed bundleNftId, NftId indexed policyNftId, Amount indexed collateralAmount) +contracts/pool/IBundleService.sol: LogBundleServiceBundleStaked(NftId indexed bundleNftId, Amount indexed amount) +contracts/pool/IBundleService.sol: LogBundleServiceBundleUnstaked(NftId indexed bundleNftId, Amount indexed amount) + =============== -contracts/pool/IPoolComponent.sol: LogPoolVerifiedByPool(address pool, NftId applicationNftId, Amount collateralizationAmount) +contracts/pool/IPoolComponent.sol: LogPoolVerifiedByPool(address indexed pool, NftId indexed applicationNftId, Amount indexed collateralizationAmount) =============== -contracts/pool/IPoolService.sol: LogPoolServiceMaxBalanceAmountUpdated(NftId poolNftId, Amount previousMaxCapitalAmount, Amount currentMaxCapitalAmount) -contracts/pool/IPoolService.sol: LogPoolServiceWalletFunded(NftId poolNftId, address poolOwner, Amount amount) -contracts/pool/IPoolService.sol: LogPoolServiceWalletDefunded(NftId poolNftId, address poolOwner, Amount amount) -contracts/pool/IPoolService.sol: LogPoolServiceBundleCreated(NftId instanceNftId, NftId poolNftId, NftId bundleNftId) -contracts/pool/IPoolService.sol: LogPoolServiceBundleClosed(NftId instanceNftId, NftId poolNftId, NftId bundleNftId, Amount balanceAmount, Amount feeAmount) -contracts/pool/IPoolService.sol: LogPoolServiceBundleStaked(NftId instanceNftId, NftId poolNftId, NftId bundleNftId, Amount amount, Amount netAmount) -contracts/pool/IPoolService.sol: LogPoolServiceBundleUnstaked(NftId instanceNftId, NftId poolNftId, NftId bundleNftId, Amount amount, Amount netAmount) -contracts/pool/IPoolService.sol: LogPoolServiceFeesWithdrawn(NftId bundleNftId, address recipient, Amount amount, address tokenAddress) -contracts/pool/IPoolService.sol: LogPoolServiceProcessFundedClaim(NftId policyNftId, ClaimId claimId, Amount availableAmount) -contracts/pool/IPoolService.sol: LogPoolServiceApplicationVerified(NftId poolNftId, NftId bundleNftId, NftId applicationNftId, Amount totalCollateralAmount) -contracts/pool/IPoolService.sol: LogPoolServiceCollateralLocked(NftId poolNftId, NftId bundleNftId, NftId applicationNftId, Amount totalCollateralAmount, Amount lockedCollateralAmount) -contracts/pool/IPoolService.sol: LogPoolServiceCollateralReleased(NftId bundleNftId, NftId policyNftId, Amount releasedCollateralAmount) -contracts/pool/IPoolService.sol: LogPoolServiceSaleProcessed(NftId poolNftId, NftId bundleNftId, Amount bundleNetAmount, Amount bundleFeeAmount, Amount poolFeeAmount) -contracts/pool/IPoolService.sol: LogPoolServicePayoutProcessed(NftId poolNftId, NftId bundleNftId, NftId policyNftId, PayoutId payoutId, Amount netPayoutAmount, Amount processingFeeAmount, address payoutBeneficiary) - -=============== -contracts/product/IApplicationService.sol: LogApplicationServiceApplicationCreated(NftId applicationNftId, NftId productNftId, NftId bundleNftId, RiskId riskId, ReferralId referralId, address applicationOwner, Amount sumInsuredAmount, Amount premiumAmount, Seconds lifetime) -contracts/product/IApplicationService.sol: LogApplicationServiceApplicationRenewed(NftId policyNftId, NftId bundleNftId) -contracts/product/IApplicationService.sol: LogApplicationServiceApplicationAdjusted(NftId applicationNftId, NftId bundleNftId, RiskId riskId, ReferralId referralId, Amount sumInsuredAmount, Seconds lifetime) -contracts/product/IApplicationService.sol: LogApplicationServiceApplicationRevoked(NftId applicationNftId) - -=============== -contracts/product/IClaimService.sol: LogClaimServiceClaimSubmitted(NftId policyNftId, ClaimId claimId, Amount claimAmount) -contracts/product/IClaimService.sol: LogClaimServiceClaimConfirmed(NftId policyNftId, ClaimId claimId, Amount confirmedAmount) -contracts/product/IClaimService.sol: LogClaimServiceClaimDeclined(NftId policyNftId, ClaimId claimId) -contracts/product/IClaimService.sol: LogClaimServiceClaimRevoked(NftId policyNftId, ClaimId claimId) -contracts/product/IClaimService.sol: LogClaimServiceClaimCancelled(NftId policyNftId, ClaimId claimId) -contracts/product/IClaimService.sol: LogClaimServicePayoutCreated(NftId policyNftId, ClaimId claimId, PayoutId payoutId, Amount amount, address beneficiary) -contracts/product/IClaimService.sol: LogClaimServicePayoutProcessed(NftId policyNftId, PayoutId payoutId, Amount amount) -contracts/product/IClaimService.sol: LogClaimServicePayoutCancelled(NftId policyNftId, PayoutId payoutId) - -=============== -contracts/product/IPolicyService.sol: LogPolicyServicePolicyCreated(NftId policyNftId, Amount premiumAmount, Timestamp activatedAt) -contracts/product/IPolicyService.sol: LogPolicyServicePolicyDeclined(NftId policyNftId) -contracts/product/IPolicyService.sol: LogPolicyServicePolicyPremiumCollected(NftId policyNftId, NftId productNftId, Amount premiumAmount, Timestamp activateAt) -contracts/product/IPolicyService.sol: LogPolicyServicePolicyActivated(NftId policyNftId, Timestamp activatedAt) -contracts/product/IPolicyService.sol: LogPolicyServicePolicyActivatedUpdated(NftId policyNftId, Timestamp activatedAt) -contracts/product/IPolicyService.sol: LogPolicyServicePolicyExpirationUpdated(NftId policyNftId, Timestamp expiredAt) -contracts/product/IPolicyService.sol: LogPolicyServicePolicyClosed(NftId policyNftId) - -=============== -contracts/product/IRiskService.sol: LogRiskServiceRiskCreated(NftId productNftId, RiskId riskId) -contracts/product/IRiskService.sol: LogRiskServiceRiskUpdated(NftId productNftId, RiskId riskId) -contracts/product/IRiskService.sol: LogRiskServiceRiskLocked(NftId productNftId, RiskId riskId) -contracts/product/IRiskService.sol: LogRiskServiceRiskUnlocked(NftId productNftId, RiskId riskId) -contracts/product/IRiskService.sol: LogRiskServiceRiskClosed(NftId productNftId, RiskId riskId) - -=============== -contracts/registry/ChainNft.sol: LogTokenInterceptorAddress(uint256 tokenId, address interceptor) - -=============== -contracts/registry/IRegistry.sol: LogRegistryObjectRegistered(NftId nftId, NftId parentNftId, ObjectType objectType, bool isInterceptor, address objectAddress, address initialOwner) -contracts/registry/IRegistry.sol: LogRegistryServiceRegistered(NftId nftId, VersionPart majorVersion, ObjectType domain) -contracts/registry/IRegistry.sol: LogRegistryChainRegistryRegistered(NftId nftId, uint256 chainId, address chainRegistryAddress) - -=============== -contracts/registry/ReleaseAdmin.sol: LogReleaseAdminReleaseLocked(VersionPart release, bool locked) -contracts/registry/ReleaseAdmin.sol: LogReleaseAdminServiceLocked(VersionPart release, address service, bool locked) - -=============== -contracts/registry/ReleaseRegistry.sol: LogReleaseCreated(IAccessAdmin admin, VersionPart release, bytes32 salt) -contracts/registry/ReleaseRegistry.sol: LogReleaseActivated(VersionPart release) -contracts/registry/ReleaseRegistry.sol: LogReleaseDisabled(VersionPart release) -contracts/registry/ReleaseRegistry.sol: LogReleaseEnabled(VersionPart release) +contracts/pool/IPoolService.sol: LogPoolServiceMaxBalanceAmountUpdated(NftId indexed poolNftId, Amount indexed previousMaxCapitalAmount, Amount indexed currentMaxCapitalAmount) +contracts/pool/IPoolService.sol: LogPoolServiceWalletFunded(NftId indexed poolNftId, address indexed poolOwner, Amount indexed amount) +contracts/pool/IPoolService.sol: LogPoolServiceWalletDefunded(NftId indexed poolNftId, address indexed poolOwner, Amount indexed amount) +contracts/pool/IPoolService.sol: LogPoolServiceBundleCreated(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId) +contracts/pool/IPoolService.sol: LogPoolServiceBundleClosed(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId, Amount balanceAmount, Amount feeAmount) +contracts/pool/IPoolService.sol: LogPoolServiceBundleStaked(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId, Amount amount, Amount netAmount) +contracts/pool/IPoolService.sol: LogPoolServiceBundleUnstaked(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId, Amount amount, Amount netAmount) +contracts/pool/IPoolService.sol: LogPoolServiceFeesWithdrawn(NftId indexed bundleNftId, address indexed recipient, Amount indexed amount, address tokenAddress) +contracts/pool/IPoolService.sol: LogPoolServiceProcessFundedClaim(NftId indexed policyNftId, ClaimId indexed claimId, Amount indexed availableAmount) +contracts/pool/IPoolService.sol: LogPoolServiceApplicationVerified(NftId indexed poolNftId, NftId indexed bundleNftId, NftId indexed applicationNftId, Amount totalCollateralAmount) +contracts/pool/IPoolService.sol: LogPoolServiceCollateralLocked(NftId indexed poolNftId, NftId indexed bundleNftId, NftId indexed applicationNftId, Amount totalCollateralAmount, Amount lockedCollateralAmount) +contracts/pool/IPoolService.sol: LogPoolServiceCollateralReleased(NftId indexed bundleNftId, NftId indexed policyNftId, Amount indexed releasedCollateralAmount) +contracts/pool/IPoolService.sol: LogPoolServiceSaleProcessed(NftId indexed poolNftId, NftId indexed bundleNftId, Amount indexed bundleNetAmount, Amount bundleFeeAmount, Amount poolFeeAmount) +contracts/pool/IPoolService.sol: LogPoolServicePayoutProcessed(NftId indexed poolNftId, NftId indexed bundleNftId, NftId indexed policyNftId, PayoutId payoutId, Amount netPayoutAmount, Amount processingFeeAmount, address payoutBeneficiary) + +=============== +contracts/product/IApplicationService.sol: LogApplicationServiceApplicationCreated(NftId indexed applicationNftId, NftId indexed productNftId, NftId indexed bundleNftId, RiskId riskId, ReferralId referralId, address applicationOwner, Amount sumInsuredAmount, Amount premiumAmount, Seconds lifetime) +contracts/product/IApplicationService.sol: LogApplicationServiceApplicationRenewed(NftId indexed policyNftId, NftId indexed bundleNftId) +contracts/product/IApplicationService.sol: LogApplicationServiceApplicationAdjusted(NftId indexed applicationNftId, NftId indexed bundleNftId, RiskId indexed riskId, ReferralId referralId, Amount sumInsuredAmount, Seconds lifetime) +contracts/product/IApplicationService.sol: LogApplicationServiceApplicationRevoked(NftId indexed applicationNftId) + +=============== +contracts/product/IClaimService.sol: LogClaimServiceClaimSubmitted(NftId indexed policyNftId, ClaimId indexed claimId, Amount indexed claimAmount) +contracts/product/IClaimService.sol: LogClaimServiceClaimConfirmed(NftId indexed policyNftId, ClaimId indexed claimId, Amount indexed confirmedAmount) +contracts/product/IClaimService.sol: LogClaimServiceClaimDeclined(NftId indexed policyNftId, ClaimId indexed claimId) +contracts/product/IClaimService.sol: LogClaimServiceClaimRevoked(NftId indexed policyNftId, ClaimId indexed claimId) +contracts/product/IClaimService.sol: LogClaimServiceClaimCancelled(NftId indexed policyNftId, ClaimId indexed claimId) +contracts/product/IClaimService.sol: LogClaimServicePayoutCreated(NftId indexed policyNftId, ClaimId indexed claimId, PayoutId indexed payoutId, Amount amount, address beneficiary) +contracts/product/IClaimService.sol: LogClaimServicePayoutProcessed(NftId indexed policyNftId, PayoutId indexed payoutId, Amount indexed amount) +contracts/product/IClaimService.sol: LogClaimServicePayoutCancelled(NftId indexed policyNftId, PayoutId indexed payoutId) + +=============== +contracts/product/IPolicyService.sol: LogPolicyServicePolicyCreated(NftId indexed policyNftId, Amount indexed premiumAmount, Timestamp indexed activatedAt) +contracts/product/IPolicyService.sol: LogPolicyServicePolicyDeclined(NftId indexed policyNftId) +contracts/product/IPolicyService.sol: LogPolicyServicePolicyPremiumCollected(NftId indexed policyNftId, NftId indexed productNftId, Amount indexed premiumAmount, Timestamp activateAt) +contracts/product/IPolicyService.sol: LogPolicyServicePolicyActivated(NftId indexed policyNftId, Timestamp indexed activatedAt) +contracts/product/IPolicyService.sol: LogPolicyServicePolicyActivatedUpdated(NftId indexed policyNftId, Timestamp indexed activatedAt) +contracts/product/IPolicyService.sol: LogPolicyServicePolicyExpirationUpdated(NftId indexed policyNftId, Timestamp indexed expiredAt) +contracts/product/IPolicyService.sol: LogPolicyServicePolicyClosed(NftId indexed policyNftId) + +=============== +contracts/product/IRiskService.sol: LogRiskServiceRiskCreated(NftId indexed productNftId, RiskId indexed riskId) +contracts/product/IRiskService.sol: LogRiskServiceRiskUpdated(NftId indexed productNftId, RiskId indexed riskId) +contracts/product/IRiskService.sol: LogRiskServiceRiskLocked(NftId indexed productNftId, RiskId indexed riskId) +contracts/product/IRiskService.sol: LogRiskServiceRiskUnlocked(NftId indexed productNftId, RiskId indexed riskId) +contracts/product/IRiskService.sol: LogRiskServiceRiskClosed(NftId indexed productNftId, RiskId indexed riskId) + +=============== +contracts/registry/ChainNft.sol: LogTokenInterceptorAddress(uint256 indexed tokenId, address indexed interceptor) + +=============== +contracts/registry/IRegistry.sol: LogRegistryObjectRegistered(NftId indexed nftId, NftId indexed parentNftId, ObjectType indexed objectType, bool isInterceptor, address objectAddress, address initialOwner) +contracts/registry/IRegistry.sol: LogRegistryServiceRegistered(NftId indexed nftId, VersionPart indexed majorVersion, ObjectType indexed domain) +contracts/registry/IRegistry.sol: LogRegistryChainRegistryRegistered(NftId indexed nftId, uint256 indexed chainId, address indexed chainRegistryAddress) + +=============== +contracts/registry/ReleaseAdmin.sol: LogReleaseAdminReleaseLocked(VersionPart indexed release, bool indexed locked) +contracts/registry/ReleaseAdmin.sol: LogReleaseAdminServiceLocked(VersionPart indexed release, address indexed service, bool indexed locked) + +=============== +contracts/registry/ReleaseRegistry.sol: LogReleaseCreated(IAccessAdmin indexed admin, VersionPart indexed release, bytes32 indexed salt) +contracts/registry/ReleaseRegistry.sol: LogReleaseActivated(VersionPart indexed release) +contracts/registry/ReleaseRegistry.sol: LogReleaseDisabled(VersionPart indexed release) +contracts/registry/ReleaseRegistry.sol: LogReleaseEnabled(VersionPart indexed release) =============== -contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenRegistered(ChainId chainId, address token, uint256 decimals, string symbol) -contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenGlobalStateSet(ChainId chainId, address token, bool active) -contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenStateSet(ChainId chainId, address token, VersionPart release, bool active) +contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenRegistered(ChainId indexed chainId, address indexed token, uint256 indexed decimals, string symbol) +contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenGlobalStateSet(ChainId indexed chainId, address indexed token, bool indexed active) +contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenStateSet(ChainId indexed chainId, address indexed token, VersionPart indexed release, bool active) =============== -contracts/shared/IComponentService.sol: LogComponentServiceComponentLocked(address component, bool locked) -contracts/shared/IComponentService.sol: LogComponentServiceTokenHandlerDeployed(NftId componentNftId, address tokenHandler, address token) -contracts/shared/IComponentService.sol: LogComponentServiceRegistered(NftId instanceNftId, NftId componentNftId, ObjectType componentType, address component, address token, address initialOwner) -contracts/shared/IComponentService.sol: LogComponentServiceComponentFeesWithdrawn(NftId componentNftId, address recipient, Amount withdrawnAmount, address token) -contracts/shared/IComponentService.sol: LogComponentServiceProductFeesUpdated(NftId productNftId) -contracts/shared/IComponentService.sol: LogComponentServiceDistributionFeesUpdated(NftId distributionNftId) -contracts/shared/IComponentService.sol: LogComponentServicePoolFeesUpdated(NftId poolNftId) -contracts/shared/IComponentService.sol: LogComponentServiceUpdateFee(NftId nftId, string feeName, UFixed previousFractionalFee, Amount previousFixedFee, UFixed newFractionalFee, Amount newFixedFee) -contracts/shared/IComponentService.sol: LogComponentServiceProductCreated(NftId productNftId, address productAddress, bool hasDistribution, uint8 expectedNumberOfOracles) -contracts/shared/IComponentService.sol: LogComponentServiceProductInitialProductFeesSet(NftId productNftId, Amount productFeeFixed, UFixed productFeeFractional, Amount processingFeeFixed, UFixed processingFeeFractional) -contracts/shared/IComponentService.sol: LogComponentServiceProductInitialDistributionFeesSet(NftId productNftId, Amount distributionFeeFixed, UFixed distributionFeeFractional, Amount minDistributionOwnerFeeFixed, UFixed minDistributionOwnerFeeFractional) -contracts/shared/IComponentService.sol: LogComponentServiceProductInitialPoolFeesSet(NftId productNftId, Amount poolFeeFixed, UFixed poolFeeFractional, Amount stakingFeeFixed, UFixed stakingFeeFractional, Amount performanceFeeFixed, UFixed performanceFeeFractional) -contracts/shared/IComponentService.sol: LogComponentServicePoolCreated(NftId poolNftId, NftId productNftId, address componentAddress, Amount maxBalanceAmount, UFixed collateralizationLevel, UFixed retentionLevel, bool isExternallyManaged, bool isVerifyingApplications) -contracts/shared/IComponentService.sol: LogComponentServiceDistributionCreated(NftId distributionNftId, NftId productNftId) -contracts/shared/IComponentService.sol: LogComponentServiceOracleCreated(NftId oracleNftId, NftId productNftId) - +contracts/shared/IComponentService.sol: LogComponentServiceComponentLocked(address indexed component, bool indexed locked) +contracts/shared/IComponentService.sol: LogComponentServiceTokenHandlerDeployed(NftId indexed componentNftId, address indexed tokenHandler, address indexed token) +contracts/shared/IComponentService.sol: LogComponentServiceRegistered(NftId indexed instanceNftId, NftId indexed componentNftId, ObjectType indexed componentType, address component, address token, address initialOwner) +contracts/shared/IComponentService.sol: LogComponentServiceComponentFeesWithdrawn(NftId indexed componentNftId, address indexed recipient, Amount indexed withdrawnAmount, address token) +contracts/shared/IComponentService.sol: LogComponentServiceProductFeesUpdated(NftId indexed productNftId) +contracts/shared/IComponentService.sol: LogComponentServiceDistributionFeesUpdated(NftId indexed distributionNftId) +contracts/shared/IComponentService.sol: LogComponentServicePoolFeesUpdated(NftId indexed poolNftId) +contracts/shared/IComponentService.sol: LogComponentServiceUpdateFee(NftId indexed nftId, string feeName, UFixed previousFractionalFee, Amount previousFixedFee, UFixed indexed newFractionalFee, Amount indexed newFixedFee) +contracts/shared/IComponentService.sol: LogComponentServiceProductCreated(NftId indexed productNftId, address indexed productAddress, bool indexed hasDistribution, uint8 expectedNumberOfOracles) +contracts/shared/IComponentService.sol: LogComponentServiceProductInitialProductFeesSet(NftId indexed productNftId, Amount indexed productFeeFixed, UFixed indexed productFeeFractional, Amount processingFeeFixed, UFixed processingFeeFractional) +contracts/shared/IComponentService.sol: LogComponentServiceProductInitialDistributionFeesSet(NftId indexed productNftId, Amount indexed distributionFeeFixed, UFixed indexed distributionFeeFractional, Amount minDistributionOwnerFeeFixed, UFixed minDistributionOwnerFeeFractional) +contracts/shared/IComponentService.sol: LogComponentServiceProductInitialPoolFeesSet(NftId indexed productNftId, Amount indexed poolFeeFixed, UFixed indexed poolFeeFractional, Amount stakingFeeFixed, UFixed stakingFeeFractional, Amount performanceFeeFixed, UFixed performanceFeeFractional) +contracts/shared/IComponentService.sol: LogComponentServicePoolCreated(NftId indexed poolNftId, NftId indexed productNftId, address indexed componentAddress, Amount maxBalanceAmount, UFixed collateralizationLevel, UFixed retentionLevel, bool isExternallyManaged, bool isVerifyingApplications) +contracts/shared/IComponentService.sol: LogComponentServiceDistributionCreated(NftId indexed distributionNftId, NftId indexed productNftId) +contracts/shared/IComponentService.sol: LogComponentServiceOracleCreated(NftId indexed oracleNftId, NftId indexed productNftId) + =============== -contracts/shared/INftOwnable.sol: LogNftOwnableNftLinkedToAddress(NftId nftId, address owner) +contracts/shared/INftOwnable.sol: LogNftOwnableNftLinkedToAddress(NftId indexed nftId, address indexed owner) =============== -contracts/shared/TokenHandler.sol: LogTokenHandlerWalletAddressChanged(NftId componentNftId, address oldWallet, address newWallet) -contracts/shared/TokenHandler.sol: LogTokenHandlerWalletTokensTransferred(NftId componentNftId, address oldWallet, address newWallet, Amount amount) -contracts/shared/TokenHandler.sol: LogTokenHandlerTokenApproved(NftId nftId, address tokenHandler, address token, Amount amount, bool isMaxAmount) -contracts/shared/TokenHandler.sol: LogTokenHandlerTokenTransferred(address token, address from, address to, Amount amount) +contracts/shared/TokenHandler.sol: LogTokenHandlerWalletAddressChanged(NftId indexed componentNftId, address indexed oldWallet, address indexed newWallet) +contracts/shared/TokenHandler.sol: LogTokenHandlerWalletTokensTransferred(NftId indexed componentNftId, address indexed oldWallet, address indexed newWallet, Amount amount) +contracts/shared/TokenHandler.sol: LogTokenHandlerTokenApproved(NftId indexed nftId, address indexed tokenHandler, address indexed token, Amount amount, bool isMaxAmount) +contracts/shared/TokenHandler.sol: LogTokenHandlerTokenTransferred(address indexed token, address indexed from, address indexed to, Amount amount) =============== -contracts/staking/IStaking.sol: LogStakingTokenHandlerDeployed(NftId componentNftId, address tokenHandler, address token) -contracts/staking/IStaking.sol: LogStakingStakingRateSet(ChainId chainId, address token, UFixed oldStakingRate, UFixed newStakingRate, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingStakingServiceSet(address oldStakingService, address stakingService, VersionPart release) -contracts/staking/IStaking.sol: LogStakingStakingReaderSet(address oldStakingReader, address stakingReader) -contracts/staking/IStaking.sol: LogStakingTargetHandlerSet(address oldTargetHandler, address targetManager) -contracts/staking/IStaking.sol: LogStakingTokenHandlerApproved(Amount oldApprovalAmount, Amount approvalAmount, address token) -contracts/staking/IStaking.sol: LogStakingTokenAdded(ChainId chainId, address token) -contracts/staking/IStaking.sol: LogStakingTargetTokenAdded(NftId targetNftId, address token) -contracts/staking/IStaking.sol: LogStakingTvlIncreased(NftId targetNftId, address token, Amount amount, Amount newBalance, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTvlDecreased(NftId targetNftId, address token, Amount amount, Amount newBalance, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingSupportInfoSet(ObjectType objectType, bool isSupported, bool allowNewTargets, bool allowCrossChain, Amount minStakingAmount, Amount maxStakingAmount, Seconds minLockingPeriod, Seconds maxLockingPeriod, UFixed minRewardRate, UFixed maxRewardRate, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetCreated(NftId targetNftId, ObjectType objectType, Seconds lockingPeriod, UFixed rewardRate) -contracts/staking/IStaking.sol: LogStakingLimitsSet(NftId targetNftId, Amount marginAmount, Amount hardLimitAmount, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetLimitsUpdated(NftId targetNftId, Amount marginAmount, Amount hardLimitAmount, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetLimitUpdated(NftId targetNftId, Amount limitAmount, Amount hardLimitAmount, Amount requiredStakeAmount, Amount actualStakeAmount, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetLockingPeriodSet(NftId targetNftId, Seconds oldLockingPeriod, Seconds lockingPeriod, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetRewardRateSet(NftId targetNftId, UFixed oldRewardRate, UFixed rewardRate, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetMaxStakedAmountSet(NftId targetNftId, Amount stakeLimitAmount, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingTargetLimitsSet(NftId targetNftId, Amount stakeLimitAmount, Amount marginAmount, Amount limitAmount) -contracts/staking/IStaking.sol: LogStakingRewardReservesRefilled(NftId targetNftId, Amount dipAmount, address targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingRewardReservesWithdrawn(NftId targetNftId, Amount dipAmount, address targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingRewardReservesSpent(NftId targetNftId, Amount dipAmount, Amount reserveBalance, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingStakeCreated(NftId stakeNftId, NftId targetNftId, Amount stakeAmount, Timestamp lockedUntil, address stakeOwner) -contracts/staking/IStaking.sol: LogStakingStakeRewardsUpdated(NftId stakeNftId, Amount rewardIncrementAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingRewardsRestaked(NftId stakeNftId, Amount restakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingStaked(NftId stakeNftId, Amount stakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingUnstaked(NftId stakeNftId, Amount unstakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingRewardsClaimed(NftId stakeNftId, Amount claimedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) -contracts/staking/IStaking.sol: LogStakingStakeRestaked(NftId stakeNftId, NftId targetNftId, Amount stakeAmount, address owner, NftId oldStakeNftId) +contracts/staking/IStaking.sol: LogStakingTokenHandlerDeployed(NftId indexed componentNftId, address indexed tokenHandler, address indexed token) +contracts/staking/IStaking.sol: LogStakingStakingRateSet(ChainId indexed chainId, address indexed token, UFixed indexed oldStakingRate, UFixed newStakingRate, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingStakingServiceSet(address indexed oldStakingService, address indexed stakingService, VersionPart indexed release) +contracts/staking/IStaking.sol: LogStakingStakingReaderSet(address indexed oldStakingReader, address indexed stakingReader) +contracts/staking/IStaking.sol: LogStakingTargetHandlerSet(address indexed oldTargetHandler, address indexed targetManager) +contracts/staking/IStaking.sol: LogStakingTokenHandlerApproved(Amount indexed oldApprovalAmount, Amount indexed approvalAmount, address indexed token) +contracts/staking/IStaking.sol: LogStakingTokenAdded(ChainId indexed chainId, address indexed token) +contracts/staking/IStaking.sol: LogStakingTargetTokenAdded(NftId indexed targetNftId, address indexed token) +contracts/staking/IStaking.sol: LogStakingTvlIncreased(NftId indexed targetNftId, address indexed token, Amount indexed amount, Amount newBalance, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTvlDecreased(NftId indexed targetNftId, address indexed token, Amount indexed amount, Amount newBalance, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingSupportInfoSet(ObjectType indexed objectType, bool indexed isSupported, bool indexed allowNewTargets, bool allowCrossChain, Amount minStakingAmount, Amount maxStakingAmount, Seconds minLockingPeriod, Seconds maxLockingPeriod, UFixed minRewardRate, UFixed maxRewardRate, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetCreated(NftId indexed targetNftId, ObjectType indexed objectType, Seconds indexed lockingPeriod, UFixed rewardRate) +contracts/staking/IStaking.sol: LogStakingLimitsSet(NftId indexed targetNftId, Amount indexed marginAmount, Amount indexed hardLimitAmount, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetLimitsUpdated(NftId indexed targetNftId, Amount indexed marginAmount, Amount indexed hardLimitAmount, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetLimitUpdated(NftId indexed targetNftId, Amount indexed limitAmount, Amount indexed hardLimitAmount, Amount requiredStakeAmount, Amount actualStakeAmount, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetLockingPeriodSet(NftId indexed targetNftId, Seconds indexed oldLockingPeriod, Seconds indexed lockingPeriod, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetRewardRateSet(NftId indexed targetNftId, UFixed indexed oldRewardRate, UFixed indexed rewardRate, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetMaxStakedAmountSet(NftId indexed targetNftId, Amount indexed stakeLimitAmount, Blocknumber indexed lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingTargetLimitsSet(NftId indexed targetNftId, Amount indexed stakeLimitAmount, Amount indexed marginAmount, Amount limitAmount) +contracts/staking/IStaking.sol: LogStakingRewardReservesRefilled(NftId indexed targetNftId, Amount indexed dipAmount, address indexed targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingRewardReservesWithdrawn(NftId indexed targetNftId, Amount indexed dipAmount, address indexed targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingRewardReservesSpent(NftId indexed targetNftId, Amount indexed dipAmount, Amount indexed reserveBalance, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingStakeCreated(NftId indexed stakeNftId, NftId indexed targetNftId, Amount indexed stakeAmount, Timestamp lockedUntil, address stakeOwner) +contracts/staking/IStaking.sol: LogStakingStakeRewardsUpdated(NftId indexed stakeNftId, Amount indexed rewardIncrementAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingRewardsRestaked(NftId indexed stakeNftId, Amount indexed restakedAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingStaked(NftId indexed stakeNftId, Amount indexed stakedAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingUnstaked(NftId indexed stakeNftId, Amount indexed unstakedAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingRewardsClaimed(NftId indexed stakeNftId, Amount indexed claimedAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn) +contracts/staking/IStaking.sol: LogStakingStakeRestaked(NftId indexed stakeNftId, NftId indexed targetNftId, Amount indexed stakeAmount, address owner, NftId oldStakeNftId) =============== -contracts/staking/IStakingService.sol: LogStakingServiceProtocolTargetRegistered(NftId protocolNftId) -contracts/staking/IStakingService.sol: LogStakingServiceInstanceTargetRegistered(NftId instanceNftId, Seconds initialLockingPeriod, UFixed initialRewardRate) -contracts/staking/IStakingService.sol: LogStakingServiceRewardReservesIncreased(NftId targetNftId, address rewardProvider, Amount dipAmount, Amount newBalance) -contracts/staking/IStakingService.sol: LogStakingServiceRewardReservesDecreased(NftId targetNftId, address targetOwner, Amount dipAmount, Amount newBalance) -contracts/staking/IStakingService.sol: LogStakingServiceStakeCreated(NftId stakeNftId, NftId targetNftId, address stakeOwner) +contracts/staking/IStakingService.sol: LogStakingServiceProtocolTargetRegistered(NftId indexed protocolNftId) +contracts/staking/IStakingService.sol: LogStakingServiceInstanceTargetRegistered(NftId indexed instanceNftId, Seconds indexed initialLockingPeriod, UFixed indexed initialRewardRate) +contracts/staking/IStakingService.sol: LogStakingServiceRewardReservesIncreased(NftId indexed targetNftId, address indexed rewardProvider, Amount indexed dipAmount, Amount newBalance) +contracts/staking/IStakingService.sol: LogStakingServiceRewardReservesDecreased(NftId indexed targetNftId, address indexed targetOwner, Amount indexed dipAmount, Amount newBalance) +contracts/staking/IStakingService.sol: LogStakingServiceStakeCreated(NftId indexed stakeNftId, NftId indexed targetNftId, address indexed stakeOwner) =============== -contracts/staking/TargetHandler.sol: LogTargetHandlerUpdateTriggersSet(uint16 tvlUpdatesTrigger, UFixed minTvlRatioTrigger, Blocknumber lastUpdateIn) +contracts/staking/TargetHandler.sol: LogTargetHandlerUpdateTriggersSet(uint16 indexed tvlUpdatesTrigger, UFixed indexed minTvlRatioTrigger, Blocknumber indexed lastUpdateIn) =============== -contracts/upgradeability/ProxyManager.sol: LogProxyManagerVersionableDeployed(address proxy, address initialImplementation) -contracts/upgradeability/ProxyManager.sol: LogProxyManagerVersionableUpgraded(address proxy, address upgradedImplementation) +contracts/upgradeability/ProxyManager.sol: LogProxyManagerVersionableDeployed(address indexed proxy, address indexed initialImplementation) +contracts/upgradeability/ProxyManager.sol: LogProxyManagerVersionableUpgraded(address indexed proxy, address indexed upgradedImplementation) =============== contracts/examples/flight/FlightLib.sol: LogFlightProductErrorUnprocessableStatus(RequestId requestId, RiskId riskId, bytes1 status) @@ -294,14 +294,14 @@ contracts/examples/unpermissioned/SimpleProduct.sol: LogSimpleProductRequestAsyn contracts/examples/unpermissioned/SimpleProduct.sol: LogSimpleProductRequestSyncFulfilled(RequestId requestId, string responseText, uint256 responseDataLength) =============== -contracts/instance/base/BalanceStore.sol: LogBalanceStoreTargetRegistered(NftId targetNftId) -contracts/instance/base/BalanceStore.sol: LogBalanceStoreFeesIncreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) -contracts/instance/base/BalanceStore.sol: LogBalanceStoreFeesDecreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) -contracts/instance/base/BalanceStore.sol: LogBalanceStoreLockedIncreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) -contracts/instance/base/BalanceStore.sol: LogBalanceStoreLockedDecreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) -contracts/instance/base/BalanceStore.sol: LogBalanceStoreBalanceIncreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) -contracts/instance/base/BalanceStore.sol: LogBalanceStoreBalanceDecreased(NftId targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn) +contracts/instance/base/BalanceStore.sol: LogBalanceStoreTargetRegistered(NftId indexed targetNftId) +contracts/instance/base/BalanceStore.sol: LogBalanceStoreFeesIncreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn) +contracts/instance/base/BalanceStore.sol: LogBalanceStoreFeesDecreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn) +contracts/instance/base/BalanceStore.sol: LogBalanceStoreLockedIncreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn) +contracts/instance/base/BalanceStore.sol: LogBalanceStoreLockedDecreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn) +contracts/instance/base/BalanceStore.sol: LogBalanceStoreBalanceIncreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn) +contracts/instance/base/BalanceStore.sol: LogBalanceStoreBalanceDecreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn) =============== -contracts/instance/base/ObjectSet.sol: LogObjectSetInitialized(address instance) +contracts/instance/base/ObjectSet.sol: LogObjectSetInitialized(address indexed instance) ``` diff --git a/scripts/find_events.ts b/scripts/find_events.ts index bc64fced0..d523260f4 100644 --- a/scripts/find_events.ts +++ b/scripts/find_events.ts @@ -5,6 +5,7 @@ import { logger } from "./logger"; import * as fs from 'fs'; import { straightThroughStringTask } from "simple-git/dist/src/lib/tasks/task"; import { ConsoleErrorListener } from "antlr4ng"; +import { transferableAbortSignal } from "util"; async function main() { @@ -22,6 +23,7 @@ class RestrictedMissingListener extends SolidityFileListener { isEventParameter = false; isTypeName = false; eventName = ""; + paramName = ""; type = ""; public enterEventDefinition = (ctx: EventDefinitionContext) => { @@ -63,6 +65,12 @@ class RestrictedMissingListener extends SolidityFileListener { public exitEventParameter = (ctx: EventParameterContext) => { this.isEventParameter = false; + let indexed = ""; + // console.log(`Parameter: ${ctx.getText()}`); + if (ctx.getTokens(SolidityParser.IndexedKeyword).length > 0) { + indexed = "indexed "; + } + this.arguments.push(`${this.type} ${indexed}${this.paramName}`); } public exitIdentifier = (ctx: IdentifierContext) => { @@ -70,8 +78,7 @@ class RestrictedMissingListener extends SolidityFileListener { if (this.isTypeName) { // console.log(`Type: ${ctx.getText()}`); } else if (this.isEventParameter) { - // console.log(`Parameter: ${ctx.getText()}`); - this.arguments.push(`${this.type} ${ctx.getText()}`); + this.paramName = ctx.getText(); } else { // console.log(`Event: ${ctx.getText()}`); this.eventName = ctx.getText(); From 3885704adfb3a24f623f0e2935e5508989e72928 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 13:37:44 +0000 Subject: [PATCH 25/35] remove unlocked/disabled/... events (#787) --- contracts/instance/BundleSet.sol | 7 +++---- contracts/instance/RiskSet.sol | 7 +++---- contracts/product/IRiskService.sol | 3 +-- contracts/product/RiskService.sol | 4 ++-- contracts/registry/ReleaseRegistry.sol | 7 +++---- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/contracts/instance/BundleSet.sol b/contracts/instance/BundleSet.sol index f232ba443..effc02391 100644 --- a/contracts/instance/BundleSet.sol +++ b/contracts/instance/BundleSet.sol @@ -18,8 +18,7 @@ contract BundleSet is event LogBundleSetPolicyUnlinked(NftId indexed bundleNftId, NftId indexed policyNftId); event LogBundleSetBundleAdded(NftId indexed poolNftId, NftId indexed bundleNftId); - event LogBundleSetBundleUnlocked(NftId indexed poolNftId, NftId indexed bundleNftId); - event LogBundleSetBundleLocked(NftId indexed poolNftId, NftId indexed bundleNftId); + event LogBundleSetBundleLocked(NftId indexed poolNftId, NftId indexed bundleNftId, bool locked); event LogBundleSetBundleClosed(NftId indexed poolNftId, NftId indexed bundleNftId); error ErrorBundleSetPolicyAlreadyActivated(NftId policyNftId); @@ -76,14 +75,14 @@ contract BundleSet is function unlock(NftId bundleNftId) external restricted() { NftId poolNftId = ObjectSetHelperLib.getPoolNftId(_instanceAddress, bundleNftId); _activate(poolNftId, _toBundleKey32(bundleNftId)); - emit LogBundleSetBundleUnlocked(poolNftId, bundleNftId); + emit LogBundleSetBundleLocked(poolNftId, bundleNftId, false); } /// @dev locked (deactivated) bundles may not collateralize any new policies function lock(NftId bundleNftId) external restricted() { NftId poolNftId = ObjectSetHelperLib.getPoolNftId(_instanceAddress, bundleNftId); _deactivate(poolNftId, _toBundleKey32(bundleNftId)); - emit LogBundleSetBundleLocked(poolNftId, bundleNftId); + emit LogBundleSetBundleLocked(poolNftId, bundleNftId, true); } diff --git a/contracts/instance/RiskSet.sol b/contracts/instance/RiskSet.sol index 430fe163e..9843a0e50 100644 --- a/contracts/instance/RiskSet.sol +++ b/contracts/instance/RiskSet.sol @@ -17,8 +17,7 @@ contract RiskSet is event LogRiskSetPolicyUnlinked(RiskId indexed riskId, NftId indexed policyNftId); event LogRiskSetRiskAdded(NftId indexed productNftId, RiskId indexed riskId); - event LogRiskSetRiskActivated(NftId indexed poolNftId, RiskId indexed riskId); - event LogRiskSetRiskPaused(NftId indexed poolNftId, RiskId indexed riskId); + event LogRiskSetRiskActivated(NftId indexed poolNftId, RiskId indexed riskId, bool indexed active); error ErrorRiskSetRiskLocked(RiskId riskId, NftId policyNftId); error ErrorRiskSetRiskUnknown(RiskId riskId); @@ -68,14 +67,14 @@ contract RiskSet is function activate(RiskId riskId) external restricted() { NftId productNftId = ObjectSetHelperLib.getProductNftId(_instanceAddress, riskId); _activate(productNftId, riskId.toKey32()); - emit LogRiskSetRiskActivated(productNftId, riskId); + emit LogRiskSetRiskActivated(productNftId, riskId, true); } /// @dev Applications linked to paused/archived risks may not be underwritten function deactivate(RiskId riskId) external restricted() { NftId productNftId = ObjectSetHelperLib.getProductNftId(_instanceAddress, riskId); _deactivate(productNftId, riskId.toKey32()); - emit LogRiskSetRiskPaused(productNftId, riskId); + emit LogRiskSetRiskActivated(productNftId, riskId, false); } function checkRisk(NftId productNftId, RiskId riskId) diff --git a/contracts/product/IRiskService.sol b/contracts/product/IRiskService.sol index 3ae53a3c9..a7cb852e2 100644 --- a/contracts/product/IRiskService.sol +++ b/contracts/product/IRiskService.sol @@ -11,8 +11,7 @@ interface IRiskService is IService { event LogRiskServiceRiskCreated(NftId indexed productNftId, RiskId indexed riskId); event LogRiskServiceRiskUpdated(NftId indexed productNftId, RiskId indexed riskId); - event LogRiskServiceRiskLocked(NftId indexed productNftId, RiskId indexed riskId); - event LogRiskServiceRiskUnlocked(NftId indexed productNftId, RiskId indexed riskId); + event LogRiskServiceRiskLocked(NftId indexed productNftId, RiskId indexed riskId, bool indexed locked); event LogRiskServiceRiskClosed(NftId indexed productNftId, RiskId indexed riskId); error ErrorRiskServiceRiskProductMismatch(RiskId riskId, NftId riskProductNftId, NftId productNftId); diff --git a/contracts/product/RiskService.sol b/contracts/product/RiskService.sol index fb8bb65e4..a9b83e4f5 100644 --- a/contracts/product/RiskService.sol +++ b/contracts/product/RiskService.sol @@ -119,10 +119,10 @@ contract RiskService is if (locked) { instance.getRiskSet().deactivate(riskId); - emit LogRiskServiceRiskLocked(productNftId, riskId); + emit LogRiskServiceRiskLocked(productNftId, riskId, true); } else { instance.getRiskSet().activate(riskId); - emit LogRiskServiceRiskUnlocked(productNftId, riskId); + emit LogRiskServiceRiskLocked(productNftId, riskId, false); } } diff --git a/contracts/registry/ReleaseRegistry.sol b/contracts/registry/ReleaseRegistry.sol index cd28006ba..9d85bb921 100644 --- a/contracts/registry/ReleaseRegistry.sol +++ b/contracts/registry/ReleaseRegistry.sol @@ -40,8 +40,7 @@ contract ReleaseRegistry is event LogReleaseCreated(IAccessAdmin indexed admin, VersionPart indexed release, bytes32 indexed salt); event LogReleaseActivated(VersionPart indexed release); - event LogReleaseDisabled(VersionPart indexed release); - event LogReleaseEnabled(VersionPart indexed release); + event LogReleaseEnabled(VersionPart indexed release, bool indexed active); // constructor error ErrorReleaseRegistryNotRegistry(Registry registry); @@ -284,12 +283,12 @@ contract ReleaseRegistry is checkTransition(state, RELEASE(), PAUSED(), ACTIVE()); _releaseInfo[release].state = ACTIVE(); _releaseInfo[release].disabledAt = TimestampLib.max(); - emit LogReleaseEnabled(release); + emit LogReleaseEnabled(release, true); } else { checkTransition(state, RELEASE(), ACTIVE(), PAUSED()); _releaseInfo[release].state = PAUSED(); _releaseInfo[release].disabledAt = TimestampLib.current(); - emit LogReleaseDisabled(release); + emit LogReleaseEnabled(release, false); } _setReleaseLocked(release, !active); From 91788d7ddfc6729f99b6d5b22f2a7a98133e4189 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 13:40:16 +0000 Subject: [PATCH 26/35] refactor bundle service events to include locked state for improved clarity (#787) --- contracts/pool/IBundleService.sol | 3 +-- docs_manual/events.md | 12 ++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/contracts/pool/IBundleService.sol b/contracts/pool/IBundleService.sol index c465ce2d5..f2c0c446d 100644 --- a/contracts/pool/IBundleService.sol +++ b/contracts/pool/IBundleService.sol @@ -32,8 +32,7 @@ interface IBundleService is IService { event LogBundleServiceBundleCreated(NftId indexed bundleNftId, NftId indexed poolNftId, Seconds indexed lifetime, Amount fixedFee, UFixed fractionalFee); event LogBundleServiceBundleClosed(NftId indexed bundleNftId); - event LogBundleServiceBundleLocked(NftId indexed bundleNftId); - event LogBundleServiceBundleUnlocked(NftId indexed bundleNftId); + event LogBundleServiceBundleLocked(NftId indexed bundleNftId, bool indexed locked); event LogBundleServiceBundleExtended(NftId indexed bundleNftId, Seconds indexed lifetimeExtension, Timestamp indexed extendedExpiredAt); event LogBundleServiceBundleFeeUpdated(NftId indexed bundleNftId, Amount indexed fixedFee, UFixed indexed fractionalFee); event LogBundleServiceCollateralLocked(NftId indexed bundleNftId, NftId indexed policyNftId, Amount indexed collateralAmount); diff --git a/docs_manual/events.md b/docs_manual/events.md index 255d92055..e2eacde93 100644 --- a/docs_manual/events.md +++ b/docs_manual/events.md @@ -30,8 +30,7 @@ contracts/distribution/IDistributionService.sol: LogDistributionServiceSaleProce contracts/instance/BundleSet.sol: LogBundleSetPolicyLinked(NftId indexed bundleNftId, NftId indexed policyNftId) contracts/instance/BundleSet.sol: LogBundleSetPolicyUnlinked(NftId indexed bundleNftId, NftId indexed policyNftId) contracts/instance/BundleSet.sol: LogBundleSetBundleAdded(NftId indexed poolNftId, NftId indexed bundleNftId) -contracts/instance/BundleSet.sol: LogBundleSetBundleUnlocked(NftId indexed poolNftId, NftId indexed bundleNftId) -contracts/instance/BundleSet.sol: LogBundleSetBundleLocked(NftId indexed poolNftId, NftId indexed bundleNftId) +contracts/instance/BundleSet.sol: LogBundleSetBundleLocked(NftId indexed poolNftId, NftId indexed bundleNftId, bool locked) contracts/instance/BundleSet.sol: LogBundleSetBundleClosed(NftId indexed poolNftId, NftId indexed bundleNftId) =============== @@ -90,8 +89,7 @@ contracts/instance/ProductStore.sol: LogProductStorePayoutInfoUpdated(NftId inde contracts/instance/RiskSet.sol: LogRiskSetPolicyLinked(RiskId indexed riskId, NftId indexed policyNftId) contracts/instance/RiskSet.sol: LogRiskSetPolicyUnlinked(RiskId indexed riskId, NftId indexed policyNftId) contracts/instance/RiskSet.sol: LogRiskSetRiskAdded(NftId indexed productNftId, RiskId indexed riskId) -contracts/instance/RiskSet.sol: LogRiskSetRiskActivated(NftId indexed poolNftId, RiskId indexed riskId) -contracts/instance/RiskSet.sol: LogRiskSetRiskPaused(NftId indexed poolNftId, RiskId indexed riskId) +contracts/instance/RiskSet.sol: LogRiskSetRiskActivated(NftId indexed poolNftId, RiskId indexed riskId, bool indexed active) =============== contracts/oracle/IOracleService.sol: LogOracleServiceRequestCreated(RequestId indexed requestId, NftId indexed requesterNftId, NftId indexed oracleNftId, Timestamp expiryAt) @@ -159,8 +157,7 @@ contracts/product/IPolicyService.sol: LogPolicyServicePolicyClosed(NftId indexed =============== contracts/product/IRiskService.sol: LogRiskServiceRiskCreated(NftId indexed productNftId, RiskId indexed riskId) contracts/product/IRiskService.sol: LogRiskServiceRiskUpdated(NftId indexed productNftId, RiskId indexed riskId) -contracts/product/IRiskService.sol: LogRiskServiceRiskLocked(NftId indexed productNftId, RiskId indexed riskId) -contracts/product/IRiskService.sol: LogRiskServiceRiskUnlocked(NftId indexed productNftId, RiskId indexed riskId) +contracts/product/IRiskService.sol: LogRiskServiceRiskLocked(NftId indexed productNftId, RiskId indexed riskId, bool indexed locked) contracts/product/IRiskService.sol: LogRiskServiceRiskClosed(NftId indexed productNftId, RiskId indexed riskId) =============== @@ -178,8 +175,7 @@ contracts/registry/ReleaseAdmin.sol: LogReleaseAdminServiceLocked(VersionPart in =============== contracts/registry/ReleaseRegistry.sol: LogReleaseCreated(IAccessAdmin indexed admin, VersionPart indexed release, bytes32 indexed salt) contracts/registry/ReleaseRegistry.sol: LogReleaseActivated(VersionPart indexed release) -contracts/registry/ReleaseRegistry.sol: LogReleaseDisabled(VersionPart indexed release) -contracts/registry/ReleaseRegistry.sol: LogReleaseEnabled(VersionPart indexed release) +contracts/registry/ReleaseRegistry.sol: LogReleaseEnabled(VersionPart indexed release, bool indexed active) =============== contracts/registry/TokenRegistry.sol: LogTokenRegistryTokenRegistered(ChainId indexed chainId, address indexed token, uint256 indexed decimals, string symbol) From e65bb8155f20692a0214d24fe8bacaeb1933534b Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Thu, 12 Dec 2024 13:51:14 +0000 Subject: [PATCH 27/35] update bundle lock/unlock events to include state in logs for clarity (#787) --- contracts/pool/BundleService.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/pool/BundleService.sol b/contracts/pool/BundleService.sol index 671c5ad12..9c49b7b73 100644 --- a/contracts/pool/BundleService.sol +++ b/contracts/pool/BundleService.sol @@ -201,10 +201,10 @@ contract BundleService is if (locked) { bundleManager.lock(bundleNftId); - emit LogBundleServiceBundleLocked(bundleNftId); + emit LogBundleServiceBundleLocked(bundleNftId, true); } else { bundleManager.unlock(bundleNftId); - emit LogBundleServiceBundleUnlocked(bundleNftId); + emit LogBundleServiceBundleLocked(bundleNftId, false); } } From baa9de29993423066269faa0a4e73dc2f71bde1b Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Mon, 16 Dec 2024 14:44:48 +0000 Subject: [PATCH 28/35] remove indexed from parameters (#787) --- contracts/distribution/IDistributionService.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/distribution/IDistributionService.sol b/contracts/distribution/IDistributionService.sol index e99eb64bb..300d0b066 100644 --- a/contracts/distribution/IDistributionService.sol +++ b/contracts/distribution/IDistributionService.sol @@ -39,13 +39,13 @@ interface IDistributionService is IService { error ErrorDistributionServiceInvalidFeeTransferred(Amount transferredDistributionFeeAmount, Amount expectedDistributionFeeAmount); error ErrorDistributionServiceReferralDistributionMismatch(ReferralId referralId, NftId referralDistributionNft, NftId distributionNftId); - event LogDistributionServiceCommissionWithdrawn(NftId indexed distributorNftId, address indexed recipient, Amount indexed amount, address tokenAddress); - event LogDistributionServiceDistributorTypeCreated(NftId indexed distributionNftId, DistributorType indexed distributorType, string name, UFixed indexed commissionPercentage); + event LogDistributionServiceCommissionWithdrawn(NftId indexed distributorNftId, address indexed recipient, Amount amount, address indexed tokenAddress); + event LogDistributionServiceDistributorTypeCreated(NftId indexed distributionNftId, DistributorType indexed distributorType, string name, UFixed commissionPercentage); event LogDistributionServiceDistributorCreated(NftId indexed distributionNftId, NftId indexed distributorNftId, address indexed distributor, DistributorType distributorType); event LogDistributionServiceDistributorTypeChanged(NftId indexed distributorNftId, DistributorType indexed oldDistributorType, DistributorType indexed newDistributorType); - event LogDistributionServiceReferralCreated(NftId indexed distributorNftId, ReferralId indexed referralId, string code, UFixed indexed discountPercentage, uint32 maxReferrals, Timestamp expiryAt); - event LogDistributionServiceReferralProcessed(NftId indexed distributorNftId, ReferralId indexed referralId, uint32 indexed usedReferrals); - event LogDistributionServiceSaleProcessed(NftId indexed distributionNftId, Amount indexed premium, Amount indexed distributionOwnerFee); + event LogDistributionServiceReferralCreated(NftId indexed distributorNftId, ReferralId indexed referralId, string code, UFixed discountPercentage, uint32 maxReferrals, Timestamp expiryAt); + event LogDistributionServiceReferralProcessed(NftId indexed distributorNftId, ReferralId indexed referralId, uint32 usedReferrals); + event LogDistributionServiceSaleProcessed(NftId indexed distributionNftId, Amount premium, Amount distributionOwnerFee); event LogDistributionServiceSaleProcessedWithReferral(NftId indexed distributionNftId, NftId indexed distributorNftId, ReferralId indexed referralId, uint32 numPoliciesSold, Amount premium, Amount distributionOwnerFee, Amount commissionAmount); function createDistributorType( From 779cb7f62e9813c51a2e23a12bcd47327da7c1c1 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Mon, 16 Dec 2024 14:47:27 +0000 Subject: [PATCH 29/35] remove indexed from parameters (#787) --- contracts/instance/IInstance.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/instance/IInstance.sol b/contracts/instance/IInstance.sol index a30a6bfa2..a61c29dee 100644 --- a/contracts/instance/IInstance.sol +++ b/contracts/instance/IInstance.sol @@ -30,7 +30,7 @@ interface IInstance is // target handling event LogInstanceCustomTargetCreated(address indexed target, RoleId indexed targetRoleId, string indexed name); event LogInstanceTargetLocked(address indexed target, bool indexed locked); - event LogInstanceCustomTargetFunctionRoleSet(address indexed target, bytes4[] indexed selectors, RoleId indexed roleId); + event LogInstanceCustomTargetFunctionRoleSet(address indexed target, bytes4[] selectors, RoleId indexed roleId); // modifier is onlyRoleAdmin error ErrorInstanceNotCustomRole(RoleId roleId); From b6696a155f8285238aa59cd6fecd53ca807e7935 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Mon, 16 Dec 2024 14:51:42 +0000 Subject: [PATCH 30/35] remove indexed from parameters (#787) --- contracts/instance/base/BalanceStore.sol | 12 ++++++------ contracts/pool/IBundleService.sol | 14 +++++++------- contracts/pool/IPoolService.sol | 14 +++++++------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/contracts/instance/base/BalanceStore.sol b/contracts/instance/base/BalanceStore.sol index 108de71ec..65ee2fbb1 100644 --- a/contracts/instance/base/BalanceStore.sol +++ b/contracts/instance/base/BalanceStore.sol @@ -12,14 +12,14 @@ contract BalanceStore { event LogBalanceStoreTargetRegistered(NftId indexed targetNftId); - event LogBalanceStoreFeesIncreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn); - event LogBalanceStoreFeesDecreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn); + event LogBalanceStoreFeesIncreased(NftId indexed targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn); + event LogBalanceStoreFeesDecreased(NftId indexed targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn); - event LogBalanceStoreLockedIncreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn); - event LogBalanceStoreLockedDecreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn); + event LogBalanceStoreLockedIncreased(NftId indexed targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn); + event LogBalanceStoreLockedDecreased(NftId indexed targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn); - event LogBalanceStoreBalanceIncreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn); - event LogBalanceStoreBalanceDecreased(NftId indexed targetNftId, Amount indexed addedAmount, Amount indexed newBalance, Blocknumber lastUpdatedIn); + event LogBalanceStoreBalanceIncreased(NftId indexed targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn); + event LogBalanceStoreBalanceDecreased(NftId indexed targetNftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn); mapping(NftId nftId => Amount balance) private _balanceAmount; mapping(NftId nftId => Amount locked) private _lockedAmount; diff --git a/contracts/pool/IBundleService.sol b/contracts/pool/IBundleService.sol index f2c0c446d..082a2b85f 100644 --- a/contracts/pool/IBundleService.sol +++ b/contracts/pool/IBundleService.sol @@ -30,15 +30,15 @@ interface IBundleService is IService { error ErrorBundleServiceExtensionLifetimeIsZero(); - event LogBundleServiceBundleCreated(NftId indexed bundleNftId, NftId indexed poolNftId, Seconds indexed lifetime, Amount fixedFee, UFixed fractionalFee); + event LogBundleServiceBundleCreated(NftId indexed bundleNftId, NftId indexed poolNftId, Seconds lifetime, Amount fixedFee, UFixed fractionalFee); event LogBundleServiceBundleClosed(NftId indexed bundleNftId); event LogBundleServiceBundleLocked(NftId indexed bundleNftId, bool indexed locked); - event LogBundleServiceBundleExtended(NftId indexed bundleNftId, Seconds indexed lifetimeExtension, Timestamp indexed extendedExpiredAt); - event LogBundleServiceBundleFeeUpdated(NftId indexed bundleNftId, Amount indexed fixedFee, UFixed indexed fractionalFee); - event LogBundleServiceCollateralLocked(NftId indexed bundleNftId, NftId indexed policyNftId, Amount indexed collateralAmount); - event LogBundleServiceCollateralReleased(NftId indexed bundleNftId, NftId indexed policyNftId, Amount indexed collateralAmount); - event LogBundleServiceBundleStaked(NftId indexed bundleNftId, Amount indexed amount); - event LogBundleServiceBundleUnstaked(NftId indexed bundleNftId, Amount indexed amount); + event LogBundleServiceBundleExtended(NftId indexed bundleNftId, Seconds lifetimeExtension, Timestamp extendedExpiredAt); + event LogBundleServiceBundleFeeUpdated(NftId indexed bundleNftId, Amount fixedFee, UFixed fractionalFee); + event LogBundleServiceCollateralLocked(NftId indexed bundleNftId, NftId indexed policyNftId, Amount collateralAmount); + event LogBundleServiceCollateralReleased(NftId indexed bundleNftId, NftId indexed policyNftId, Amount collateralAmount); + event LogBundleServiceBundleStaked(NftId indexed bundleNftId, Amount amount); + event LogBundleServiceBundleUnstaked(NftId indexed bundleNftId, Amount amount); /// @dev Create a new bundle for the specified attributes. function create( diff --git a/contracts/pool/IPoolService.sol b/contracts/pool/IPoolService.sol index 1b8b04a06..c4656f090 100644 --- a/contracts/pool/IPoolService.sol +++ b/contracts/pool/IPoolService.sol @@ -14,9 +14,9 @@ import {PayoutId} from "../type/PayoutId.sol"; interface IPoolService is IService { - event LogPoolServiceMaxBalanceAmountUpdated(NftId indexed poolNftId, Amount indexed previousMaxCapitalAmount, Amount indexed currentMaxCapitalAmount); - event LogPoolServiceWalletFunded(NftId indexed poolNftId, address indexed poolOwner, Amount indexed amount); - event LogPoolServiceWalletDefunded(NftId indexed poolNftId, address indexed poolOwner, Amount indexed amount); + event LogPoolServiceMaxBalanceAmountUpdated(NftId indexed poolNftId, Amount previousMaxCapitalAmount, Amount currentMaxCapitalAmount); + event LogPoolServiceWalletFunded(NftId indexed poolNftId, address indexed poolOwner, Amount amount); + event LogPoolServiceWalletDefunded(NftId indexed poolNftId, address indexed poolOwner, Amount amount); event LogPoolServiceBundleCreated(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId); event LogPoolServiceBundleClosed(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId, Amount balanceAmount, Amount feeAmount); @@ -24,14 +24,14 @@ interface IPoolService is IService { event LogPoolServiceBundleStaked(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId, Amount amount, Amount netAmount); event LogPoolServiceBundleUnstaked(NftId indexed instanceNftId, NftId indexed poolNftId, NftId indexed bundleNftId, Amount amount, Amount netAmount); - event LogPoolServiceFeesWithdrawn(NftId indexed bundleNftId, address indexed recipient, Amount indexed amount, address tokenAddress); + event LogPoolServiceFeesWithdrawn(NftId indexed bundleNftId, address indexed recipient, Amount amount, address indexed tokenAddress); - event LogPoolServiceProcessFundedClaim(NftId indexed policyNftId, ClaimId indexed claimId, Amount indexed availableAmount); + event LogPoolServiceProcessFundedClaim(NftId indexed policyNftId, ClaimId indexed claimId, Amount availableAmount); event LogPoolServiceApplicationVerified(NftId indexed poolNftId, NftId indexed bundleNftId, NftId indexed applicationNftId, Amount totalCollateralAmount); event LogPoolServiceCollateralLocked(NftId indexed poolNftId, NftId indexed bundleNftId, NftId indexed applicationNftId, Amount totalCollateralAmount, Amount lockedCollateralAmount); - event LogPoolServiceCollateralReleased(NftId indexed bundleNftId, NftId indexed policyNftId, Amount indexed releasedCollateralAmount); - event LogPoolServiceSaleProcessed(NftId indexed poolNftId, NftId indexed bundleNftId, Amount indexed bundleNetAmount, Amount bundleFeeAmount, Amount poolFeeAmount); + event LogPoolServiceCollateralReleased(NftId indexed bundleNftId, NftId indexed policyNftId, Amount releasedCollateralAmount); + event LogPoolServiceSaleProcessed(NftId indexed poolNftId, NftId indexed bundleNftId, Amount bundleNetAmount, Amount bundleFeeAmount, Amount poolFeeAmount); event LogPoolServicePayoutProcessed(NftId indexed poolNftId, NftId indexed bundleNftId, NftId indexed policyNftId, PayoutId payoutId, Amount netPayoutAmount, Amount processingFeeAmount, address payoutBeneficiary); error ErrorPoolServicePoolNotExternallyManaged(NftId poolNftId); From 6153e71e4a82762f3e8eba2d3b1f5bc3925e0d16 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Mon, 16 Dec 2024 15:02:02 +0000 Subject: [PATCH 31/35] remove indexed from parameters (#787) --- contracts/product/IClaimService.sol | 6 +++--- contracts/product/IPolicyService.sol | 10 +++++----- contracts/shared/IComponentService.sol | 12 ++++++------ contracts/staking/IStaking.sol | 8 ++++---- contracts/staking/IStakingService.sol | 6 +++--- contracts/staking/TargetHandler.sol | 2 +- test/component/product/ProductClaim.t.sol | 4 ++-- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/contracts/product/IClaimService.sol b/contracts/product/IClaimService.sol index bc8e313d9..1c0fd7b91 100644 --- a/contracts/product/IClaimService.sol +++ b/contracts/product/IClaimService.sol @@ -19,14 +19,14 @@ import {Fee} from "../type/Fee.sol"; interface IClaimService is IService { - event LogClaimServiceClaimSubmitted(NftId indexed policyNftId, ClaimId indexed claimId, Amount indexed claimAmount); - event LogClaimServiceClaimConfirmed(NftId indexed policyNftId, ClaimId indexed claimId, Amount indexed confirmedAmount); + event LogClaimServiceClaimSubmitted(NftId indexed policyNftId, ClaimId indexed claimId, Amount claimAmount); + event LogClaimServiceClaimConfirmed(NftId indexed policyNftId, ClaimId indexed claimId, Amount confirmedAmount); event LogClaimServiceClaimDeclined(NftId indexed policyNftId, ClaimId indexed claimId); event LogClaimServiceClaimRevoked(NftId indexed policyNftId, ClaimId indexed claimId); event LogClaimServiceClaimCancelled(NftId indexed policyNftId, ClaimId indexed claimId); event LogClaimServicePayoutCreated(NftId indexed policyNftId, ClaimId indexed claimId, PayoutId indexed payoutId, Amount amount, address beneficiary); - event LogClaimServicePayoutProcessed(NftId indexed policyNftId, PayoutId indexed payoutId, Amount indexed amount); + event LogClaimServicePayoutProcessed(NftId indexed policyNftId, PayoutId indexed payoutId, Amount amount); event LogClaimServicePayoutCancelled(NftId indexed policyNftId, PayoutId indexed payoutId); error ErrorClaimServiceBeneficiarySet(NftId policyNftId, PayoutId payoutId, address beneficiary); diff --git a/contracts/product/IPolicyService.sol b/contracts/product/IPolicyService.sol index d80c4077f..e76d1a14e 100644 --- a/contracts/product/IPolicyService.sol +++ b/contracts/product/IPolicyService.sol @@ -11,12 +11,12 @@ import {Timestamp} from "../type/Timestamp.sol"; interface IPolicyService is IService { - event LogPolicyServicePolicyCreated(NftId indexed policyNftId, Amount indexed premiumAmount, Timestamp indexed activatedAt); + event LogPolicyServicePolicyCreated(NftId indexed policyNftId, Amount premiumAmount, Timestamp activatedAt); event LogPolicyServicePolicyDeclined(NftId indexed policyNftId); - event LogPolicyServicePolicyPremiumCollected(NftId indexed policyNftId, NftId indexed productNftId, Amount indexed premiumAmount, Timestamp activateAt); - event LogPolicyServicePolicyActivated(NftId indexed policyNftId, Timestamp indexed activatedAt); - event LogPolicyServicePolicyActivatedUpdated(NftId indexed policyNftId, Timestamp indexed activatedAt); - event LogPolicyServicePolicyExpirationUpdated(NftId indexed policyNftId, Timestamp indexed expiredAt); + event LogPolicyServicePolicyPremiumCollected(NftId indexed policyNftId, NftId indexed productNftId, Amount premiumAmount, Timestamp activateAt); + event LogPolicyServicePolicyActivated(NftId indexed policyNftId, Timestamp activatedAt); + event LogPolicyServicePolicyActivatedUpdated(NftId indexed policyNftId, Timestamp activatedAt); + event LogPolicyServicePolicyExpirationUpdated(NftId indexed policyNftId, Timestamp expiredAt); event LogPolicyServicePolicyClosed(NftId indexed policyNftId); error LogPolicyServiceMaxPremiumAmountExceeded(NftId policyNftId, Amount maxPremiumAmount, Amount premiumAmount); diff --git a/contracts/shared/IComponentService.sol b/contracts/shared/IComponentService.sol index 461529251..f844a9edd 100644 --- a/contracts/shared/IComponentService.sol +++ b/contracts/shared/IComponentService.sol @@ -48,7 +48,7 @@ interface IComponentService is event LogComponentServiceComponentLocked(address indexed component, bool indexed locked); event LogComponentServiceTokenHandlerDeployed(NftId indexed componentNftId, address indexed tokenHandler, address indexed token); event LogComponentServiceRegistered(NftId indexed instanceNftId, NftId indexed componentNftId, ObjectType indexed componentType, address component, address token, address initialOwner); - event LogComponentServiceComponentFeesWithdrawn(NftId indexed componentNftId, address indexed recipient, Amount indexed withdrawnAmount, address token); + event LogComponentServiceComponentFeesWithdrawn(NftId indexed componentNftId, address indexed recipient, Amount withdrawnAmount, address indexed token); event LogComponentServiceProductFeesUpdated(NftId indexed productNftId); event LogComponentServiceDistributionFeesUpdated(NftId indexed distributionNftId); event LogComponentServicePoolFeesUpdated(NftId indexed poolNftId); @@ -57,22 +57,22 @@ interface IComponentService is string feeName, UFixed previousFractionalFee, Amount previousFixedFee, - UFixed indexed newFractionalFee, - Amount indexed newFixedFee + UFixed newFractionalFee, + Amount newFixedFee ); event LogComponentServiceProductCreated( NftId indexed productNftId, address indexed productAddress, bool indexed hasDistribution, uint8 expectedNumberOfOracles); event LogComponentServiceProductInitialProductFeesSet( NftId indexed productNftId, - Amount indexed productFeeFixed, UFixed indexed productFeeFractional, + Amount productFeeFixed, UFixed productFeeFractional, Amount processingFeeFixed, UFixed processingFeeFractional); event LogComponentServiceProductInitialDistributionFeesSet( NftId indexed productNftId, - Amount indexed distributionFeeFixed, UFixed indexed distributionFeeFractional, + Amount distributionFeeFixed, UFixed distributionFeeFractional, Amount minDistributionOwnerFeeFixed, UFixed minDistributionOwnerFeeFractional); event LogComponentServiceProductInitialPoolFeesSet( NftId indexed productNftId, - Amount indexed poolFeeFixed, UFixed indexed poolFeeFractional, + Amount poolFeeFixed, UFixed poolFeeFractional, Amount stakingFeeFixed, UFixed stakingFeeFractional, Amount performanceFeeFixed, UFixed performanceFeeFractional); event LogComponentServicePoolCreated( diff --git a/contracts/staking/IStaking.sol b/contracts/staking/IStaking.sol index 2938e1f71..c0ca712f0 100644 --- a/contracts/staking/IStaking.sol +++ b/contracts/staking/IStaking.sol @@ -28,19 +28,19 @@ interface IStaking is event LogStakingTokenHandlerDeployed(NftId indexed componentNftId, address indexed tokenHandler, address indexed token); // owner functions - event LogStakingStakingRateSet(ChainId indexed chainId, address indexed token, UFixed indexed oldStakingRate, UFixed newStakingRate, Blocknumber lastUpdateIn); + event LogStakingStakingRateSet(ChainId indexed chainId, address indexed token, UFixed oldStakingRate, UFixed newStakingRate, Blocknumber lastUpdateIn); event LogStakingStakingServiceSet(address indexed oldStakingService, address indexed stakingService, VersionPart indexed release); event LogStakingStakingReaderSet(address indexed oldStakingReader, address indexed stakingReader); event LogStakingTargetHandlerSet(address indexed oldTargetHandler, address indexed targetManager); - event LogStakingTokenHandlerApproved(Amount indexed oldApprovalAmount, Amount indexed approvalAmount, address indexed token); + event LogStakingTokenHandlerApproved(Amount oldApprovalAmount, Amount approvalAmount, address indexed token); // token event LogStakingTokenAdded(ChainId indexed chainId, address indexed token); event LogStakingTargetTokenAdded(NftId indexed targetNftId, address indexed token); // total value locked - event LogStakingTvlIncreased(NftId indexed targetNftId, address indexed token, Amount indexed amount, Amount newBalance, Blocknumber lastUpdateIn); - event LogStakingTvlDecreased(NftId indexed targetNftId, address indexed token, Amount indexed amount, Amount newBalance, Blocknumber lastUpdateIn); + event LogStakingTvlIncreased(NftId indexed targetNftId, address indexed token, Amount amount, Amount newBalance, Blocknumber lastUpdateIn); + event LogStakingTvlDecreased(NftId indexed targetNftId, address indexed token, Amount amount, Amount newBalance, Blocknumber lastUpdateIn); // targets event LogStakingSupportInfoSet( diff --git a/contracts/staking/IStakingService.sol b/contracts/staking/IStakingService.sol index 7d164afea..fbdaa518a 100644 --- a/contracts/staking/IStakingService.sol +++ b/contracts/staking/IStakingService.sol @@ -17,10 +17,10 @@ interface IStakingService is IService { event LogStakingServiceProtocolTargetRegistered(NftId indexed protocolNftId); - event LogStakingServiceInstanceTargetRegistered(NftId indexed instanceNftId, Seconds indexed initialLockingPeriod, UFixed indexed initialRewardRate); + event LogStakingServiceInstanceTargetRegistered(NftId indexed instanceNftId, Seconds initialLockingPeriod, UFixed initialRewardRate); - event LogStakingServiceRewardReservesIncreased(NftId indexed targetNftId, address indexed rewardProvider, Amount indexed dipAmount, Amount newBalance); - event LogStakingServiceRewardReservesDecreased(NftId indexed targetNftId, address indexed targetOwner, Amount indexed dipAmount, Amount newBalance); + event LogStakingServiceRewardReservesIncreased(NftId indexed targetNftId, address indexed rewardProvider, Amount dipAmount, Amount newBalance); + event LogStakingServiceRewardReservesDecreased(NftId indexed targetNftId, address indexed targetOwner, Amount dipAmount, Amount newBalance); event LogStakingServiceStakeCreated(NftId indexed stakeNftId, NftId indexed targetNftId, address indexed stakeOwner); diff --git a/contracts/staking/TargetHandler.sol b/contracts/staking/TargetHandler.sol index 94ed986ad..70c1e887a 100644 --- a/contracts/staking/TargetHandler.sol +++ b/contracts/staking/TargetHandler.sol @@ -20,7 +20,7 @@ contract TargetHandler is ITargetLimitHandler { - event LogTargetHandlerUpdateTriggersSet(uint16 indexed tvlUpdatesTrigger, UFixed indexed minTvlRatioTrigger, Blocknumber indexed lastUpdateIn); + event LogTargetHandlerUpdateTriggersSet(uint16 tvlUpdatesTrigger, UFixed minTvlRatioTrigger, Blocknumber lastUpdateIn); IRegistry private _registry; StakingStore private _store; diff --git a/test/component/product/ProductClaim.t.sol b/test/component/product/ProductClaim.t.sol index 7b53cb433..c96ae5844 100644 --- a/test/component/product/ProductClaim.t.sol +++ b/test/component/product/ProductClaim.t.sol @@ -80,7 +80,7 @@ contract TestProductClaim is GifTest { assertEq(entries[4].topics[0], keccak256("LogClaimServiceClaimSubmitted(uint96,uint16,uint96)"), "unexpected log signature"); uint96 nftIdInt = uint96(uint256(entries[4].topics[1])); uint24 claimIdInt = uint24(uint256(entries[4].topics[2])); - uint96 claimAmountInt = uint96(uint256(entries[4].topics[3])); + (uint96 claimAmountInt ) = abi.decode(entries[4].data, (uint96)); assertEq(nftIdInt, policyNftId.toInt(), "unexpected policy nft id"); assertEq(claimIdInt, claimId.toInt(), "unexpected claim id"); assertEq(claimAmountInt, claimAmount.toInt(), "unexpected claim amount"); @@ -213,7 +213,7 @@ contract TestProductClaim is GifTest { assertEq(entries[4].topics[0], keccak256("LogClaimServiceClaimConfirmed(uint96,uint16,uint96)"), "unexpected log signature"); uint96 nftIdInt = uint96(uint256(entries[4].topics[1])); uint16 claimIdInt = uint16(uint256(entries[4].topics[2])); - uint96 amountInt = uint96(uint256(entries[4].topics[3])); + (uint96 amountInt ) = abi.decode(entries[4].data, (uint96)); assertEq(nftIdInt, policyNftId.toInt(), "unexpected policy nft id"); assertEq(claimIdInt, claimId.toInt(), "unexpected claim id"); assertEq(amountInt, confirmedAmount.toInt(), "unexpected amount"); From af432069a729ac69a2914536b495171d906c9743 Mon Sep 17 00:00:00 2001 From: Matthias Zimmermann Date: Mon, 16 Dec 2024 21:17:07 +0000 Subject: [PATCH 32/35] cleanup remaining unintended indexed event properties --- contracts/accounting/IAccountingService.sol | 4 +-- contracts/oracle/IOracleService.sol | 2 +- contracts/pool/IPoolComponent.sol | 2 +- contracts/registry/ReleaseRegistry.sol | 4 +-- contracts/registry/TokenRegistry.sol | 2 +- contracts/staking/IStaking.sol | 38 ++++++++++----------- contracts/staking/TargetHandler.sol | 6 +++- test/component/product/ProductClaim.t.sol | 6 +++- 8 files changed, 36 insertions(+), 28 deletions(-) diff --git a/contracts/accounting/IAccountingService.sol b/contracts/accounting/IAccountingService.sol index 85cb3544b..8495ec55a 100644 --- a/contracts/accounting/IAccountingService.sol +++ b/contracts/accounting/IAccountingService.sol @@ -15,8 +15,8 @@ interface IAccountingService is { event LogAccountingServiceBalanceChanged( NftId indexed nftId, - Amount indexed amount, - Amount indexed feeAmount, + Amount amount, + Amount feeAmount, bool increase, ObjectType objectType ); diff --git a/contracts/oracle/IOracleService.sol b/contracts/oracle/IOracleService.sol index ba98a4963..72d518707 100644 --- a/contracts/oracle/IOracleService.sol +++ b/contracts/oracle/IOracleService.sol @@ -13,7 +13,7 @@ interface IOracleService is IService { event LogOracleServiceRequestCreated(RequestId indexed requestId, NftId indexed requesterNftId, NftId indexed oracleNftId, Timestamp expiryAt); event LogOracleServiceResponseProcessed(RequestId indexed requestId, NftId indexed requesterNftId, NftId indexed oracleNftId); - event LogOracleServiceDeliveryFailed(RequestId indexed requestId, address indexed requesterAddress, string indexed functionSignature); + event LogOracleServiceDeliveryFailed(RequestId indexed requestId, address indexed requesterAddress, string functionSignature); event LogOracleServiceResponseResent(RequestId indexed requestId, NftId indexed requesterNftId); event LogOracleServiceRequestCancelled(RequestId indexed requestId, NftId indexed requesterNftId); diff --git a/contracts/pool/IPoolComponent.sol b/contracts/pool/IPoolComponent.sol index fad4d089a..ca2701db1 100644 --- a/contracts/pool/IPoolComponent.sol +++ b/contracts/pool/IPoolComponent.sol @@ -19,7 +19,7 @@ interface IPoolComponent is IInstanceLinkedComponent { error ErrorPoolNotPoolService(address caller); error ErrorPoolApplicationBundleMismatch(NftId applicationNftId); - event LogPoolVerifiedByPool(address indexed pool, NftId indexed applicationNftId, Amount indexed collateralizationAmount); + event LogPoolVerifiedByPool(address indexed pool, NftId indexed applicationNftId, Amount collateralizationAmount); /// @dev This is a callback function that is called by the product service when underwriting a policy. /// The pool has the option to check the details and object to underwriting by reverting. diff --git a/contracts/registry/ReleaseRegistry.sol b/contracts/registry/ReleaseRegistry.sol index 9d85bb921..136701aaf 100644 --- a/contracts/registry/ReleaseRegistry.sol +++ b/contracts/registry/ReleaseRegistry.sol @@ -38,7 +38,7 @@ contract ReleaseRegistry is { uint256 public constant INITIAL_GIF_VERSION = 3;// first active release version - event LogReleaseCreated(IAccessAdmin indexed admin, VersionPart indexed release, bytes32 indexed salt); + event LogReleaseCreated(address indexed releaseAdmin, VersionPart indexed release, bytes32 indexed salt); event LogReleaseActivated(VersionPart indexed release); event LogReleaseEnabled(VersionPart indexed release, bool indexed active); @@ -167,7 +167,7 @@ contract ReleaseRegistry is _releaseInfo[releaseVersion].auth = serviceAuthorization; _releaseInfo[releaseVersion].releaseAdmin = address(releaseAdmin); - emit LogReleaseCreated(releaseAdmin, releaseVersion, releaseSalt); + emit LogReleaseCreated(address(releaseAdmin), releaseVersion, releaseSalt); } function registerService(IService service) diff --git a/contracts/registry/TokenRegistry.sol b/contracts/registry/TokenRegistry.sol index 3c721d046..61011133f 100644 --- a/contracts/registry/TokenRegistry.sol +++ b/contracts/registry/TokenRegistry.sol @@ -18,7 +18,7 @@ contract TokenRegistry is AccessManaged, IRegistryLinked { - event LogTokenRegistryTokenRegistered(ChainId indexed chainId, address indexed token, uint256 indexed decimals, string symbol); + event LogTokenRegistryTokenRegistered(ChainId indexed chainId, address indexed token, uint256 decimals, string symbol); event LogTokenRegistryTokenGlobalStateSet(ChainId indexed chainId, address indexed token, bool indexed active); event LogTokenRegistryTokenStateSet(ChainId indexed chainId, address indexed token, VersionPart indexed release, bool active); diff --git a/contracts/staking/IStaking.sol b/contracts/staking/IStaking.sol index c0ca712f0..dba16e895 100644 --- a/contracts/staking/IStaking.sol +++ b/contracts/staking/IStaking.sol @@ -56,31 +56,31 @@ interface IStaking is UFixed maxRewardRate, Blocknumber lastUpdateIn); - event LogStakingTargetCreated(NftId indexed targetNftId, ObjectType indexed objectType, Seconds indexed lockingPeriod, UFixed rewardRate); - event LogStakingLimitsSet(NftId indexed targetNftId, Amount indexed marginAmount, Amount indexed hardLimitAmount, Blocknumber lastUpdateIn); - event LogStakingTargetLimitsUpdated(NftId indexed targetNftId, Amount indexed marginAmount, Amount indexed hardLimitAmount, Blocknumber lastUpdateIn); - event LogStakingTargetLimitUpdated(NftId indexed targetNftId, Amount indexed limitAmount, Amount indexed hardLimitAmount, Amount requiredStakeAmount, Amount actualStakeAmount, Blocknumber lastUpdateIn); + event LogStakingTargetCreated(NftId indexed targetNftId, ObjectType indexed objectType, Seconds lockingPeriod, UFixed rewardRate); + event LogStakingLimitsSet(NftId indexed targetNftId, Amount marginAmount, Amount hardLimitAmount, Blocknumber lastUpdateIn); + event LogStakingTargetLimitsUpdated(NftId indexed targetNftId, Amount marginAmount, Amount hardLimitAmount, Blocknumber lastUpdateIn); + event LogStakingTargetLimitUpdated(NftId indexed targetNftId, Amount limitAmount, Amount hardLimitAmount, Amount requiredStakeAmount, Amount actualStakeAmount, Blocknumber lastUpdateIn); // target parameters - event LogStakingTargetLockingPeriodSet(NftId indexed targetNftId, Seconds indexed oldLockingPeriod, Seconds indexed lockingPeriod, Blocknumber lastUpdateIn); - event LogStakingTargetRewardRateSet(NftId indexed targetNftId, UFixed indexed oldRewardRate, UFixed indexed rewardRate, Blocknumber lastUpdateIn); - event LogStakingTargetMaxStakedAmountSet(NftId indexed targetNftId, Amount indexed stakeLimitAmount, Blocknumber indexed lastUpdateIn); - event LogStakingTargetLimitsSet(NftId indexed targetNftId, Amount indexed stakeLimitAmount, Amount indexed marginAmount, Amount limitAmount); + event LogStakingTargetLockingPeriodSet(NftId indexed targetNftId, Seconds oldLockingPeriod, Seconds lockingPeriod, Blocknumber lastUpdateIn); + event LogStakingTargetRewardRateSet(NftId indexed targetNftId, UFixed oldRewardRate, UFixed rewardRate, Blocknumber lastUpdateIn); + event LogStakingTargetMaxStakedAmountSet(NftId indexed targetNftId, Amount stakeLimitAmount, Blocknumber indexed lastUpdateIn); + event LogStakingTargetLimitsSet(NftId indexed targetNftId, Amount stakeLimitAmount, Amount marginAmount, Amount limitAmount); // reward reserves - event LogStakingRewardReservesRefilled(NftId indexed targetNftId, Amount indexed dipAmount, address indexed targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn); - event LogStakingRewardReservesWithdrawn(NftId indexed targetNftId, Amount indexed dipAmount, address indexed targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn); - event LogStakingRewardReservesSpent(NftId indexed targetNftId, Amount indexed dipAmount, Amount indexed reserveBalance, Blocknumber lastUpdateIn); + event LogStakingRewardReservesRefilled(NftId indexed targetNftId, Amount dipAmount, address indexed targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn); + event LogStakingRewardReservesWithdrawn(NftId indexed targetNftId, Amount dipAmount, address indexed targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn); + event LogStakingRewardReservesSpent(NftId indexed targetNftId, Amount dipAmount, Amount reserveBalance, Blocknumber lastUpdateIn); // stakes - event LogStakingStakeCreated(NftId indexed stakeNftId, NftId indexed targetNftId, Amount indexed stakeAmount, Timestamp lockedUntil, address stakeOwner); - event LogStakingStakeRewardsUpdated(NftId indexed stakeNftId, Amount indexed rewardIncrementAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); - event LogStakingRewardsRestaked(NftId indexed stakeNftId, Amount indexed restakedAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); - event LogStakingStaked(NftId indexed stakeNftId, Amount indexed stakedAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); - event LogStakingUnstaked(NftId indexed stakeNftId, Amount indexed unstakedAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); - event LogStakingRewardsClaimed(NftId indexed stakeNftId, Amount indexed claimedAmount, Amount indexed stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); - - event LogStakingStakeRestaked(NftId indexed stakeNftId, NftId indexed targetNftId, Amount indexed stakeAmount, address owner, NftId oldStakeNftId); + event LogStakingStakeCreated(NftId indexed stakeNftId, NftId indexed targetNftId, Amount stakeAmount, Timestamp lockedUntil, address stakeOwner); + event LogStakingStakeRewardsUpdated(NftId indexed stakeNftId, Amount rewardIncrementAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); + event LogStakingRewardsRestaked(NftId indexed stakeNftId, Amount restakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); + event LogStakingStaked(NftId indexed stakeNftId, Amount stakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); + event LogStakingUnstaked(NftId indexed stakeNftId, Amount unstakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); + event LogStakingRewardsClaimed(NftId indexed stakeNftId, Amount claimedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil, Blocknumber lastUpdateIn); + + event LogStakingStakeRestaked(NftId indexed stakeNftId, NftId indexed targetNftId, Amount stakeAmount, address owner, NftId oldStakeNftId); // modifiers error ErrorStakingNotStake(NftId stakeNftId); diff --git a/contracts/staking/TargetHandler.sol b/contracts/staking/TargetHandler.sol index 70c1e887a..0008625f9 100644 --- a/contracts/staking/TargetHandler.sol +++ b/contracts/staking/TargetHandler.sol @@ -20,7 +20,11 @@ contract TargetHandler is ITargetLimitHandler { +<<<<<<< HEAD event LogTargetHandlerUpdateTriggersSet(uint16 tvlUpdatesTrigger, UFixed minTvlRatioTrigger, Blocknumber lastUpdateIn); +======= + event LogTargetHandlerUpdateTriggersSet(uint16 tvlUpdatesTrigger, UFixed minTvlRatioTrigger, Blocknumber indexed lastUpdateIn); +>>>>>>> 9cc31631 (cleanup remaining unintended indexed event properties) IRegistry private _registry; StakingStore private _store; @@ -45,7 +49,7 @@ contract TargetHandler is // set default trigger values _setUpdateTriggers( - 10, // check after 2 TVL updates + 10, // check after 10 TVL updates UFixedLib.toUFixed(1, -1)); // 10% deviation from baseline TVL } diff --git a/test/component/product/ProductClaim.t.sol b/test/component/product/ProductClaim.t.sol index c96ae5844..67f123d88 100644 --- a/test/component/product/ProductClaim.t.sol +++ b/test/component/product/ProductClaim.t.sol @@ -80,7 +80,11 @@ contract TestProductClaim is GifTest { assertEq(entries[4].topics[0], keccak256("LogClaimServiceClaimSubmitted(uint96,uint16,uint96)"), "unexpected log signature"); uint96 nftIdInt = uint96(uint256(entries[4].topics[1])); uint24 claimIdInt = uint24(uint256(entries[4].topics[2])); +<<<<<<< HEAD (uint96 claimAmountInt ) = abi.decode(entries[4].data, (uint96)); +======= + uint96 claimAmountInt = abi.decode(entries[4].data, (uint96)); +>>>>>>> 9cc31631 (cleanup remaining unintended indexed event properties) assertEq(nftIdInt, policyNftId.toInt(), "unexpected policy nft id"); assertEq(claimIdInt, claimId.toInt(), "unexpected claim id"); assertEq(claimAmountInt, claimAmount.toInt(), "unexpected claim amount"); @@ -213,7 +217,7 @@ contract TestProductClaim is GifTest { assertEq(entries[4].topics[0], keccak256("LogClaimServiceClaimConfirmed(uint96,uint16,uint96)"), "unexpected log signature"); uint96 nftIdInt = uint96(uint256(entries[4].topics[1])); uint16 claimIdInt = uint16(uint256(entries[4].topics[2])); - (uint96 amountInt ) = abi.decode(entries[4].data, (uint96)); + uint96 amountInt = abi.decode(entries[4].data, (uint96)); assertEq(nftIdInt, policyNftId.toInt(), "unexpected policy nft id"); assertEq(claimIdInt, claimId.toInt(), "unexpected claim id"); assertEq(amountInt, confirmedAmount.toInt(), "unexpected amount"); From 7f314d9ee155e1704ff87c985db7876e710464ad Mon Sep 17 00:00:00 2001 From: Matthias Zimmermann Date: Mon, 16 Dec 2024 21:30:11 +0000 Subject: [PATCH 33/35] fix pr --- contracts/staking/TargetHandler.sol | 4 ---- test/component/product/ProductClaim.t.sol | 4 ---- 2 files changed, 8 deletions(-) diff --git a/contracts/staking/TargetHandler.sol b/contracts/staking/TargetHandler.sol index 0008625f9..c46391895 100644 --- a/contracts/staking/TargetHandler.sol +++ b/contracts/staking/TargetHandler.sol @@ -20,11 +20,7 @@ contract TargetHandler is ITargetLimitHandler { -<<<<<<< HEAD - event LogTargetHandlerUpdateTriggersSet(uint16 tvlUpdatesTrigger, UFixed minTvlRatioTrigger, Blocknumber lastUpdateIn); -======= event LogTargetHandlerUpdateTriggersSet(uint16 tvlUpdatesTrigger, UFixed minTvlRatioTrigger, Blocknumber indexed lastUpdateIn); ->>>>>>> 9cc31631 (cleanup remaining unintended indexed event properties) IRegistry private _registry; StakingStore private _store; diff --git a/test/component/product/ProductClaim.t.sol b/test/component/product/ProductClaim.t.sol index 67f123d88..6c3d11869 100644 --- a/test/component/product/ProductClaim.t.sol +++ b/test/component/product/ProductClaim.t.sol @@ -80,11 +80,7 @@ contract TestProductClaim is GifTest { assertEq(entries[4].topics[0], keccak256("LogClaimServiceClaimSubmitted(uint96,uint16,uint96)"), "unexpected log signature"); uint96 nftIdInt = uint96(uint256(entries[4].topics[1])); uint24 claimIdInt = uint24(uint256(entries[4].topics[2])); -<<<<<<< HEAD - (uint96 claimAmountInt ) = abi.decode(entries[4].data, (uint96)); -======= uint96 claimAmountInt = abi.decode(entries[4].data, (uint96)); ->>>>>>> 9cc31631 (cleanup remaining unintended indexed event properties) assertEq(nftIdInt, policyNftId.toInt(), "unexpected policy nft id"); assertEq(claimIdInt, claimId.toInt(), "unexpected claim id"); assertEq(claimAmountInt, claimAmount.toInt(), "unexpected claim amount"); From 8c8e108ce0ece0cba3c09fbd31bcd699d06cd888 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Mon, 16 Dec 2024 21:41:39 +0000 Subject: [PATCH 34/35] fix build --- contracts/oracle/OracleService.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/oracle/OracleService.sol b/contracts/oracle/OracleService.sol index ed956b6ec..d35daedf6 100644 --- a/contracts/oracle/OracleService.sol +++ b/contracts/oracle/OracleService.sol @@ -147,7 +147,7 @@ contract OracleService is emit LogOracleServiceDeliveryFailed(requestId, requesterInfo.objectAddress, functionSignature); } - emit LogOracleServiceResponseProcessed(requestId, request.requesterNftId, oracleNftId); + emit LogOracleServiceResponseProcessed(requestId, requesterInfo.nftId, oracleNftId); } From 09cd353245ae6e72264b368ed4456544d63e3298 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Tue, 17 Dec 2024 08:19:16 +0000 Subject: [PATCH 35/35] fix parameter names (#787) --- scripts/libs/release.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/libs/release.ts b/scripts/libs/release.ts index df1bcc47f..737af392d 100644 --- a/scripts/libs/release.ts +++ b/scripts/libs/release.ts @@ -208,9 +208,9 @@ export async function createRelease(owner: Signer, registry: RegistryAddresses, "releaseRegistry.prepareNextRelease", [releaseRegistry.interface]); - let logCreationInfo = getFieldFromTxRcptLogs(rcpt!, registry.releaseRegistry.interface, "LogReleaseCreated", "admin"); + let logCreationInfo = getFieldFromTxRcptLogs(rcpt!, registry.releaseRegistry.interface, "LogReleaseCreated", "releaseAdmin"); const releaseAdminAddress = logCreationInfo as AddressLike; - logCreationInfo = getFieldFromTxRcptLogs(rcpt!, registry.releaseRegistry.interface, "LogReleaseCreated", "version"); + logCreationInfo = getFieldFromTxRcptLogs(rcpt!, registry.releaseRegistry.interface, "LogReleaseCreated", "release"); const releaseVersion = logCreationInfo as BigNumberish; logCreationInfo = getFieldFromTxRcptLogs(rcpt!, registry.releaseRegistry.interface, "LogReleaseCreated", "salt"); const releaseSalt = logCreationInfo as BytesLike;