-
Notifications
You must be signed in to change notification settings - Fork 9
Split preparations #348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Split preparations #348
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a0f4d1e
refactor: organize repository folder structure
Luisfc68 a97f51f
refactor: fix linter errors
Luisfc68 8cda64a
refactor: move QuotesV2 to legacy directory
Luisfc68 4199658
refactor: move safe contracts to test-contracts folder
Luisfc68 057037e
refactor: rename interface files
Luisfc68 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,23 +1,31 @@ | ||
| { | ||
| "extends": "solhint:recommended", | ||
| "rules": { | ||
| "avoid-throw": "off", | ||
| "compiler-version": ["error", "0.8.25"], | ||
| "max-line-length": ["error", 120], | ||
| "max-states-count": ["error", 20], | ||
| "avoid-tx-origin": "off", | ||
| "max-states-count": ["error", 10], | ||
| "not-rely-on-time": "off", | ||
| "func-visibility": [ | ||
| "warn", | ||
| "error", | ||
| { | ||
| "ignoreConstructors": true | ||
| } | ||
| ], | ||
| "no-global-import": "off", | ||
| "no-inline-assembly": "off", | ||
| "var-name-mixedcase": "off", | ||
| "reason-string": "off", | ||
| "no-unused-vars": "error", | ||
| "no-empty-blocks": "off" | ||
| "payable-fallback": "error", | ||
| "func-param-name-mixedcase": "error", | ||
| "private-vars-leading-underscore": [ | ||
| "warn", | ||
| { | ||
| "strict": true | ||
| } | ||
| ], | ||
| "imports-order": "warn", | ||
| "ordering": "warn", | ||
| "gas-length-in-loops": "error", | ||
| "comprehensive-interface": "error", | ||
| "explicit-types": "off", | ||
|
|
||
| "use-natspec": "off" | ||
| } | ||
| } |
This file contains hidden or 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 +1,5 @@ | ||
| contracts/safe-test-contracts | ||
| contracts/test-contracts/safe-test-contracts | ||
| contracts/legacy | ||
|
|
||
| # TEMPORARY | ||
| contracts/split |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,28 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.25; | ||
|
|
||
| import {Flyover} from "../libraries/Flyover.sol"; | ||
|
|
||
| interface ICollateralManagement { | ||
| event WithdrawCollateral(address indexed addr, uint indexed amount); | ||
| event Resigned(address indexed addr); | ||
| event PegInCollateralAdded(address indexed addr, uint256 indexed amount); | ||
| event PegOutCollateralAdded(address indexed addr, uint256 indexed amount); | ||
|
|
||
| error AlreadyResigned(address from); | ||
| error NotResigned(address from); | ||
| error ResignationDelayNotMet(address from, uint resignationBlockNum, uint resignDelayInBlocks); | ||
| error WithdrawalFailed(address from, uint amount); | ||
|
|
||
| function addPegInCollateralTo(address addr) external payable; | ||
| function addPegInCollateral() external payable; | ||
| function addPegOutCollateralTo(address addr) external payable; | ||
| function addPegOutCollateral() external payable; | ||
|
|
||
| function getPegInCollateral(address addr) external view returns (uint256); | ||
| function getPegOutCollateral(address addr) external view returns (uint256); | ||
| function getResignationBlock(address addr) external view returns (uint256); | ||
| function getMinCollateral() external view returns (uint256); | ||
| function isRegistered(Flyover.ProviderType providerType, address addr) external view returns (bool); | ||
| function isCollateralSufficient(Flyover.ProviderType providerType, address addr) external view returns (bool); | ||
| } |
This file contains hidden or 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,30 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.25; | ||
|
|
||
| import {Flyover} from "../libraries/Flyover.sol"; | ||
|
|
||
| interface IFlyoverDiscovery { | ||
| event Register(uint indexed id, address indexed from, uint256 indexed amount); | ||
| event ProviderUpdate(address indexed from, string name, string apiBaseUrl); | ||
| event ProviderStatusSet(uint indexed id, bool indexed status); | ||
|
|
||
| error NotAuthorized(address from); | ||
| error NotEOA(address from); | ||
| error InvalidProviderData(string name, string apiBaseUrl); | ||
| error InvalidProviderType(Flyover.ProviderType providerType); | ||
| error AlreadyRegistered(address from); | ||
| error InsufficientCollateral(uint amount); | ||
|
|
||
| function register( | ||
| string memory name, | ||
| string memory apiBaseUrl, | ||
| bool status, | ||
| Flyover.ProviderType providerType | ||
| ) external payable returns (uint); | ||
|
|
||
| function updateProvider(string memory name,string memory apiBaseUrl) external; | ||
| function setProviderStatus(uint providerId, bool status) external; | ||
| function getProviders() external view returns (Flyover.LiquidityProvider[] memory); | ||
| function getProvider(address providerAddress) external view returns (Flyover.LiquidityProvider memory); | ||
| function isOperational(Flyover.ProviderType providerType, address addr) external view returns (bool); | ||
| } |
This file contains hidden or 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,18 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.25; | ||
|
|
||
| import {QuotesV2} from "../legacy/QuotesV2.sol"; | ||
|
|
||
| interface ILegacyLiquidityBridgeContract { | ||
| function register( | ||
| string memory name, | ||
| string memory apiBaseUrl, | ||
| bool status, | ||
| string memory providerType | ||
| ) external payable returns (uint); | ||
|
|
||
| function depositPegout( | ||
| QuotesV2.PegOutQuote memory quote, | ||
| bytes memory signature | ||
| ) external payable; | ||
| } |
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -2,9 +2,9 @@ | |
| pragma solidity 0.8.25; | ||
| pragma experimental ABIEncoderV2; | ||
|
|
||
| import "./Bridge.sol"; | ||
| import "../interfaces/IBridge.sol"; | ||
| import "./QuotesV2.sol"; | ||
| import "./SignatureValidator.sol"; | ||
| import "../libraries/SignatureValidator.sol"; | ||
| import "@rsksmart/btc-transaction-solidity-helper/contracts/BtcUtils.sol"; | ||
| import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; | ||
| import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; | ||
|
|
@@ -90,7 +90,7 @@ | |
| event DaoFeeSent(bytes32 indexed quoteHash, uint256 amount); | ||
| event ProviderUpdate(address indexed providerAddress, string name, string url); | ||
|
|
||
| Bridge public bridge; | ||
| IBridge public bridge; | ||
Check warningCode scanning / Slither State variables that could be declared constant Warning
LiquidityBridgeContractV2.bridge should be constant
|
||
| mapping(address => uint256) private balances; | ||
| mapping(address => uint256) private collateral; | ||
| mapping(address => uint256) private pegoutCollateral; | ||
|
|
||
File renamed without changes.
File renamed without changes.
This file contains hidden or 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,17 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.25; | ||
|
|
||
| library Flyover { | ||
| enum ProviderType { PegIn, PegOut, Both } | ||
|
|
||
| struct LiquidityProvider { | ||
| uint id; | ||
| address providerAddress; | ||
| bool status; | ||
| ProviderType providerType; | ||
| string name; | ||
| string apiBaseUrl; | ||
| } | ||
|
|
||
| error ProviderNotRegistered(address from); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.