29 Commits

Author SHA1 Message Date
r4bbit
22ba4ff130 refactor(RLN): remove verifier and exit function 2025-07-16 10:49:03 +02:00
r4bbit
fdc45eac07 fix(RLN): ensure init params are valid 2025-07-16 10:49:03 +02:00
Ricardo Guilherme Schmidt
edd63e75f9 feat(RLN): implement KarmaRLN
Closes #217, #218, #219
2025-07-15 13:39:22 +02:00
r4bbit
382b1c1643 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
2025-06-26 15:36:02 +02:00
Ricardo Guilherme Schmidt
83d8574867 chore(RLN): use same pragma as other files 2025-06-05 13:56:52 +02:00
Ricardo Guilherme Schmidt
458e07cc70 chore(RLN): import rln-contracts 2025-06-05 13:56:52 +02:00
r4bbit
309d765731 refactor(DeploymentConfig): remove proxy implementation address
This was a bandaid solution to easily allow for upgrade scripts.
We've changed those now to expect environment variables instead.
This allows us to change the dependencies without committing them to
version control.
2025-04-02 16:56:16 +02:00
r4bbit
801740f74f !refactor(RewardsStreamerMP): rename RewardsStreamerMP to StakeManager
This renames `RewardsStreamerMP` to `StakeManager`. The original name
only exists because the project has started with different versions of
the contract. Since the contract is no longer just dealing with MPs but
actually distributes rewards, it makes sense to make this the official
stake manager of the protocol.

**BREAKING CHANGE:**

- `RewardsStreamerMP` is now `StakeManager`
- `StakingManager__*` error selectors are now `StakeManager__*`
  selectors
2025-03-28 14:45:31 +01:00
Andrea Franz
47b9fd0ebe chore(KarmaNFT): update deploy scripts with proper svg strings 2025-03-14 16:01:34 +01:00
r4bbit
28cc5d6b2a chore: add deployment script for metadata generator 2025-03-14 16:01:34 +01:00
Andrea Franz
32bb2356dc chore(KarmaNFT): use deploy script in tests 2025-03-06 11:50:07 +01:00
Andrea Franz
96e50c6818 chore(KarmaNFT): add deploy script and remove nft address var in the metadata generators 2025-03-05 11:52:30 +01:00
r4bbit
aa1addbfcd chore: downgrade to paris
We put `cancun` as evm version into the foundry toml by mistake and
ended up building on top of it with certain assumptions.

Turns out that the network we're deploying to does not support that
version so we have to compile with `paris`.

This however, also requires a downgrade of the open zeppelin libraries,
which in turn requires changes in our code base. Primarily related to
initialization of `OwnableUpgradeable` and upgrades via UUPSUpgradeable.

This commit makes all the necessary changes.
2025-03-05 11:47:30 +01:00
r4bbit
d7e0d532d1 cleanup: address linter warnings 2025-03-05 11:20:21 +01:00
Andrea Franz
aa3442b577 feat(Karma): make karma upgradeable 2025-02-28 14:39:15 +01:00
r4bbit
60081c14fb refactor: cleanup, move code around, and adjust deployscript 2025-02-28 12:05:18 +01:00
Andrea Franz
ed3577f8c4 feat(Karma): allocate external rewards using the Karma contract 2025-02-27 20:48:39 +01:00
r4bbit
70a7f30d2a feat: introduce proxy clones
This commit introduces proxy clones to make create `StakeVault`s as
cheap as possible.

Major changes here are:

- Introduce `VaultFactory` which takes care of creating clones and
  registering them with the stake manager
- Make `StakeVault` and `Initializable` so it can be used as a
  "template" contract to later have proxies point to it
- Adjust the deployment script to also deploy `VaultFactory` and ensure
  The proxy is whitelisted in the stake manager
- Make use of the new proxy clones in tests
- Add a test for `TrustedCodehashAccess` that ensures the proxy
  whitelisting works and setting up a (malicious) proxy is not going to
  work

Closes #101
2025-02-06 13:21:01 +01:00
r4bbit
177aba24d6 refactor: introduce TransparentProxy in favor of StakeManagerProxy
We use `IStakeManagerProxy` to ensure instances of `TransparentProxy`
are stake managers where necessary.
2025-02-06 08:52:53 +01:00
r4bbit
cb43de39b9 chore(scripts): add deployment config for sepolia 2025-01-22 11:33:28 +01:00
r4bbit
b5ce251b8e feat(scripts): add upgrade script
This introduces a simple upgrade script template that can be used to
upgrade the stake manager.
2024-12-10 13:26:33 +01:00
r4bbit
a565dbbac4 feat: introduce deployment script for RewardsStreamerMP
This commit introduces a deployment script for the stake manager which
can later be extended to work with other networks.

The deployment script is also used inside our testsuite, ensuring it's
working as intended.

Closes #88
2024-12-09 14:31:03 +01:00
r4bbit
24c3469cd1 chore: make linter and formatter happy 2024-09-25 10:23:46 +02:00
Andrea Franz
4ef75621a3 import foundry template (#1) 2024-09-25 09:39:14 +02:00
Andrea Franz
6ee5259fb5 update names to use RewardsStreamer 2024-09-11 15:52:59 +02:00
Andrea Franz
7e15f37eba implement base indexes logic 2024-09-10 01:08:53 +02:00
Andrea Franz
6b86d96142 update license and solc version 2024-09-10 00:05:27 +02:00
Andrea Franz
da3a05badf add StakeManager contract 2024-09-10 00:02:52 +02:00
Andrea Franz
9999866d0c chore: forge init 2024-09-09 22:23:01 +02:00