feat: implement KarmaTiers

This commit introduces a new contract `KarmaTiers` that allows for
maintaing tiers for gasless transactions.

The owner of the contract can add tiers, update tiers and deactivate or
activate them.

Tier names can only be 32 bytes long and there's no overlap allowed
between min and max Karma bounds of the tiers.

Closes #216
This commit is contained in:
r4bbit
2025-06-11 10:03:14 +02:00
committed by Andrea Franz
parent 8bd6687569
commit 382b1c1643
5 changed files with 797 additions and 29 deletions

View File

@@ -0,0 +1,22 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import { BaseScript } from "./Base.s.sol";
import { DeploymentConfig } from "./DeploymentConfig.s.sol";
import { KarmaTiers } from "../src/KarmaTiers.sol";
contract DeployKarmaTiersScript is BaseScript {
function run() public returns (KarmaTiers, DeploymentConfig) {
DeploymentConfig deploymentConfig = new DeploymentConfig(broadcaster);
(address deployer,) = deploymentConfig.activeNetworkConfig();
vm.startBroadcast(deployer);
KarmaTiers karmaTiers = new KarmaTiers();
vm.stopBroadcast();
return (karmaTiers, deploymentConfig);
}
}