@@ -17,6 +17,7 @@ import {TestERC20} from "../../src/token/TestERC20.sol";
17
17
import {ArbitrableExample, IArbitrableV2} from "../../src/arbitration/arbitrables/ArbitrableExample.sol " ;
18
18
import {DisputeTemplateRegistry} from "../../src/arbitration/DisputeTemplateRegistry.sol " ;
19
19
import "../../src/libraries/Constants.sol " ;
20
+ import {IKlerosCore, KlerosCoreSnapshotProxy} from "../../src/snapshot-proxy/KlerosCoreSnapshotProxy.sol " ;
20
21
21
22
contract KlerosCoreTest is Test {
22
23
event Initialized (uint64 version );
@@ -1279,6 +1280,33 @@ contract KlerosCoreTest is Test {
1279
1280
core.setStakeBySortitionModule (staker1, GENERAL_COURT, 1000 , false );
1280
1281
}
1281
1282
1283
+ function test_setStake_snapshotProxyCheck () public {
1284
+ vm.prank (staker1);
1285
+ core.setStake (GENERAL_COURT, 12346 );
1286
+
1287
+ KlerosCoreSnapshotProxy snapshotProxy = new KlerosCoreSnapshotProxy (governor, IKlerosCore (address (core)));
1288
+ assertEq (snapshotProxy.name (), "Staked Pinakion " , "Wrong name of the proxy token " );
1289
+ assertEq (snapshotProxy.symbol (), "stPNK " , "Wrong symbol of the proxy token " );
1290
+ assertEq (snapshotProxy.decimals (), 18 , "Wrong decimals of the proxy token " );
1291
+ assertEq (snapshotProxy.governor (), msg .sender , "Wrong governor " );
1292
+ assertEq (address (snapshotProxy.core ()), address (core), "Wrong core in snapshot proxy " );
1293
+ assertEq (snapshotProxy.balanceOf (staker1), 12346 , "Wrong stPNK balance " );
1294
+
1295
+ vm.prank (other);
1296
+ vm.expectRevert (bytes ("Access not allowed: Governor only. " ));
1297
+ snapshotProxy.changeCore (IKlerosCore (other));
1298
+ vm.prank (governor);
1299
+ snapshotProxy.changeCore (IKlerosCore (other));
1300
+ assertEq (address (snapshotProxy.core ()), other, "Wrong core in snapshot proxy after change " );
1301
+
1302
+ vm.prank (other);
1303
+ vm.expectRevert (bytes ("Access not allowed: Governor only. " ));
1304
+ snapshotProxy.changeGovernor (other);
1305
+ vm.prank (governor);
1306
+ snapshotProxy.changeGovernor (other);
1307
+ assertEq (snapshotProxy.governor (), other, "Wrong governor after change " );
1308
+ }
1309
+
1282
1310
// *************************************** //
1283
1311
// * Disputes * //
1284
1312
// *************************************** //
0 commit comments