Skip to content

Commit d6be531

Browse files
committed
feat: add discovery split poc
1 parent 141850d commit d6be531

28 files changed

+19527
-10173
lines changed

.solhint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "solhint:recommended",
33
"rules": {
44
"avoid-throw": "off",
5-
"compiler-version": ["error", "^0.8.18"],
5+
"compiler-version": ["error", "0.8.25"],
66
"max-line-length": ["error", 120],
77
"max-states-count": ["error", 20],
88
"avoid-tx-origin": "off",

contracts/Bridge.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.18;
2+
pragma solidity 0.8.25;
33

44
interface Bridge {
55

@@ -129,4 +129,4 @@ interface Bridge {
129129
function getBtcBlockchainBlockHeaderByHeight(uint256 btcBlockHeight) external view returns (bytes memory);
130130

131131
function getBtcBlockchainParentBlockHeaderByHash(bytes32 btcBlockHash) external view returns (bytes memory);
132-
}
132+
}

contracts/BridgeMock.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.18;
2+
pragma solidity 0.8.25;
33

44
import "./Bridge.sol";
55

contracts/LiquidityBridgeContract.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.18;
2+
pragma solidity 0.8.25;
33
pragma experimental ABIEncoderV2;
44

55
import "./Bridge.sol";
66
import "./Quotes.sol";
77
import "./SignatureValidator.sol";
88
import "@rsksmart/btc-transaction-solidity-helper/contracts/BtcUtils.sol";
99
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
10-
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
10+
import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
1111

1212
/**
1313
@title Contract that assists with the Flyover protocol
@@ -157,7 +157,8 @@ contract LiquidityBridgeContract is Initializable, OwnableUpgradeable, Reentranc
157157
require(_rewardPercentage <= 100, "LBC004");
158158
require(_minimumCollateral >= 0.03 ether, "LBC072");
159159
require(_resignDelayBlocks >= 60, "LBC073");
160-
__Ownable_init_unchained();
160+
__Ownable_init_unchained(msg.sender);
161+
__ReentrancyGuard_init_unchained();
161162
bridge = Bridge(_bridgeAddress);
162163
minCollateral = _minimumCollateral;
163164
minPegIn = _minimumPegIn;
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.18;
2+
pragma solidity 0.8.25;
33

44
import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
55

6-
contract LiquidityBridgeContractAdmin is ProxyAdmin {}
6+
contract LiquidityBridgeContractAdmin is ProxyAdmin {
7+
constructor() ProxyAdmin(msg.sender) {}
8+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.18;
2+
pragma solidity 0.8.25;
33

44
import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
55

66
contract LiquidityBridgeContractProxy is TransparentUpgradeableProxy {
77
constructor(address _logic, address _admin, bytes memory _data)
88
TransparentUpgradeableProxy(_logic,_admin, _data) payable {}
9-
}
9+
}

contracts/LiquidityBridgeContractV2.sol

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.18;
2+
pragma solidity 0.8.25;
33
pragma experimental ABIEncoderV2;
44

55
import "./Bridge.sol";
66
import "./QuotesV2.sol";
77
import "./SignatureValidator.sol";
88
import "@rsksmart/btc-transaction-solidity-helper/contracts/BtcUtils.sol";
99
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
10-
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
10+
import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
1111

1212
/**
1313
@title Contract that assists with the Flyover protocol
1414
*/
1515

16-
contract LiquidityBridgeContractV2 is Initializable, OwnableUpgradeable, ReentrancyGuardUpgradeable {
16+
contract LiquidityBridgeContractV2 is OwnableUpgradeable, ReentrancyGuardUpgradeable {
1717
uint16 constant public MAX_CALL_GAS_COST = 35000;
1818
uint16 constant public MAX_REFUND_GAS_LIMIT = 2300;
1919

@@ -135,6 +135,11 @@ contract LiquidityBridgeContractV2 is Initializable, OwnableUpgradeable, Reentra
135135
_;
136136
}
137137

138+
function initializeV2() public initializer {
139+
__Ownable_init_unchained(msg.sender);
140+
__ReentrancyGuard_init_unchained();
141+
}
142+
138143
function setProviderStatus(
139144
uint _providerId,
140145
bool status
@@ -150,22 +155,10 @@ contract LiquidityBridgeContractV2 is Initializable, OwnableUpgradeable, Reentra
150155
return "1.3.0";
151156
}
152157

153-
function getProviderIds() external view returns (uint) {
154-
return providerId;
155-
}
156-
157-
function getBridgeAddress() external view returns (address) {
158-
return address(bridge);
159-
}
160-
161158
function getMinCollateral() public view returns (uint) {
162159
return minCollateral;
163160
}
164161

165-
function getMinPegIn() external view returns (uint) {
166-
return minPegIn;
167-
}
168-
169162
function getRewardPercentage() external view returns (uint) {
170163
return rewardP;
171164
}
@@ -174,14 +167,6 @@ contract LiquidityBridgeContractV2 is Initializable, OwnableUpgradeable, Reentra
174167
return resignDelayInBlocks;
175168
}
176169

177-
function getDustThreshold() external view returns (uint) {
178-
return dust;
179-
}
180-
181-
function isPegOutQuoteCompleted(bytes32 quoteHash) external view returns (bool) {
182-
return pegoutRegistry[quoteHash].completed;
183-
}
184-
185170
/**
186171
@dev Checks whether a liquidity provider can deliver a pegin service
187172
@return Whether the liquidity provider is registered and has enough locked collateral

contracts/Migrations.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.18;
2+
pragma solidity 0.8.25;
33

44
contract Migrations {
55
address public owner = msg.sender;

contracts/Mock.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.18;
2+
pragma solidity 0.8.25;
33

44
import "./LiquidityBridgeContract.sol";
55

contracts/Quotes.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.18;
2+
pragma solidity 0.8.25;
33

44
library Quotes {
55
struct PeginQuote {
@@ -138,4 +138,4 @@ library Quotes {
138138
);
139139
}
140140

141-
}
141+
}

0 commit comments

Comments
 (0)