From aee13442e28d0bc42a15191a6ea2b55fab93e717 Mon Sep 17 00:00:00 2001 From: Joseph Schiarizzi <9449596+cupOJoseph@users.noreply.github.com> Date: Wed, 27 Aug 2025 15:05:16 -0400 Subject: [PATCH 1/2] remove multiplier onchain and bring it offchain --- src/ShellToken.sol | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/ShellToken.sol b/src/ShellToken.sol index aebd643..a1e2a8c 100644 --- a/src/ShellToken.sol +++ b/src/ShellToken.sol @@ -11,11 +11,6 @@ contract ShellToken is ERC20, Ownable { uint256 amount; } - struct Multiplier { - address activity; - uint256 multiplier; - } - mapping(address => bool) public isAdmin; // address of activity -> multiplier @@ -24,7 +19,7 @@ contract ShellToken is ERC20, Ownable { mapping(address => bool) public allowedToTransfer; - constructor() ERC20("ShellToken", "SHELL") Ownable(msg.sender) {} + constructor() ERC20("Nerite Shell Points", "SHELL") Ownable(msg.sender) {} function mintShells(address to, uint256 amount) public { require(isAdmin[msg.sender], "Not an admin"); @@ -58,16 +53,6 @@ contract ShellToken is ERC20, Ownable { return super.transferFrom(from, to, amount); } - - function getMultipliers(address[] calldata contracts) external view returns (Multiplier[] memory) { - Multiplier[] memory multipliers = new Multiplier[](contracts.length); - for (uint i; i < contracts.length; ) { - multipliers[i] = Multiplier(contracts[i], multiplier[contracts[i]]); - unchecked { ++i; } - } - return multipliers; - } - ////////////////////////// // ONLY OWNER FUNCTIONS // ////////////////////////// @@ -79,9 +64,5 @@ contract ShellToken is ERC20, Ownable { function updateIsAdmin(address user, bool _isAdmin) public onlyOwner { isAdmin[user] = _isAdmin; } - - function setMultiplier(address activity, uint perc) public onlyOwner { - multiplier[activity] = perc; - } } From eaa2a489adb02e10a3976b80e107ee33eaf4a335 Mon Sep 17 00:00:00 2001 From: Joseph Schiarizzi <9449596+cupOJoseph@users.noreply.github.com> Date: Wed, 27 Aug 2025 15:06:42 -0400 Subject: [PATCH 2/2] remove tests --- test/ShellToken.t.sol | 45 ------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/test/ShellToken.t.sol b/test/ShellToken.t.sol index 92ca1da..47ca95e 100644 --- a/test/ShellToken.t.sol +++ b/test/ShellToken.t.sol @@ -195,49 +195,4 @@ contract ShellTokenTest is Test { assertEq(shellToken.balanceOf(user), 0); assertEq(shellToken.balanceOf(to), 100); } - - function test_setMultiplier() public { - address activity = makeAddr("activity"); - - vm.startPrank(owner); - shellToken.setMultiplier(activity, 100); - vm.stopPrank(); - } - - function test_revert_setMultiplier_notOwner() public { - address activity = makeAddr("activity"); - address notOwner = makeAddr("notOwner"); - - vm.startPrank(notOwner); - vm.expectRevert(abi.encodeWithSelector(Ownable.OwnableUnauthorizedAccount.selector, notOwner)); - shellToken.setMultiplier(activity, 100); - vm.stopPrank(); - - vm.startPrank(admin); - vm.expectRevert(abi.encodeWithSelector(Ownable.OwnableUnauthorizedAccount.selector, admin)); - shellToken.setMultiplier(activity, 100); - vm.stopPrank(); - } - - function test_getMultipliers() public { - address[] memory contracts = new address[](3); - contracts[0] = makeAddr("activity1"); - contracts[1] = makeAddr("activity2"); - contracts[2] = makeAddr("activity3"); - - vm.startPrank(owner); - for (uint i; i < contracts.length; ) { - shellToken.setMultiplier(contracts[i], 100 + i); - unchecked { ++i; } - } - vm.stopPrank(); - - ShellToken.Multiplier[] memory multipliers = shellToken.getMultipliers(contracts); - assertEq(multipliers.length, contracts.length); - for (uint i; i < multipliers.length; ) { - assertEq(multipliers[i].activity, contracts[i]); - assertEq(multipliers[i].multiplier, 100 + i); - unchecked { ++i; } - } - } } \ No newline at end of file