Skip to content

Commit 32fe70a

Browse files
committed
refactor: renamed token accreditedLawyerToken into accreditedProfessionalToken
1 parent 7f64aba commit 32fe70a

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

contracts/src/arbitration/dispute-kits/DisputeKitGatedArgentinaConsumerProtection.sol

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface IBalanceHolder {
1515

1616
/// @title DisputeKitGatedArgentinaConsumerProtection
1717
/// @notice Dispute kit implementation adapted from DisputeKitClassic
18-
/// - a drawing system: proportional to staked PNK among the jurors holding a `accreditedLawyerToken` or a `accreditedConsumerProtectionLawyerToken`
18+
/// - a drawing system: proportional to staked PNK among the jurors holding a `accreditedProfessionalToken` or a `accreditedConsumerProtectionLawyerToken`
1919
/// and at least one of the drawn jurors is holding a `accreditedConsumerProtectionLawyerToken`,
2020
/// - a vote aggregation system: plurality,
2121
/// - an incentive system: equal split between coherent votes,
@@ -27,7 +27,7 @@ contract DisputeKitGatedArgentinaConsumerProtection is DisputeKitClassicBase {
2727
// * Storage * //
2828
// ************************************* //
2929

30-
address public accreditedLawyerToken; // The address of the accredited lawyer token.
30+
address public accreditedProfessionalToken; // The address of the accredited professional token.
3131
address public accreditedConsumerProtectionLawyerToken; // The address of the accredited consumer protection lawyer token.
3232
mapping(uint256 localDisputeID => mapping(uint256 localRoundID => bool)) public drawnConsumerProtectionLawyer; // Maps the local dispute and round ID to the boolean indicating if the consumer protection lawyer was drawn.
3333

@@ -44,17 +44,17 @@ contract DisputeKitGatedArgentinaConsumerProtection is DisputeKitClassicBase {
4444
/// @param _owner The owner's address.
4545
/// @param _core The KlerosCore arbitrator.
4646
/// @param _wNative The wrapped native token address, typically wETH.
47-
/// @param _accreditedLawyerToken The address of the accredited lawyer token.
47+
/// @param _accreditedProfessionalToken The address of the accredited professional token.
4848
/// @param _accreditedConsumerProtectionLawyerToken The address of the accredited consumer protection lawyer token.
4949
function initialize(
5050
address _owner,
5151
KlerosCore _core,
5252
address _wNative,
53-
address _accreditedLawyerToken,
53+
address _accreditedProfessionalToken,
5454
address _accreditedConsumerProtectionLawyerToken
5555
) external initializer {
5656
__DisputeKitClassicBase_initialize(_owner, _core, _wNative);
57-
accreditedLawyerToken = _accreditedLawyerToken;
57+
accreditedProfessionalToken = _accreditedProfessionalToken;
5858
accreditedConsumerProtectionLawyerToken = _accreditedConsumerProtectionLawyerToken;
5959
}
6060

@@ -68,10 +68,10 @@ contract DisputeKitGatedArgentinaConsumerProtection is DisputeKitClassicBase {
6868
// NOP
6969
}
7070

71-
/// @notice Changes the accredited lawyer token.
72-
/// @param _accreditedLawyerToken The address of the accredited lawyer token.
73-
function changeAccreditedLawyerToken(address _accreditedLawyerToken) external onlyByOwner {
74-
accreditedLawyerToken = _accreditedLawyerToken;
71+
/// @notice Changes the accredited professional token.
72+
/// @param _accreditedProfessionalToken The address of the accredited lawyer token.
73+
function changeAccreditedProfessionalToken(address _accreditedProfessionalToken) external onlyByOwner {
74+
accreditedProfessionalToken = _accreditedProfessionalToken;
7575
}
7676

7777
/// @notice Changes the accredited consumer protection lawyer token.
@@ -129,7 +129,7 @@ contract DisputeKitGatedArgentinaConsumerProtection is DisputeKitClassicBase {
129129
// Reject this draw so that another iteration can try again later.
130130
return false;
131131
}
132-
if (IBalanceHolder(accreditedLawyerToken).balanceOf(_juror) == 0) {
132+
if (IBalanceHolder(accreditedProfessionalToken).balanceOf(_juror) == 0) {
133133
// The juror does not hold either of the tokens.
134134
return false;
135135
}

contracts/test/foundry/DisputeKitGatedArgentinaConsumerProtection_Drawing.t.sol

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ import "../../src/libraries/Constants.sol";
1414
/// @title DisputeKitGatedArgentinaConsumerProtection_DrawingTest
1515
/// @dev Tests for DisputeKitGatedArgentinaConsumerProtection drawing logic
1616
/// This dispute kit requires:
17-
/// - Jurors must own either accreditedLawyerToken OR accreditedConsumerProtectionLawyerToken
17+
/// - Jurors must own either accreditedProfessionalToken OR accreditedConsumerProtectionLawyerToken
1818
/// - Each round must have at least one juror with accreditedConsumerProtectionLawyerToken
1919
contract DisputeKitGatedArgentinaConsumerProtection_DrawingTest is KlerosCore_TestBase {
2020
// ************************************* //
2121
// * Test Contracts * //
2222
// ************************************* //
2323

2424
DisputeKitGatedArgentinaConsumerProtection argentinaDK;
25-
TestERC721 accreditedLawyerToken;
25+
TestERC721 accreditedProfessionalToken;
2626
TestERC721 accreditedConsumerProtectionLawyerToken;
2727

2828
// ************************************* //
2929
// * Test Accounts * //
3030
// ************************************* //
3131

32-
address lawyer1; // Has only accredited lawyer token
33-
address lawyer2; // Has only accredited lawyer token
32+
address lawyer1; // Has only accredited professional token
33+
address lawyer2; // Has only accredited professional token
3434
address consumerLawyer1; // Has only consumer protection lawyer token
3535
address consumerLawyer2; // Has only consumer protection lawyer token
3636
address bothLawyer; // Has both tokens
@@ -56,7 +56,7 @@ contract DisputeKitGatedArgentinaConsumerProtection_DrawingTest is KlerosCore_Te
5656
noTokenJuror = vm.addr(15);
5757

5858
// Deploy token contracts
59-
accreditedLawyerToken = new TestERC721("Accredited Lawyer", "AL");
59+
accreditedProfessionalToken = new TestERC721("Accredited Lawyer", "AL");
6060
accreditedConsumerProtectionLawyerToken = new TestERC721("Consumer Protection Lawyer", "CPL");
6161

6262
// Deploy and initialize the Argentina dispute kit
@@ -66,7 +66,7 @@ contract DisputeKitGatedArgentinaConsumerProtection_DrawingTest is KlerosCore_Te
6666
owner,
6767
address(core),
6868
address(wNative),
69-
address(accreditedLawyerToken),
69+
address(accreditedProfessionalToken),
7070
address(accreditedConsumerProtectionLawyerToken)
7171
);
7272
UUPSProxy proxyDK = new UUPSProxy(address(dkLogic), initData);
@@ -173,8 +173,8 @@ contract DisputeKitGatedArgentinaConsumerProtection_DrawingTest is KlerosCore_Te
173173
/// Expected: Drawing never completes all required jurors due to last-iteration rejection logic
174174
function test_drawFailsWithOnlyAccreditedLawyers() public {
175175
// Mint accredited lawyer tokens (but NOT consumer protection tokens)
176-
accreditedLawyerToken.safeMint(lawyer1);
177-
accreditedLawyerToken.safeMint(lawyer2);
176+
accreditedProfessionalToken.safeMint(lawyer1);
177+
accreditedProfessionalToken.safeMint(lawyer2);
178178

179179
// Stake in the Argentina court
180180
vm.prank(lawyer1);
@@ -246,8 +246,8 @@ contract DisputeKitGatedArgentinaConsumerProtection_DrawingTest is KlerosCore_Te
246246
/// @notice Test that drawing succeeds with a mix of both lawyer types
247247
function test_drawSucceedsWithMixedLawyers() public {
248248
// Mint tokens to different jurors
249-
accreditedLawyerToken.safeMint(lawyer1);
250-
accreditedLawyerToken.safeMint(lawyer2);
249+
accreditedProfessionalToken.safeMint(lawyer1);
250+
accreditedProfessionalToken.safeMint(lawyer2);
251251
accreditedConsumerProtectionLawyerToken.safeMint(consumerLawyer1);
252252

253253
// Stake in the Argentina court
@@ -287,7 +287,7 @@ contract DisputeKitGatedArgentinaConsumerProtection_DrawingTest is KlerosCore_Te
287287
/// @notice Test drawing when a juror holds both token types
288288
function test_drawWithJurorHoldingBothTokens() public {
289289
// Mint both tokens to the same juror
290-
accreditedLawyerToken.safeMint(bothLawyer);
290+
accreditedProfessionalToken.safeMint(bothLawyer);
291291
accreditedConsumerProtectionLawyerToken.safeMint(bothLawyer);
292292

293293
// Stake in the Argentina court
@@ -365,7 +365,7 @@ contract DisputeKitGatedArgentinaConsumerProtection_DrawingTest is KlerosCore_Te
365365
/// @notice Test that each round independently satisfies the consumer protection lawyer requirement
366366
function test_multipleRoundsRequirement() public {
367367
// Mint tokens
368-
accreditedLawyerToken.safeMint(lawyer1);
368+
accreditedProfessionalToken.safeMint(lawyer1);
369369
accreditedConsumerProtectionLawyerToken.safeMint(consumerLawyer1);
370370

371371
// Stake in the Argentina court

0 commit comments

Comments
 (0)