Skip to content

Commit 23817d5

Browse files
authored
Merge pull request #412 from rsksmart/feature/FLY-2195
Feature/FLY-2195 - Remove DAO contributor functionality
2 parents 48aa00e + da91cca commit 23817d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+127
-1281
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on: [push, pull_request, workflow_dispatch]
77

88
permissions:
99
contents: read
10+
packages: read
1011

1112
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1213
jobs:

.github/workflows/fuzz.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Fuzz test smart contracts
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- QA-Test
8+
- Stable-Test
9+
- master
10+
- "v*.*.*"
11+
pull_request:
12+
branches:
13+
- QA-Test
14+
- Stable-Test
15+
- master
16+
- "v*.*.*"
17+
18+
permissions:
19+
contents: read
20+
packages: read
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
28+
- name: Use Node.js 20.15.1
29+
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
30+
with:
31+
node-version: "20.15.1"
32+
33+
- name: NPM Login
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
run: npm config set //npm.pkg.github.com/:_authToken $GITHUB_TOKEN
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- name: "Install Foundry"
42+
uses: "foundry-rs/foundry-toolchain@50d5a8956f2e319df19e6b57539d7e2acb9f8c1e" # v1.5.0
43+
with:
44+
version: stable
45+
46+
- name: Lint contracts
47+
run: npm run lint:sol
48+
49+
- name: Compile contracts
50+
run: npm run compile
51+
52+
- name: Fuzz test smart contracts
53+
run: npm run test:fuzz

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ PegIn Quotes consist of:
4848
uint callTime; // the time (in seconds) that the LP has to perform the call on behalf of the user after the deposit achieves the number of confirmations
4949
uint depositConfirmations; // the number of confirmations that the LP requires before making the call
5050
bool callOnRegister: // a boolean value indicating whether the callForUser can be called on registerPegIn.
51-
uint256 productFeeAmount; // the fee payed to the network DAO
5251
uint256 gasFee; // the fee payed to the LP to cover the gas of the RSK transaction
5352
}
5453

@@ -72,7 +71,6 @@ PegOut Quotes consist of:
7271
uint transferTime; // the time (in seconds) that the LP has to transfer on behalf of the user after the deposit achieves the number of confirmations
7372
uint expireDate; // the timestamp to consider the quote expired
7473
uint expireBlock; // the block number to consider the quote expired
75-
uint256 productFeeAmount; // the fee payed to the network DAO
7674
uint256 gasFee; // the fee payed to the LP to cover the fee of the BTC transaction
7775
}
7876

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"compile": "npm run lint:sol && forge build",
88
"test": "npm run compile && make test-unit",
9+
"test:fuzz": "npm run compile && make test-fuzz",
910
"coverage": "forge coverage",
1011
"lint:ts": "npx prettier --check . && npx eslint .",
1112
"lint:sol": "solhint 'src/**/*.sol'",

script/HelperConfig.s.sol

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ import {Script} from "lib/forge-std/src/Script.sol";
55
import {BridgeMock} from "../src/test-contracts/BridgeMock.sol";
66

77
contract HelperConfig is Script {
8-
error InvalidDaoFeeConfiguration(
9-
uint256 feePercentage,
10-
address feeCollector
11-
);
12-
138
struct NetworkConfig {
149
address bridge;
1510
uint256 minimumCollateral;
@@ -33,8 +28,6 @@ contract HelperConfig is Script {
3328
uint256 dustThreshold;
3429
uint256 btcBlockTime;
3530
bool mainnet;
36-
uint256 daoFeePercentage;
37-
address payable daoFeeCollector;
3831
uint48 adminDelay;
3932
}
4033

@@ -193,23 +186,9 @@ contract HelperConfig is Script {
193186
cachedFlyoverConfig = getFlyoverLocalConfig();
194187
}
195188

196-
// Validate DAO fee configuration
197-
_validateDaoFeeConfig(cachedFlyoverConfig);
198-
199189
return cachedFlyoverConfig;
200190
}
201191

202-
/// @notice Validate that DAO fee configuration is consistent
203-
/// @dev If feePercentage > 0, feeCollector must not be address(0)
204-
function _validateDaoFeeConfig(FlyoverConfig memory cfg) internal pure {
205-
if (cfg.daoFeePercentage > 0 && cfg.daoFeeCollector == address(0)) {
206-
revert InvalidDaoFeeConfiguration(
207-
cfg.daoFeePercentage,
208-
cfg.daoFeeCollector
209-
);
210-
}
211-
}
212-
213192
/// @notice Build Flyover config for a specific network suffix
214193
/// @param suffix The network suffix (e.g., "MAINNET", "TESTNET")
215194
/// @param isMainnet Whether this is mainnet
@@ -250,16 +229,6 @@ contract HelperConfig is Script {
250229
uint256(600)
251230
),
252231
mainnet: isMainnet,
253-
daoFeePercentage: vm.envOr(
254-
string.concat("DAO_FEE_PERCENTAGE_", suffix),
255-
uint256(0)
256-
),
257-
daoFeeCollector: payable(
258-
vm.envOr(
259-
string.concat("DAO_FEE_COLLECTOR_", suffix),
260-
address(0)
261-
)
262-
),
263232
adminDelay: uint48(
264233
vm.envOr(string.concat("ADMIN_DELAY_", suffix), uint256(0))
265234
)
@@ -286,13 +255,6 @@ contract HelperConfig is Script {
286255
),
287256
btcBlockTime: vm.envOr("BTC_BLOCK_TIME_LOCAL", uint256(600)),
288257
mainnet: false,
289-
daoFeePercentage: vm.envOr(
290-
"DAO_FEE_PERCENTAGE_LOCAL",
291-
uint256(0)
292-
),
293-
daoFeeCollector: payable(
294-
vm.envOr("DAO_FEE_COLLECTOR_LOCAL", address(0))
295-
),
296258
adminDelay: uint48(vm.envOr("ADMIN_DELAY_LOCAL", uint256(0)))
297259
});
298260
}

script/deployment/DeployFlyover.s.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ contract DeployFlyover is Script {
102102
cfg.dustThreshold,
103103
cfg.minimumPegIn,
104104
d.collateralManagementProxy,
105-
cfg.mainnet,
106-
cfg.daoFeePercentage,
107-
cfg.daoFeeCollector
105+
cfg.mainnet
108106
)
109107
)
110108
)
@@ -124,9 +122,7 @@ contract DeployFlyover is Script {
124122
cfg.dustThreshold,
125123
d.collateralManagementProxy,
126124
cfg.mainnet,
127-
cfg.btcBlockTime,
128-
cfg.daoFeePercentage,
129-
cfg.daoFeeCollector
125+
cfg.btcBlockTime
130126
)
131127
)
132128
)

script/deployment/DeployPegIn.s.sol

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ contract DeployPegIn is Script {
5757
cfg.dustThreshold,
5858
cfg.minimumPegIn,
5959
collateralManagementProxy,
60-
cfg.mainnet,
61-
cfg.daoFeePercentage,
62-
cfg.daoFeeCollector
60+
cfg.mainnet
6361
)
6462
)
6563
)

script/deployment/DeployPegOut.s.sol

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ contract DeployPegOut is Script {
5757
cfg.dustThreshold,
5858
collateralManagementProxy,
5959
cfg.mainnet,
60-
cfg.btcBlockTime,
61-
cfg.daoFeePercentage,
62-
cfg.daoFeeCollector
60+
cfg.btcBlockTime
6361
)
6462
)
6563
)

script/helpers/QuoteParser.sol

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {BtcAddressParser} from "./BtcAddressParser.sol";
1919
* - btcRefundAddr: BTC refund address (string)
2020
* - rskRefundAddr: RSK refund address (address)
2121
* - lpBTCAddr: LP Bitcoin address (string)
22-
* - callFee, penaltyFee, value, gasFee, productFeeAmount: (uint256)
22+
* - callFee, penaltyFee, value, gasFee: (uint256)
2323
* - contractAddr: Destination contract address (address)
2424
* - data: Call data (bytes)
2525
* - gasLimit: Gas limit (uint32)
@@ -37,7 +37,7 @@ import {BtcAddressParser} from "./BtcAddressParser.sol";
3737
* - rskRefundAddress: RSK refund address (address)
3838
* - lpBtcAddr: LP Bitcoin address (string)
3939
* - depositAddr: Deposit address (string)
40-
* - callFee, penaltyFee, value, gasFee, productFeeAmount: (uint256)
40+
* - callFee, penaltyFee, value, gasFee: (uint256)
4141
* - nonce: Quote nonce (int64 or string)
4242
* - agreementTimestamp: Agreement timestamp (uint32)
4343
* - depositDateLimit: Deposit date limit (uint32)
@@ -103,7 +103,6 @@ abstract contract QuoteParser is BtcAddressParser {
103103
);
104104
quote.callOnRegister = vm.parseJsonBool(json, ".callOnRegister");
105105
quote.gasFee = vm.parseJsonUint(json, ".gasFee");
106-
quote.productFeeAmount = vm.parseJsonUint(json, ".productFeeAmount");
107106
}
108107

109108
/// @notice Parse a PegOut quote from JSON string
@@ -153,7 +152,6 @@ abstract contract QuoteParser is BtcAddressParser {
153152
quote.transferConfirmations = uint16(
154153
vm.parseJsonUint(json, ".transferConfirmations")
155154
);
156-
quote.productFeeAmount = vm.parseJsonUint(json, ".productFeeAmount");
157155
quote.gasFee = vm.parseJsonUint(json, ".gasFee");
158156
quote.expireBlock = uint32(vm.parseJsonUint(json, ".expireBlocks"));
159157
quote.expireDate = uint32(vm.parseJsonUint(json, ".expireDate"));

src/DaoContributor.sol

Lines changed: 0 additions & 144 deletions
This file was deleted.

0 commit comments

Comments
 (0)