-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
171 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
@openzeppelin/contracts@5.0.2/=lib/openzeppelin-contracts/contracts/ | ||
forge-std/=lib/forge-std/src/ | ||
@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/ | ||
@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.20; | ||
|
||
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; | ||
|
||
contract CollatorStorage { | ||
// ---------------------- CollatorSetStorage ---------------------------- | ||
// collator count; | ||
uint256 public count; | ||
// ordered collators. | ||
mapping(address => address) public collators; | ||
// collator => score = staked_ring * (1 - commission) | ||
mapping(address => uint256) public scoreOf; | ||
|
||
// ---------------------- CollatorStakingHubStorage --------------------- | ||
// operator => collator | ||
mapping(address => address) public collatorOf; | ||
// collator => commission | ||
mapping(address => uint256) public commissionOf; | ||
// user => staked ring | ||
mapping(address => uint256) public stakedRINGOf; | ||
// user => staked depositIds | ||
mapping(address => EnumerableSet.UintSet) internal _stakedDepositsOf; | ||
|
||
struct DepositInfo { | ||
address account; | ||
uint256 assets; | ||
address collator; | ||
} | ||
// depositId => depositInfo | ||
|
||
mapping(uint256 => DepositInfo) public depositInfoOf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.