Skip to content

Commit 18055b6

Browse files
authored
Merge pull request #86 from Folks-Finance/feat/rewards-v2
add on chain rewards v2 contracts
2 parents 8594bd0 + 6801f7a commit 18055b6

17 files changed

+3096
-12
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ To build:
1919

2020
## Smart Contracts
2121

22-
The smart contracts are split into 4 distinct folders:
22+
The smart contracts are split into 6 distinct folders:
2323

2424
- `contracts/bridge` contains all the smart contracts relating to sending messages (data and token) between the spoke chains and hub chain. Unless named specifically, they are deployed both in the spoke chains and hub chain.
2525
- `contracts/hub` contains the smart contracts relating to the core business logic of the protocol. They are deployed only in the hub chain.
26+
- `contracts/hub-rewards` contains the smart contracts relating to the core business logic of the on-chain rewards. They are deployed only in the hub chain.
2627
- `contracts/oracle` contains the smart contracts relating to the oracle for token price information. They are deployed only in the hub chain.
2728
- `contracts/spoke` contains the smart contracts relating to the user entry point into the protocol. They are deployed only in the spoke chains (the hub chain may also be a spoke chain).
29+
- `contracts/spoke-rewards` contains the smart contracts relating to the user entry point into the on-chain rewards. They are deployed only in the spoke chains (the hub chain may also be a spoke chain).
2830

2931
Within each you can also find `test` folder which contains smart contracts used for testing. These are not part of the protocol and won't be deployed.
3032

contracts/bridge/libraries/Messages.sol

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,53 @@ library Messages {
8484
Liquidate,
8585
SwitchBorrowType,
8686
// HUB -> SPOKE
87-
SendToken
87+
SendToken,
88+
// ADDITIONAL
89+
ClaimRewardsV2,
90+
P20,
91+
P21,
92+
P22,
93+
P23,
94+
P24,
95+
P25,
96+
P26,
97+
P27,
98+
P28,
99+
P29,
100+
P30,
101+
P31,
102+
P32,
103+
P33,
104+
P34,
105+
P35,
106+
P36,
107+
P37,
108+
P38,
109+
P39,
110+
P40,
111+
P41,
112+
P42,
113+
P43,
114+
P44,
115+
P45,
116+
P46,
117+
P47,
118+
P48,
119+
P49,
120+
P50,
121+
P51,
122+
P52,
123+
P53,
124+
P54,
125+
P55,
126+
P56,
127+
P57,
128+
P58,
129+
P59,
130+
P60,
131+
P61,
132+
P62,
133+
P63
88134
}
89135

90136
struct MessagePayload {

contracts/hub/RewardsV1.sol renamed to contracts/hub-rewards/HubRewardsV1.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import "@openzeppelin/contracts/access/extensions/AccessControlDefaultAdminRules
55
import "@openzeppelin/contracts/utils/math/Math.sol";
66

77
import "../bridge/libraries/Messages.sol";
8-
import "./interfaces/IAccountManager.sol";
9-
import "./LoanManager.sol";
8+
import "../hub/interfaces/IAccountManager.sol";
9+
import "../hub/LoanManager.sol";
1010

1111
contract RewardsV1 is AccessControlDefaultAdminRules {
1212
struct PoolEpoch {

0 commit comments

Comments
 (0)